diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-03 23:46:42 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-03 23:46:42 +0400 |
commit | 4a63c69faac6fca4eea6fc4e8466ebdc8c4575c5 (patch) | |
tree | 93e2a4a8b3f3af332e04fd09157e394832f210b7 /libavcodec/atrac.c | |
parent | 2ece7d94bc35ba0ee2b650caec25853b9fcc2eb7 (diff) | |
parent | 79cbac8cd456c3f1c914bd1e7262b55e48de13a7 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
atrac3: Generalize gain compensation code
Conflicts:
libavcodec/atrac.c
libavcodec/atrac.h
libavcodec/atrac3.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/atrac.c')
-rw-r--r-- | libavcodec/atrac.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c index f960ffc594..12e8997dbc 100644 --- a/libavcodec/atrac.c +++ b/libavcodec/atrac.c @@ -88,7 +88,8 @@ void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev, float lev, gc_scale, gain_inc; int i, pos, lastpos; - gc_scale = gc_next->num_points ? gctx->gain_tab1[gc_next->levcode[0]] : 1.0f; + gc_scale = gc_next->num_points ? gctx->gain_tab1[gc_next->lev_code[0]] + : 1.0f; if (!gc_now->num_points) { for (pos = 0; pos < num_samples; pos++) @@ -97,13 +98,12 @@ void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev, pos = 0; for (i = 0; i < gc_now->num_points; i++) { - lastpos = gc_now->loccode[i] << gctx->loc_scale; + lastpos = gc_now->loc_code[i] << gctx->loc_scale; - lev = gctx->gain_tab1[gc_now->levcode[i]]; - gain_inc = gctx->gain_tab2[(i + 1 < gc_now->num_points - ? gc_now->levcode[i + 1] - : gctx->id2exp_offset) - - gc_now->levcode[i] + 15]; + lev = gctx->gain_tab1[gc_now->lev_code[i]]; + gain_inc = gctx->gain_tab2[(i + 1 < gc_now->num_points ? gc_now->lev_code[i + 1] + : gctx->id2exp_offset) - + gc_now->lev_code[i] + 15]; /* apply constant gain level and overlap */ for (; pos < lastpos; pos++) |