diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-03-08 13:18:55 -0500 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-08 19:42:23 +0100 |
commit | 67fc32ac6197a7fe265795d0bf60bf704464394e (patch) | |
tree | 012fdf20fab40ccc14891c7642d681ef065b815b /libavcodec | |
parent | 76d4c1676f6367df2847d59754717fb076d98f43 (diff) | |
download | ffmpeg-67fc32ac6197a7fe265795d0bf60bf704464394e.tar.gz |
ac3enc: use MUL64() to multiply fixed-point coefficients
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ac3enc.c | 8 | ||||
-rw-r--r-- | libavcodec/ac3enc_fixed.h | 2 | ||||
-rw-r--r-- | libavcodec/ac3enc_float.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index baa9597977..e792eaf163 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -328,10 +328,10 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s) CoefType rt = block->mdct_coef[1][i]; CoefType md = lt + rt; CoefType sd = lt - rt; - sum[0] += lt * lt; - sum[1] += rt * rt; - sum[2] += md * md; - sum[3] += sd * sd; + sum[0] += MUL_COEF(lt, lt); + sum[1] += MUL_COEF(rt, rt); + sum[2] += MUL_COEF(md, md); + sum[3] += MUL_COEF(sd, sd); } /* compare sums to determine if rematrixing will be used for this band */ diff --git a/libavcodec/ac3enc_fixed.h b/libavcodec/ac3enc_fixed.h index 12c8ace4aa..773caec2c3 100644 --- a/libavcodec/ac3enc_fixed.h +++ b/libavcodec/ac3enc_fixed.h @@ -36,6 +36,8 @@ typedef int16_t SampleType; typedef int32_t CoefType; typedef int64_t CoefSumType; +#define MUL_COEF(a,b) MUL64(a,b) + /** * Compex number. diff --git a/libavcodec/ac3enc_float.h b/libavcodec/ac3enc_float.h index 1726ca045f..6ad22ecc0b 100644 --- a/libavcodec/ac3enc_float.h +++ b/libavcodec/ac3enc_float.h @@ -36,6 +36,8 @@ typedef float SampleType; typedef float CoefType; typedef float CoefSumType; +#define MUL_COEF(a,b) ((a)*(b)) + typedef struct AC3MDCTContext { const float *window; ///< MDCT window function |