[FFmpeg-devel] [PATCH] aacenc: WIP support for PCEs

pkv.stream pkv.stream at gmail.com
Sun Sep 24 18:54:17 EEST 2017

Le 24/09/2017 à 5:06 PM, Rostislav Pehlivanov a écrit :
> On 24 September 2017 at 15:27, pkv.stream <pkv.stream at gmail.com> wrote:
>> Hi atomnuker and others
>> I am interested in working on this patch by atomnuker who did a great job.
>> This could allow encoding to more channels with aac (e.g. ambisonics order
>> three = 16 audio channels).
>> Here's a report about additions I made to the PCE table for all the basic
>> ffmpeg channel layouts (except mixed stereo).
>> I have followed atomnuker assumptions for the guess work, notably
>> regarding indexes (which seems right, I saw on spec an example with indexes
>> running like 0 1 0 so ithe indexing seems to reset , quite probably for
>> each group of either, front, side, back or LFE channels in the PCE).
>> I have done some testing:
>> encoding goes without fuss up to 16 channels. No warning, no error.
>> But, ffmpeg aac decoder is throwing errors in aacdec_template.c :
>> lines 3119-3124:
>>          if (elem_type < TYPE_DSE) {
>>              if (!(che=get_che(ac, elem_type, elem_id))) {
>>                  av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is
>> not allocated\n",
>>                         elem_type, elem_id);
>>                  err = AVERROR_INVALIDDATA;
>>                  goto fail;
>> error message is:
>> channel element 0.0 is not allocated
>> So the get_che function is failing.
> Of course it isn't going to work, I explicitly told you 1.) its a wip patch
> so no real error reporting and 2.) you need to add a new entry for whatever
> messed up channel layout ambisonics use and make sure the signalling
> indices are correct. And the latter isn't easy since nothing tells you
> what's correct - the spec, a decoder or anything like that.
I understand.
I did get though a decode of pce 4.0  or quad with vlc (downmixed to 
stereo by my sound card). In contrast ffmpeg aac decoder throws the 
error I mentioned (in ffmpeg and ffplay).
So already your pce code is not doing a bad job.
My point is maybe faad2 is perhaps implementing pce decode better than 
ffmpeg own aac decoder.
Or your pce implementation might miss something that faad2 works around. 
I'll inquire and post if I find something useful for getting functional 

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list