You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
use memset() instead of slow c loops
Originally committed as revision 6059 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -1686,18 +1686,20 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
|
|||||||
linbits = mpa_huff_data[k][1];
|
linbits = mpa_huff_data[k][1];
|
||||||
vlc = &huff_vlc[l];
|
vlc = &huff_vlc[l];
|
||||||
|
|
||||||
|
if(!l){
|
||||||
|
memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*j);
|
||||||
|
s_index += 2*j;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* read huffcode and compute each couple */
|
/* read huffcode and compute each couple */
|
||||||
for(;j>0;j--) {
|
for(;j>0;j--) {
|
||||||
if (get_bits_count(&s->gb) >= end_pos)
|
if (get_bits_count(&s->gb) >= end_pos)
|
||||||
break;
|
break;
|
||||||
if (l) {
|
y = get_vlc2(&s->gb, vlc->table, 8, 3);
|
||||||
y = get_vlc2(&s->gb, vlc->table, 8, 3);
|
x = y >> 4;
|
||||||
x = y >> 4;
|
y = y & 0x0f;
|
||||||
y = y & 0x0f;
|
|
||||||
} else {
|
|
||||||
x = 0;
|
|
||||||
y = 0;
|
|
||||||
}
|
|
||||||
dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
|
dprintf("region=%d n=%d x=%d y=%d exp=%d\n",
|
||||||
i, g->region_size[i] - j, x, y, exponents[s_index]);
|
i, g->region_size[i] - j, x, y, exponents[s_index]);
|
||||||
if (x) {
|
if (x) {
|
||||||
@@ -1756,8 +1758,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
|
|||||||
g->sb_hybrid[s_index++] = v;
|
g->sb_hybrid[s_index++] = v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (s_index < 576)
|
memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index));
|
||||||
g->sb_hybrid[s_index++] = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user