[FFmpeg-devel] [PATCH] Implement AAC Long Term Prediction (LTP) decoding module

Diego Biurrun diego
Sun Jan 30 17:24:37 CET 2011


On Sun, Jan 30, 2011 at 01:33:54PM +0900, beckgom wrote:
> 
> I hope it's okay now.

We're almost there :)

> PS. lu's reply mades it easier. Thanks a lot.

We shall document this centrally, it is a recurring issue.

> --- a/libavcodec/aacdec.c
> +++ b/libavcodec/aacdec.c
> @@ -682,9 +702,11 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
>              } else {
> -                av_log_missing_feature(ac->avctx, "Predictor bit set but LTP is", 1);
> -                memset(ics, 0, sizeof(IndividualChannelStream));
> -                return -1;
> +                if ((ics->ltp.present = get_bits(gb, 1)))
> +                    decode_ltp(ac, &ics->ltp, gb, ics->max_sfb);
> +                 if (common_window)
> +                     if ((ics->ltp2.present = get_bits(gb, 1)))
> +                         decode_ltp(ac, &ics->ltp2, gb, ics->max_sfb);

Indentation of the second if is off.

> @@ -1682,23 +1706,108 @@ static void apply_tns(float coef[1024], TemporalNoiseShaping *tns,
>  
> +static void update_ltp(AACContext *ac, SingleChannelElement *sce)
> +{
> +    memcpy(sce->ltp_state, &sce->ltp_state[1024],   1024*sizeof(int16_t));

The three spaces after the comma look weird and
spaces around the * would make this more readable.

Diego



More information about the ffmpeg-devel mailing list