diff options
author | Måns Rullgård <mans@mansr.com> | 2010-01-13 06:11:02 +0300 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-01-13 06:11:02 +0300 |
commit | f3da24c4c311766d8d2f76d008b0e6a652300dd0 (patch) | |
tree | f1b0f8ab9b266763279b626b039d8a532f237bcf /libavcodec/sipr.c | |
parent | 0cd73b6c30269e1185e39ff812751671ad64c3b7 (diff) |
SIPR: kill variable-length arrays
Two of these are in fact constant size, so use the constant instead of
a variable in the declarations. The remaining one is small enough
that always using the maximum size is acceptable.
Originally committed as revision 21183 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/sipr.c')
-rw-r--r-- | libavcodec/sipr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index 7bfa3ab9f1..e84e3530ac 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -46,6 +46,8 @@ /** Subframe size for all modes except 16k */ #define SUBFR_SIZE 48 +#define MAX_SUBFRAME_COUNT 5 + #include "siprdata.h" typedef enum { @@ -233,8 +235,8 @@ static void decode_parameters(SiprParameters* parms, GetBitContext *pgb, static void lsp2lpc_sipr(const double *lsp, float *Az) { int lp_half_order = LP_FILTER_ORDER >> 1; - double buf[lp_half_order + 1]; - double pa[lp_half_order + 1]; + double buf[(LP_FILTER_ORDER >> 1) + 1]; + double pa[(LP_FILTER_ORDER >> 1) + 1]; double *qa = buf + 1; int i,j; @@ -409,7 +411,7 @@ static void decode_frame(SiprContext *ctx, SiprParameters *params, { int i, j; int frame_size = ctx->m.subframe_count * SUBFR_SIZE; - float Az[LP_FILTER_ORDER * ctx->m.subframe_count]; + float Az[LP_FILTER_ORDER * MAX_SUBFRAME_COUNT]; float *excitation; float ir_buf[SUBFR_SIZE + LP_FILTER_ORDER]; float lsf_new[LP_FILTER_ORDER]; |