* [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders
@ 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
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:33 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: 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 },
};
--
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 2/6] avcodec/mmaldec: Avoid using AVCodec.pix_fmts
2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
@ 2024-02-05 23:36 ` Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 3/6] avcodec/vc1dec: Set pointers for hwaccel even without hwaccel Andreas Rheinhardt
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:36 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is entirely unnecessary to use it given that all decoders
here share the same set of supported pixel formats. So just
hardcode this list.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mmaldec.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 2dc7bbee04..a8cda27570 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -101,6 +101,10 @@ typedef struct MMALDecodeContext {
// packets (where each packet contains 1 frame).
#define MAX_DELAYED_FRAMES 16
+static const enum AVPixelFormat mmal_pixfmts[] = {
+ AV_PIX_FMT_MMAL, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
+};
+
static void ffmmal_poolref_unref(FFPoolRef *ref)
{
if (ref &&
@@ -367,7 +371,7 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
return AVERROR(ENOSYS);
}
- if ((ret = ff_get_format(avctx, avctx->codec->pix_fmts)) < 0)
+ if ((ret = ff_get_format(avctx, mmal_pixfmts)) < 0)
return ret;
avctx->pix_fmt = ret;
@@ -844,9 +848,6 @@ static const AVClass ffmmal_dec_class = {
.p.priv_class = &ffmmal_dec_class, \
.p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
- .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \
- AV_PIX_FMT_YUV420P, \
- AV_PIX_FMT_NONE}, \
.hw_configs = mmal_hw_configs, \
.p.wrapper_name = "mmal", \
};
--
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 3/6] avcodec/vc1dec: Set pointers for hwaccel even without hwaccel
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 ` Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 4/6] avcodec/vc1dec: Don't call ff_get_format() twice Andreas Rheinhardt
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:36 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
VC-1 uses a 0x03 escaping scheme like H.26x and our decoder
unescapes data for this purpose, but hardware accelerations
just want the data as-is and therefore get fed the original
data. The pointers to the actual data are only setcorrectly
if avctx->hwaccel is set (after all, they are only used in
this case).
There are two problems with this: The first is that the branch
is pointless; the second is that it is harmful, because
a hardware acceleration may be added after the packet has been
parsed (in case there is a reconfiguration e.g. due to frame
size changes) in which case decoding the first few frames
won't work.
So delete these branches.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1dec.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 6eff2ec04c..6462a40fd3 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -846,14 +846,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
if (size <= 0) continue;
switch (AV_RB32(start)) {
case VC1_CODE_FRAME:
- if (avctx->hwaccel)
- buf_start = start;
+ buf_start = start;
buf_size2 = v->vc1dsp.vc1_unescape_buffer(start + 4, size, buf2);
break;
case VC1_CODE_FIELD: {
int buf_size3;
- if (avctx->hwaccel)
- buf_start_second_field = start;
+ buf_start_second_field = start;
av_size_mult(sizeof(*slices), n_slices+1, &next_allocated);
tmp = next_allocated ? av_fast_realloc(slices, &slices_allocated, next_allocated) : NULL;
if (!tmp) {
@@ -918,8 +916,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
ret = AVERROR_INVALIDDATA;
goto err;
} else { // found field marker, unescape second field
- if (avctx->hwaccel)
- buf_start_second_field = divider;
+ buf_start_second_field = divider;
av_size_mult(sizeof(*slices), n_slices+1, &next_allocated);
tmp = next_allocated ? av_fast_realloc(slices, &slices_allocated, next_allocated) : NULL;
if (!tmp) {
--
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 4/6] avcodec/vc1dec: Don't call ff_get_format() twice
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 ` Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays Andreas Rheinhardt
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:36 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is currently called once in the codecs' init function
and once when (re)initializing the VC-1 decode context
(which happens upon frame size changes as well as before
decoding the first frame). The first one is unnecessary
now that vc1_decode_frame() no longer requires avctx->hwaccel
to be already set for hwaccel to work properly.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vc1dec.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 6462a40fd3..4f4aa8aa07 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -691,14 +691,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if (v->profile == PROFILE_ADVANCED)
avctx->level = v->level;
- if (!CONFIG_GRAY || !(avctx->flags & AV_CODEC_FLAG_GRAY))
- avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
- else {
- avctx->pix_fmt = AV_PIX_FMT_GRAY8;
- if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
- avctx->color_range = AVCOL_RANGE_MPEG;
- }
-
ff_blockdsp_init(&s->bdsp);
ff_h264chroma_init(&v->h264chroma, 8);
--
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays
2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
` (2 preceding siblings ...)
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
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: " Andreas Rheinhardt
2024-02-08 1:05 ` [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:36 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: Remove AVCodec.pix_fmts arrays
2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
` (3 preceding siblings ...)
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays Andreas Rheinhardt
@ 2024-02-05 23:36 ` Andreas Rheinhardt
2024-02-08 1:05 ` [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-05 23:36 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
They are not intended for decoders (for which there is the get_format
callback in case the user has a choice).
Also note that the list was wrong for MPEG4, because it did not contain
the high bit depth pixel formats used for studio profiles.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/flvdec.c | 2 --
libavcodec/h263dec.c | 43 ++++++++++++++++++++------------------
libavcodec/h263dec.h | 2 --
libavcodec/intelh263dec.c | 4 ----
libavcodec/mpeg4videodec.c | 1 -
libavcodec/msmpeg4dec.c | 16 --------------
libavcodec/wmv2dec.c | 2 --
7 files changed, 23 insertions(+), 47 deletions(-)
diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c
index 09fefd3d1c..8baaed06a8 100644
--- a/libavcodec/flvdec.c
+++ b/libavcodec/flvdec.c
@@ -123,6 +123,4 @@ const FFCodec ff_flv_decoder = {
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.max_lowres = 3,
- .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE },
};
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index eb1d87a2fe..910df7585f 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -49,6 +49,23 @@
#include "thread.h"
#include "wmv2dec.h"
+static const enum AVPixelFormat h263_hwaccel_pixfmt_list_420[] = {
+#if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
+ AV_PIX_FMT_VAAPI,
+#endif
+#if CONFIG_MPEG4_NVDEC_HWACCEL
+ AV_PIX_FMT_CUDA,
+#endif
+#if CONFIG_MPEG4_VDPAU_HWACCEL
+ AV_PIX_FMT_VDPAU,
+#endif
+#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL || CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL
+ AV_PIX_FMT_VIDEOTOOLBOX,
+#endif
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_NONE
+};
+
static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
{
/* MPEG-4 Studio Profile only, not supported by hardware */
@@ -63,7 +80,12 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
return AV_PIX_FMT_GRAY8;
}
- return avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts);
+ if (avctx->codec_id == AV_CODEC_ID_H263 ||
+ avctx->codec_id == AV_CODEC_ID_H263P ||
+ avctx->codec_id == AV_CODEC_ID_MPEG4)
+ return avctx->pix_fmt = ff_get_format(avctx, h263_hwaccel_pixfmt_list_420);
+
+ return AV_PIX_FMT_YUV420P;
}
av_cold int ff_h263_decode_init(AVCodecContext *avctx)
@@ -659,23 +681,6 @@ frame_end:
return get_consumed_bytes(s, buf_size);
}
-const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
-#if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI,
-#endif
-#if CONFIG_MPEG4_NVDEC_HWACCEL
- AV_PIX_FMT_CUDA,
-#endif
-#if CONFIG_MPEG4_VDPAU_HWACCEL
- AV_PIX_FMT_VDPAU,
-#endif
-#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL || CONFIG_MPEG4_VIDEOTOOLBOX_HWACCEL
- AV_PIX_FMT_VIDEOTOOLBOX,
-#endif
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
-};
-
static const AVCodecHWConfigInternal *const h263_hw_config_list[] = {
#if CONFIG_H263_VAAPI_HWACCEL
HWACCEL_VAAPI(h263),
@@ -706,7 +711,6 @@ const FFCodec ff_h263_decoder = {
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = ff_mpeg_flush,
.p.max_lowres = 3,
- .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
.hw_configs = h263_hw_config_list,
};
@@ -724,6 +728,5 @@ const FFCodec ff_h263p_decoder = {
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.flush = ff_mpeg_flush,
.p.max_lowres = 3,
- .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
.hw_configs = h263_hw_config_list,
};
diff --git a/libavcodec/h263dec.h b/libavcodec/h263dec.h
index 06ff7c1c48..89c5fcf58f 100644
--- a/libavcodec/h263dec.h
+++ b/libavcodec/h263dec.h
@@ -38,8 +38,6 @@ extern VLCElem ff_h263_inter_MCBPC_vlc[];
extern VLCElem ff_h263_cbpy_vlc[];
extern VLCElem ff_h263_mv_vlc[];
-extern const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[];
-
int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code);
int ff_h263_decode_init(AVCodecContext *avctx);
int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *frame,
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index 2c216b00a6..f8eeb6b44e 100644
--- a/libavcodec/intelh263dec.c
+++ b/libavcodec/intelh263dec.c
@@ -138,8 +138,4 @@ const FFCodec ff_h263i_decoder = {
FF_CODEC_DECODE_CB(ff_h263_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
- .p.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
- },
};
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 65d4bf429b..07de5d6d91 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3865,7 +3865,6 @@ const FFCodec ff_mpeg4_decoder = {
FF_CODEC_CAP_ALLOCATE_PROGRESS,
.flush = ff_mpeg_flush,
.p.max_lowres = 3,
- .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
UPDATE_THREAD_CONTEXT(mpeg4_update_thread_context),
UPDATE_THREAD_CONTEXT_FOR_USER(mpeg4_update_thread_context_for_user),
diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index 5b10d8f225..bf1e4877bd 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -853,10 +853,6 @@ const FFCodec ff_msmpeg4v1_decoder = {
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.max_lowres = 3,
- .p.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
- },
};
const FFCodec ff_msmpeg4v2_decoder = {
@@ -871,10 +867,6 @@ const FFCodec ff_msmpeg4v2_decoder = {
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.max_lowres = 3,
- .p.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
- },
};
const FFCodec ff_msmpeg4v3_decoder = {
@@ -889,10 +881,6 @@ const FFCodec ff_msmpeg4v3_decoder = {
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.max_lowres = 3,
- .p.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
- },
};
const FFCodec ff_wmv1_decoder = {
@@ -907,8 +895,4 @@ const FFCodec ff_wmv1_decoder = {
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.max_lowres = 3,
- .p.pix_fmts = (const enum AVPixelFormat[]) {
- AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE
- },
};
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index ab72590a8e..ff27d1b4d0 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -599,6 +599,4 @@ const FFCodec ff_wmv2_decoder = {
FF_CODEC_DECODE_CB(ff_h263_decode_frame),
.p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
- .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_NONE },
};
--
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders
2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
` (4 preceding siblings ...)
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: " Andreas Rheinhardt
@ 2024-02-08 1:05 ` Andreas Rheinhardt
5 siblings, 0 replies; 7+ messages in thread
From: Andreas Rheinhardt @ 2024-02-08 1:05 UTC (permalink / raw)
To: ffmpeg-devel
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".
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-08 1:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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 ` [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
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