[FFmpeg-devel] [PATCH] adpcm-ima-wav header and codec
Michael Niedermayer
michaelni
Thu Oct 18 03:17:31 CEST 2007
Hi
On Wed, Oct 17, 2007 at 05:24:02PM +0400, Timofei V. Bondarenko wrote:
[...]
>> [...]
>>> --- ffmpeg-svn/libavcodec/adpcm.c 2007-10-12 12:21:16.000000000 +0400
>>> +++ ffmpeg/libavcodec/adpcm.c 2007-10-12 19:01:53.000000000 +0400
>>> @@ -483,17 +483,17 @@
>> looks ok
>
> BTW these changes break regression tests. It is intentional. Should i do
> something about?
yes update the regresson tests checksums in the same patch which changes them
[...]
> --- ffmpeg-svn/libavcodec/adpcm.c 2007-10-17 15:38:27.000000000 +0400
> +++ ffmpeg/libavcodec/adpcm.c 2007-10-17 15:48:51.000000000 +0400
> @@ -455,7 +455,7 @@ static int adpcm_encode_frame(AVCodecCon
looks ok
[...]
> return nibble;
> }
>
> +static void adpcm_ima_init_step_index(ADPCMChannelStatus *c, short next_sample)
> +{
> + int delta = (abs(next_sample - c->prev_sample) * 4) / 7;
FFABS
> + int step_index = av_clip(c->step_index, 0, 88);
> +
trailing whitespace is forbidden in svn
> + while(delta > step_table[step_index] && step_index < 88) step_index++;
> +
> + c->step_index = step_index;
> +}
> +
> static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, short sample)
> {
> int predictor, nibble, bias;
> @@ -448,15 +458,15 @@ static int adpcm_encode_frame(AVCodecCon
> break;
> case CODEC_ID_ADPCM_IMA_WAV:
> n = avctx->frame_size / 8;
> - c->status[0].prev_sample = (signed short)samples[0]; /* XXX */
> -/* c->status[0].step_index = 0; *//* XXX: not sure how to init the state machine */
> + c->status[0].prev_sample = (signed short)samples[0];
> + adpcm_ima_init_step_index(&c->status[0], samples[st]);
shouldnt this be st+1 ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- 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/20071018/e9ddf264/attachment.pgp>
More information about the ffmpeg-devel
mailing list