VLC: decodage d'un Truncated Exp-Golomb code [Résolu] - Algo - Programmation
Marsh Posté le 16-06-2005 à 13:25:04
J'ai trouvé ma réponse en regardant les sources du projet x264 (http://www.videolan.org/x264.html):
A priori (surtout en regardant les sources), la Recommendation H.264 s'exprimerait mal et le cas des truncated Exp-Golomb code se gèrerait indépendamment des cas signed, unsigned et mapped:
Code :
|
donc x était un paramètre passé à l'appel et il ne faut pas, dans le cas du truncated Exp-Golomb code, prendre en compte l'info suivante:
Citation : The parsing process for these syntax elements begins with reading the bits starting at the current |
mais uniquement:
Citation : Otherwise (the syntax element is coded as te(v)), the range of the syntax element shall be determined first. The range
|
Marsh Posté le 15-06-2005 à 16:15:27
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:
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:
The variable codeNum is then assigned as follows:
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)):
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:
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:
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:
Message édité par chicotruss le 16-06-2005 à 13:25:50