Commit 119974b1 authored by Justin Ruggles's avatar Justin Ruggles

adpcm_ima_wav: process channel-interleaved blocks sequentially rather than simultaneously.

Speeds up the ADPCM IMA WAV decoder by 15-20% overall.
parent 7c287b18
...@@ -448,14 +448,18 @@ static int adpcm_decode_frame(AVCodecContext *avctx, ...@@ -448,14 +448,18 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
} }
while(src < buf + buf_size){ while(src < buf + buf_size){
for(m=0; m<4; m++){ for (i = 0; i < avctx->channels; i++) {
for(i=0; i<=st; i++) cs = &c->status[i];
*samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] & 0x0F, 3); for (m = 0; m < 4; m++) {
for(i=0; i<=st; i++) uint8_t v = *src++;
*samples++ = adpcm_ima_expand_nibble(&c->status[i], src[4*i] >> 4 , 3); *samples = adpcm_ima_expand_nibble(cs, v & 0x0F, 3);
src++; samples += avctx->channels;
*samples = adpcm_ima_expand_nibble(cs, v >> 4 , 3);
samples += avctx->channels;
}
samples -= 8 * avctx->channels - 1;
} }
src += 4*st; samples += 7 * avctx->channels;
} }
break; break;
case CODEC_ID_ADPCM_4XM: case CODEC_ID_ADPCM_4XM:
......
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