<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div> <!--StartFragment--><p style="margin: 0px;" data-mce-style="margin: 0px;">This is a repost of <br data-mce-bogus="1"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">https://bitbucket.org/multicoreware/x265_git/issues/1/unexpected-banding-issues-with-x265-12bit<br data-mce-bogus="1"></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br data-mce-bogus="1"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">Low CRF or QP values, like 0 or 1 for lossy encoding a simple 12bit ramp produces unexpected gaps and duplicate values</p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">Test: 12bit ramp, 4K DCI 4096x2160, Y= 0 to 4095. Every x= position coordinate has the same value in the Y channel. 1 frame.</p><p style="margin: 0px;" data-mce-style="margin: 0px;">Result: Repeats and gaps in the waveform at regular intervals. eg. x=252, x=253 both have a Y value of 252. The value Y=256 is missing, etc... x=4060, 4061 both have a Y value of 4060, and Y value of 4064 missing, etc…</p><p style="margin: 0px;" data-mce-style="margin: 0px;">eg. --crf 0 Y waveform PSNR y:81.274910<br><a data-is-external-link="true" href="https://i.postimg.cc/nhFd7Kvt/x265-yuv444p12-crf0.png" rel="nofollow" data-mce-href="https://i.postimg.cc/nhFd7Kvt/x265-yuv444p12-crf0.png">https://i.postimg.cc/nhFd7Kvt/x265-yuv444p12-crf0.png</a><br data-mce-bogus="1"></p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">[code]</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><code>vspipe --y4m 4k_greyramp_yuv444p12.vpy - | "x265.exe" --y4m -
--input-csp i444 --input-depth 12 --output-depth 12 --qp 1 -o
x265_yuv444p12_qp1.hevc</code></p><p style="margin: 0px;" data-mce-style="margin: 0px;">[/code]</p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">Double checked values with vapoursynth picker (missing values/gaps, and repeated values), and psnr testing.</p><p style="margin: 0px;" data-mce-style="margin: 0px;">--lossless is ok - so that mostly rules out a script or toolchain issue; a decoder side issue also less likely. But also checked ffmpeg yuv4mpegpipe on the ffv1 below, instead of vspipe - same issue</p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">eg. --lossless Y waveform PSNR y: inf</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><a data-is-external-link="true" href="https://i.postimg.cc/ZnPcv0nR/x265-yuv444p12-lossless.png" rel="nofollow" data-mce-href="https://i.postimg.cc/ZnPcv0nR/x265-yuv444p12-lossless.png">https://i.postimg.cc/ZnPcv0nR/x265-yuv444p12-lossless.png</a><br data-mce-bogus="1"></p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">When using --qp 0, --qp 1, or --crf 0, --crf 1 , I also tested some variations like --tune psnr... , tried adding --tskip --cu-lossles, checked several different x265 builds => always gaps, banding without the --lossless switch</p><p style="margin: 0px;" data-mce-style="margin: 0px;">A simple gradient ramp should be lossless at low qp values - it is with 10bit ramps; e.g. even at crf16 with default settings, x264 is lossless on a simple 10bit ramp (probably at higher qp’s or crf’s too)</p><p style="margin: 0px;" data-mce-style="margin: 0px;"></p><p style="margin: 0px;" data-mce-style="margin: 0px;">Source file ffv1 yuv444p12le for testing (lossless, PSNR infinity compared to original script)</p><p style="margin: 0px;" data-mce-style="margin: 0px;"><a data-is-external-link="true" href="http://www.mediafire.com/file/2h4xrmvug0lm127/4k_greyramp_yuv444p12_ffv1.mkv/file" rel="nofollow" data-mce-href="http://www.mediafire.com/file/2h4xrmvug0lm127/4k_greyramp_yuv444p12_ffv1.mkv/file">http://www.mediafire.com/file/2h4xrmvug0lm127/4k_greyramp_yuv444p12_ffv1.mkv/file</a><br data-mce-bogus="1"></p><!--EndFragment--> </div></div></body></html>