diff options
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r-- | libavcodec/aaccoder.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index 36a49a7538..b6fefd3e62 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -2,20 +2,20 @@ * AAC coefficients encoder * Copyright (C) 2008-2009 Konstantin Shishkov * - * 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 */ @@ -721,6 +721,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, int allz = 0; float minthr = INFINITY; + // for values above this the decoder might end up in an endless loop + // due to always having more bits than what can be encoded. + destbits = FFMIN(destbits, 5800); //XXX: some heuristic to determine initial quantizers will reduce search time //determine zero bands and upper limits for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { @@ -1112,7 +1115,7 @@ static void search_for_ms(AACEncContext *s, ChannelElement *cpe, } } -AACCoefficientsEncoder ff_aac_coders[] = { +AACCoefficientsEncoder ff_aac_coders[AAC_CODER_NB] = { { search_for_quantizers_faac, encode_window_bands_info, |