[FFmpeg-devel] [PATCH 1/2] avcodec: Implement Acorn Replay IMA ADPCM decoder

Michael Niedermayer michael at niedermayer.cc
Fri Jul 5 19:16:08 EEST 2019


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190705/082030c2/attachment.sig>


More information about the ffmpeg-devel mailing list