From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays Date: Tue, 6 Feb 2024 00:36:13 +0100 Message-ID: <AS8P250MB0744E9FB917044F33C2D43D78F472@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB0744694CDB4F9751AE9419C88F472@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> They are not intended for decoders (for which there is the get_format callback in case the user has a choice). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/vc1dec.c | 64 ++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 4f4aa8aa07..e71b92eef8 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -72,6 +72,30 @@ typedef struct SpriteData { int effect_params1[15], effect_params2[10]; ///< effect parameters in 16.16 fixed point format } SpriteData; +static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { +#if CONFIG_VC1_DXVA2_HWACCEL + AV_PIX_FMT_DXVA2_VLD, +#endif +#if CONFIG_VC1_D3D11VA_HWACCEL + AV_PIX_FMT_D3D11VA_VLD, + AV_PIX_FMT_D3D11, +#endif +#if CONFIG_VC1_D3D12VA_HWACCEL + AV_PIX_FMT_D3D12, +#endif +#if CONFIG_VC1_NVDEC_HWACCEL + AV_PIX_FMT_CUDA, +#endif +#if CONFIG_VC1_VAAPI_HWACCEL + AV_PIX_FMT_VAAPI, +#endif +#if CONFIG_VC1_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU, +#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE +}; + static inline int get_fp_val(GetBitContext* gb) { return (get_bits_long(gb, 30) - (1 << 29)) << 1; @@ -417,7 +441,11 @@ static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx) return AV_PIX_FMT_GRAY8; } - return ff_get_format(avctx, avctx->codec->pix_fmts); + if (avctx->codec_id == AV_CODEC_ID_VC1IMAGE || + avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) + return AV_PIX_FMT_YUV420P; + + return ff_get_format(avctx, vc1_hwaccel_pixfmt_list_420); } av_cold int ff_vc1_decode_init(AVCodecContext *avctx) @@ -1354,30 +1382,6 @@ err: } -static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { -#if CONFIG_VC1_DXVA2_HWACCEL - AV_PIX_FMT_DXVA2_VLD, -#endif -#if CONFIG_VC1_D3D11VA_HWACCEL - AV_PIX_FMT_D3D11VA_VLD, - AV_PIX_FMT_D3D11, -#endif -#if CONFIG_VC1_D3D12VA_HWACCEL - AV_PIX_FMT_D3D12, -#endif -#if CONFIG_VC1_NVDEC_HWACCEL - AV_PIX_FMT_CUDA, -#endif -#if CONFIG_VC1_VAAPI_HWACCEL - AV_PIX_FMT_VAAPI, -#endif -#if CONFIG_VC1_VDPAU_HWACCEL - AV_PIX_FMT_VDPAU, -#endif - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE -}; - const FFCodec ff_vc1_decoder = { .p.name = "vc1", CODEC_LONG_NAME("SMPTE VC-1"), @@ -1389,7 +1393,6 @@ const FFCodec ff_vc1_decoder = { FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VC1_DXVA2_HWACCEL HWACCEL_DXVA2(vc1), @@ -1429,7 +1432,6 @@ const FFCodec ff_wmv3_decoder = { FF_CODEC_DECODE_CB(vc1_decode_frame), .flush = ff_mpeg_flush, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_WMV3_DXVA2_HWACCEL HWACCEL_DXVA2(wmv3), @@ -1470,10 +1472,6 @@ const FFCodec ff_wmv3image_decoder = { FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .flush = vc1_sprite_flush, - .p.pix_fmts = (const enum AVPixelFormat[]) { - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }, }; #endif @@ -1489,9 +1487,5 @@ const FFCodec ff_vc1image_decoder = { FF_CODEC_DECODE_CB(vc1_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, .flush = vc1_sprite_flush, - .p.pix_fmts = (const enum AVPixelFormat[]) { - AV_PIX_FMT_YUV420P, - AV_PIX_FMT_NONE - }, }; #endif -- 2.34.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".
next prev parent reply other threads:[~2024-02-05 23:34 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders 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 ` Andreas Rheinhardt [this message] 2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: Remove AVCodec.pix_fmts arrays Andreas Rheinhardt 2024-02-08 1:05 ` [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
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=AS8P250MB0744E9FB917044F33C2D43D78F472@AS8P250MB0744.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