summaryrefslogtreecommitdiff
path: root/libavcodec/libfdk-aacenc.c
diff options
context:
space:
mode:
authorJean First <jeanfirst@gmail.com>2014-01-26 01:31:53 +0100
committerMartin Storsjö <martin@martin.st>2014-05-05 14:01:53 +0300
commit15fa856b82ea7dbbf69edc1074eb13dd00b0fa84 (patch)
tree898adc3ae87f0766cad8a610b5096a13e4d9dd41 /libavcodec/libfdk-aacenc.c
parent9580818c5d934bde65a95efd2cee61c174721092 (diff)
libfdk-aacenc: Enable 7.1 channel encoding
7.1(wide) and 7.1(wide-side) channel layouts are supported in fdk-aac since the 0.1.3 release. The earlier versions of fdk-aac didn't include any library version defines in the public headers, thus checking for the AACENCODER_LIB_VL0 define is enough to know that we're building against a new enough version of fdk-aac. This change includes contributions by Tim Walker, Michael Niedermayer and Timothy Gu. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/libfdk-aacenc.c')
-rw-r--r--libavcodec/libfdk-aacenc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 48271692c4..0cd7e94e3f 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -151,6 +151,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);
@@ -386,6 +400,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,
};