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 17th July 2019, 12:34   #6921  |  Link
tuanden0
Registered User
 
Join Date: Oct 2016
Posts: 111
New commit with new aq-mode
Quote:
--aq-mode <0|1|2|3|4>

Adaptive Quantization operating mode. Raise or lower per-block quantization based on complexity analysis of the source image. The more complex the block, the more quantization is used. This offsets the tendency of the encoder to spend too many bits on complex areas and not enough in flat areas.

disabled
AQ enabled
AQ enabled with auto-variance (default)

3. AQ enabled with auto-variance and bias to dark scenes. This is recommended for 8-bit encodes or low-bitrate 10-bit encodes, to prevent color banding/blocking. 4. AQ enabled with
tuanden0 is offline   Reply With Quote
Old 17th July 2019, 12:45   #6922  |  Link
quietvoid
Registered User
 
Join Date: Jan 2019
Location: Canada
Posts: 570
Quote:
Originally Posted by mandarinka View Post
If I'm not mistaken, this method could perhaps improve the search by allowing it to find more distant motion vectors (large motion difference between frames say in anime action sequences?). I'm completely assuming, haven't tried yet.

Has anybody here tested it?

(Edit: also, is it finished/ready for testing yet, or are there more incoming patches to plumb it together?)
From my quick testing using --hme with --hme-search hex,star,hex is 3x slower than just --me star (subme 5) with --preset slower.
Even hex,hex,hex is still 10% slower, so not sure what the use case is when it's that slow.
quietvoid is offline   Reply With Quote
Old 17th July 2019, 16:04   #6923  |  Link
vpupkind
Registered User
 
Join Date: Jul 2007
Posts: 60
Quote:
Originally Posted by quietvoid View Post
From my quick testing using --hme with --hme-search hex,star,hex is 3x slower than just --me star (subme 5) with --preset slower.
Even hex,hex,hex is still 10% slower, so not sure what the use case is when it's that slow.
The point is having a much larger search range. On high resolutions (e.g. 4K) the current search range is very small and is not great at capturing fast motion. With HME, using 3 levels with range of 32 will get you to the range of 224. The current default for star, hex, et al is less than 64.
The other point is better coherency of motion field at high resolutions.
vpupkind is offline   Reply With Quote
Old 17th July 2019, 17:21   #6924  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Any reason why --HME uses hex, umh, umh as its default motion searches, but generally x265 uses --me star in its presets?
(would Star be better than UMH in HME, and generally outside of HME?)

Last edited by mandarinka; 17th July 2019 at 17:23.
mandarinka is offline   Reply With Quote
Old 17th July 2019, 18:21   #6925  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by mandarinka View Post
Any reason why --HME uses hex, umh, umh as its default motion searches, but generally x265 uses --me star in its presets?
(would Star be better than UMH in HME, and generally outside of HME?)
I guess performance reasons. I use hme-search=star for all levels (L0,1,2)
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 17th July 2019, 19:03   #6926  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
So basically the option has no practical use in encodes of sub-4K resolutions?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th July 2019, 19:04   #6927  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by Boulder View Post
So basically the option has no practical use in encodes of sub-4K resolutions?
I use it for Full HD movies. I find it looks a bit sharper compared to no hme
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 18th July 2019, 11:49   #6928  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,752
x265 3.1+8-21db162c8622 (MSYS2, MinGW32 / MinGW64 + GCC 9.1.0)

Code:
   --[no-]hme                    Enable Hierarchical Motion Estimation. Default disabled
   --hme-search <string>         Motion search-method for HME L0,L1 and L2. Default(L0,L1,L2) is 1,2,2
   --aq-mode <integer>           Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes 4:auto variance with edge information. Default 2
   --[no-]aq-motion              Block level QP adaptation based on the relative motion between the block and the frame. Default disabled
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 18th July 2019, 20:23   #6929  |  Link
Morku
Registered User
 
Join Date: Jul 2012
Posts: 208
@LigH
As silent reader I want to say thank you for the fresh, updated Encoders. Please never stop. Even when the board seems to fall asleep sometimes, we appreciate all the work. A Thank Button would be nice here. Every contribute is important

I hope Zathor is fine...?
Morku is offline   Reply With Quote
Old 19th July 2019, 12:00   #6930  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
what exctly that aq-mode 4 is doing? is it that "HEVC" aq? or? that HEVC aq was not so good... currently i am using aq-mode 2.
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Old 19th July 2019, 17:17   #6931  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
Quote:
Originally Posted by LigH View Post
x265 3.1+8-21db162c8622 (MSYS2, MinGW32 / MinGW64 + GCC 9.1.0)

Code:
   --[no-]hme                    Enable Hierarchical Motion Estimation. Default disabled
   --hme-search <string>         Motion search-method for HME L0,L1 and L2. Default(L0,L1,L2) is 1,2,2
   --aq-mode <integer>           Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes 4:auto variance with edge information. Default 2
   --[no-]aq-motion              Block level QP adaptation based on the relative motion between the block and the frame. Default disabled
I add function qp zero, aq-mode doesn't work.
p->rc.aqMode = X265_AQ_EDGE;
p->bAQMotion = 1;
p->bEnableHME = 1;
p->hmeSearchMethod[1] = p->hmeSearchMethod[2] = X265_STAR_SEARCH;

Quote:
x265 (build 178) - 3.1+8:[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=2 subme=5 merange=92 temporal-mvp hme Level 0,1,2=1,3,3 no-weightp no-weightb no-analyze-src-pics deblock=-1:1 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=32 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 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=33620483 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
For what presets is it and additional functions? Can it be used for 10bit?

Last edited by Jamaika; 21st July 2019 at 12:16.
Jamaika is offline   Reply With Quote
Old 20th July 2019, 14:07   #6932  |  Link
_kermit
Registered User
 
Join Date: Apr 2017
Posts: 63
Quote:
Originally Posted by jlpsvk View Post
what exctly that aq-mode 4 is doing? is it that "HEVC" aq? or? that HEVC aq was not so good... currently i am using aq-mode 2.
I have the same question
_kermit is offline   Reply With Quote
Old 20th July 2019, 17:18   #6933  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
Code:
--aq-mode <integer>           Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes 4:auto variance with edge information. Default 2
--[no-]hevc-aq                Mode for HEVC Adaptive Quantization. Default disabled
--aq-strength <float>         Reduces blocking and blurring in flat and textured areas (0 to 3.0). Default 1.00
--qp-adaptation-range <float> Delta QP range by QP adaptation based on a psycho-visual model (1.0 to 6.0). Default 1.00
--[no-]aq-motion              Block level QP adaptation based on the relative motion between the block and the frame. Default disabled
source: x265 --fullhelp
-> hevc-aq is still there, so aq-mode 4 should be something different
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 20th July 2019, 21:15   #6934  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
From the description, it looks both aqmode 3 and aqmode 4 are modifications of aqmode 2. Based on the descriptions, the first adds bias for darker scenes/parts and the second (#4) adds bias for detected(?) edges (to improve them?).
mandarinka is offline   Reply With Quote
Old 21st July 2019, 10:31   #6935  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 240
But how... quality and speed impact??? I've done test on the whole 4K HDR movie. Same settings, one with AQ2, one with AQ4.

AQ2:
Code:
x265 [info]: HEVC encoder version 3.1+8-21db162c8622
x265 [info]: build info [Windows][GCC 9.1.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
x265 [info]: Main 10 profile, Level-5.1 (High tier)
x265 [info]: Thread pool created using 28 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 4 / wpp(25 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 48 / 8 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 8 / 1
x265 [info]: Rate Control / qCompress            : CRF-16.0 / 0.60
x265 [info]: VBV/HRD buffer / max-rate / init    : 160000 / 160000 / 0.900
x265 [info]: tools: rect amp limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: signhide tmvp lslices=4
                                                                                
x265 [info]: frame I:   1572, Avg QP:19.24  kb/s: 36306.92
x265 [info]: frame P:  31790, Avg QP:20.31  kb/s: 29999.39
x265 [info]: frame B: 120253, Avg QP:23.15  kb/s: 17831.23
x265 [info]: Weighted P-Frames: Y:9.7% UV:1.7%
x265 [info]: consecutive B-frames: 17.9% 9.6% 8.6% 19.1% 7.5% 10.0% 6.4% 9.3% 11.7% 

encoded 153615 frames in 81511.10s (1.88 fps), 20538.46 kb/s, Avg QP:22.53
AQ4:
Code:
x265 [info]: HEVC encoder version 3.1+8-21db162c8622
x265 [info]: build info [Windows][GCC 9.1.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
x265 [info]: Main 10 profile, Level-5.1 (High tier)
x265 [info]: Thread pool created using 28 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 4 / wpp(25 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : star / 57 / 3 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 48 / 8 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 4 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 4 / 1.0 / 8 / 1
x265 [info]: Rate Control / qCompress            : CRF-16.0 / 0.60
x265 [info]: VBV/HRD buffer / max-rate / init    : 160000 / 160000 / 0.900
x265 [info]: tools: rect amp limit-modes rd=4 psy-rd=2.00 rdoq=2 psy-rdoq=1.00
x265 [info]: tools: signhide tmvp lslices=4
                                                                                
x265 [info]: frame I:   1571, Avg QP:19.38  kb/s: 35277.33
x265 [info]: frame P:  31792, Avg QP:20.46  kb/s: 29185.39
x265 [info]: frame B: 120252, Avg QP:23.29  kb/s: 17402.88
x265 [info]: Weighted P-Frames: Y:9.6% UV:1.7%
x265 [info]: consecutive B-frames: 17.9% 9.6% 8.7% 19.1% 7.6% 10.0% 6.3% 9.3% 11.7% 

encoded 153615 frames in 83129.38s (1.85 fps), 20024.18 kb/s, Avg QP:22.66
__________________
AMD Ryzen 9 5950X, 32GB DDR4-3200 CL16, RTX 3060, 2TB NVMe PCIE4.0, NAS with 8x16TB HDD
jlpsvk is offline   Reply With Quote
Old 21st July 2019, 12:14   #6936  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
I just found out that "aq-mode" parameters don't apply to frames I i.e. pictures. For qp on for frames P, aq-mode on. For qp off for frames I, aq-mode off.
Jamaika is offline   Reply With Quote
Old 21st July 2019, 16:50   #6937  |  Link
vpupkind
Registered User
 
Join Date: Jul 2007
Posts: 60
Quote:
Originally Posted by mandarinka View Post
From the description, it looks both aqmode 3 and aqmode 4 are modifications of aqmode 2. Based on the descriptions, the first adds bias for darker scenes/parts and the second (#4) adds bias for detected(?) edges (to improve them?).
Both hevc-aq and aq=4 try to take into account edges passing through the block.
vpupkind is offline   Reply With Quote
Old 21st July 2019, 21:11   #6938  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 697
x265&svt-3.1+8
I don't know why no one adds x265 & svt. Is this a temporary fusion? I will risk something to write.
https://www.sendspace.com/file/mt3kue
Information about color space is also interesting. For SVT, this is currently the High Dymanic Range. For 8bit is Low Dynamic Range.
Quote:

x265 [info]: SVT doesn't support input-csp param; Disabling it
x265 [info]: SVT doesn't support crf param; Disabling it
x265 [info]: SVT doesn't support info param; Disabling it
x265 [info]: SVT doesn't support aq-mode param; Disabling it
x265 [info]: SVT doesn't support colormatrix param; Disabling it
x265 [info]: SVT doesn't support colorprim param; Disabling it
x265 [info]: SVT doesn't support transfer param; Disabling it
x265 [info]: SVT doesn't support limit-refs param; Disabling it
x265 [info]: SVT doesn't support range param; Disabling it
Quote:
if (params->color_space == BPG_CS_YCbCr_HDR) {
p->vui.matrixCoeffs = 9;
svtHevcParam->highDynamicRangeInput = 1;
if (params->bit_depth => 10) {
p->vui.bEnableVideoFullRangeFlag = 1;
} else {
p->vui.bEnableVideoFullRangeFlag = 0;
}// for 8bit is Low Dynamic Range
}
PS change files in x265
svt.h --> #define INPUT_SIZE_8K_TH 0xB71B00 // 12 Million
param.cpp --> svtHevcParam->vbvMaxrate = 0;
param.cpp --> svtHevcParam->vbvBufsize = 0;
param.cpp --> svtHevcParam->vbvBufInit = 90;
param.cpp --> svtHevcParam->hrdFlag = 0;

Last edited by Jamaika; 22nd July 2019 at 18:39.
Jamaika is offline   Reply With Quote
Old 22nd July 2019, 08:54   #6939  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
Can someone explain, what's the purpose of HME? Is it for better quality/accuracy of ME or just for making things faster?
__________________
Me on GitHub
PC Specs: Ryzen 5950X, 64 GB RAM, RTX 2070
DJATOM is offline   Reply With Quote
Old 22nd July 2019, 09:36   #6940  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by DJATOM View Post
Can someone explain, what's the purpose of HME? Is it for better quality/accuracy of ME or just for making things faster?
the former. it's for better quality/accuracy. Here's an article that explains it. It is also low computational but highly efficient

http://homepages.inf.ed.ac.uk/rbf/CV...stimation.html
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 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 12:52.


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