X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3enc.c;h=3657ece1e04083117f36fc258990f6f296db571e;hb=988f585fcb1cfb40fe4b706c32b31594b536bba0;hp=c1564d2a3a83816d5c835beadcad331ca1192a32;hpb=c2d9a65bc08cdb61f13b4101c5bbec7b86d30f9f;p=ffmpeg diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index c1564d2a3a8..3657ece1e04 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;