[FFmpeg-cvslog] r23795 - in trunk/libavcodec: lsp.c lsp.h
mru
subversion
Sat Jun 26 16:34:12 CEST 2010
Author: mru
Date: Sat Jun 26 16:34:12 2010
New Revision: 23795
Log:
lsp: convert variable-length arrays to fixed size
Max LP order is defined to be 16, fixed-size buffers are OK.
Modified:
trunk/libavcodec/lsp.c
trunk/libavcodec/lsp.h
Modified: trunk/libavcodec/lsp.c
==============================================================================
--- trunk/libavcodec/lsp.c Sat Jun 26 16:34:08 2010 (r23794)
+++ trunk/libavcodec/lsp.c Sat Jun 26 16:34:12 2010 (r23795)
@@ -90,8 +90,8 @@ static void lsp2poly(int* f, const int16
void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
{
int i;
- int f1[lp_half_order+1]; // (3.22)
- int f2[lp_half_order+1]; // (3.22)
+ int f1[MAX_LP_HALF_ORDER+1]; // (3.22)
+ int f2[MAX_LP_HALF_ORDER+1]; // (3.22)
lsp2poly(f1, lsp , lp_half_order);
lsp2poly(f2, lsp+1, lp_half_order);
@@ -111,7 +111,7 @@ void ff_acelp_lsp2lpc(int16_t* lp, const
void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order)
{
- int16_t lsp_1st[lp_order]; // (0.15)
+ int16_t lsp_1st[MAX_LP_ORDER]; // (0.15)
int i;
/* LSP values for first subframe (3.2.5 of G.729, Equation 24)*/
Modified: trunk/libavcodec/lsp.h
==============================================================================
--- trunk/libavcodec/lsp.h Sat Jun 26 16:34:08 2010 (r23794)
+++ trunk/libavcodec/lsp.h Sat Jun 26 16:34:12 2010 (r23795)
@@ -82,6 +82,7 @@ void ff_acelp_lp_decode(int16_t* lp_1st,
#define MAX_LP_HALF_ORDER 8
+#define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER)
/**
* Reconstructs LPC coefficients from the line spectral pair frequencies.
More information about the ffmpeg-cvslog
mailing list