[FFmpeg-cvslog] aac: correctly map 7.1ch-wide AAC from FDK AAC encoder

nu774 git at videolan.org
Mon Jun 8 01:30:44 CEST 2015


ffmpeg | branch: master | nu774 <honeycomb77 at gmail.com> | Thu Jun  4 14:42:08 2015 +0900| [677c804aa3a78d61b21e6423165a252846c20f0e] | committer: Luca Barbato

aac: correctly map 7.1ch-wide AAC from FDK AAC encoder

FDK AAC encoder outputs SCE(front)+CPE(front)+CPE(back)+CPE(back) on
MODE_7_1_REAR_SURROUND configuration.
Since decoder couldn't properly map 4 back channels, decoding failed
unless -request_channel_layout 0x8000000000000000 has been specified.
Now we treat first CPE(back) as CPE(side) on channel mapping.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

 libavcodec/aacdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 0c7e2c4..74628d6 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -291,6 +291,11 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
     if (num_back_channels < 0)
         return 0;
 
+    if (num_side_channels == 0 && num_back_channels >= 4) {
+        num_side_channels = 2;
+        num_back_channels -= 2;
+    }
+
     i = 0;
     if (num_front_channels & 1) {
         e2c_vec[i] = (struct elem_to_channel) {



More information about the ffmpeg-cvslog mailing list