[FFmpeg-cvslog] r9743 - trunk/libavcodec/adpcm.c

banan subversion
Wed Jul 18 20:40:04 CEST 2007


Author: banan
Date: Wed Jul 18 20:40:03 2007
New Revision: 9743

Log:
Set the step index correctly for flash adpcm. Patch by Baptiste 
Coudurier.


Modified:
   trunk/libavcodec/adpcm.c

Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c	(original)
+++ trunk/libavcodec/adpcm.c	Wed Jul 18 20:40:03 2007
@@ -531,8 +531,9 @@ static int adpcm_encode_frame(AVCodecCon
 
         //Init the encoder state
         for(i=0; i<avctx->channels; i++){
+            c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63); // clip step so it fits 6 bits
             put_bits(&pb, 16, samples[i] & 0xFFFF);
-            put_bits(&pb, 6, c->status[i].step_index & 0x3F);
+            put_bits(&pb, 6, c->status[i].step_index);
             c->status[i].prev_sample = (signed short)samples[i];
         }
 




More information about the ffmpeg-cvslog mailing list