diff mbox

[FFmpeg-devel,3/4] aacsbr: Associate SBR data with AAC elements on init

Message ID 20170209174039.8218-3-alex.converse@gmail.com
State Accepted
Commit 3bb24fc344f0e8448b3c6826193e8ee43f7d984d
Headers show

Commit Message

Alex Converse Feb. 9, 2017, 5:40 p.m. UTC
Quiets some log spam on pure upsampling mode.
---
 libavcodec/aacdec_template.c | 2 +-
 libavcodec/aacsbr.h          | 2 +-
 libavcodec/aacsbr_template.c | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Carl Eugen Hoyos Feb. 10, 2017, 12:11 a.m. UTC | #1
2017-02-09 18:40 GMT+01:00 Alex Converse <alex.converse@gmail.com>:
> Quiets some log spam on pure upsampling mode.

Please mention ticket #5163.

For the whole patchset, I suggest you push as soon as everybody
agrees on the function prefixes.

Could you review my patch for ticket #1614?
https://ffmpeg.org/pipermail/ffmpeg-devel/2014-October/164080.html
It seems to fix the second sample attached on trac, aac_broken.mp4.

Did you see ticket #5722?

Thank you for the important patches!

Carl Eugen
Alex Converse Feb. 13, 2017, 5:37 a.m. UTC | #2
On Thu, Feb 9, 2017 at 4:11 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>
> 2017-02-09 18:40 GMT+01:00 Alex Converse <alex.converse@gmail.com>:
> > Quiets some log spam on pure upsampling mode.
>
> Please mention ticket #5163.
>

Done

> For the whole patchset, I suggest you push as soon as everybody
> agrees on the function prefixes.
>

Prefix changed. Patches 2 and 4 don't have any comments. Do they need
further review by anyone?

> Could you review my patch for ticket #1614?
> https://ffmpeg.org/pipermail/ffmpeg-devel/2014-October/164080.html
> It seems to fix the second sample attached on trac, aac_broken.mp4.
>

It appears that your patch is decoding two channels "on top of each
other" creating the artifacts noted in the original review. There
isn't an easy change to make to that patch to fix this. The best way
to handle it is in positional channel orders to try to decode
everything we see then sniff out the channel order after the fact,
using the indexed channel configuration as more of a suggestion. That
may open the door to some truly crazy stuff, so it's probably best to
do some fuzzing and large scale testing on that sort of change before
landing it.

> Did you see ticket #5722?
>

It looks like it's probably a demuxer issue. I haven't looked at mov.c
in a long time.

[...]

Regards,
Alex
Carl Eugen Hoyos Feb. 13, 2017, 10:46 a.m. UTC | #3
2017-02-13 6:37 GMT+01:00 Alex Converse <alex.converse@gmail.com>:
> On Thu, Feb 9, 2017 at 4:11 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
>>
>> 2017-02-09 18:40 GMT+01:00 Alex Converse <alex.converse@gmail.com>:
>> > Quiets some log spam on pure upsampling mode.
>>
>> Please mention ticket #5163.
>
> Done

Thank you.

>> For the whole patchset, I suggest you push as soon as everybody
>> agrees on the function prefixes.
>
> Prefix changed. Patches 2 and 4 don't have any comments. Do
> they need further review by anyone?

Imo, you have waited long enough.

Thanks for the review and the patches, Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 2a06f82efe..6654416e69 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -134,7 +134,7 @@  static av_cold int che_configure(AACContext *ac,
         if (!ac->che[type][id]) {
             if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
                 return AVERROR(ENOMEM);
-            AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr);
+            AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr, type);
         }
         if (type != TYPE_CCE) {
             if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) {
diff --git a/libavcodec/aacsbr.h b/libavcodec/aacsbr.h
index 88c4d8a916..dd8b66c7bb 100644
--- a/libavcodec/aacsbr.h
+++ b/libavcodec/aacsbr.h
@@ -81,7 +81,7 @@  static const int8_t vlc_sbr_lav[10] =
 /** Initialize SBR. */
 void AAC_RENAME(ff_aac_sbr_init)(void);
 /** Initialize one SBR context. */
-void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr);
+void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac);
 /** Close one SBR context. */
 void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr);
 /** Decode one SBR element. */
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index 511054276a..f8aa4854df 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -81,11 +81,12 @@  static void sbr_turnoff(SpectralBandReplication *sbr) {
     memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters));
 }
 
-av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr)
+av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac)
 {
     if(sbr->mdct.mdct_bits)
         return;
     sbr->kx[0] = sbr->kx[1];
+    sbr->id_aac = id_aac;
     sbr_turnoff(sbr);
     sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);
     sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);