X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3enc.c;h=3d012492852061a4e6ac1a184b3c086e459f58b8;hb=967facb6950549d0cc4e0ba79a056ebc6f93a049;hp=c903b724d5f8f9a56219eb10988089670b86ceb4;hpb=6aba117f1273c7704312c6d892c9f552fa0661bb;p=ffmpeg diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index c903b724d5f..3d012492852 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -4,20 +4,20 @@ * Copyright (c) 2006-2010 Justin Ruggles * Copyright (c) 2006-2010 Prakash Punnoor * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -1210,14 +1210,11 @@ static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef, int i; for (i = start_freq; i < end_freq; i++) { - int v; int c = fixed_coef[i]; int e = exp[i]; - int b = bap[i]; - switch (b) { - case 0: - v = 0; - break; + int v = bap[i]; + if (v) + switch (v) { case 1: v = sym_quant(c, e, 3); switch (s->mant1_cnt) { @@ -1286,7 +1283,7 @@ static void quantize_mantissas_blk_ch(AC3Mant *s, int32_t *fixed_coef, v = asym_quant(c, e, 16); break; default: - v = asym_quant(c, e, b - 1); + v = asym_quant(c, e, v - 1); break; } qmant[i] = v;