~ft/faad2

f04dced0c0331caf7c6e1dbfb3297221e48d0f06 — Sigrid Haflínudóttir a month ago 80ea6d5 + e48c2c8 master
Merge remote-tracking branch 'upstream/master' into master
5 files changed, 41 insertions(+), 14 deletions(-)

M libfaad/mp4.c
M libfaad/pns.c
M libfaad/sbr_dec.c
M libfaad/specrec.c
M libfaad/syntax.c
M libfaad/mp4.c => libfaad/mp4.c +7 -3
@@ 104,7 104,11 @@ static uint8_t ObjectTypesTable[32] = {
    0, /* 27 ER Parametric */
#endif
    0, /* 28 (Reserved) */
    0, /* 29 (Reserved) */
#ifdef PS_DEC
    1, /* 29 AAC LC + SBR + PS */
#else
    0, /* 29 AAC LC + SBR + PS */
#endif
    0, /* 30 (Reserved) */
    0  /* 31 (Reserved) */
};


@@ 171,7 175,7 @@ int8_t AudioSpecificConfigFromBitfile(bitfile *ld,

#ifdef SBR_DEC
    mp4ASC->sbr_present_flag = -1;
    if (mp4ASC->objectTypeIndex == 5)
    if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29)
    {
        uint8_t tmp;



@@ 228,7 232,7 @@ int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
    else
		bits_to_decode = (int8_t)(buffer_size*8 - (startpos-faad_get_processed_bits(ld)));

    if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
    if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16))
    {
        int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11
            DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));

M libfaad/pns.c => libfaad/pns.c +11 -9
@@ 236,7 236,17 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
                if ((ics_right != NULL)
                    && is_noise(ics_right, g, sfb))
                {
                    if (channel_pair &&
#ifdef LTP_DEC
                    /* See comment above. */
                    ics_right->ltp.long_used[sfb] = 0;
                    ics_right->ltp2.long_used[sfb] = 0;
#endif
#ifdef MAIN_DEC
                    /* See comment above. */
                    ics_right->pred.prediction_used[sfb] = 0;
#endif

                    if (channel_pair && is_noise(ics_left, g, sfb) &&
                        (((ics_left->ms_mask_present == 1) &&
                        (ics_left->ms_used[g][sfb])) ||
                        (ics_left->ms_mask_present == 2)))


@@ 252,14 262,6 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right,

                    } else /*if (ics_left->ms_mask_present == 0)*/ {

#ifdef LTP_DEC
                        ics_right->ltp.long_used[sfb] = 0;
                        ics_right->ltp2.long_used[sfb] = 0;
#endif
#ifdef MAIN_DEC
                        ics_right->pred.prediction_used[sfb] = 0;
#endif

                        offs = ics_right->swb_offset[sfb];
                        size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;


M libfaad/sbr_dec.c => libfaad/sbr_dec.c +8 -1
@@ 94,10 94,17 @@ sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
    {
        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
        sbr->numTimeSlots = NO_TIME_SLOTS_960;
    } else {
    }
    else if (framelength == 1024)
    {
        sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
        sbr->numTimeSlots = NO_TIME_SLOTS;
    }
    else
    {
        faad_free(sbr);
        return NULL;
    }

    sbr->GQ_ringbuf_index[0] = 0;
    sbr->GQ_ringbuf_index[1] = 0;

M libfaad/specrec.c => libfaad/specrec.c +4 -0
@@ 1054,6 1054,8 @@ uint8_t reconstruct_single_channel(NeAACDecStruct *hDecoder, ic_stream *ics,
#endif
                );
        }
        if (!hDecoder->sbr[ele])
            return 19;

        if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
            hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max((int)sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);


@@ 1310,6 1312,8 @@ uint8_t reconstruct_channel_pair(NeAACDecStruct *hDecoder, ic_stream *ics1, ic_s
#endif
                );
        }
        if (!hDecoder->sbr[ele])
            return 19;

        if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
            hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max((int)cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);

M libfaad/syntax.c => libfaad/syntax.c +11 -1
@@ 879,7 879,10 @@ static uint8_t ics_info(NeAACDecStruct *hDecoder, ic_stream *ics, bitfile *ld,
                    if ((ics->ltp.data_present = faad_get1bit(ld
                        DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
                    {
                        ltp_data(hDecoder, ics, &(ics->ltp), ld);
                        if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
                        {
                            return retval;
                        }
                    }
                }
#endif


@@ 1086,6 1089,8 @@ static uint8_t fill_element(NeAACDecStruct *hDecoder, bitfile *ld, drc_info *drc
#endif
                    );
            }
            if (!hDecoder->sbr[sbr_ele])
                return 19;

            hDecoder->sbr_present_flag = 1;



@@ 1355,6 1360,11 @@ void DRM_aac_scalable_main_element(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *
            hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
                2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
        }
        if (!hDecoder->sbr[0])
        {
            hInfo->error = 19;
            return;
        }

        /* Reverse bit reading of SBR data in DRM audio frame */
        revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));