On Fri, May 08, 2020 at 02:31:27PM +0000, Zane van Iperen wrote: > Signed-off-by: Zane van Iperen <z...@zanevaniperen.com> > --- > Changelog | 1 + > doc/general.texi | 2 +- > libavcodec/Makefile | 1 + > libavcodec/adpcmenc.c | 65 +++++++++++++++++++++++++++++++----------- > libavcodec/allcodecs.c | 1 + > libavcodec/utils.c | 1 + > libavcodec/version.h | 2 +- > 7 files changed, 55 insertions(+), 18 deletions(-) > > diff --git a/Changelog b/Changelog > index b75d2b6b96..002fccb5cf 100644 > --- a/Changelog > +++ b/Changelog > @@ -66,6 +66,7 @@ version <next>: > - asubboost filter > - Pro Pinball Series Soundbank demuxer > - pcm_rechunk bitstream filter > +- Simon & Schuster Interactive ADPCM encoder > > > version 4.2: > diff --git a/doc/general.texi b/doc/general.texi > index 4aaf506e56..9b0ee96752 100644 > --- a/doc/general.texi > +++ b/doc/general.texi > @@ -1108,7 +1108,7 @@ following image formats are supported: > @item ADPCM IMA Funcom @tab @tab X > @item ADPCM IMA High Voltage Software ALP @tab @tab X > @item ADPCM IMA QuickTime @tab X @tab X > -@item ADPCM IMA Simon & Schuster Interactive @tab @tab X > +@item ADPCM IMA Simon & Schuster Interactive @tab X @tab X > @item ADPCM IMA Ubisoft APM @tab @tab X > @item ADPCM IMA Loki SDL MJPEG @tab @tab X > @item ADPCM IMA WAV @tab X @tab X > diff --git a/libavcodec/Makefile b/libavcodec/Makefile > index 38f6f07680..2fab8dc40b 100644 > --- a/libavcodec/Makefile > +++ b/libavcodec/Makefile > @@ -856,6 +856,7 @@ OBJS-$(CONFIG_ADPCM_IMA_QT_DECODER) += adpcm.o > adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_QT_ENCODER) += adpcmenc.o adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_RAD_DECODER) += adpcm.o adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_SSI_DECODER) += adpcm.o adpcm_data.o > +OBJS-$(CONFIG_ADPCM_IMA_SSI_ENCODER) += adpcmenc.o adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_SMJPEG_DECODER) += adpcm.o adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_WAV_DECODER) += adpcm.o adpcm_data.o > OBJS-$(CONFIG_ADPCM_IMA_WAV_ENCODER) += adpcmenc.o adpcm_data.o > diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c > index 668939c778..d1194c1f8f 100644 > --- a/libavcodec/adpcmenc.c > +++ b/libavcodec/adpcmenc.c > @@ -77,6 +77,15 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) > return AVERROR(EINVAL); > } > > + if (avctx->trellis && avctx->codec->id == AV_CODEC_ID_ADPCM_IMA_SSI) { > + /* > + * The current trellis implementation doesn't work for extended > + * runs of samples without periodic resets. Disallow it. > + */ > + av_log(avctx, AV_LOG_ERROR, "trellis not supported\n");
> + return AVERROR(EINVAL); AVERROR_PATCHWELCOME [...] > @@ -706,21 +737,23 @@ static const enum AVSampleFormat sample_fmts_p[] = { > AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE > }; > > -#define ADPCM_ENCODER(id_, name_, sample_fmts_, long_name_) \ > -AVCodec ff_ ## name_ ## _encoder = { \ > - .name = #name_, \ > - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ > - .type = AVMEDIA_TYPE_AUDIO, \ > - .id = id_, \ > - .priv_data_size = sizeof(ADPCMEncodeContext), \ > - .init = adpcm_encode_init, \ > - .encode2 = adpcm_encode_frame, \ > - .close = adpcm_encode_close, \ > - .sample_fmts = sample_fmts_, \ > +#define ADPCM_ENCODER(id_, name_, sample_fmts_, capabilities_, long_name_) \ > +AVCodec ff_ ## name_ ## _encoder = { \ > + .name = #name_, \ > + .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ > + .type = AVMEDIA_TYPE_AUDIO, \ > + .id = id_, \ > + .priv_data_size = sizeof(ADPCMEncodeContext), \ > + .init = adpcm_encode_init, \ > + .encode2 = adpcm_encode_frame, \ > + .close = adpcm_encode_close, \ > + .sample_fmts = sample_fmts_, \ > + .capabilities = capabilities_, \ > } > > -ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, > "ADPCM IMA QuickTime"); > -ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, sample_fmts_p, > "ADPCM IMA WAV"); > -ADPCM_ENCODER(AV_CODEC_ID_ADPCM_MS, adpcm_ms, sample_fmts, > "ADPCM Microsoft"); > -ADPCM_ENCODER(AV_CODEC_ID_ADPCM_SWF, adpcm_swf, sample_fmts, > "ADPCM Shockwave Flash"); > -ADPCM_ENCODER(AV_CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, sample_fmts, > "ADPCM Yamaha"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, 0, > "ADPCM IMA QuickTime"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_SSI, adpcm_ima_ssi, sample_fmts, > AV_CODEC_CAP_SMALL_LAST_FRAME, "ADPCM IMA Simon & Schuster Interactive"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, sample_fmts_p, 0, > "ADPCM IMA WAV"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_MS, adpcm_ms, sample_fmts, 0, > "ADPCM Microsoft"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_SWF, adpcm_swf, sample_fmts, 0, > "ADPCM Shockwave Flash"); > +ADPCM_ENCODER(AV_CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, sample_fmts, 0, > "ADPCM Yamaha"); This could be split out into a seperate patch which adds the parameter before the encoder using it, would make the commits slightly more readable [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is what and why we do it that matters, not just one of them.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".