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 26th February 2017, 12:40   #4841  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,550
Quote:
Originally Posted by pingfr View Post
@froggy1: Noted. Any idea why the "best presets" have it enabled then?
The presets of x265 are optimized for (very) low bitrate where at those levels, blur is preferred over other compression artifacts. That's why most have SAO and intra smoothing enabled. Also the x265 presets haven't been optimized in a long time. If you want to squeeze out as much detail as possible, you'll need to tweak manually (IMHO)
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 26th February 2017, 12:46   #4842  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by froggy1 View Post
The presets of x265 are optimized for (very) low bitrate where at those levels, blur is preferred over other compression artifacts.
That's not my case here, quite the contrary, I'm trying to optimize for top-notch quality at a 10%~15% size/compression efficiency over x264, bitrate isn't an issue and never will be.

Quote:
Originally Posted by froggy1 View Post
That's why most have SAO and intra smoothing enabled.
Gotcha.

Quote:
Originally Posted by froggy1 View Post
Also the x265 presets haven't been optimized in a long time.
Not really helpful now is it?

Quote:
Originally Posted by froggy1 View Post
If you want to squeeze out as much detail as possible, you'll need to tweak manually (IMHO)
That's exactly what I'm doing as we speak.

Speaking of quality or should we rather call it "detail retention", I see everyone coming up with different custom deblocking values.

Some are like -1:-1 where as others recommend as far as -6:-6, is there a "best" and a "safe" value? or when is actually too much deblocking... well... "too much"?

My latest test settings are:

x265.exe --crf 21 --aq-mode 1 --ctu 64 --qg-size 32 --deblock -6:-6 --me star --bframes 8 --rc-lookahead 60 --ref 5 --b-adapt 2 --tu-intra-depth 4 --tu-inter-depth 4 --merange 92 --weightp --weightb --scenecut 40 --rd 4 --limit-ref 0 --limit-modes --tskip --rect --amp --max-merge 5 --subme 7 --b-intra --no-rskip --no-sao --no-strong-intra-smoothing in.y4m -o out.hevc
pingfr is offline   Reply With Quote
Old 26th February 2017, 12:50   #4843  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,550
your line looks good, except for the, IMHO, too high merange value. Even for UHD, that's overkill. As to deblocking, there's no magic value and different people prefer different values. I'm fine with -3 and even -2. also, if you're mostly encoding HD/FHD, a CTU of 32 is slightly preferred
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 26th February 2017, 12:59   #4844  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by froggy1 View Post
your line looks good, except for the, IMHO, too high merange value. Even for UHD, that's overkill.
Will lowering the --merange 92 back to a saner --merange 57 value have any significant impacts on either resulting quality (better/worse looking?) and/or compression speed (faster/slower?) and/or compression efficiency (bigger/smaller filesize?)?

Quote:
Originally Posted by froggy1 View Post
As to deblocking, there's no magic value and different people prefer different values. I'm fine with -3 and even -2.
If you were asked to justify your choices of a -3 or -2 values, how would you do so?

Quote:
Originally Posted by froggy1 View Post
also, if you're mostly encoding HD/FHD, a CTU of 32 is slightly preferred
I'm tackling with 1080p/720p encodes from Blu-Ray disc sources at the moment, however it appears all the presets recommend using a --ctu 64. I think I'll stick to that at least for now.

Edit: Also I can't find the command line switch to set a custom lookahead-slices arg.
pingfr is offline   Reply With Quote
Old 26th February 2017, 13:23   #4845  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,550
Quote:
Originally Posted by pingfr View Post
Will lowering the --merange 92 back to a saner --merange 57 value have any significant impacts on either resulting quality (better/worse looking?) and/or compression speed (faster/slower?) and/or compression efficiency (bigger/smaller filesize?)?
it will have a slight impact on speed. As to quality, it will be difficult to spot the difference, unless you really "stick your nose" into the picture with a microscope.

The reason I said that 97 is overkill is because with that value, the encoder may select a motion vector that's not necessarily the best one. It is a similar situation with x264 where values above 32 can actually in some cases hurt quality instead of improving it.


Quote:
If you were asked to justify your choices of a -3 or -2 values, how would you do so?
Simply, I prefer a slightly "soft" picture instead of one that jumps at me


Quote:
I'm tackling with 1080p/720p encodes from Blu-Ray disc sources at the moment, however it appears all the presets recommend using a --ctu 64. I think I'll stick to that at least for now.
Keep in mind that the presets, as I said, are optimized for 2 things. One I already mentioned (very low bitrates) while the other is at least UHD resolutions. At these resolutions, a larger CTU makes sense

Quote:
Edit: Also I can't find the command line switch to set a custom lookahead-slices arg.
I don't think it has one yet
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 26th February 2017, 13:28   #4846  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,033
Quote:
Originally Posted by pingfr View Post
Will lowering the --merange 92 back to a saner --merange 57 value have any significant impacts on either resulting quality (better/worse looking?) and/or compression speed (faster/slower?) and/or compression efficiency (bigger/smaller filesize?)?
You can always test it yourself with a short sample and compare the results...

Yes the filesize will be a little bit smaller or the quality a little bit better, but it will be so small that it's not really worth it. That's why it is in the placebo preset, bcs it's sloooow
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database || https://github.com/avisynth-repository
ChaosKing is offline   Reply With Quote
Old 26th February 2017, 14:50   #4847  |  Link
aymanalz
Registered User
 
Join Date: May 2015
Posts: 67
Quote:
Originally Posted by pingfr View Post
1920x1080.
Then I repeat, merange of 92 is insanely high. Even the default of 57 is very high.
aymanalz is offline   Reply With Quote
Old 26th February 2017, 14:53   #4848  |  Link
aymanalz
Registered User
 
Join Date: May 2015
Posts: 67
Quote:
Originally Posted by pingfr View Post
Will lowering the --merange 92 back to a saner --merange 57 value have any significant impacts on either resulting quality (better/worse looking?) and/or compression speed (faster/slower?) and/or compression efficiency (bigger/smaller filesize?)?



If you were asked to justify your choices of a -3 or -2 values, how would you do so?



I'm tackling with 1080p/720p encodes from Blu-Ray disc sources at the moment, however it appears all the presets recommend using a --ctu 64. I think I'll stick to that at least for now.

Edit: Also I can't find the command line switch to set a custom lookahead-slices arg.

1) Lowering the merange to 57 will significantly boost your encoding speed, and it is very unlikely (read, impossible) that you will notice any quality degradation.

2) CTU of 32 is good enough for 1080p, and that too will give you significant speed increase. Only much higher resolutions will benefit from CTU 64.

A couple of pages back, you were complaining about slow encoding speed, so I'm wondering why you would set these unhelpfully large values for merange especially, and CTU.

Last edited by aymanalz; 26th February 2017 at 14:55.
aymanalz is offline   Reply With Quote
Old 26th February 2017, 16:47   #4849  |  Link
littlepox
Registered User
 
Join Date: Nov 2012
Posts: 218
--ssim-rd seems to be another detail killer. May I know how to use it in near-transparent encoding?
littlepox is offline   Reply With Quote
Old 26th February 2017, 17:48   #4850  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by aymanalz View Post
Then I repeat, merange of 92 is insanely high. Even the default of 57 is very high.
Back to 57 then I guess. Thanks!
pingfr is offline   Reply With Quote
Old 26th February 2017, 17:51   #4851  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by aymanalz View Post
1) Lowering the merange to 57 will significantly boost your encoding speed, and it is very unlikely (read, impossible) that you will notice any quality degradation.
57 it is then. Case settled.

2160p = 92 merange.
1080p = 57 merange.
720p = ?? merange.

Quote:
Originally Posted by aymanalz View Post
2) CTU of 32 is good enough for 1080p, and that too will give you significant speed increase. Only much higher resolutions will benefit from CTU 64.
2160p = CTU 64.
1080p = CTU 32.
720p = CTU ??.

Quote:
Originally Posted by aymanalz View Post
A couple of pages back, you were complaining about slow encoding speed, so I'm wondering why you would set these unhelpfully large values for merange especially, and CTU.
Because... these values were the ones taken directly from the placebo presets?
pingfr is offline   Reply With Quote
Old 26th February 2017, 17:53   #4852  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,946
But "placebo" means "you have to believe in it to see any advantage over sensible presets". Or in other words: Rather a waste of time and energy than a visible advantage.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 26th February 2017, 17:54   #4853  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,495
Even 57 is probably overkill for 1080p. x264 preset placebo uses 24...
sneaker_ger is offline   Reply With Quote
Old 26th February 2017, 18:31   #4854  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by sneaker_ger View Post
Even 57 is probably overkill for 1080p. x264 preset placebo uses 24...
Isn't comparing x264 and x265 values more or less equals comparing oranges to eggs?
pingfr is offline   Reply With Quote
Old 26th February 2017, 19:09   #4855  |  Link
aymanalz
Registered User
 
Join Date: May 2015
Posts: 67
Quote:
Originally Posted by pingfr View Post
Because... these values were the ones taken directly from the placebo presets?
There is a reason they call it placebo!

Placebo: Anything of no direct benefit which nevertheless makes people feel better or benefit psychologically.
aymanalz is offline   Reply With Quote
Old 26th February 2017, 19:32   #4856  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,623
I did a small test concerning CTU 64 and 32. The source was a short scene from the first The Hobbit movie, mattes cropped and scaled down to 1280x544 with some sharpening to compensate and then very light denoising. This is what I mostly do to the material that I put on my media server.

With my default settings, which also means CTU 64, the bitrate was 3983.05 kbps and average speed 2.38 fps. With CTU 32, the bitrate was 4092.48 kbps and the average speed 2.76 fps.

I really didn't expect the bitrate to change that much at such a low resolution but it's there. The scene itself is fairly detailed, but there's also some sky etc. which could give the 64-pixel CTU something to work on.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is online now   Reply With Quote
Old 26th February 2017, 19:43   #4857  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Latest changes:

Increased --crf 18 to --crf 21.
Lowered --ctu 64 to --ctu 32.
Lowered --bframes 8 to --bframes 4.
Lowered --merange 92 to --merange 57.
Lowered --rd 6 to --rd 4.
Lowered --subme 7 to --subme 5.

I'm getting an average of 1.16 fps, my current goal is 2.00 fps.

The remaining values that are untouched are:

--qg-size 32
--deblock -6:-6
--rc-lookahead 60
--tu-intra-depth 4
--tu-inter-depth 4
--scenecut 40
--limit-ref 0
--limit-modes
--max-merge 5

Anything else I could tweak at this point to increase crunching speed without hurting either the efficiency or the quality resulted?
pingfr is offline   Reply With Quote
Old 26th February 2017, 19:48   #4858  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,623
--tu-intra-depth 3
--tu-inter-depth 3
--limit-refs 3
--max-merge 3

You won't see a visible difference but the encoding will go faster.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is online now   Reply With Quote
Old 26th February 2017, 19:50   #4859  |  Link
pingfr
Registered User
 
Join Date: May 2015
Posts: 185
Quote:
Originally Posted by Boulder View Post
--tu-intra-depth 3
--tu-inter-depth 3
--limit-refs 3
--max-merge 3

You won't see a visible difference but the encoding will go faster.
Tested the suggested values, while it is true it encoded much faster at 2.48 fps and even exceeded my expectations, the water ripples from my sample clip were blocky. That's a no-go for me.

Thanks.

Last edited by pingfr; 26th February 2017 at 19:56.
pingfr is offline   Reply With Quote
Old 26th February 2017, 20:01   #4860  |  Link
aymanalz
Registered User
 
Join Date: May 2015
Posts: 67
Quote:
Originally Posted by pingfr View Post
Tested the suggested values, while it is true it encoded much faster at 2.48 fps and even exceeded my expectations, the water ripples from my sample clip were blocky. That's a no-go for me.

Thanks.

Try just the limit refs 3.

And if blocking is the only issue you saw, increase the deblocking to -3,-3 or higher. Lowering deblocking by so much from default values, probably causes...blocking.
aymanalz 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 19:09.


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