diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-07-27 20:35:32 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-07-27 20:35:32 +0000 |
commit | 3df136d438ae468141846f08da330fef9bb46d45 (patch) | |
tree | 0a75ce71d982f04db094ed965e2e68d71b617790 /libavcodec/ra288.c | |
parent | 9c1703720003af918afd4ab2d273b4f43fddaef1 (diff) | |
download | ffmpeg-3df136d438ae468141846f08da330fef9bb46d45.tar.gz |
Change slightly the meaning of RA288Context.phase. This
allows to remove two intermediary buffers and avoid a few
memcpy's.
Originally committed as revision 14432 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r-- | libavcodec/ra288.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index d9f58d06d6..824fd555cb 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -195,24 +195,18 @@ static void do_hybrid_window(int order, int n, int non_rec, const float *in, */ static void backward_filter(RA288Context *ractx) { - float buffer1[40], temp1[37]; - float buffer2[8], temp2[11]; + float temp1[37]; + float temp2[11]; float st1[37]; float st2[11]; - memcpy(buffer1 , ractx->output + 20, 20*sizeof(*buffer1)); - memcpy(buffer1 + 20, ractx->output , 20*sizeof(*buffer1)); - - do_hybrid_window(36, 40, 35, buffer1, temp1, ractx->sp_hist, ractx->sp_rec, + do_hybrid_window(36, 40, 35, ractx->output, temp1, ractx->sp_hist, ractx->sp_rec, syn_window); if (!eval_lpc_coeffs(temp1, st1, 36)) colmult(ractx->pr1, st1, syn_bw_tab, 36); - memcpy(buffer2 , ractx->history + 4, 4*sizeof(*buffer2)); - memcpy(buffer2 + 4, ractx->history , 4*sizeof(*buffer2)); - - do_hybrid_window(10, 8, 20, buffer2, temp2, ractx->gain_hist, ractx->gain_rec, + do_hybrid_window(10, 8, 20, ractx->history, temp2, ractx->gain_hist, ractx->gain_rec, gain_window); if (!eval_lpc_coeffs(temp2, st2, 10)) @@ -241,13 +235,13 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, for (x=0; x < 32; x++) { float gain = amptable[get_bits(&gb, 3)]; int cb_coef = get_bits(&gb, 6 + (x&1)); - ractx->phase = x & 7; + ractx->phase = (x + 4) & 7; decode(ractx, gain, cb_coef); for (y=0; y < 5; y++) *(out++) = 8 * ractx->output[ractx->phase*5 + y]; - if (ractx->phase == 3) + if (ractx->phase == 7) backward_filter(ractx); } |