diff mbox

[FFmpeg-devel] aacenc: remove unsupported PCE mappings

Message ID 20180828212937.30039-1-atomnuker@gmail.com
State New
Headers show

Commit Message

Rostislav Pehlivanov Aug. 28, 2018, 9:29 p.m. UTC
Turns out those ones make the decoder unable to accurately determine the
layout, hence making some API users' guess, and sometimes those are correct
(ffmpeg.c), but most often (especially with side channels) they're wrong.
The removed ones need to be investigated into as to why the decoder rejects
them.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
---
 libavcodec/aacenc.h | 177 --------------------------------------------
 1 file changed, 177 deletions(-)

Comments

Rostislav Pehlivanov Aug. 28, 2018, 11:01 p.m. UTC | #1
On 28 August 2018 at 22:29, Rostislav Pehlivanov <atomnuker@gmail.com>
wrote:

> Turns out those ones make the decoder unable to accurately determine the
> layout, hence making some API users' guess, and sometimes those are correct
> (ffmpeg.c), but most often (especially with side channels) they're wrong.
> The removed ones need to be investigated into as to why the decoder rejects
> them.
>
> Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> ---
>  libavcodec/aacenc.h | 177 --------------------------------------------
>  1 file changed, 177 deletions(-)
>

CCing pkv, if you have the time can you go over what's happening?
Its a bit suspicious that 5.1, 6.1, 7.1, etc. don't use TYPE_LFE but rather
just an SCE (there's a difference in coding).
Michael Niedermayer Aug. 30, 2018, 9:12 p.m. UTC | #2
On Tue, Aug 28, 2018 at 10:29:37PM +0100, Rostislav Pehlivanov wrote:
> Turns out those ones make the decoder unable to accurately determine the
> layout, hence making some API users' guess, and sometimes those are correct
> (ffmpeg.c), but most often (especially with side channels) they're wrong.
> The removed ones need to be investigated into as to why the decoder rejects
> them.
> 
> Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
> ---
>  libavcodec/aacenc.h | 177 --------------------------------------------
>  1 file changed, 177 deletions(-)

breaks for example:
./ffmpeg -i ~/tickets/1065/Test1.wtv -acodec aac test.mov

i assume the input is the same as this: ​http://www.mediafire.com/?ojp54ym1mkaqkg4

thx

[...]
Carl Eugen Hoyos Aug. 30, 2018, 10:21 p.m. UTC | #3
2018-08-30 23:12 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Tue, Aug 28, 2018 at 10:29:37PM +0100, Rostislav Pehlivanov wrote:
>> Turns out those ones make the decoder unable to accurately determine the
>> layout, hence making some API users' guess, and sometimes those are
>> correct
>> (ffmpeg.c), but most often (especially with side channels) they're wrong.
>> The removed ones need to be investigated into as to why the decoder
>> rejects
>> them.
>>
>> Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
>> ---
>>  libavcodec/aacenc.h | 177 --------------------------------------------
>>  1 file changed, 177 deletions(-)
>
> breaks for example:
> ./ffmpeg -i ~/tickets/1065/Test1.wtv -acodec aac test.mov

The sample is in samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1065/

Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index 5a015ca92e..74f8fcf43a 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -167,38 +167,6 @@  static const AACPCEInfo aac_pce_configs[] = {
         .config_map = { 2, TYPE_CPE, TYPE_SCE },
         .reorder_map = { 0, 1, 2 },
     },
-    {
-        .layout = AV_CH_LAYOUT_SURROUND,
-        .num_ele = { 2, 0, 0, 0 },
-        .pairing = { { 1, 0 }, },
-        .index = { { 0, 0 }, },
-        .config_map = { 2, TYPE_CPE, TYPE_SCE, },
-        .reorder_map = { 0, 1, 2 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_3POINT1,
-        .num_ele = { 2, 0, 0, 1 },
-        .pairing = { { 1, 0 }, },
-        .index = { { 0, 0 }, { 0 }, { 0 }, { 0 }, },
-        .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_LFE },
-        .reorder_map = { 0, 1, 2, 3 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_4POINT0,
-        .num_ele = { 2, 0, 1, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 0 }, },
-        .index = { { 0, 0 }, { 0 }, { 1 } },
-        .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_SCE },
-        .reorder_map = {  0, 1, 2, 3 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_4POINT1,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 0 }, },
-        .index = { { 0, 0 }, { 1 }, { 2 }, { 0 } },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4 },
-    },
     {
         .layout = AV_CH_LAYOUT_2_2,
         .num_ele = { 1, 1, 0, 0 },
@@ -215,46 +183,6 @@  static const AACPCEInfo aac_pce_configs[] = {
         .config_map = { 2, TYPE_CPE, TYPE_CPE },
         .reorder_map = { 0, 1, 2, 3 },
     },
-    {
-        .layout = AV_CH_LAYOUT_5POINT0,
-        .num_ele = { 2, 1, 0, 0 },
-        .pairing = { { 1, 0 }, { 1 }, },
-        .index = { { 0, 0 }, { 1 } },
-        .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_5POINT1,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 1 } },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_5POINT0_BACK,
-        .num_ele = { 2, 0, 1, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1 } },
-        .index = { { 0, 0 }, { 0 }, { 1 } },
-        .config_map = { 3, TYPE_CPE, TYPE_SCE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_5POINT1_BACK,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 1 } },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_6POINT0,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 1 }, { 0 }, },
-        .index = { { 0, 0 }, { 1 }, { 1 } },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5 },
-    },
     {
         .layout = AV_CH_LAYOUT_6POINT0_FRONT,
         .num_ele = { 2, 1, 0, 0 },
@@ -263,111 +191,6 @@  static const AACPCEInfo aac_pce_configs[] = {
         .config_map = { 3, TYPE_CPE, TYPE_CPE, TYPE_CPE, },
         .reorder_map = { 0, 1, 2, 3, 4, 5 },
     },
-    {
-        .layout = AV_CH_LAYOUT_HEXAGONAL,
-        .num_ele = { 2, 0, 2, 0 },
-        .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
-        .index = { { 0, 0 },{ 0 },{ 1, 1 } },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, },
-        .reorder_map = { 0, 1, 2, 3, 4, 5 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_6POINT1,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 },{ 0 },{ 1, 0 }, },
-        .index = { { 0, 0 },{ 1 },{ 1, 2 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_6POINT1_BACK,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
-        .index = { { 0, 0 }, { 1 }, { 1, 2 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_6POINT1_FRONT,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1, 0 }, },
-        .index = { { 0, 0 }, { 1 }, { 1, 2 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_7POINT0,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 1 }, { 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 2 }, },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_7POINT0_FRONT,
-        .num_ele = { 2, 1, 1, 0 },
-        .pairing = { { 1, 0 }, { 1 }, { 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 2 }, },
-        .config_map = { 4, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_7POINT1,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE,  TYPE_SCE, TYPE_CPE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_7POINT1_WIDE,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 0 },{  1, 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_7POINT1_WIDE_BACK,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 0 }, { 1, 1 }, },
-        .index = { { 0, 0 }, { 1 }, { 1, 2 }, { 0 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_SCE, TYPE_CPE, TYPE_CPE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_OCTAGONAL,
-        .num_ele = { 2, 1, 2, 0 },
-        .pairing = { { 1, 0 }, { 1 }, { 1, 0 }, },
-        .index = { { 0, 0 }, { 1 }, { 2, 1 } },
-        .config_map = { 5, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7 },
-    },
-    {   /* Meant for order 2/mixed ambisonics */
-        .layout = AV_CH_LAYOUT_OCTAGONAL | AV_CH_TOP_CENTER,
-        .num_ele = { 2, 2, 2, 0 },
-        .pairing = { { 1, 0 }, { 1, 0 }, { 1, 0 }, },
-        .index = { { 0, 0 }, { 1, 1 }, { 2, 2 } },
-        .config_map = { 6, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
-    },
-    {   /* Meant for order 2/mixed ambisonics */
-        .layout = AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_BACK_CENTER |
-                  AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_TOP_CENTER,
-        .num_ele = { 2, 2, 2, 0 },
-        .pairing = { { 1, 1 }, { 1, 0 }, { 1, 0 }, },
-        .index = { { 0, 1 }, { 2, 0 }, { 3, 1 } },
-        .config_map = { 6, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 },
-    },
-    {
-        .layout = AV_CH_LAYOUT_HEXADECAGONAL,
-        .num_ele = { 4, 2, 4, 0 },
-        .pairing = { { 1, 0, 1, 0 }, { 1, 1 }, { 1, 0, 1, 0 }, },
-        .index = { { 0, 0, 1, 1 }, { 2, 3 }, { 4, 2, 5, 3 } },
-        .config_map = { 10, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_CPE, TYPE_SCE },
-        .reorder_map = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
-    },
 };
 
 /**