diff options
author | Stefan Gehrer <stefan.gehrer@gmx.de> | 2009-01-17 20:08:43 +0000 |
---|---|---|
committer | Stefan Gehrer <stefan.gehrer@gmx.de> | 2009-01-17 20:08:43 +0000 |
commit | 055dc116fcf75f7f38c64b689ebda7480a7da8c2 (patch) | |
tree | c6b232602cbfb4b536f0f46b194fa21e3bdc80a1 /libavcodec/adpcm.c | |
parent | 8a569fee99eba28d3e993182c89a797c455a3bd6 (diff) | |
download | ffmpeg-055dc116fcf75f7f38c64b689ebda7480a7da8c2.tar.gz |
added demuxer for FunCom ISS audio files,
extended ADPCM decoder by ISS specific IMA variant
Originally committed as revision 16658 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index b13a376ea3..883b723c6f 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1131,6 +1131,33 @@ static int adpcm_decode_frame(AVCodecContext *avctx, *samples++ = c->status[0].predictor - c->status[1].predictor; } break; + case CODEC_ID_ADPCM_IMA_ISS: + c->status[0].predictor = (int16_t)AV_RL16(src + 0); + c->status[0].step_index = src[2]; + src += 4; + if(st) { + c->status[1].predictor = (int16_t)AV_RL16(src + 0); + c->status[1].step_index = src[2]; + src += 4; + } + + while (src < buf + buf_size) { + + if (st) { + *samples++ = adpcm_ima_expand_nibble(&c->status[0], + src[0] >> 4 , 3); + *samples++ = adpcm_ima_expand_nibble(&c->status[1], + src[0] & 0x0F, 3); + } else { + *samples++ = adpcm_ima_expand_nibble(&c->status[0], + src[0] & 0x0F, 3); + *samples++ = adpcm_ima_expand_nibble(&c->status[0], + src[0] >> 4 , 3); + } + + src++; + } + break; case CODEC_ID_ADPCM_IMA_WS: /* no per-block initialization; just start decoding the data */ while (src < buf + buf_size) { @@ -1641,6 +1668,7 @@ ADPCM_DECODER(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3, "IMA Duck DK3 ADPCM"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4, "IMA Duck DK4 ADPCM"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs, "IMA Electronic Arts EACS ADPCM"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead, "IMA Electronic Arts SEAD ADPCM"); +ADPCM_DECODER(CODEC_ID_ADPCM_IMA_ISS, adpcm_ima_iss, "IMA Funcom ISS ADPCM"); ADPCM_CODEC (CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, "IMA QuickTime ADPCM"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg, "IMA Loki SDL MJPEG ADPCM"); ADPCM_CODEC (CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, "IMA Wav ADPCM"); |