Commit aed39f6c authored by Vitor Sessak's avatar Vitor Sessak

Remove RA288Context.output buffer. This buffer is just RA288Context.sb

backwards (output[i] == sb[N-i], where N is the buffer length).

This makes the code slower, this will be fixed in my next commit.

Originally committed as revision 14446 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 452a398f
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "ra288.h" #include "ra288.h"
typedef struct { typedef struct {
float output[40];
float sp_lpc[36]; ///< LPC coefficients for speech data (spec: A) float sp_lpc[36]; ///< LPC coefficients for speech data (spec: A)
float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB) float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB)
int phase; int phase;
...@@ -101,7 +100,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) ...@@ -101,7 +100,7 @@ static void decode(RA288Context *ractx, float gain, int cb_coef)
/* output */ /* output */
for (x=0; x < 5; x++) { for (x=0; x < 5; x++) {
ractx->output[ractx->phase*5+x] = ractx->sb[4-x] = ractx->sb[4-x] =
av_clipf(ractx->sb[4-x] + buffer[x], -4095, 4095); av_clipf(ractx->sb[4-x] + buffer[x], -4095, 4095);
} }
} }
...@@ -200,12 +199,16 @@ static void backward_filter(RA288Context *ractx) ...@@ -200,12 +199,16 @@ static void backward_filter(RA288Context *ractx)
float temp1[37]; // RTMP in the spec float temp1[37]; // RTMP in the spec
float temp2[11]; // GPTPMP in the spec float temp2[11]; // GPTPMP in the spec
float history[8]; float history[8];
float speech[40];
int i; int i;
for (i=0 ; i < 8; i++) for (i=0 ; i < 8; i++)
history[i] = ractx->lhist[7-i]; history[i] = ractx->lhist[7-i];
do_hybrid_window(36, 40, 35, ractx->output, temp1, ractx->sp_hist, for (i=0; i < 40; i++)
speech[i] = ractx->sb[39-i];
do_hybrid_window(36, 40, 35, speech, temp1, ractx->sp_hist,
ractx->sp_rec, syn_window); ractx->sp_rec, syn_window);
if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36)) if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36))
...@@ -244,7 +247,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, ...@@ -244,7 +247,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data,
decode(ractx, gain, cb_coef); decode(ractx, gain, cb_coef);
for (y=0; y < 5; y++) for (y=0; y < 5; y++)
*(out++) = 8 * ractx->output[ractx->phase*5 + y]; *(out++) = 8 * ractx->sb[4 - y];
if (ractx->phase == 7) if (ractx->phase == 7)
backward_filter(ractx); backward_filter(ractx);
......
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