diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-06-30 16:57:27 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-06-30 16:57:27 +0000 |
commit | 44528363914634764107e18fa06489a9598fe3e2 (patch) | |
tree | 97f474b534cb08b02e980318dad6f7111efc210b | |
parent | c1fadf50129751812c1011e3e8e6a51044e9ea40 (diff) | |
download | ffmpeg-44528363914634764107e18fa06489a9598fe3e2.tar.gz |
Move function to avoid forward declaration
Originally committed as revision 14036 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/ra288.c | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index d684987462..b4d632219c 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -35,12 +35,6 @@ typedef struct { float lhist[10]; } Real288_internal; -static void prodsum(float *tgt, float *src, int len, int n); -static void co(int n, int i, int j, float *in, float *out, float *st1, float *st2, const float *table); -static int pred(float *in, float *tgt, int n); -static void colmult(float *tgt, float *m1, const float *m2, int n); - - /* initial decode */ static void unpack(unsigned short *tgt, const unsigned char *src, unsigned int len) @@ -69,27 +63,6 @@ static void unpack(unsigned short *tgt, const unsigned char *src, } } -static void update(Real288_internal *glob) -{ - int x,y; - float buffer1[40], temp1[37]; - float buffer2[8], temp2[11]; - - for (x=0, y=glob->phasep+5; x < 40; buffer1[x++] = glob->output[(y++)%40]); - - co(36, 40, 35, buffer1, temp1, glob->st1a, glob->st1b, table1); - - if (pred(temp1, glob->st1, 36)) - colmult(glob->pr1, glob->st1, table1a, 36); - - for (x=0, y=glob->phase + 1; x < 8; buffer2[x++] = glob->history[(y++) % 8]); - - co(10, 8, 20, buffer2, temp2, glob->st2a, glob->st2b, table2); - - if (pred(temp2, glob->st2, 10)) - colmult(glob->pr2, glob->st2, table2a, 10); -} - /* Decode and produce output */ static void decode(Real288_internal *glob, unsigned int input) { @@ -194,6 +167,20 @@ static int pred(float *in, float *tgt, int n) } } +/* product sum (lsf) */ +static void prodsum(float *tgt, float *src, int len, int n) +{ + unsigned int x; + float *p1, *p2; + double sum; + + while (n >= 0) { + p1 = (p2 = src) - n; + for (sum=0, x=len; x--; sum += (*p1++) * (*p2++)); + tgt[n--] = sum; + } +} + static void co(int n, int i, int j, float *in, float *out, float *st1, float *st2, const float *table) { @@ -223,18 +210,25 @@ static void co(int n, int i, int j, float *in, float *out, float *st1, *out *= 1.00390625; /* to prevent clipping */ } -/* product sum (lsf) */ -static void prodsum(float *tgt, float *src, int len, int n) +static void update(Real288_internal *glob) { - unsigned int x; - float *p1, *p2; - double sum; + int x,y; + float buffer1[40], temp1[37]; + float buffer2[8], temp2[11]; - while (n >= 0) { - p1 = (p2 = src) - n; - for (sum=0, x=len; x--; sum += (*p1++) * (*p2++)); - tgt[n--] = sum; - } + for (x=0, y=glob->phasep+5; x < 40; buffer1[x++] = glob->output[(y++)%40]); + + co(36, 40, 35, buffer1, temp1, glob->st1a, glob->st1b, table1); + + if (pred(temp1, glob->st1, 36)) + colmult(glob->pr1, glob->st1, table1a, 36); + + for (x=0, y=glob->phase + 1; x < 8; buffer2[x++] = glob->history[(y++) % 8]); + + co(10, 8, 20, buffer2, temp2, glob->st2a, glob->st2b, table2); + + if (pred(temp2, glob->st2, 10)) + colmult(glob->pr2, glob->st2, table2a, 10); } static void * decode_block(AVCodecContext * avctx, const unsigned char *in, |