avcodec: Remove redundant pix_fmts from decoders

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.
317b7b06fd added support for YUV444P16
for cuviddec, but forgot to add it to pix_fmts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.0
Andreas Rheinhardt 11 months ago
parent 395469c1b0
commit 89995cfda1
  1. 1
      libavcodec/crystalhd.c
  2. 5
      libavcodec/cuviddec.c
  3. 2
      libavcodec/flashsv.c
  4. 2
      libavcodec/libdavs2.c
  5. 3
      libavcodec/libuavs3d.c
  6. 11
      libavcodec/qsvdec.c
  7. 2
      libavcodec/rkmppdec.c
  8. 8
      libavcodec/rv10.c
  9. 4
      libavcodec/rv30.c
  10. 4
      libavcodec/rv40.c
  11. 2
      libavcodec/svq1dec.c
  12. 2
      libavcodec/svq3.c
  13. 1
      libavcodec/xfacedec.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", \
};

@ -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", \
};

@ -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 */

@ -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",
};

@ -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",
};

@ -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, \

@ -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", \

@ -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
},
};

@ -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,
};

@ -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,
};

@ -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 },
};

@ -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,
};

@ -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 },
};

Loading…
Cancel
Save