diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-08-24 12:40:09 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-08-24 12:40:09 +0400 |
commit | 6430ce0f727f93600742cc3da5750b102b568857 (patch) | |
tree | c8f50f34294e72aebe9275d6c4f174942f8f5df1 /libavcodec/mpegaudiodec.c | |
parent | a753e55bb542a1c474754cdd405a7ae4265222aa (diff) |
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
Diffstat (limited to 'libavcodec/mpegaudiodec.c')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 04d65a51b5..3b11cfe7b0 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -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)); } } |