You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/bitstream: fill invalid vlc tables entries as last pass instead of first
This avoids writing entries twice Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -174,11 +174,6 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
|
|||||||
return table_index;
|
return table_index;
|
||||||
table = &vlc->table[table_index];
|
table = &vlc->table[table_index];
|
||||||
|
|
||||||
for (i = 0; i < table_size; i++) {
|
|
||||||
table[i][1] = 0; //bits
|
|
||||||
table[i][0] = -1; //codes
|
|
||||||
}
|
|
||||||
|
|
||||||
/* first pass: map codes and compute auxiliary table sizes */
|
/* first pass: map codes and compute auxiliary table sizes */
|
||||||
for (i = 0; i < nb_codes; i++) {
|
for (i = 0; i < nb_codes; i++) {
|
||||||
n = codes[i].bits;
|
n = codes[i].bits;
|
||||||
@@ -237,6 +232,12 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
|
|||||||
i = k-1;
|
i = k-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < table_size; i++) {
|
||||||
|
if (table[i][1] == 0) //bits
|
||||||
|
table[i][0] = -1; //codes
|
||||||
|
}
|
||||||
|
|
||||||
return table_index;
|
return table_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user