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 20th July 2019, 21:15   #6941  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 732
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   #6942  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 190
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
__________________
Core i9-7960X, 64GB DDR4, RTX 2070, 1TB NVMe SSD, 56TB NAS
jlpsvk is offline   Reply With Quote
Old 21st July 2019, 12:14   #6943  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 581
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   #6944  |  Link
vpupkind
Registered User
 
Join Date: Jul 2007
Posts: 13
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   #6945  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 581
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   #6946  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 160
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 | My Telegram
DJATOM is offline   Reply With Quote
Old 22nd July 2019, 09:36   #6947  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
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
froggy1 is online now   Reply With Quote
Old 22nd July 2019, 19:19   #6948  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,894
Quote:
Originally Posted by froggy1 View Post
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
So, it can make things faster at the same quality, higher quality at the same speed, or a mix of the two.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 24th July 2019, 12:46   #6949  |  Link
aegisofrime
Registered User
 
Join Date: Apr 2009
Posts: 457
Quote:
Originally Posted by benwaggoner View Post
So, it can make things faster at the same quality, higher quality at the same speed, or a mix of the two.
Could you share your settings? By simply setting --hme, I'm seeing a reduction of around 40% in speed on my encodes. Thanks!
aegisofrime is offline   Reply With Quote
Old 24th July 2019, 13:12   #6950  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Quote:
Originally Posted by aegisofrime View Post
Could you share your settings? By simply setting --hme, I'm seeing a reduction of around 40% in speed on my encodes. Thanks!
I don't see such a high penalty on my i7 7700K processor. I use hme=1 and hme-search=umh,umh,umh
__________________
ffx264--ffhevc--ffxvid
froggy1 is online now   Reply With Quote
Old 24th July 2019, 15:16   #6951  |  Link
DJATOM
Registered User
 
DJATOM's Avatar
 
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 160
My friend tried star,star,umh and caught a crash on frame 50, but umh,star,umh works fine (but slower).
__________________
Me on GitHub | My Telegram
DJATOM is offline   Reply With Quote
Old 24th July 2019, 15:20   #6952  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Quote:
Originally Posted by DJATOM View Post
My friend tried star,star,umh and caught a crash on frame 50, but umh,star,umh works fine (but slower).
yes, I experienced the same crash when using star for all levels (L0,1,2) hme-search=star

I use umh because I find it preserves details better but is a bit slower than star
__________________
ffx264--ffhevc--ffxvid
froggy1 is online now   Reply With Quote
Old 24th July 2019, 18:20   #6953  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,894
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?).
Speculation: aq-mode 4 is the non-experimental implementation of --hevc-aq.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 24th July 2019, 21:00   #6954  |  Link
jlpsvk
Registered User
 
Join Date: Dec 2014
Posts: 190
@benwaggoner

i don't think so, as hevc-aq and aq-mode 4 coexists...
__________________
Core i9-7960X, 64GB DDR4, RTX 2070, 1TB NVMe SSD, 56TB NAS
jlpsvk is offline   Reply With Quote
Old 24th July 2019, 22:41   #6955  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 732
Quote:
Originally Posted by DJATOM View Post
My friend tried star,star,umh and caught a crash on frame 50, but umh,star,umh works fine (but slower).
I can confirm it doesn't like star on the first instance, I got crash right at start with merange 92 and 1440x1080 source.

Quote:
Originally Posted by aegisofrime View Post
Could you share your settings? By simply setting --hme, I'm seeing a reduction of around 40% in speed on my encodes. Thanks!
To get higher speed, lower your merange. The value given is used as the distance of the first-stage search, so it is effectively quadrupled.
mandarinka is offline   Reply With Quote
Old 25th July 2019, 06:28   #6956  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,562
I'm currently using merange 32 for my 720p encodes (max CTU and TU is 32 for better CPU utilization). Would it make sense to lower the value for example to 16-20 and enable HME (with umh,umh,umh), or is the first stage range so important that it will start to affect the final result too much?
__________________
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 25th July 2019, 06:55   #6957  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Quote:
Originally Posted by Boulder View Post
I'm currently using merange 32 for my 720p encodes (max CTU and TU is 32 for better CPU utilization). Would it make sense to lower the value for example to 16-20 and enable HME (with umh,umh,umh), or is the first stage range so important that it will start to affect the final result too much?
I use as ME range a value of 26 for 1080p encodes (ctu is 32 too). ME range is calculated as follows:

ctu size - 4(luma) - 2(chroma) (- 1 if me=hex is used)

You can lower it to 26 and enable HME like I do. Here the performance penalty is very minor, also considering that HME, as explained in the article I linked to a few posts earlier, has computationally low complexity

I wonder what options the poster above uses to hit a 40% reduction in speed when HME is enabled
__________________
ffx264--ffhevc--ffxvid
froggy1 is online now   Reply With Quote
Old 25th July 2019, 10:17   #6958  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,562
Quote:
Originally Posted by froggy1 View Post
I use as ME range a value of 26 for 1080p encodes (ctu is 32 too). ME range is calculated as follows:

ctu size - 4(luma) - 2(chroma) (- 1 if me=hex is used)

You can lower it to 26 and enable HME like I do. Here the performance penalty is very minor, also considering that HME, as explained in the article I linked to a few posts earlier, has computationally low complexity

I wonder what options the poster above uses to hit a 40% reduction in speed when HME is enabled
Thanks, I need to test that change. I also noticed a severe slowdown when testing HME at its default values and with merange 32. This is with basically settings from preset 'slower' with only a few minor changes.
__________________
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 25th July 2019, 11:55   #6959  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Quote:
Originally Posted by Boulder View Post
Thanks, I need to test that change. I also noticed a severe slowdown when testing HME at its default values and with merange 32. This is with basically settings from preset 'slower' with only a few minor changes.
I don't use presets but my own settings which I'm satisfied with. Here are my libx265 ffmpeg settings

Code:
X265PARAMS="ref=4:me=umh:hme=1:hme-search=umh,umh,umh:bframes=6:rd=4:subme=4:merange=26:strong-intra-smoothing=0:ctu=32:sao=0:cu-lossless=0:cutree=1:fades=1:tu-inter-depth=3:tu-intra-depth=3:rskip=1:max-merge=1:rc-lookahead=60:aq-mode=1:aq-strength=1.0:rdoq-level=1:psy-rdoq=1.5:psy-rd=2.3:limit-modes=1:limit-refs=3:limit-tu=1:rd-refine=0:deblock=-3,-3:weightb=1:weightp=1:rect=1:amp=0:wpp=1:pmode=0:pme=0:b-intra=1:b-adapt=2:b-pyramid=1:tskip-fast=0:fast-intra=0:early-skip=0:min-keyint=24:keyint=240"
__________________
ffx264--ffhevc--ffxvid
froggy1 is online now   Reply With Quote
Old 25th July 2019, 13:45   #6960  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,562
Biggest differences seem to be ref=5, me star, rd=6, rd-refine, strong-intra-smoothing, max-merge=4 and amp in my settings. I don't think those should affect the search for motion though. I really need to test to get some rough values.
__________________
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
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 13:00.


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