[FFmpeg-devel] [PATCH 1/2] avcodec: Implement Acorn Replay IMA ADPCM decoder
Cameron Cawley
ccawley2011 at gmail.com
Fri Jul 5 19:53:15 EEST 2019
Samples are available from
http://riscos.com/ftp_space/370/files/diversions.zip (in the "AudioDemos"
folder) and http://riscos.com/ftp_space/370/files/sound.zip (the files
"1812" and "Enigma").
On Fri, 5 Jul 2019 at 17:16, Michael Niedermayer <michael at niedermayer.cc>
wrote:
> On Thu, Jun 27, 2019 at 08:56:01PM +0100, Cameron Cawley wrote:
> > Signed-off-by: Cameron Cawley <ccawley2011 at gmail.com>
> > ---
> > doc/general.texi | 1 +
> > libavcodec/Makefile | 1 +
> > libavcodec/adpcm.c | 14 ++++++++++++++
> > libavcodec/allcodecs.c | 1 +
> > libavcodec/avcodec.h | 1 +
> > libavcodec/codec_desc.c | 7 +++++++
> > libavcodec/utils.c | 1 +
> > 7 files changed, 26 insertions(+)
> >
> > diff --git a/doc/general.texi b/doc/general.texi
> > index ed3cdfcf99..fbbbc24753 100644
> > --- a/doc/general.texi
> > +++ b/doc/general.texi
> > @@ -1070,6 +1070,7 @@ following image formats are supported:
> > @item ADPCM Electronic Arts XAS @tab @tab X
> > @item ADPCM G.722 @tab X @tab X
> > @item ADPCM G.726 @tab X @tab X
> > + at item ADPCM IMA Acorn Replay @tab @tab X
> > @item ADPCM IMA AMV @tab @tab X
> > @tab Used in AMV files
> > @item ADPCM IMA Electronic Arts EACS @tab @tab X
> > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > index edccd73037..9c0dd5d189 100644
> > --- a/libavcodec/Makefile
> > +++ b/libavcodec/Makefile
> > @@ -825,6 +825,7 @@ OBJS-$(CONFIG_ADPCM_G726_DECODER) += g726.o
> > OBJS-$(CONFIG_ADPCM_G726_ENCODER) += g726.o
> > OBJS-$(CONFIG_ADPCM_G726LE_DECODER) += g726.o
> > OBJS-$(CONFIG_ADPCM_G726LE_ENCODER) += g726.o
> > +OBJS-$(CONFIG_ADPCM_IMA_ACORN_DECODER) += adpcm.o adpcm_data.o
> > OBJS-$(CONFIG_ADPCM_IMA_AMV_DECODER) += adpcm.o adpcm_data.o
> > OBJS-$(CONFIG_ADPCM_IMA_APC_DECODER) += adpcm.o adpcm_data.o
> > OBJS-$(CONFIG_ADPCM_IMA_DAT4_DECODER) += adpcm.o adpcm_data.o
> > diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> > index ede0130bf1..1d4b4d2c22 100644
> > --- a/libavcodec/adpcm.c
> > +++ b/libavcodec/adpcm.c
> > @@ -594,6 +594,7 @@ static int get_nb_samples(AVCodecContext *avctx,
> GetByteContext *gb,
> > switch (avctx->codec->id) {
> > case AV_CODEC_ID_ADPCM_4XM:
> > case AV_CODEC_ID_ADPCM_AGM:
> > + case AV_CODEC_ID_ADPCM_IMA_ACORN:
> > case AV_CODEC_ID_ADPCM_IMA_DAT4:
> > case AV_CODEC_ID_ADPCM_IMA_ISS: header_size = 4 * ch;
> break;
> > case AV_CODEC_ID_ADPCM_IMA_AMV: header_size = 8;
> break;
> > @@ -1412,6 +1413,18 @@ static int adpcm_decode_frame(AVCodecContext
> *avctx, void *data,
> > }
> > }
> > break;
> > + case AV_CODEC_ID_ADPCM_IMA_ACORN:
> > + for (i=0; i<=st; i++) {
> > + bytestream2_skip(&gb, 2); // TODO: What does this do?
> > + c->status[i].step_index = bytestream2_get_le16u(&gb);
> > + }
>
> where can we find such adpcm files for testing ?
>
> 2 bytes per stream could be initial raw pcm samples
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> No great genius has ever existed without some touch of madness. --
> Aristotle
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list