diff options
author | Måns Rullgård <mans@mansr.com> | 2010-06-26 14:34:12 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-06-26 14:34:12 +0000 |
commit | 164d166e8590350d9e493ecaada98fd07c5e7da5 (patch) | |
tree | 1a070a93cd70b20cd36c726cc5ebfc7dbd3e16db /libavcodec | |
parent | 5228bcd8705523cee43e351e1a113e12aefcf837 (diff) | |
download | ffmpeg-streaming-164d166e8590350d9e493ecaada98fd07c5e7da5.zip ffmpeg-streaming-164d166e8590350d9e493ecaada98fd07c5e7da5.tar.gz |
lsp: convert variable-length arrays to fixed size
Max LP order is defined to be 16, fixed-size buffers are OK.
Originally committed as revision 23795 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/lsp.c | 6 | ||||
-rw-r--r-- | libavcodec/lsp.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c index 003ffbc..7112492 100644 --- a/libavcodec/lsp.c +++ b/libavcodec/lsp.c @@ -90,8 +90,8 @@ static void lsp2poly(int* f, const int16_t* lsp, int lp_half_order) 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 int16_t* lsp, int lp_half_order) 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)*/ diff --git a/libavcodec/lsp.h b/libavcodec/lsp.h index c3aee7b..6d979e8 100644 --- a/libavcodec/lsp.h +++ b/libavcodec/lsp.h @@ -82,6 +82,7 @@ void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd #define MAX_LP_HALF_ORDER 8 +#define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER) /** * Reconstructs LPC coefficients from the line spectral pair frequencies. |