Commit 67fc32ac authored by Justin Ruggles's avatar Justin Ruggles Committed by Michael Niedermayer

ac3enc: use MUL64() to multiply fixed-point coefficients

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 76d4c167
...@@ -328,10 +328,10 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s) ...@@ -328,10 +328,10 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s)
CoefType rt = block->mdct_coef[1][i]; CoefType rt = block->mdct_coef[1][i];
CoefType md = lt + rt; CoefType md = lt + rt;
CoefType sd = lt - rt; CoefType sd = lt - rt;
sum[0] += lt * lt; sum[0] += MUL_COEF(lt, lt);
sum[1] += rt * rt; sum[1] += MUL_COEF(rt, rt);
sum[2] += md * md; sum[2] += MUL_COEF(md, md);
sum[3] += sd * sd; sum[3] += MUL_COEF(sd, sd);
} }
/* compare sums to determine if rematrixing will be used for this band */ /* compare sums to determine if rematrixing will be used for this band */
......
...@@ -36,6 +36,8 @@ typedef int16_t SampleType; ...@@ -36,6 +36,8 @@ typedef int16_t SampleType;
typedef int32_t CoefType; typedef int32_t CoefType;
typedef int64_t CoefSumType; typedef int64_t CoefSumType;
#define MUL_COEF(a,b) MUL64(a,b)
/** /**
* Compex number. * Compex number.
......
...@@ -36,6 +36,8 @@ typedef float SampleType; ...@@ -36,6 +36,8 @@ typedef float SampleType;
typedef float CoefType; typedef float CoefType;
typedef float CoefSumType; typedef float CoefSumType;
#define MUL_COEF(a,b) ((a)*(b))
typedef struct AC3MDCTContext { typedef struct AC3MDCTContext {
const float *window; ///< MDCT window function const float *window; ///< MDCT window function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment