On Wed, Sep 07, 2011 at 10:58:36PM -0400, Justin Ruggles wrote:
> 
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -352,35 +378,41 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
>      case CODEC_ID_ADPCM_IMA_QT:
>          n = buf_size - 2*avctx->channels;
>          for (channel = 0; channel < avctx->channels; channel++) {
> +            int16_t predictor;
> +            int step_index;
>              cs = &(c->status[channel]);
>              /* (pppppp) (piiiiiii) */
>  
>              /* Bits 15-7 are the _top_ 9 bits of the 16-bit initial 
> predictor value */
> +            predictor = AV_RB16(src);
> +            step_index = predictor & 0x7F;
> +            predictor &= 0xFF80;
> +
> +            src += 2;
> +
> +            if (cs->step_index == step_index) {
> +                int diff = (int)predictor - cs->predictor;

I may be missing something obvious, but why isn't the predictor variable
int to begin with?

> +                if (diff < 0)
> +                    diff = - diff;
> +                if (diff > 0x7f)
> +                    goto update;
> +            } else {
> +            update:
> +                cs->step_index = step_index;
> +                cs->predictor = predictor;

goto labels should IMO be placed in the first column.

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to