[FFmpeg-devel] [RFC] avcodec: Add native DCA decoder based on libdcadec.

foo86 foobaz86 at gmail.com
Fri Jan 8 15:34:25 CET 2016


On Thu, Jan 07, 2016 at 08:17:59PM +0100, Andreas Cadhalpun wrote:
> On 03.01.2016 18:49, foo86 wrote:
> > +            for (i = 0; i < spkr_remap_nsets; i++) {
> > +                // Number of channels to be decoded for speaker remapping
> > +                int nch_for_remaps = get_bits(&s->gb, 5) + 1;
> > +
> > +                for (j = 0; j < nspeakers[i]; j++) {
> > +                    // Decoded channels to output speaker mapping mask
> > +                    int remap_ch_mask = get_bits(&s->gb, nch_for_remaps);
> 
> Here nch_for_remaps can be up to 32, so this has to use get_bits_long, as
> get_bits only supports reading 1-25 bits.

Missed this one, changed to get_bits_long.

> > +        for (i = 0; i < s->nmixoutconfigs; i++) {
> > +            for (j = 0; j < nchannels_dmix; j++) {
> > +                // Mix output mask
> > +                int mix_map_mask = get_bits(&s->gb, s->nmixoutchs[i]);
> 
> Here s->nmixoutchs[i] can be zero. If that should not happen, there needs
> to be an error check and otherwise it should use get_bitsz, because
> get_bits doesn't support reading 0 bits.

It doesn't seem that zero channel mask should normally happen, added an
error check earlier.

> Anyway, I still think the code is pretty robust. :-)

Thanks for testing!

> I'd be glad to increase fuzz-testing coverage further, but I'm lacking
> input examples. It would be great if you could share some (tiny) samples
> triggering the HEADER_XCH/HEADER_XXCH cases and/or *_down_mix functions.

As Hendrik pointed out, there are lidcadec test suite samples you can
use for this. To trigger all downmixing functions you may need to
provide -request_channel_layout 3 option.


More information about the ffmpeg-devel mailing list