From 0e2feaf16371c2b6d2362d8b1323801fcd33d9e2 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Mon, 27 Nov 2023 12:32:17 +0000 Subject: [PATCH] Update uvlc definition to match implementations The specified uvlc parsing process does not match that used by the libaom reference implementation [1]. The specification encodes 2^32-1 as at least thirty-two zero bits followed by a one, while libaom uses exactly thirty-two zero bits without a one. Other implementations also do not match the specification here ([2] matches the libaom behaviour, [3] raises an error if it sees this case). The difference is never encountered in conforming streams because the one syntax element using the uvlc parsing process (num_ticks_per_picture_minus_1) is not allowed to take the maximum value of 2^32-1. Given that this area is therefore not covered for conformance purposes, it seems easier to update the text of the specification to match the existing implementations than to do the reverse. [1] , line 63. [2] [3] , line 161. --- 04.conventions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/04.conventions.md b/04.conventions.md index 4fc0a45d..4b284f39 100644 --- a/04.conventions.md +++ b/04.conventions.md @@ -345,14 +345,14 @@ The parsing process for this descriptor is specified below: | --------------------------------------------------------- | ---------------- | | uvlc() { | **Type** | leadingZeros = 0 | -| while ( 1 ) { | +| while ( leadingZeros \< 32 ) { | | @@done | f(1) | if ( done ) | | break | | leadingZeros++ | | } | -| if ( leadingZeros >\= 32 ) { | -| return ( 1 \<\< 32 ) - 1 | +| if ( leadingZeros \=\= 32 ) { | +| return ( 1 \<\< 32 ) - 1 | | } | | @@value | f(leadingZeros) | return value + ( 1 \<\< leadingZeros ) - 1