codec/h264/h264dec: implement parsing process for level_prefix

Issue #141 resolved
Saxon Milton created an issue

Need to implement parsing process for level_prefix defined as follows from specifications:

9.2.2.1 Parsing process for level_prefix
Inputs to this process are bits from slice data.
Output of this process is level_prefix.
The parsing process for this syntax element consists in reading the bits starting at the current location in the bitstream up
to and including the first non-zero bit, and counting the number of leading bits that are equal to 0. This process is specified
as follows:

leadingZeroBits = −1
for( b = 0; !b; leadingZeroBits++ )
  b = read_bits( 1 )
level_prefix = leadingZeroBits

(9-4)
Table 9-6 illustrates the codeword table for level_prefix.
NOTE – The value of level_prefix is constrained to not exceed 15 in bitstreams conforming to the Baseline, Constrained Baseline, Main, and Extended profiles, as specified in clauses A.2.1, A.2.1.1, A.2.2, and A.2.3, respectively. In bitstreams conforming to other profiles, it has been reported that the value of level_prefix cannot exceed 11 + bitDepth with bitDepth being the variable BitDepth_Y for transform coefficient blocks related to the luma component and being the variable BitDepth C for transform coefficient blocks related to a chroma component.

Comments (1)

  1. Log in to comment