1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

optimize reorder_block() though this function seems to be executed too rarely for this to make much difference

Originally committed as revision 6068 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-08-24 08:40:09 +00:00
parent a753e55bb5
commit 6430ce0f72

View File

@ -1776,7 +1776,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
complicated */ complicated */
static void reorder_block(MPADecodeContext *s, GranuleDef *g) static void reorder_block(MPADecodeContext *s, GranuleDef *g)
{ {
int i, j, k, len; int i, j, len;
int32_t *ptr, *dst, *ptr1; int32_t *ptr, *dst, *ptr1;
int32_t tmp[576]; int32_t tmp[576];
@ -1796,14 +1796,15 @@ static void reorder_block(MPADecodeContext *s, GranuleDef *g)
for(i=g->short_start;i<13;i++) { for(i=g->short_start;i<13;i++) {
len = band_size_short[s->sample_rate_index][i]; len = band_size_short[s->sample_rate_index][i];
ptr1 = ptr; ptr1 = ptr;
for(k=0;k<3;k++) { dst = tmp;
dst = tmp + k;
for(j=len;j>0;j--) { for(j=len;j>0;j--) {
*dst = *ptr++; *dst++ = ptr[0*len];
dst += 3; *dst++ = ptr[1*len];
*dst++ = ptr[2*len];
ptr++;
} }
} ptr+=2*len;
memcpy(ptr1, tmp, len * 3 * sizeof(int32_t)); memcpy(ptr1, tmp, len * 3 * sizeof(*ptr1));
} }
} }