Salut,
j'ai un petit problème avec un décodage de données de type H.264/AVC:
je dispose d'un flot de bits dont certaines parties sont truncated
Exp-Golomb-coded marquées par la suite te(v):
selon la Recommendation H.264 de l'ITU-T, tous les codages de golomb commencent de la manière suivante:
Citation :
Syntax elements coded as ue(v), me(v), or se(v) are Exp-Golomb-coded. Syntax elements coded as te(v) are truncated
Exp-Golomb-coded. The parsing process for these syntax elements begins with 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 shall be equivalent to the following:
Code :
- leadingZeroBits = -1;
- for( b = 0; !b; leadingZeroBits++ )
- b = read_bits( 1 )
|
The variable codeNum is then assigned as follows:
Code :
- codeNum = 2^leadingZeroBits 1 + read_bits( leadingZeroBits )
|
where the value returned from read_bits( leadingZeroBits ) is interpreted as a binary representation of an unsigned
integer with most significant bit written first.
|
jusque la pas de problème. Ensuite, suivant la variante du codage (unsigned|truncated|signed|mapped exp-golomb-coded), le traitement suivant diffère. Tous sont exprimés clairement sauf le truncated (te(v)):
Citation :
Otherwise (the syntax element is coded as te(v)), the range of the syntax element shall be determined first. The range
of this syntax element may be between 0 and x, with x being greater than or equal to 1 and is used in the derivation
of the value of a syntax element as follows
- If x is greater than 1, codeNum and the value of the syntax element shall be derived in the same way as for
syntax elements coded as ue(v)
- Otherwise (x is equal to 1), the parsing process for codeNum which is equal to the value of the syntax element
is given by a process equivalent to:
Code :
- b = read_bits( 1 )
- codeNum = !b
|
|
Connaissant la valeur de x on peut trouver facilement le résultat.
Mon problème est comment trouve t'on x, la Recommendation H.264 n'y fait nullement référence dans la section concernée exceptée peut être ceci mais je n'arive pas a comprendre la relation entre x et les xi:
Citation :
Table 9-1 illustrates the structure of the Exp-Golomb code by separating the bit string into prefix and suffix bits. The
prefix bits are those bits that are parsed in the above pseudo-code for the computation of leadingZeroBits, and are
shown as either 0 or 1 in the bit string column of Table 9-1. The suffix bits are those bits that are parsed in the
computation of codeNum and are shown as xi in Table 9-1, with i being in the range 0 to leadingZeroBits - 1, inclusive.
Each xi can take on values 0 or 1.
Table 9-1 Bit strings with prefix and suffix bits and assignment to codeNum ranges (informative)
Bit string form Range of codeNum
1 0
0 1 x0 1-2
0 0 1 x1 x0 3-6
0 0 0 1 x2 x1 x0 7-14
0 0 0 0 1 x3 x2 x1 x0 15-30
0 0 0 0 0 1 x4 x3 x2 x1 x0 31-62
|
Quelqu'un arrive t'il a comprendre le relation entre x et xi (s'il y en a une) ou alors quelqu'un connait et peut il m'expliquer comment decoder un codage Exp-Golomb trucated ?
Merci.
Remarque:
- On peut trouver les infos en citation dans la section 9.1 de la Recommendation H.264, un exemplaire est disponible à http://www.dspr.com/www/technology/h264.pdf (page 164 (PDF) ou 148 (Document))
- La fonction read_bits(n) permet de récupérer n bits (dans le flot de données) et fait avancer le pointeur de position du flot de n positions
Message édité par chicotruss le 16-06-2005 à 13:25:50