View Full Version : How to test if 10bit is downsampled to 8bit?
ShortKatz
9th November 2020, 17:04
I have a 10bit HDR video file. This file is modified with some filters and then converted to 10bit HEVC. So, the input is 10bit and the output is 10bit. But it could be, that in-between the file is downsampled to 8bit. Is this possible to test? Can I test if a 10bit video file was downsampled to 8bit?
videoh
9th November 2020, 18:33
Just look at your processing chain. Does the source filter deliver 10 bits? Do any of your subsequent filters downsample? If you just have a stream you downloaded from somewhere, there is no way to tell unless you also have the original 10-bit stream to compare it to, or the party who encoded it wants to tell you their processing chain.
StainlessS
9th November 2020, 18:42
Pretty much any processing [except eg frame ordering] following a 10Bit->8Bit->10Bit conversion will affect least significant bits
of the samples, so no way to tell if those bit depth conversions ever happened, so is as videoH said.
EDIT: To below PDR post, Nice one PDR :)
poisondeathray
9th November 2020, 18:54
You can test a workflow chain by using a synthetic 10bit ramp 0-1023
Any 8bit intermediate steps will introduce gaps or jumps in a waveform, or if you use a 10bit picker. eg. Instead of 0,1,2,3,4, you'd get 0,4,8,12 etc...with gaps in the data and banding instead of smooth gradient
Note - this does not indicate what your source video actually was, it just verifies the workflow chain and if any 8bit intermediate steps were used
e.g. handbrake is a common example of a 8bit pipeline, although it can encode 10bit. Moreover , the test shows the 10bit => 8bit step is dithered , adding a significant increase in filesize
You can use the test video in post #7 of this thread
https://forum.videohelp.com/threads/397681-Xmedia-recode-true-10bit-encoding-and-hdr
ShortKatz
9th November 2020, 23:44
Thanks. So, as I understand, I use orig_crf1unflagged.mp4 in my workflow chain. And what will change, if there is a 8bit step in my chain? I only see a shift to the whiter part, I do not see any gaps. And I don't see this diagonal line, like in the screenshots.
poisondeathray
10th November 2020, 00:03
What filters are you using ? Is there tonemapping somewhere ?
An intermediate 8bit step will introduce banding and gaps in the data in general. You can see gaps in the waveform (and if you used a 10bit YUV color picker, such as in vapoursynth editor, you could read off the values and see the gaps) . But it can also depends on what filters you are using. If you have some extreme curve that can introduce gaps too at high bit depths
The diagonal line is the waveform from ffmpeg. Take that test video , run your workflow , then test the output video
ffmpeg -i output_video.ext -vf waveform -frames:v 1 waveform.png
ShortKatz
10th November 2020, 11:27
The diagonal line is the waveform from ffmpeg. Take that test video , run your workflow , then test the output video
ffmpeg -i output_video.ext -vf waveform -frames:v 1 waveform.png
Thanks. Then it looks like this.
https://i.ibb.co/1q838jq/orig-crf1unflagged.png (https://ibb.co/xjJyJdj)
Does this count as gaps? I will try vapoursynth editor later.
poisondeathray
10th November 2020, 15:45
They might be gaps, and 10bit to 8bit dithering to "fill" the gaps, or "noise" to fill the gaps
When you encode the output test video, also make sure you use something lossless (or very near lossless) at each step to rule out compression artifacts . Repeat the test using --lossless switch with hevc or a lossless codec like ffv1
What filters / process did you use? You might expect this with certain types of filters, even if they work at higher bit depths - e.g. adding grain
ShortKatz
11th November 2020, 10:13
Ah, thats it, my encode was not set to lossless. There are several filters I want to test, but for this test I disabled all of them.
There is a patch for HandBrake that should "fix" the 8bit pipeline (at least for x265) and I would like to check if this is already enough, which filters can be used and if more code modifications are needed.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.