[FFmpeg-cvslog] avcodec/libfdk_aacenc: enable 7.1 channel encoding

Jean First git at videolan.org
Sun Jan 26 04:07:51 CET 2014


ffmpeg | branch: master | Jean First <jeanfirst at gmail.com> | Sun Jan 26 01:31:53 2014 +0100| [91489d28ba271fb9dde54cb26e7ae93ada2997df] | committer: Michael Niedermayer

avcodec/libfdk_aacenc: enable 7.1 channel encoding

7.1(wide) and 7.1(wide-side) channel layouts are supported in fdk_aac since october 2013 (commit fa3eba1644)

Signed-off-by: Jean First <jeanfirst at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=91489d28ba271fb9dde54cb26e7ae93ada2997df
---

 configure                  |    4 +++-
 libavcodec/libfdk-aacenc.c |   12 ++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index d7bd6f7..1a91e02 100755
--- a/configure
+++ b/configure
@@ -4426,7 +4426,9 @@ enabled libcelt           && require libcelt celt/celt.h celt_decode -lcelt0 &&
                                die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
 enabled libcaca           && require_pkg_config caca caca.h caca_create_canvas
 enabled libfaac           && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
-enabled libfdk_aac        && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
+enabled libfdk_aac        && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
+                             { check_cpp_condition fdk-aac/aacenc_lib.h "AACENCODER_LIB_VL0 >= 3 && AACENCODER_LIB_VL1 >= 4 && AACENCODER_LIB_VL2 >= 12" ||
+                               die "ERROR: libfdk_aac must be installed and version must be >= 3.4.12."; }
 flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
 enabled libflite          && require2 libflite "flite/flite.h" flite_init $flite_libs
 enabled libfreetype       && require_libfreetype
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 755b76f..82bfce1 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -151,6 +151,16 @@ 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;
+    case 8:
+        sce = 2;
+        cpe = 3;
+        if (avctx->channel_layout == AV_CH_LAYOUT_7POINT1_WIDE_BACK) {
+            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;
     default:
         av_log(avctx, AV_LOG_ERROR,
                "Unsupported number of channels %d\n", avctx->channels);
@@ -384,6 +394,8 @@ static const uint64_t aac_channel_layout[] = {
     AV_CH_LAYOUT_4POINT0,
     AV_CH_LAYOUT_5POINT0_BACK,
     AV_CH_LAYOUT_5POINT1_BACK,
+    AV_CH_LAYOUT_7POINT1_WIDE,
+    AV_CH_LAYOUT_7POINT1_WIDE_BACK,
     0,
 };
 



More information about the ffmpeg-cvslog mailing list