[FFmpeg-cvslog] r10879 - in trunk: libavcodec/Makefile libavcodec/adpcm.c libavcodec/allcodecs.c libavcodec/avcodec.h libavformat/electronicarts.c
aurel
subversion
Wed Oct 31 00:12:18 CET 2007
Author: aurel
Date: Wed Oct 31 00:12:18 2007
New Revision: 10879
Log:
EA IMA SEAD 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:12:18 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_SEAD_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcm.o
OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o
Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c (original)
+++ trunk/libavcodec/adpcm.c Wed Oct 31 00:12:18 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 SEAD decoder by Peter Ross (pross at xvid.org)
* THP ADPCM decoder by Marco Gerards (mgerards at xs4all.nl)
*
* Features and limitations:
@@ -1137,6 +1138,12 @@ static int adpcm_decode_frame(AVCodecCon
buf_size -= 128;
}
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);
+ *samples++ = adpcm_ima_expand_nibble(&c->status[st],src[0]&0x0F, 6);
+ }
+ break;
case CODEC_ID_ADPCM_EA:
samples_in_chunk = AV_RL32(src);
if (samples_in_chunk >= ((buf_size - 12) * 2)) {
@@ -1535,6 +1542,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_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);
ADPCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);
Modified: trunk/libavcodec/allcodecs.c
==============================================================================
--- trunk/libavcodec/allcodecs.c (original)
+++ trunk/libavcodec/allcodecs.c Wed Oct 31 00:12:18 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_SEAD, adpcm_ima_ea_sead);
REGISTER_ENCDEC (ADPCM_IMA_QT, adpcm_ima_qt);
REGISTER_ENCDEC (ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
REGISTER_ENCDEC (ADPCM_IMA_WAV, adpcm_ima_wav);
Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h (original)
+++ trunk/libavcodec/avcodec.h Wed Oct 31 00:12:18 2007
@@ -33,8 +33,8 @@
#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s
-#define LIBAVCODEC_VERSION_INT ((51<<16)+(47<<8)+1)
-#define LIBAVCODEC_VERSION 51.47.1
+#define LIBAVCODEC_VERSION_INT ((51<<16)+(47<<8)+2)
+#define LIBAVCODEC_VERSION 51.47.2
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
@@ -214,6 +214,7 @@ enum CodecID {
CODEC_ID_ADPCM_EA_R1,
CODEC_ID_ADPCM_EA_R3,
CODEC_ID_ADPCM_EA_R2,
+ CODEC_ID_ADPCM_IMA_EA_SEAD,
/* AMR */
CODEC_ID_AMR_NB= 0x12000,
Modified: trunk/libavformat/electronicarts.c
==============================================================================
--- trunk/libavformat/electronicarts.c (original)
+++ trunk/libavformat/electronicarts.c Wed Oct 31 00:12:18 2007
@@ -27,6 +27,9 @@
#include "avformat.h"
#define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
+#define SEAD_TAG MKTAG('S', 'E', 'A', 'D') /* Sxxx header */
+#define SNDC_TAG MKTAG('S', 'N', 'D', 'C') /* Sxxx data */
+#define SEND_TAG MKTAG('S', 'E', 'N', 'D') /* Sxxx end */
#define ISNh_TAG MKTAG('1', 'S', 'N', 'h') /* 1SNx header */
#define EACS_TAG MKTAG('E', 'A', 'C', 'S')
#define ISNd_TAG MKTAG('1', 'S', 'N', 'd') /* 1SNx data */
@@ -205,6 +208,23 @@ static int process_audio_header_eacs(AVF
return 1;
}
+/*
+ * Process SEAD sound header
+ * return 1 if success, 0 if invalid format, otherwise AVERROR_xxx
+ */
+static int process_audio_header_sead(AVFormatContext *s)
+{
+ EaDemuxContext *ea = s->priv_data;
+ ByteIOContext *pb = &s->pb;
+
+ ea->sample_rate = get_le32(pb);
+ ea->bytes = get_le32(pb); /* 1=8-bit, 2=16-bit */
+ ea->num_channels = get_le32(pb);
+ ea->audio_codec = CODEC_ID_ADPCM_IMA_EA_SEAD;
+
+ return 1;
+}
+
static int process_video_header_vp6(AVFormatContext *s)
{
EaDemuxContext *ea = s->priv_data;
@@ -259,6 +279,10 @@ static int process_ea_header(AVFormatCon
err = process_audio_header_elements(s);
break;
+ case SEAD_TAG:
+ err = process_audio_header_sead(s);
+ break;
+
case MVhd_TAG :
err = process_video_header_vp6(s);
break;
@@ -283,6 +307,7 @@ static int ea_probe(AVProbeData *p)
switch (AV_RL32(&p->buf[0])) {
case ISNh_TAG:
case SCHl_TAG:
+ case SEAD_TAG:
case MVhd_TAG:
return AVPROBE_SCORE_MAX;
}
@@ -354,6 +379,7 @@ static int ea_read_packet(AVFormatContex
chunk_size -= 32;
case ISNd_TAG:
case SCDl_TAG:
+ case SNDC_TAG:
if (!ea->audio_codec) {
url_fskip(pb, chunk_size);
break;
@@ -387,6 +413,7 @@ static int ea_read_packet(AVFormatContex
case 0:
case ISNe_TAG:
case SCEl_TAG:
+ case SEND_TAG:
ret = AVERROR(EIO);
packet_read = 1;
break;
More information about the ffmpeg-cvslog
mailing list