Mercurial > libavcodec.hg
comparison lsp.c @ 11961:d7808ddcbcee libavcodec
lsp: convert variable-length arrays to fixed size
Max LP order is defined to be 16, fixed-size buffers are OK.
author | mru |
---|---|
date | Sat, 26 Jun 2010 14:34:12 +0000 |
parents | d4ca61e293a3 |
children | 2dd67ed2f947 |
comparison
equal
deleted
inserted
replaced
11960:670516285e58 | 11961:d7808ddcbcee |
---|---|
88 } | 88 } |
89 | 89 |
90 void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order) | 90 void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order) |
91 { | 91 { |
92 int i; | 92 int i; |
93 int f1[lp_half_order+1]; // (3.22) | 93 int f1[MAX_LP_HALF_ORDER+1]; // (3.22) |
94 int f2[lp_half_order+1]; // (3.22) | 94 int f2[MAX_LP_HALF_ORDER+1]; // (3.22) |
95 | 95 |
96 lsp2poly(f1, lsp , lp_half_order); | 96 lsp2poly(f1, lsp , lp_half_order); |
97 lsp2poly(f2, lsp+1, lp_half_order); | 97 lsp2poly(f2, lsp+1, lp_half_order); |
98 | 98 |
99 /* 3.2.6 of G.729, Equations 25 and 26*/ | 99 /* 3.2.6 of G.729, Equations 25 and 26*/ |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 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) | 112 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) |
113 { | 113 { |
114 int16_t lsp_1st[lp_order]; // (0.15) | 114 int16_t lsp_1st[MAX_LP_ORDER]; // (0.15) |
115 int i; | 115 int i; |
116 | 116 |
117 /* LSP values for first subframe (3.2.5 of G.729, Equation 24)*/ | 117 /* LSP values for first subframe (3.2.5 of G.729, Equation 24)*/ |
118 for(i=0; i<lp_order; i++) | 118 for(i=0; i<lp_order; i++) |
119 #ifdef G729_BITEXACT | 119 #ifdef G729_BITEXACT |