View Single Post
Old 13th July 2021, 00:19   #1  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
Updated (Grainy Source): x264 vs x265 vs NVENC H.265 vs QSV H.265 [2-pass @ 5000kbps]

Update: Please see this post for updated encoding and five screenshots per encode


Quote:
OLD POST

Introduction
I've spent about 30 hours testing the same four minute clip of a very grainy source using 2-pass @ 4,500 kbps to control for size and bitrate (for comparisons), as well as a couple of CRF encodes thrown in to see what bitrate would be required (for x265).

The aim of my experiment is to keep the grain, or as much of it as possible - or perceivably possible -, for the bitrate allocated. I've spent about 80 hours reading threads on doom9 the x265 documentation over a two week period. However, I have played around with heavy noise removal using x265 and x264 built-in noise reduction. I have done this to see what sort of difference it makes to the grain quality (I apologise if that doesn't make sense to anyone else).

For creating a 'perceived rating', I tested scenes with motion, darkness, detail, edge detail (plants in the corner), and other small details. All encodes were 10 bit to create a level playing field (as much as possible). The resolution is 1920x1080. Sensible flags, such as veryslow for x264 and tuning for grain, and not tuning for grain on x265 but using slow and changing options manually that should preserve more grain, but with speed optimisations (just to get a rough idea of the output).

I did create a different thread with screenshots, but it went to moderation and was never seen again (I don't believe it broke the rules at all, as I read each one - I've not received a message or notification about the thread so assume it has been lost).


Software/Hardware Versions
NVENC (Pascal 1080 and Turing 2080)
x265 3.5 (3.5.0.9)
x264 161 r3048 (10 bit)

Results
From testing, I've found (perceived rating out of 10):

x265
- NVENC (Pascal): 6/10
- NVENC (Turing): 6/10
- x265: 3/10

x264
- NVENC (Pascal): 7/10
- NVENC (Turing): 7/10
- x264: 8/10

NOTE: These are 2-pass where stated, or CRF. One of the CRF files has a bitrate of over 8mbps (x265) and is OK, but also very large. I have lost many of the logs - and please ignore the () after -x265 as that's for my own sanity to try and make sure the information is correct.

Screenshots - SOURCE



Screenshots - NVENC (Turing)
Quote:
--cqp 28 --codec h265 --preset P7 --output-depth 10 --profile main10 --level 4.1 --aq --aq-temporal --lookahead 32 --vpp-knn --mv-precision q-pel



Screenshots - QSV (Gemini Lake Refresh - 'Gen 9.5')
Quote:
Don't currently have the information to hand. Will attempt to update post with info.


Screenshots - x264
Quote:
--pass 2 --bitrate 4500 --preset slow --tune grain --output-depth 10 --profile high10 --level 4.1 --no-fast-pskip --nr 50 --aq-mode 2 --subme 9 --me umh --merange 30 --b-adapt 2 --bframes 4 --colorprim bt709 --colormatrix bt709 --transfer bt709 --deblock -3:-3


Screenshots - x265 (test3)
Quote:
--pass 2 --bitrate 4500 --output-depth 10 --profile main10 --no-high-tier --psy-rd 3.5 --rdoq-level 1 --psy-rdoq 15 --rskip 2 --rskip-edge-threshold 2 --no-early-skip --me star --hme --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -4:-4 --no-sao


Screenshots - x265 (test4)
Quote:
--pass 2 --bitrate 4500 --output-depth 10 --profile main10 --no-high-tier --psy-rd 3.5 --rdoq-level 1 --psy-rdoq 15 --rskip 2 --rskip-edge-threshold 2 --no-early-skip --nr-inter 500 --me star --hme --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -4:-4 --no-sao


Screenshots - x265 (test6)
Quote:
--crf 24 --output-depth 10 --profile main10 --no-high-tier --rskip-edge-threshold 2 --nr-inter 2000 --hme --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -4:-4 --no-sao


Screenshots - x265 (test8)
Quote:
--pass 2 --bitrate 5250 --output-depth 10 --profile main10 --psy-rd 4 --psy-rdoq 15 --aq-strength 0.8 --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -3:-3


Screenshots - x265 (x265n)
Quote:
--pass 2 --bitrate 4500 --preset slow --output-depth 10 --profile main10 --rd 5 --psy-rd 2.15 --no-rect --aq-strength 0.6 --qcomp 0.65 --crf-max 0 --ipratio 1.35 --pbratio 1.25 --no-cutree --subme 4 --weightb --bframes 6 --rc-lookahead 30 --lookahead-slices 3 --colorprim bt709 --colormatrix bt709 --transfer bt709 --range limited --deblock -3:-3



What I'm trying to understand, and I have read many, many threads, is why x265 appears to have such a problem with grain - even with a 10mbps 3-pass encode. The grain on x265 appears to be static, and tuning for grain seems to be counterproductive. I've read threads where it's stated that --tune grain isn't effective, but without an explanation.

Conclusion
I hope this can lead to a discussion about the state of grain retention with x265 in 2021. It's come a long way in a relatively short period of time and much of the guidance and opinion appears to apply to older builds.


Edit: I've not included screenshots as I believe this might have been the reason the previous thread (with about eight screenshots) was not allowed.
Edit2: Included screenshots and basic information.
Edit3: Updated top of post to reflect new encodes and screenshots

Last edited by tonemapped; 17th July 2021 at 02:27. Reason: Edited to ask users to see updated posts
tonemapped is offline   Reply With Quote