diff mbox series

[FFmpeg-devel,v3,3/5] avcodec/adpcm_ima_amv: document header format

Message ID 20201103114136.28092-4-zane@zanevaniperen.com
State Superseded
Headers show
Series AMV muxing and adpcm_ima_amv encoding support | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Zane van Iperen Nov. 3, 2020, 11:41 a.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavcodec/adpcm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index d0807cbd98..7f2c958d16 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -1698,6 +1698,16 @@  static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
     case AV_CODEC_ID_ADPCM_IMA_AMV:
         av_assert0(avctx->channels == 1);
 
+        /*
+         * Header format:
+         *   int16_t  predictor;
+         *   uint8_t  step_index;
+         *   uint8_t  reserved;
+         *   uint32_t frame_size;
+         *
+         * Some implementations have step_index as 16-bits, but others
+         * only use the lower 8 and store garbage in the upper 8.
+         */
         c->status[0].predictor = sign_extend(bytestream2_get_le16u(&gb), 16);
         c->status[0].step_index = bytestream2_get_byteu(&gb);
         bytestream2_skipu(&gb, 5);