Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders
Date: Thu, 8 Feb 2024 02:05:27 +0100
Message-ID: <DU0P250MB0747024A688CFB30A740818E8F442@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB0744694CDB4F9751AE9419C88F472@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

Andreas Rheinhardt:
> AVCodec.pix_fmts is only intended for encoders (decoders use
> the get_format callback to let the user choose a pix fmt).
> So remove them for the decoders for which this is possible
> without further complications; keep them for now in the codecs
> that actually use them (by passing avctx->codec->pix_fmts to
> ff_get_formatt()).
> 
> Also notice that some of these lists were wrong; e.g.
> 317b7b06fd97cd39feac7df57db22a30550351ff added support for YUV444P16
> for cuviddec, but forgot to add it to pix_fmts.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/crystalhd.c |  1 -
>  libavcodec/cuviddec.c  |  5 -----
>  libavcodec/flashsv.c   |  2 --
>  libavcodec/libdavs2.c  |  2 --
>  libavcodec/libuavs3d.c |  3 ---
>  libavcodec/qsvdec.c    | 11 -----------
>  libavcodec/rkmppdec.c  |  2 --
>  libavcodec/rv10.c      |  8 --------
>  libavcodec/rv30.c      |  4 ----
>  libavcodec/rv40.c      |  4 ----
>  libavcodec/svq1dec.c   |  2 --
>  libavcodec/svq3.c      |  2 --
>  libavcodec/xfacedec.c  |  1 -
>  13 files changed, 47 deletions(-)
> 
> diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c
> index 86f6cfa6c1..fb190436f5 100644
> --- a/libavcodec/crystalhd.c
> +++ b/libavcodec/crystalhd.c
> @@ -797,7 +797,6 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame)
>          .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
>          .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \
>                            FF_CODEC_CAP_SETS_FRAME_PROPS, \
> -        .p.pix_fmts     = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \
>          .p.wrapper_name = "crystalhd", \
>      };
>  
> diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
> index da37207cf2..84edf5c209 100644
> --- a/libavcodec/cuviddec.c
> +++ b/libavcodec/cuviddec.c
> @@ -1174,11 +1174,6 @@ static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = {
>          .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
>          .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE | \
>                            FF_CODEC_CAP_SETS_FRAME_PROPS, \
> -        .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \
> -                                                        AV_PIX_FMT_NV12, \
> -                                                        AV_PIX_FMT_P010, \
> -                                                        AV_PIX_FMT_P016, \
> -                                                        AV_PIX_FMT_NONE }, \
>          .hw_configs     = cuvid_hw_configs, \
>          .p.wrapper_name = "cuvid", \
>      };
> diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
> index 8a01e3a4b6..fe00e529a5 100644
> --- a/libavcodec/flashsv.c
> +++ b/libavcodec/flashsv.c
> @@ -511,7 +511,6 @@ const FFCodec ff_flashsv_decoder = {
>      FF_CODEC_DECODE_CB(flashsv_decode_frame),
>      .p.capabilities = AV_CODEC_CAP_DR1,
>      .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
>  };
>  #endif /* CONFIG_FLASHSV_DECODER */
>  
> @@ -579,6 +578,5 @@ const FFCodec ff_flashsv2_decoder = {
>      FF_CODEC_DECODE_CB(flashsv_decode_frame),
>      .p.capabilities = AV_CODEC_CAP_DR1,
>      .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE },
>  };
>  #endif /* CONFIG_FLASHSV2_DECODER */
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> index 179d2f4e4b..5a605c36f6 100644
> --- a/libavcodec/libdavs2.c
> +++ b/libavcodec/libdavs2.c
> @@ -234,7 +234,5 @@ const FFCodec ff_libdavs2_decoder = {
>      .p.capabilities =  AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS,
>      .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
>                        FF_CODEC_CAP_AUTO_THREADS,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
> -                                                     AV_PIX_FMT_NONE },
>      .p.wrapper_name = "libdavs2",
>  };
> diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c
> index 66e8d31001..f5d47f28ed 100644
> --- a/libavcodec/libuavs3d.c
> +++ b/libavcodec/libuavs3d.c
> @@ -274,8 +274,5 @@ const FFCodec ff_libuavs3d_decoder = {
>      .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
>                        FF_CODEC_CAP_AUTO_THREADS,
>      .flush          = libuavs3d_flush,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
> -                                                     AV_PIX_FMT_YUV420P10LE,
> -                                                     AV_PIX_FMT_NONE },
>      .p.wrapper_name = "libuavs3d",
>  };
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index 559f63698a..812bfd8830 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -1127,17 +1127,6 @@ const FFCodec ff_##x##_qsv_decoder = { \
>      .bsfs           = bsf_name, \
>      .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID, \
>      .p.priv_class   = &x##_qsv_class, \
> -    .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \
> -                                                    AV_PIX_FMT_P010, \
> -                                                    AV_PIX_FMT_P012, \
> -                                                    AV_PIX_FMT_YUYV422, \
> -                                                    AV_PIX_FMT_Y210, \
> -                                                    AV_PIX_FMT_Y212, \
> -                                                    AV_PIX_FMT_VUYX, \
> -                                                    AV_PIX_FMT_XV30, \
> -                                                    AV_PIX_FMT_XV36, \
> -                                                    AV_PIX_FMT_QSV, \
> -                                                    AV_PIX_FMT_NONE }, \
>      .hw_configs     = qsv_hw_configs, \
>      .p.wrapper_name = "qsv", \
>      .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
> diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
> index 5768568b00..53b6f6d5e8 100644
> --- a/libavcodec/rkmppdec.c
> +++ b/libavcodec/rkmppdec.c
> @@ -575,8 +575,6 @@ static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = {
>          .flush          = rkmpp_flush, \
>          .p.priv_class   = &rkmpp_##NAME##_dec_class, \
>          .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \
> -        .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \
> -                                                         AV_PIX_FMT_NONE}, \
>          .hw_configs     = rkmpp_hw_configs, \
>          .bsfs           = BSFS, \
>          .p.wrapper_name = "rkmpp", \
> diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
> index 216328ffe7..d32faa628b 100644
> --- a/libavcodec/rv10.c
> +++ b/libavcodec/rv10.c
> @@ -671,10 +671,6 @@ const FFCodec ff_rv10_decoder = {
>      FF_CODEC_DECODE_CB(rv10_decode_frame),
>      .p.capabilities = AV_CODEC_CAP_DR1,
>      .p.max_lowres   = 3,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) {
> -        AV_PIX_FMT_YUV420P,
> -        AV_PIX_FMT_NONE
> -    },
>  };
>  
>  const FFCodec ff_rv20_decoder = {
> @@ -689,8 +685,4 @@ const FFCodec ff_rv20_decoder = {
>      .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
>      .flush          = ff_mpeg_flush,
>      .p.max_lowres   = 3,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) {
> -        AV_PIX_FMT_YUV420P,
> -        AV_PIX_FMT_NONE
> -    },
>  };
> diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
> index be62577f99..9e13e71805 100644
> --- a/libavcodec/rv30.c
> +++ b/libavcodec/rv30.c
> @@ -303,10 +303,6 @@ const FFCodec ff_rv30_decoder = {
>      .p.capabilities        = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
>                               AV_CODEC_CAP_FRAME_THREADS,
>      .flush                 = ff_mpeg_flush,
> -    .p.pix_fmts            = (const enum AVPixelFormat[]) {
> -        AV_PIX_FMT_YUV420P,
> -        AV_PIX_FMT_NONE
> -    },
>      UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context),
>      .caps_internal         = FF_CODEC_CAP_ALLOCATE_PROGRESS,
>  };
> diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
> index 3ee405f33c..e48aa1f684 100644
> --- a/libavcodec/rv40.c
> +++ b/libavcodec/rv40.c
> @@ -581,10 +581,6 @@ const FFCodec ff_rv40_decoder = {
>      .p.capabilities        = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
>                               AV_CODEC_CAP_FRAME_THREADS,
>      .flush                 = ff_mpeg_flush,
> -    .p.pix_fmts            = (const enum AVPixelFormat[]) {
> -        AV_PIX_FMT_YUV420P,
> -        AV_PIX_FMT_NONE
> -    },
>      UPDATE_THREAD_CONTEXT(ff_rv34_decode_update_thread_context),
>      .caps_internal         = FF_CODEC_CAP_ALLOCATE_PROGRESS,
>  };
> diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
> index af02063a45..d2cfe4cf40 100644
> --- a/libavcodec/svq1dec.c
> +++ b/libavcodec/svq1dec.c
> @@ -863,6 +863,4 @@ const FFCodec ff_svq1_decoder = {
>      FF_CODEC_DECODE_CB(svq1_decode_frame),
>      .p.capabilities = AV_CODEC_CAP_DR1,
>      .flush          = svq1_flush,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
> -                                                     AV_PIX_FMT_NONE },
>  };
> diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
> index 2d03dbc457..d2f53742e1 100644
> --- a/libavcodec/svq3.c
> +++ b/libavcodec/svq3.c
> @@ -1602,7 +1602,5 @@ const FFCodec ff_svq3_decoder = {
>      .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND |
>                        AV_CODEC_CAP_DR1             |
>                        AV_CODEC_CAP_DELAY,
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P,
> -                                                     AV_PIX_FMT_NONE},
>      .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>  };
> diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c
> index 378d6aea0e..78b70cae8c 100644
> --- a/libavcodec/xfacedec.c
> +++ b/libavcodec/xfacedec.c
> @@ -182,5 +182,4 @@ const FFCodec ff_xface_decoder = {
>      .priv_data_size = sizeof(XFaceContext),
>      .init           = xface_decode_init,
>      FF_CODEC_DECODE_CB(xface_decode_frame),
> -    .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE },
>  };

Will apply this patchset tomorrow unless there are objections.

- Andreas

_______________________________________________
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".

      parent reply	other threads:[~2024-02-08  1:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 23:33 Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 2/6] avcodec/mmaldec: Avoid using AVCodec.pix_fmts Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 3/6] avcodec/vc1dec: Set pointers for hwaccel even without hwaccel Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 4/6] avcodec/vc1dec: Don't call ff_get_format() twice Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: " Andreas Rheinhardt
2024-02-08  1:05 ` Andreas Rheinhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DU0P250MB0747024A688CFB30A740818E8F442@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git