Commit a8b2d579 authored by michael's avatar michael

optimize reorder_block() though this function seems to be executed too rarely...

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6068 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4f87a3ea
......@@ -1776,7 +1776,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
complicated */
static void reorder_block(MPADecodeContext *s, GranuleDef *g)
{
int i, j, k, len;
int i, j, len;
int32_t *ptr, *dst, *ptr1;
int32_t tmp[576];
......@@ -1796,14 +1796,15 @@ static void reorder_block(MPADecodeContext *s, GranuleDef *g)
for(i=g->short_start;i<13;i++) {
len = band_size_short[s->sample_rate_index][i];
ptr1 = ptr;
for(k=0;k<3;k++) {
dst = tmp + k;
for(j=len;j>0;j--) {
*dst = *ptr++;
dst += 3;
}
dst = tmp;
for(j=len;j>0;j--) {
*dst++ = ptr[0*len];
*dst++ = ptr[1*len];
*dst++ = ptr[2*len];
ptr++;
}
memcpy(ptr1, tmp, len * 3 * sizeof(int32_t));
ptr+=2*len;
memcpy(ptr1, tmp, len * 3 * sizeof(*ptr1));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment