Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th June 2018, 18:35   #161  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Adaptive quantization (psy-rd, aq-mode, aq-strength). Psychovisual tuning is just as important for still images (albeit a simpler subset).

With aq-mode 3, you’ll get a lower QP in smoother and darker areas, allowing for a higher CRF that will apply to parts of the image that are easier to compress. To get the same visual quality with QP would require a significantly lower QP to make sure the harder parts look good. But that results in that QP being used for the easier parts of frame as well, giving THEM a lower QP than using CRF would, thus increasing total bytes used. For real-world content, QP needs a higher bitrates to achieve the same quality.

This is basically how “JPEG Optimizers” deliver better quality than just using the JPEG quality parameter. HEVC has WAY more awesome tools available for efficient image coding, though.

Hoping for a good —tune stillimage someday.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 9th July 2019, 07:14   #162  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
Quote:
Originally Posted by benwaggoner View Post
Adaptive quantization (psy-rd, aq-mode, aq-strength). Psychovisual tuning is just as important for still images (albeit a simpler subset).

With aq-mode 3, you’ll get a lower QP in smoother and darker areas, allowing for a higher CRF that will apply to parts of the image that are easier to compress. To get the same visual quality with QP would require a significantly lower QP to make sure the harder parts look good. But that results in that QP being used for the easier parts of frame as well, giving THEM a lower QP than using CRF would, thus increasing total bytes used. For real-world content, QP needs a higher bitrates to achieve the same quality.

This is basically how “JPEG Optimizers” deliver better quality than just using the JPEG quality parameter. HEVC has WAY more awesome tools available for efficient image coding, though.

Hoping for a good —tune stillimage someday.
So you have to add the corrections for x265 stillimage:
p->rc.aqMode = 3;
p->rc.aqStrength = 1.0;
p->deblockingFilterTCOffset = -6;
p->deblockingFilterBetaOffset = 6;
p->psyRd = 2.0;
Is that enough?
https://x265.readthedocs.io/en/default/presets.html
PS What is wrong with aq-mode? For values three is always blocked.
Quote:
x265 (build 176) - 3.1+5:[Windows][GCC 9.1.1][64 bit][noasm] 10bit - H.265/HEVC codec - Copyright 2013-2018 (c) Multicoreware, Inc - http://x265.org - options: cpuid=0 frame-threads=2 wpp no-pmode no-pme no-psnr no-ssim log-level=2 bitdepth=10 input-csp=2 fps=25/1 input-res=1568x1560 interlace=0 total-frames=1 level-idc=0 high-tier=1 uhd-bd=0 ref=1 no-allow-non-conformance repeat-headers annexb no-aud no-hrd info hash=0 no-temporal-layers no-open-gop min-keyint=1 keyint=1 gop-lookahead=0 bframes=0 b-adapt=0 no-b-pyramid bframe-bias=0 rc-lookahead=0 lookahead-slices=0 scenecut=0 radl=0 no-splice no-intra-refresh ctu=64 min-cu-size=8 rect amp max-tu-size=32 tu-inter-depth=4 tu-intra-depth=4 limit-tu=0 rdoq-level=2 dynamic-rd=0.00 no-ssim-rd signhide tskip nr-intra=0 nr-inter=0 no-constrained-intra strong-intra-smoothing max-merge=5 limit-refs=0 no-limit-modes me=3 subme=5 merange=92 temporal-mvp no-weightp no-weightb no-analyze-src-pics deblock=-6:6 sao no-sao-non-deblock rd=6 no-early-skip no-rskip no-fast-intra no-tskip-fast no-cu-lossless b-intra no-splitrd-skip rdpenalty=0 psy-rd=2.00 psy-rdoq=0.00 no-rd-refine no-lossless cbqpoffs=0 crqpoffs=0 rc=cqp qp=0 aq-mode=0 aq-strength=0.00 no-cutree zone-count=0 no-strict-cbr qg-size=64 no-rc-grain qpmax=69 qpmin=0 no-const-vbv sar=0 overscan=0 videoformat=5 range=0 colorprim=2 transfer=2 colormatrix=2 chromaloc=0 display-window=0cll=0,0 min-luma=0 max-luma=1023 log2-max-poc-lsb=8 vui-timing-info vui-hrd-info slices=1 no-opt-qp-pps no-opt-ref-list-length-pps no-multi-pass-opt-rps scenecut-bias=0.05 no-opt-cu-delta-qp no-aq-motion no-hdr no-hdr-opt no-dhdr10-opt no-idr-recovery-sei analysis-reuse-level=5 scale-factor=0 refine-intra=0 refine-inter=0 refine-mv=0 refine-ctu-distortion=0 no-limit-sao ctu-info=0 no-lowpass-dct refine-analysis-type=34210312 copy-pic=1 max-ausize-factor=1.0 no-dynamic-refine no-single-sei no-hevc-aq no-svt no-field qp-adaptation-range=1.00
https://www.sendspace.com/file/2w4rnt
Setting for libHEIF (x265)
Code:
// BPG uses CQP. It does not seem to be better though.
//  param->rc.rateControlMode = X265_RC_CQP;
//  param->rc.qp = (100 - encoder->quality)/2;
  param->totalFrames = 1;
  param->internalCsp = X265_CSP_I420;
  api->param_parse(param, "info", "0");
  api->param_parse(param, "limit-modes", "0");
  api->param_parse(param, "limit-refs", "0");
  api->param_parse(param, "wpp", "0");
  api->param_parse(param, "rd", "6");
  api->param_parse(param, "ctu", "64");
  api->param_parse(param, "rskip", "0");
  api->param_parse(param, "rect", "1");
  api->param_parse(param, "amp", "1");
  api->param_parse(param, "cu-lossless", "1");
  api->param_parse(param, "aq-mode", "1");
  api->param_parse(param, "rd-refine", "1");
  api->param_parse(param, "psy-rd", "1.0");
  api->param_parse(param, "psy-rdoq", "1.0");

Last edited by Jamaika; 9th July 2019 at 08:04.
Jamaika is offline   Reply With Quote
Old 10th July 2019, 17:56   #163  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Jamaika View Post
So you have to add the corrections for x265 stillimage:
p->rc.aqMode = 3;
p->rc.aqStrength = 1.0;
p->deblockingFilterTCOffset = -6;
p->deblockingFilterBetaOffset = 6;
p->psyRd = 2.0;
Is that enough?
https://x265.readthedocs.io/en/default/presets.html
PS What is wrong with aq-mode? For values three is always blocked.
I don't think there is any need to turn down deblocking so much. It can really help reduce bitrate with natural images. Maybe -1,-1.

I haven't poked at this since my last post a year ago, so I'm not sure if those would still be my recommendations as of 3.1.1, but it's probably in the ballpark.

That said, I think the energy around PBG has really moved towards HEIF. Having a JS HEIF parser/decoder would be tremendous, though. Adding HEIF parsing would be so delightful.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.