summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2015-03-14 11:49:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2015-03-14 15:25:42 +0100
commit73ebbfdff0bb2c22e3b5c14b11485e5798a317fd (patch)
treebc8d1e9257279af492d1c8cde2737057b9f7e587 /libavcodec/ac3dec.c
parent0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e (diff)
downloadffmpeg-73ebbfdff0bb2c22e3b5c14b11485e5798a317fd.tar.gz
ac3dec: cosmetics
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index ae4129ff9d..ac53bdc5e3 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -924,14 +924,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
bin = s->spx_src_start_freq;
for (bnd = 0; bnd < s->num_spx_bands; bnd++) {
- int bandsize;
+ int bandsize = s->spx_band_sizes[bnd];
int spx_coord_exp, spx_coord_mant;
INTFLOAT nratio, sblend, nblend;
#if USE_FIXED
- int64_t accu;
/* calculate blending factors */
- bandsize = s->spx_band_sizes[bnd];
- accu = (int64_t)((bin << 23) + (bandsize << 22)) * s->spx_dst_end_freq;
+ int64_t accu = ((bin << 23) + (bandsize << 22))
+ * (int64_t)s->spx_dst_end_freq;
nratio = (int)(accu >> 32);
nratio -= spx_blend << 18;
@@ -951,7 +950,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
float spx_coord;
/* calculate blending factors */
- bandsize = s->spx_band_sizes[bnd];
nratio = ((float)((bin + (bandsize >> 1))) / s->spx_dst_end_freq) - spx_blend;
nratio = av_clipf(nratio, 0.0f, 1.0f);
nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3)