Bento4 icon indicating copy to clipboard operation
Bento4 copied to clipboard

Fix Level and BitDepth in AV1 Codec String

Open saisrirammortha opened this issue 2 years ago • 2 comments

https://github.com/axiomatic-systems/Bento4/issues/917

The logic of generating codec string for AV1 had a bug. It is giving same Codec String for all the generated manifests. Bitdepth is added as a constant value

For Bitdepth From AV1 Spec (https://aomediacodec.github.io/av1-spec/av1-spec.pdf), Section 5.5.2. Color config syntax image

We can derive this statements for Bitdepth

If high_bitdepth is 0, then the value for bitdepth is 08. If high_bitdepth is 1 and twelve_bit is 0, then the value for bitdepth is 10. If high_bitdepth is 1 and twelve_bit is 1, then the value for bitdepth is 12.

For Level From AV1 Spec (https://aomediacodec.github.io/av1-spec/av1-spec.pdf), Section Annex A: Profiles and levels, A.3. Levels Seq Level Index value can be stored for the Level. We need not right shift Seq Level Index by 4 bits This 2 digit Seq Level Index can be converted to the X.Y format level format, where X = 2 + (seq_level_index >> 2) and Y = seq_level_index & 3

image

saisrirammortha avatar Jan 11 '24 14:01 saisrirammortha

@barbibulle Please check this when you find time.

saisrirammortha avatar Jan 11 '24 14:01 saisrirammortha

We can avoid adding additional details in the Codec String as those values are default. This is mentioned in the spec

image

https://aomediacodec.github.io/av1-isobmff/#codecsparam

What do you suggest?

saisrirammortha avatar Jan 11 '24 15:01 saisrirammortha

Thanks for the fix. Sorry it took so long to merge it.

barbibulle avatar Jun 17 '24 03:06 barbibulle