diff options
Diffstat (limited to 'chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c')
-rw-r--r-- | chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c index 755b76f958c..7a85dfff54a 100644 --- a/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c +++ b/chromium/third_party/ffmpeg/libavcodec/libfdk-aacenc.c @@ -4,19 +4,29 @@ * * This file is part of FFmpeg. * - * 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. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * 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. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <fdk-aac/aacenc_lib.h> @@ -151,6 +161,20 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) case 4: mode = MODE_1_2_1; sce = 2; cpe = 1; break; case 5: mode = MODE_1_2_2; sce = 1; cpe = 2; break; case 6: mode = MODE_1_2_2_1; sce = 2; cpe = 2; break; +/* The version macro is introduced the same time as the 7.1 support, so this + should suffice. */ +#ifdef AACENCODER_LIB_VL0 + case 8: + sce = 2; + cpe = 3; + if (avctx->channel_layout == AV_CH_LAYOUT_7POINT1) { + mode = MODE_7_1_REAR_SURROUND; + } else { + // MODE_1_2_2_2_1 and MODE_7_1_FRONT_CENTER use the same channel layout + mode = MODE_7_1_FRONT_CENTER; + } + break; +#endif default: av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels %d\n", avctx->channels); @@ -384,6 +408,10 @@ static const uint64_t aac_channel_layout[] = { AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, +#ifdef AACENCODER_LIB_VL0 + AV_CH_LAYOUT_7POINT1_WIDE_BACK, + AV_CH_LAYOUT_7POINT1, +#endif 0, }; |