Dolby Vision: Parse RPU in HEVC and AV1#2392
Conversation
|
To resolve #2118, refer to 6.2 Annex II (page 23) of https://professionalsupport.dolby.com/s/article/What-is-Dolby-Vision-Profile?language=en_US |
a38215f to
05f224c
Compare
|
Since it is complex to parse the RPU, I do not know if there are still bugs in the parsing. I only parse the RPU and not fill or check integrity. I'll leave that to @JeromeMartinez since I do not know what info to extract and how to indicate enhancement layer type. The temporary section is to be removed when that information is filled and shown in output. I did not add any |
5e4ef9f to
3d35138
Compare
|
Some interesting Dolby Vision IQ / Dolby Vision 2 stuff found in iPhone sample: |
Thank you, it helps a lot.
I'll check (but only in October :( ), but do you have any hing about FEL vs MEL? |
Hint? Find this part of the code added in this PR: // TEMPORARY ==========================================================================
if (isMEL)
Param2("EL Type", "Minimum Enhancement Layer (MEL)");
else
Param2("EL Type", "Full Enhancement Layer (FEL / non-MEL)");
// end TEMPORARY ======================================================================It is based on what's mentioned above in #2392 (comment). |
|
Hmm... Dolby sometimes calls RPU Reference Processing Unit and sometimes Reference Picture Unit... Also...
For now only parsed the Unspecified NALu type. |
I never saw such content but if we find it, it would be easy to map the code to this one. |
This one Dolby Vision profile 10 in AV1. |
I have missed something, link? |
I have not looked into this but I saw it at the following places: |
396fc80 to
46d9a2e
Compare
|
The L11 metadata part has mismatch between Dolby docs and Dolby patent so may have to tweak once there are more samples. |
dolby docs are usually at a later time and have fixes the patent doesn't have, so priority on Dolby docs. |
|
@cjee21 please split the PR, the 2 commits are 2 different things and I may merge the small one quickly. |
For the part that are in docs and sample files I follow that (docs did not say how many bits but it is parsed in a way that correct data is obtained from actual files) but some parts that I guess are used by Dolby Vision 2 are only seen in patent for now. |
fc37bb7 to
c705531
Compare
There is |
a6a33b3 to
0519800
Compare
|
Dolby Vision also contains aspect ratio metadata that may be used to indicate cropping or active display area. But it is dynamic and may vary throughout the video so I am not sure if it should be shown in MediaInfo.
|
Please show this information, it is classic to have dynamic metadata (also for e.g. AVC aspect ratio), and we have a long term plan for better showing that when it changes, better to have the information now so it will be ready for metadata change display when we implement it. |
Rebased and done. Using the faulty (double-cropped) sample from the xbmc/Kodi issue link above: |
1c430e9 to
4ff7094
Compare
|
@cjee21 It was reported to me that the code in this PR (or maybe a former version of this PR) is not exact and that the exact parsing is in FFmpeg. Could you crosscheck?
|
|
@JeromeMartinez FFmpeg code changed recently: FFmpeg/FFmpeg@3474ec0 Is that the issue? Looks like both this PR and FFmpeg is not accurate for that part now. Dolby seems to have repurposed those bits for Dolby Vision 2 motion control. |
|
Removed the uncertain parts. No data is better than potentially inaccurate data. |
|
FWIW FFmpeg's L11 byte1 isn't right. It's supposed to be interpreted in LE, see quietvoid/dovi_tool@77b5402. |
|
So the bitstream in MSB first looks like: Correct? Is there a list of known white point values? |
Yes this works. I just prefer not doing it in reverse.
It seems to map like this according to the strings from Dolby's verifier. |
There was a delay between when a report was made and when I received it,, so it is a bit outdated because you changed it several times in the meantime. |
|
This PR was already based alot on FFmpeg from the beginning. It was a mistake to follow FFmpeg L11 parsing which was wrong and is still wrong. This is corrected. There is some strangeness in FFmpeg code so I do not trust it 100%. int bl_bit_depth_minus8 = get_ue_golomb_31(gb);
int el_bit_depth_minus8 = get_ue_golomb_long(gb);
int vdr_bit_depth_minus8 = get_ue_golomb_31(gb);This part is inaccurate. dm->l11.content_type = get_bits(gb, 8);
dm->l11.whitepoint = get_bits(gb, 4);
dm->l11.reference_mode_flag = get_bits1(gb);
skip_bits(gb, 3); /* reserved */
skip_bits(gb, 8); /* reserved */
skip_bits(gb, 8); /* reserved */Every RPU in all DV samples I have are parsed properly. A randomly picked HEVC stream also produces a trace similar to output of Dovi tool. So I will not touch it anymore unless someone has a file that demonstrates a parsing issue. I don't mind if this PR is reviewed last or if it is modified or not merged. There isn't much use for the typical consumer where DV files come mainly from iPhones and some rare Android phones. In these cases, the characteristics of the streams are already known except the newer L11 part that even FFmpeg or Dovi tool does not know. |
|
and for AV1 it is inside EMDF which is inside ITU T35 so it can wait after ITU T35 parser also. |
|
I just noticed |
I am not surprised :). |
Parse RPU in HEVC which is needed for resolving #1482, #2118 and #2468
Also parse EL in BL+EL+RPU type HEVC streams.
Also parse RPU in AV1 metadata OBU.