[FFmpeg-cvslog] r10880 - in trunk: libavcodec/Makefile libavcodec/adpcm.c libavcodec/allcodecs.c libavcodec/avcodec.h libavformat/electronicarts.c
aurel
subversion
Wed Oct 31 00:20:26 CET 2007
Author: aurel
Date: Wed Oct 31 00:20:26 2007
New Revision: 10880
Log:
EA IMA EACS decoder
Modified:
trunk/libavcodec/Makefile
trunk/libavcodec/adpcm.c
trunk/libavcodec/allcodecs.c
trunk/libavcodec/avcodec.h
trunk/libavformat/electronicarts.c
Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile (original)
+++ trunk/libavcodec/Makefile Wed Oct 31 00:20:26 2007
@@ -276,6 +276,7 @@ OBJS-$(CONFIG_ADPCM_IMA_DK3_DECODER) +
OBJS-$(CONFIG_ADPCM_IMA_DK3_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_DK4_ENCODER) += adpcm.o
+OBJS-$(CONFIG_ADPCM_IMA_EA_EACS_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_EA_SEAD_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcm.o
Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c (original)
+++ trunk/libavcodec/adpcm.c Wed Oct 31 00:20:26 2007
@@ -31,6 +31,7 @@
* CD-ROM XA ADPCM codec by BERO
* EA ADPCM decoder by Robin Kay (komadori at myrealbox.com)
* EA ADPCM R1/R2/R3 decoder by Peter Ross (pross at xvid.org)
+ * EA IMA EACS decoder by Peter Ross (pross at xvid.org)
* EA IMA SEAD decoder by Peter Ross (pross at xvid.org)
* THP ADPCM decoder by Marco Gerards (mgerards at xs4all.nl)
*
@@ -1138,6 +1139,24 @@ static int adpcm_decode_frame(AVCodecCon
buf_size -= 128;
}
break;
+ case CODEC_ID_ADPCM_IMA_EA_EACS:
+ samples_in_chunk = bytestream_get_le32(&src) >> (1-st);
+
+ if (samples_in_chunk > buf_size-4-(8<<st)) {
+ src += buf_size - 4;
+ break;
+ }
+
+ for (i=0; i<=st; i++)
+ c->status[i].step_index = bytestream_get_le32(&src);
+ for (i=0; i<=st; i++)
+ c->status[i].predictor = bytestream_get_le32(&src);
+
+ for (; samples_in_chunk; samples_in_chunk--, src++) {
+ *samples++ = adpcm_ima_expand_nibble(&c->status[0], *src>>4, 3);
+ *samples++ = adpcm_ima_expand_nibble(&c->status[st], *src&0x0F, 3);
+ }
+ break;
case CODEC_ID_ADPCM_IMA_EA_SEAD:
for (; src < buf+buf_size; src++) {
*samples++ = adpcm_ima_expand_nibble(&c->status[0], src[0] >> 4, 6);
@@ -1542,6 +1561,7 @@ ADPCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea)
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_AMV, adpcm_ima_amv);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4);
+ADPCM_CODEC(CODEC_ID_ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
Modified: trunk/libavcodec/allcodecs.c
==============================================================================
--- trunk/libavcodec/allcodecs.c (original)
+++ trunk/libavcodec/allcodecs.c Wed Oct 31 00:20:26 2007
@@ -254,6 +254,7 @@ void avcodec_register_all(void)
REGISTER_DECODER (ADPCM_IMA_AMV, adpcm_ima_amv);
REGISTER_ENCDEC (ADPCM_IMA_DK3, adpcm_ima_dk3);
REGISTER_ENCDEC (ADPCM_IMA_DK4, adpcm_ima_dk4);
+ REGISTER_DECODER (ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs);
REGISTER_DECODER (ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead);
REGISTER_ENCDEC (ADPCM_IMA_QT, adpcm_ima_qt);
REGISTER_ENCDEC (ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h (original)
+++ trunk/libavcodec/avcodec.h Wed Oct 31 00:20:26 2007
@@ -215,6 +215,7 @@ enum CodecID {
CODEC_ID_ADPCM_EA_R3,
CODEC_ID_ADPCM_EA_R2,
CODEC_ID_ADPCM_IMA_EA_SEAD,
+ CODEC_ID_ADPCM_IMA_EA_EACS,
/* AMR */
CODEC_ID_AMR_NB= 0x12000,
Modified: trunk/libavformat/electronicarts.c
==============================================================================
--- trunk/libavformat/electronicarts.c (original)
+++ trunk/libavformat/electronicarts.c Wed Oct 31 00:20:26 2007
@@ -201,6 +201,7 @@ static int process_audio_header_eacs(AVF
}
break;
case 1: ea->audio_codec = CODEC_ID_PCM_MULAW; ea->bytes = 1; break;
+ case 2: ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_EACS; break;
default:
av_log (s, AV_LOG_ERROR, "unsupported stream type; audio compression_type=%i\n", compression_type);
}
More information about the ffmpeg-cvslog
mailing list