diff mbox series

[FFmpeg-devel,v5,1/4] avcodec/adpcmenc: add capabilities argument to ADPCM_ENCODER()

Message ID 20200516115307.593748-2-zane@zanevaniperen.com
State Accepted
Headers show
Series adpcm_ima_ssi encoder + kvag muxer
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zane van Iperen May 16, 2020, 11:53 a.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavcodec/adpcmenc.c | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

Comments

Paul B Mahol May 16, 2020, 1:03 p.m. UTC | #1
Why sending this kind of patches?

I see no point in this patch?

On 5/16/20, Zane van Iperen <zane@zanevaniperen.com> wrote:
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
> ---
>  libavcodec/adpcmenc.c | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
> index 668939c778..d3098a8f9c 100644
> --- a/libavcodec/adpcmenc.c
> +++ b/libavcodec/adpcmenc.c
> @@ -706,21 +706,22 @@ 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_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");
> --
> 2.25.1
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Zane van Iperen May 16, 2020, 1:56 p.m. UTC | #2
On Sat, 16 May 2020 15:03:22 +0200
"Paul B Mahol" <onemda@gmail.com> wrote:

> 
> Why sending this kind of patches?
> 
> I see no point in this patch?
> 

Michael suggested it here https://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262730.html
Paul B Mahol May 16, 2020, 4:48 p.m. UTC | #3
On 5/16/20, Zane van Iperen <zane@zanevaniperen.com> wrote:
> On Sat, 16 May 2020 15:03:22 +0200
> "Paul B Mahol" <onemda@gmail.com> wrote:
>
>>
>> Why sending this kind of patches?
>>
>> I see no point in this patch?
>>
>
> Michael suggested it here
> https://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262730.html
>
>
>

Ah, one of them use small last frame capability.
Everything is ok then.
Michael Niedermayer May 27, 2020, 8:11 p.m. UTC | #4
On Sat, May 16, 2020 at 06:48:08PM +0200, Paul B Mahol wrote:
> On 5/16/20, Zane van Iperen <zane@zanevaniperen.com> wrote:
> > On Sat, 16 May 2020 15:03:22 +0200
> > "Paul B Mahol" <onemda@gmail.com> wrote:
> >
> >>
> >> Why sending this kind of patches?
> >>
> >> I see no point in this patch?
> >>
> >
> > Michael suggested it here
> > https://ffmpeg.org/pipermail/ffmpeg-devel/2020-May/262730.html
> >
> >
> >
> 
> Ah, one of them use small last frame capability.
> Everything is ok then.

will apply

thx

[...]
Zane van Iperen May 28, 2020, 1:21 a.m. UTC | #5
On Wed, 27 May 2020 22:11:41 +0200
"Michael Niedermayer" <michael@niedermayer.cc> wrote:

> 
> will apply
> 
> thx
> 
Thanks! Could you please also apply part 4 (the muxer)? The encoder's
useless without it.

Zane
diff mbox series

Patch

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 668939c778..d3098a8f9c 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -706,21 +706,22 @@  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_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");