summaryrefslogtreecommitdiff
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-07-24 04:05:41 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-07-24 04:05:41 +0000
commita3896c63775e82d2d06766db682e816872a8c0e1 (patch)
tree88dc042bd6b46af0b402e9f130731fc7bf124fa9 /libavcodec/ra288.c
parenta0cce1587bfe30168873a66f851881f16480f00c (diff)
Rename pred() to eval_lpc_coeffs() and add a doxy comment
Originally committed as revision 14361 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 946820cf56..228125825d 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -97,7 +97,13 @@ static void colmult(float *tgt, const float *m1, const float *m2, int n)
*(tgt++) = (*(m1++)) * (*(m2++));
}
-static int pred(const float *in, float *tgt, int n)
+/**
+ * Converts autocorrelation coefficients to LPC coefficients using the
+ * Levinson-Durbin algorithm. See blocks 37 and 50 of the G.728 specification.
+ *
+ * @return 1 if success, 0 if fail
+ */
+static int eval_lpc_coeffs(const float *in, float *tgt, int n)
{
int x, y;
double f0, f1, f2;
@@ -189,7 +195,7 @@ static void update(Real288_internal *glob)
do_hybrid_window(36, 40, 35, buffer1, temp1, glob->st1a, glob->st1b,
syn_window);
- if (pred(temp1, glob->st1, 36))
+ if (eval_lpc_coeffs(temp1, glob->st1, 36))
colmult(glob->pr1, glob->st1, table1a, 36);
memcpy(buffer2 , glob->history + 4, 4*sizeof(*buffer2));
@@ -198,7 +204,7 @@ static void update(Real288_internal *glob)
do_hybrid_window(10, 8, 20, buffer2, temp2, glob->st2a, glob->st2b,
gain_window);
- if (pred(temp2, glob->st2, 10))
+ if (eval_lpc_coeffs(temp2, glob->st2, 10))
colmult(glob->pr2, glob->st2, table2a, 10);
}