[FFmpeg-devel] [PATCH] Microsoft XBox ADPCM decoder

Michael Niedermayer michaelni
Thu Nov 20 00:02:06 CET 2008


On Wed, Nov 19, 2008 at 09:44:36AM +1100, Peter Ross wrote:
> $subject. Samples are pending in /MPlayer/incoming/xbox-adpcm-wav .
[...]
> @@ -1502,6 +1503,30 @@
>          src += buf_size;
>          break;
>      }
> +    case CODEC_ID_ADPCM_IMA_XBOX:
> +        if (buf_size < 36*avctx->channels)
> +            return -1;
> +
> +        for(channel=0; channel<avctx->channels; channel++) {
> +            samples[channel] = (int16_t)AV_RL16(src);
> +            c->status[channel].predictor  = samples[channel];
> +            c->status[channel].step_index = av_clip(AV_RL16(src+2), 0, 88);
> +            c->status[channel].step  = step_table[ c->status[channel].step_index ];
> +            src += 4;
> +        }
> +        samples += avctx->channels;
> +

> +        for(n=0; n<8; n++) {
> +            for(channel=0; channel<avctx->channels; channel++) {
> +                for(m=0; m<4; m++) {

> +                    samples[(2*m)*avctx->channels+channel] = adpcm_ima_expand_nibble(&c->status[channel], src[0] & 0x0F, 3);
> +                    samples[(2*m+1)*avctx->channels+channel] = adpcm_ima_expand_nibble(&c->status[channel], src[0] >> 4, 3);

vertical align
but before you do, what is the difference of this to CODEC_ID_ADPCM_IMA_WAV ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081120/30eed721/attachment.pgp>



More information about the ffmpeg-devel mailing list