Log in

View Full Version : Issue with x264 grain retention around edges (possibly bug?)


TomArrow
9th January 2018, 01:55
I hope this is the right forum, first timer here.

Trying to encode something with the following settings: x264.2851kMod.10bit.x86.exe --preset=veryslow --tune=grain --b-adapt=2 --deblock=-4:-4 --rc-lookahead=60 --keyint=400 --min-keyint=40 --me=umh --merange=64 --psy-rd=1.5:0.15 --aq-mode=1 --qpstep=40 --partitions=all --no-dct-decimate --bframes=16 --no-dct-decimate --no-fast-pskip --deadzone-inter 0 --deadzone-intra 0 --aq-strength=1.0 --trellis=2 --qcomp=1 --subme=11 --ref=8 --crf 24.0 --output="Escape-Trailer-test.264" --profile high444 --input-csp i444 --output-csp i444 --input-res 1920x796 --input-depth=16 --frames 3601 --fps=24000/1001 -

There's no input file because I'm piping from ffmpeg.

Anyway, this is an issue I had with multiple encodes in the past, it's nothing 4:4:4 exclusive.

The issue is that while grain is usually retained very nicely, this simply doesn't seem to work when there are edges in the image. Worst example is a sharp text overlay. Around this text, everything is a blurry mess and whatever little grain structure is preserved there, is static and doesn't "move" like grain should.

Lower CRF values do help it, but dramatically increase bitrate, which I feel is unjustified considering that the rest of the image looks fine.

Now mind you, it's not so horrible as to be noticeable from a normal viewing distance on my LCD, but I'm an old pixel peeper and it annoys me, because it's just ugly. Like a part of the image around the text is static while it should be full of grain.

Any clues?

poisondeathray
9th January 2018, 17:55
The "halo" effect of "grainlessness" around objects is partially byproduct of AQ which tends to redistribute bits from edges. Notice the default tune grain preset has it set to 0.5, but you increased it to 1. Try lowering the AQ strength

TomArrow
9th January 2018, 18:18
Hey, thanks. Yes, I thought that might be the reason. But lowering the aq makes the shadows look terrible/static-grainy, which is much worse than this problem.

Isn't there some additional switch to counter specifically this problem?

poisondeathray
9th January 2018, 18:26
Hey, thanks. Yes, I thought that might be the reason. But lowering the aq makes the shadows look terrible/static-grainy, which is much worse than this problem.

Isn't there some additional switch to counter specifically this problem?

That is the switch is most responsible for the redistribution. It's not just object edges, it takes away from frame edges too

Preserving grain needs bits. There is no way around it. Use higher bitrate / lower CRF if you want to use a higher AQ strength

Or change your strategy and prefilter degrain/denoise to reduce the amount of grain