Commit 7150123a authored by Zane van Iperen's avatar Zane van Iperen Committed by Michael Niedermayer

avcodec/adpcm_ima_{apc, ssi, oki}: replace while() with for()

Per discussion at https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260854.htmlSigned-off-by: 's avatarZane van Iperen <zane@zanevaniperen.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 300e6f03
...@@ -1271,14 +1271,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1271,14 +1271,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
} }
break; break;
case AV_CODEC_ID_ADPCM_IMA_APC: case AV_CODEC_ID_ADPCM_IMA_APC:
while (bytestream2_get_bytes_left(&gb) > 0) { for (n = nb_samples >> (1 - st); n > 0; n--) {
int v = bytestream2_get_byteu(&gb); int v = bytestream2_get_byteu(&gb);
*samples++ = adpcm_ima_expand_nibble(&c->status[0], v >> 4 , 3); *samples++ = adpcm_ima_expand_nibble(&c->status[0], v >> 4 , 3);
*samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3); *samples++ = adpcm_ima_expand_nibble(&c->status[st], v & 0x0F, 3);
} }
break; break;
case AV_CODEC_ID_ADPCM_IMA_SSI: case AV_CODEC_ID_ADPCM_IMA_SSI:
while (bytestream2_get_bytes_left(&gb) > 0) { for (n = nb_samples >> (1 - st); n > 0; n--) {
int v = bytestream2_get_byteu(&gb); int v = bytestream2_get_byteu(&gb);
*samples++ = adpcm_ima_qt_expand_nibble(&c->status[0], v >> 4 ); *samples++ = adpcm_ima_qt_expand_nibble(&c->status[0], v >> 4 );
*samples++ = adpcm_ima_qt_expand_nibble(&c->status[st], v & 0x0F); *samples++ = adpcm_ima_qt_expand_nibble(&c->status[st], v & 0x0F);
...@@ -1305,7 +1305,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1305,7 +1305,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
} }
break; break;
case AV_CODEC_ID_ADPCM_IMA_OKI: case AV_CODEC_ID_ADPCM_IMA_OKI:
while (bytestream2_get_bytes_left(&gb) > 0) { for (n = nb_samples >> (1 - st); n > 0; n--) {
int v = bytestream2_get_byteu(&gb); int v = bytestream2_get_byteu(&gb);
*samples++ = adpcm_ima_oki_expand_nibble(&c->status[0], v >> 4 ); *samples++ = adpcm_ima_oki_expand_nibble(&c->status[0], v >> 4 );
*samples++ = adpcm_ima_oki_expand_nibble(&c->status[st], v & 0x0F); *samples++ = adpcm_ima_oki_expand_nibble(&c->status[st], v & 0x0F);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment