ffmpeg-devel
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
June 2026
- 35 participants
- 385 discussions
PR #23568 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23568
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23568.patch
Necessary after 509c1f99a7c0a3ffb9387c1aac19fe7b2c87594a.
From 741dd2bc5ab0c887073d2c6a0f4b219f60afa384 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt(a)outlook.com>
Date: Tue, 23 Jun 2026 21:05:49 +0200
Subject: [PATCH] avfilter/buffersink: Fix indentation
Necessary after 509c1f99a7c0a3ffb9387c1aac19fe7b2c87594a.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt(a)outlook.com>
---
libavfilter/buffersink.c | 70 ++++++++++++++++++++--------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index dda3abf385..e829007557 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -299,26 +299,26 @@ static int vsink_query_formats(const AVFilterContext *ctx,
const BufferSinkContext *buf = ctx->priv;
int ret;
- if (buf->nb_pixel_formats) {
- ret = ff_set_pixel_formats_from_list2(ctx, cfg_in, cfg_out, buf->pixel_formats);
- if (ret < 0)
- return ret;
- }
- if (buf->nb_colorspaces) {
- ret = ff_set_common_color_spaces_from_list2(ctx, cfg_in, cfg_out, buf->colorspaces);
- if (ret < 0)
- return ret;
- }
- if (buf->nb_colorranges) {
- ret = ff_set_common_color_ranges_from_list2(ctx, cfg_in, cfg_out, buf->colorranges);
- if (ret < 0)
- return ret;
- }
- if (buf->nb_alphamodes) {
- ret = ff_set_common_alpha_modes_from_list2(ctx, cfg_in, cfg_out, buf->alphamodes);
- if (ret < 0)
- return ret;
- }
+ if (buf->nb_pixel_formats) {
+ ret = ff_set_pixel_formats_from_list2(ctx, cfg_in, cfg_out, buf->pixel_formats);
+ if (ret < 0)
+ return ret;
+ }
+ if (buf->nb_colorspaces) {
+ ret = ff_set_common_color_spaces_from_list2(ctx, cfg_in, cfg_out, buf->colorspaces);
+ if (ret < 0)
+ return ret;
+ }
+ if (buf->nb_colorranges) {
+ ret = ff_set_common_color_ranges_from_list2(ctx, cfg_in, cfg_out, buf->colorranges);
+ if (ret < 0)
+ return ret;
+ }
+ if (buf->nb_alphamodes) {
+ ret = ff_set_common_alpha_modes_from_list2(ctx, cfg_in, cfg_out, buf->alphamodes);
+ if (ret < 0)
+ return ret;
+ }
return 0;
}
@@ -330,21 +330,21 @@ static int asink_query_formats(const AVFilterContext *ctx,
const BufferSinkContext *buf = ctx->priv;
int ret;
- if (buf->nb_sample_formats) {
- ret = ff_set_sample_formats_from_list2(ctx, cfg_in, cfg_out, buf->sample_formats);
- if (ret < 0)
- return ret;
- }
- if (buf->nb_samplerates) {
- ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, buf->samplerates);
- if (ret < 0)
- return ret;
- }
- if (buf->nb_channel_layouts) {
- ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, buf->channel_layouts);
- if (ret < 0)
- return ret;
- }
+ if (buf->nb_sample_formats) {
+ ret = ff_set_sample_formats_from_list2(ctx, cfg_in, cfg_out, buf->sample_formats);
+ if (ret < 0)
+ return ret;
+ }
+ if (buf->nb_samplerates) {
+ ret = ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, buf->samplerates);
+ if (ret < 0)
+ return ret;
+ }
+ if (buf->nb_channel_layouts) {
+ ret = ff_set_common_channel_layouts_from_list2(ctx, cfg_in, cfg_out, buf->channel_layouts);
+ if (ret < 0)
+ return ret;
+ }
return 0;
}
--
2.52.0
2
1
23 Jun '26
PR #23567 opened by Niklas Haas (haasn)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23567
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23567.patch
The changes to fate-sws-uops-macros and aarch64/ops_entries.c reflect a
real regression, because these files were not iterating over possible
combinations of full and limited range during generation. Having YUVJ
formats in the default pixel format list essentially caused them to be
included by accident.
The correct solution for that would be to refactor the sws fmt enumeration
code to include all possible full/limited range combinations, though that
would possible make these tasks a lot slower than they already are, so it's
probably better to hold off on that.
As it stands, these regressions only affect -sws_flags +unstable, and
only cause a fallback to legacy swscale, so I don't consider it a blocking
regression.
Signed-off-by: Niklas Haas <git(a)haasn.dev>
# Summary of changes
Briefly describe what this PR does and why.
<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).
Attached filenames must match the sample's filename:
```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->
From 26e7f6f9a965ceffc0d02a98658b54aa7fee2a19 Mon Sep 17 00:00:00 2001
From: Niklas Haas <git(a)haasn.dev>
Date: Tue, 23 Jun 2026 19:45:30 +0200
Subject: [PATCH] Remove YUVJ pixel formats from the codebase
The changes to fate-sws-uops-macros and aarch64/ops_entries.c reflect a
real regression, because these files were not iterating over possible
combinations of full and limited range during generation. Having YUVJ
formats in the default pixel format list essentially caused them to be
included by accident.
The correct solution for that would be to refactor the sws fmt enumeration
code to include all possible full/limited range combinations, though that
would possible make these tasks a lot slower than they already are, so it's
probably better to hold off on that.
As it stands, these regressions only affect -sws_flags +unstable, and
only cause a fallback to legacy swscale, so I don't consider it a blocking
regression.
Signed-off-by: Niklas Haas <git(a)haasn.dev>
---
Changelog | 1 +
libavcodec/amfdec.c | 1 -
libavcodec/aom_film_grain.c | 3 -
libavcodec/encode.c | 6 --
libavcodec/fraps.c | 2 +-
libavcodec/h264_slice.c | 26 +-------
libavcodec/hevc/hevcdec.c | 16 -----
libavcodec/hevc/ps.c | 2 -
libavcodec/libopenh264enc.c | 6 +-
libavcodec/librav1e.c | 17 +----
libavcodec/libx264.c | 13 ----
libavcodec/libx265.c | 14 +---
libavcodec/ljpegenc.c | 1 -
libavcodec/mdec.c | 2 +-
libavcodec/mjpegdec.c | 28 +++-----
libavcodec/mjpegenc.c | 5 +-
libavcodec/mjpegenc_common.c | 2 +-
libavcodec/mpegvideo_enc.c | 3 -
libavcodec/nvenc.c | 9 +--
libavcodec/qsv.c | 1 -
libavcodec/raw_pix_fmt_tags.h | 14 ----
libavcodec/roqvideodec.c | 2 +-
libavcodec/roqvideoenc.c | 2 +-
libavcodec/svq3.c | 2 +-
libavcodec/tdsc.c | 2 +-
libavcodec/utils.c | 5 --
libavcodec/vdpau.c | 3 -
libavfilter/avf_showcwt.c | 2 +-
libavfilter/avf_showspectrum.c | 2 +-
libavfilter/avfiltergraph.c | 32 ++-------
libavfilter/buffersrc.c | 15 ++---
libavfilter/drawutils.c | 5 +-
libavfilter/f_select.c | 3 +-
libavfilter/vaf_spectrumsynth.c | 4 +-
libavfilter/vf_amplify.c | 3 -
libavfilter/vf_atadenoise.c | 3 -
libavfilter/vf_avgblur.c | 4 +-
libavfilter/vf_bbox.c | 3 -
libavfilter/vf_bilateral.c | 4 +-
libavfilter/vf_bitplanenoise.c | 2 -
libavfilter/vf_blackdetect.c | 12 +---
libavfilter/vf_blend.c | 1 -
libavfilter/vf_blockdetect.c | 2 -
libavfilter/vf_blurdetect.c | 2 -
libavfilter/vf_bm3d.c | 3 -
libavfilter/vf_bwdif.c | 2 -
libavfilter/vf_cas.c | 3 -
libavfilter/vf_chromanr.c | 1 -
libavfilter/vf_chromashift.c | 1 -
libavfilter/vf_colorcorrect.c | 1 -
libavfilter/vf_colorize.c | 3 -
libavfilter/vf_colorspace.c | 1 -
libavfilter/vf_convolution.c | 4 +-
libavfilter/vf_convolve.c | 4 +-
libavfilter/vf_corr.c | 2 -
libavfilter/vf_cover_rect.c | 4 +-
libavfilter/vf_cropdetect.c | 4 +-
libavfilter/vf_dblur.c | 4 +-
libavfilter/vf_deband.c | 4 +-
libavfilter/vf_deblock.c | 4 +-
libavfilter/vf_decimate.c | 2 -
libavfilter/vf_dedot.c | 4 +-
libavfilter/vf_deflicker.c | 3 -
libavfilter/vf_deshake.c | 3 +-
libavfilter/vf_displace.c | 4 +-
libavfilter/vf_drawbox.c | 3 +-
libavfilter/vf_entropy.c | 2 -
libavfilter/vf_estdif.c | 3 -
libavfilter/vf_extractplanes.c | 3 -
libavfilter/vf_fade.c | 3 +-
libavfilter/vf_fftdnoiz.c | 3 -
libavfilter/vf_fftfilt.c | 6 +-
libavfilter/vf_fieldmatch.c | 3 -
libavfilter/vf_fillborders.c | 4 +-
libavfilter/vf_find_rect.c | 2 +-
libavfilter/vf_framepack.c | 3 -
libavfilter/vf_framerate.c | 10 +--
libavfilter/vf_freezedetect.c | 5 +-
libavfilter/vf_fspp.c | 2 -
libavfilter/vf_gblur.c | 4 +-
libavfilter/vf_guided.c | 4 +-
libavfilter/vf_histogram.c | 8 +--
libavfilter/vf_hqdn3d.c | 1 -
libavfilter/vf_hysteresis.c | 4 +-
libavfilter/vf_identity.c | 2 -
libavfilter/vf_idet.c | 4 --
libavfilter/vf_lagfun.c | 3 -
libavfilter/vf_lenscorrection.c | 3 -
libavfilter/vf_limitdiff.c | 4 +-
libavfilter/vf_limiter.c | 4 +-
libavfilter/vf_lut.c | 2 -
libavfilter/vf_lut2.c | 4 +-
libavfilter/vf_maskedclamp.c | 4 +-
libavfilter/vf_maskedmerge.c | 4 +-
libavfilter/vf_maskedminmax.c | 4 +-
libavfilter/vf_maskedthreshold.c | 4 +-
libavfilter/vf_maskfun.c | 4 +-
libavfilter/vf_median.c | 4 +-
libavfilter/vf_mestimate.c | 3 -
libavfilter/vf_midequalizer.c | 4 +-
libavfilter/vf_minterpolate.c | 3 -
libavfilter/vf_monochrome.c | 3 -
libavfilter/vf_morpho.c | 4 +-
libavfilter/vf_mpdecimate.c | 2 -
libavfilter/vf_negate.c | 2 -
libavfilter/vf_neighbor.c | 4 +-
libavfilter/vf_nlmeans.c | 3 -
libavfilter/vf_nnedi.c | 3 -
libavfilter/vf_ocr.c | 3 -
libavfilter/vf_overlay.c | 6 +-
libavfilter/vf_perspective.c | 1 -
libavfilter/vf_phase.c | 3 -
libavfilter/vf_pixelize.c | 3 -
libavfilter/vf_pp7.c | 2 -
libavfilter/vf_premultiply.c | 10 +--
libavfilter/vf_psnr.c | 2 -
libavfilter/vf_pullup.c | 4 +-
libavfilter/vf_quirc.c | 3 -
libavfilter/vf_readeia608.c | 3 -
libavfilter/vf_readvitc.c | 5 --
libavfilter/vf_remap.c | 1 -
libavfilter/vf_removegrain.c | 2 -
libavfilter/vf_rotate.c | 4 +-
libavfilter/vf_scdet.c | 8 +--
libavfilter/vf_scroll.c | 4 +-
libavfilter/vf_shear.c | 3 -
libavfilter/vf_signalstats.c | 2 -
libavfilter/vf_signature.c | 3 -
libavfilter/vf_siti.c | 12 +---
libavfilter/vf_spp.c | 2 -
libavfilter/vf_ssim.c | 2 -
libavfilter/vf_ssim360.c | 2 -
libavfilter/vf_stereo3d.c | 5 --
libavfilter/vf_threshold.c | 4 +-
libavfilter/vf_tiltandshift.c | 8 +--
libavfilter/vf_tinterlace.c | 25 +++----
libavfilter/vf_tmidequalizer.c | 4 +-
libavfilter/vf_unsharp.c | 4 +-
libavfilter/vf_uspp.c | 2 -
libavfilter/vf_v360.c | 5 --
libavfilter/vf_vaguedenoiser.c | 3 -
libavfilter/vf_varblur.c | 4 +-
libavfilter/vf_vectorscope.c | 10 +--
libavfilter/vf_vif.c | 2 -
libavfilter/vf_w3fdif.c | 3 -
libavfilter/vf_waveform.c | 8 +--
libavfilter/vf_xfade.c | 1 -
libavfilter/vf_xmedian.c | 3 -
libavfilter/vf_xpsnr.c | 2 -
libavfilter/vf_yadif.c | 2 -
libavfilter/vf_yaepblur.c | 4 +-
libavfilter/vf_zoompan.c | 3 -
libavfilter/vf_zscale.c | 3 -
libavfilter/video.h | 5 --
libavfilter/vsrc_testsrc.c | 3 +-
libavformat/yuv4mpegenc.c | 16 -----
libavutil/pixdesc.c | 65 -------------------
libavutil/pixfmt.h | 5 --
libswscale/aarch64/ops_entries.c | 5 --
libswscale/format.c | 15 -----
libswscale/uops_macros.h | 14 ----
libswscale/utils.c | 23 ++-----
tests/fate/lavf-image.mak | 2 +-
tests/fate/pixfmt.mak | 4 --
tests/fate/vcodec.mak | 12 ++--
tests/ref/fate/exif-image-embedded | 2 +-
tests/ref/fate/exif-image-jpg | 34 +++++-----
tests/ref/fate/filter-pixdesc-yuvj411p | 2 +-
tests/ref/fate/filter-pixdesc-yuvj420p | 2 +-
tests/ref/fate/filter-pixdesc-yuvj422p | 2 +-
tests/ref/fate/filter-pixdesc-yuvj440p | 2 +-
tests/ref/fate/filter-pixdesc-yuvj444p | 2 +-
tests/ref/fate/filter-pixfmts-copy | 5 --
tests/ref/fate/filter-pixfmts-crop | 5 --
tests/ref/fate/filter-pixfmts-field | 5 --
tests/ref/fate/filter-pixfmts-fieldorder | 3 -
tests/ref/fate/filter-pixfmts-hflip | 5 --
tests/ref/fate/filter-pixfmts-il | 5 --
tests/ref/fate/filter-pixfmts-lut | 4 --
tests/ref/fate/filter-pixfmts-null | 5 --
tests/ref/fate/filter-pixfmts-pad | 5 --
tests/ref/fate/filter-pixfmts-pullup | 5 --
tests/ref/fate/filter-pixfmts-rotate | 2 -
tests/ref/fate/filter-pixfmts-scale | 5 --
tests/ref/fate/filter-pixfmts-swapuv | 5 --
.../ref/fate/filter-pixfmts-tinterlace_cvlpf | 4 --
.../ref/fate/filter-pixfmts-tinterlace_merge | 4 --
tests/ref/fate/filter-pixfmts-tinterlace_pad | 4 --
tests/ref/fate/filter-pixfmts-tinterlace_vlpf | 4 --
tests/ref/fate/filter-pixfmts-transpose | 2 -
tests/ref/fate/filter-pixfmts-vflip | 5 --
tests/ref/fate/imgutils | 10 ---
tests/ref/fate/jpg-icc | 2 +-
tests/ref/fate/sws-ops-list | 2 +-
tests/ref/fate/sws-pixdesc-query | 15 -----
tests/ref/pixfmt/gbrp-yuvj420p | 2 -
tests/ref/pixfmt/gbrp-yuvj422p | 2 -
tests/ref/pixfmt/gbrp-yuvj440p | 2 -
tests/ref/pixfmt/gbrp-yuvj444p | 2 -
tests/ref/pixfmt/gbrp10-yuvj420p | 2 -
tests/ref/pixfmt/gbrp10-yuvj422p | 2 -
tests/ref/pixfmt/gbrp10-yuvj440p | 2 -
tests/ref/pixfmt/gbrp10-yuvj444p | 2 -
tests/ref/pixfmt/gbrp12-yuvj420p | 2 -
tests/ref/pixfmt/gbrp12-yuvj422p | 2 -
tests/ref/pixfmt/gbrp12-yuvj440p | 2 -
tests/ref/pixfmt/gbrp12-yuvj444p | 2 -
tests/ref/pixfmt/nv24-yuvj420p | 2 -
tests/ref/pixfmt/nv24-yuvj422p | 2 -
tests/ref/pixfmt/nv24-yuvj440p | 2 -
tests/ref/pixfmt/nv24-yuvj444p | 2 -
tests/ref/pixfmt/p410-yuvj420p | 2 -
tests/ref/pixfmt/p410-yuvj422p | 2 -
tests/ref/pixfmt/p410-yuvj440p | 2 -
tests/ref/pixfmt/p410-yuvj444p | 2 -
tests/ref/pixfmt/p412-yuvj420p | 2 -
tests/ref/pixfmt/p412-yuvj422p | 2 -
tests/ref/pixfmt/p412-yuvj440p | 2 -
tests/ref/pixfmt/p412-yuvj444p | 2 -
tests/ref/pixfmt/rgb24-yuvj420p | 2 -
tests/ref/pixfmt/rgb24-yuvj422p | 2 -
tests/ref/pixfmt/rgb24-yuvj440p | 2 -
tests/ref/pixfmt/rgb24-yuvj444p | 2 -
tests/ref/pixfmt/rgb48-yuvj420p | 2 -
tests/ref/pixfmt/rgb48-yuvj422p | 2 -
tests/ref/pixfmt/rgb48-yuvj440p | 2 -
tests/ref/pixfmt/rgb48-yuvj444p | 2 -
tests/ref/pixfmt/yuv444p-yuvj420p | 2 -
tests/ref/pixfmt/yuv444p-yuvj422p | 2 -
tests/ref/pixfmt/yuv444p-yuvj440p | 2 -
tests/ref/pixfmt/yuv444p-yuvj444p | 2 -
tests/ref/pixfmt/yuv444p10-yuvj420p | 2 -
tests/ref/pixfmt/yuv444p10-yuvj422p | 2 -
tests/ref/pixfmt/yuv444p10-yuvj440p | 2 -
tests/ref/pixfmt/yuv444p10-yuvj444p | 2 -
tests/ref/pixfmt/yuv444p12-yuvj420p | 2 -
tests/ref/pixfmt/yuv444p12-yuvj422p | 2 -
tests/ref/pixfmt/yuv444p12-yuvj440p | 2 -
tests/ref/pixfmt/yuv444p12-yuvj444p | 2 -
tests/ref/pixfmt/yuvj420p | 2 -
tests/ref/pixfmt/yuvj422p | 2 -
tests/ref/pixfmt/yuvj440p | 2 -
tests/ref/pixfmt/yuvj444p | 2 -
243 files changed, 166 insertions(+), 953 deletions(-)
delete mode 100644 tests/ref/pixfmt/gbrp-yuvj420p
delete mode 100644 tests/ref/pixfmt/gbrp-yuvj422p
delete mode 100644 tests/ref/pixfmt/gbrp-yuvj440p
delete mode 100644 tests/ref/pixfmt/gbrp-yuvj444p
delete mode 100644 tests/ref/pixfmt/gbrp10-yuvj420p
delete mode 100644 tests/ref/pixfmt/gbrp10-yuvj422p
delete mode 100644 tests/ref/pixfmt/gbrp10-yuvj440p
delete mode 100644 tests/ref/pixfmt/gbrp10-yuvj444p
delete mode 100644 tests/ref/pixfmt/gbrp12-yuvj420p
delete mode 100644 tests/ref/pixfmt/gbrp12-yuvj422p
delete mode 100644 tests/ref/pixfmt/gbrp12-yuvj440p
delete mode 100644 tests/ref/pixfmt/gbrp12-yuvj444p
delete mode 100644 tests/ref/pixfmt/nv24-yuvj420p
delete mode 100644 tests/ref/pixfmt/nv24-yuvj422p
delete mode 100644 tests/ref/pixfmt/nv24-yuvj440p
delete mode 100644 tests/ref/pixfmt/nv24-yuvj444p
delete mode 100644 tests/ref/pixfmt/p410-yuvj420p
delete mode 100644 tests/ref/pixfmt/p410-yuvj422p
delete mode 100644 tests/ref/pixfmt/p410-yuvj440p
delete mode 100644 tests/ref/pixfmt/p410-yuvj444p
delete mode 100644 tests/ref/pixfmt/p412-yuvj420p
delete mode 100644 tests/ref/pixfmt/p412-yuvj422p
delete mode 100644 tests/ref/pixfmt/p412-yuvj440p
delete mode 100644 tests/ref/pixfmt/p412-yuvj444p
delete mode 100644 tests/ref/pixfmt/rgb24-yuvj420p
delete mode 100644 tests/ref/pixfmt/rgb24-yuvj422p
delete mode 100644 tests/ref/pixfmt/rgb24-yuvj440p
delete mode 100644 tests/ref/pixfmt/rgb24-yuvj444p
delete mode 100644 tests/ref/pixfmt/rgb48-yuvj420p
delete mode 100644 tests/ref/pixfmt/rgb48-yuvj422p
delete mode 100644 tests/ref/pixfmt/rgb48-yuvj440p
delete mode 100644 tests/ref/pixfmt/rgb48-yuvj444p
delete mode 100644 tests/ref/pixfmt/yuv444p-yuvj420p
delete mode 100644 tests/ref/pixfmt/yuv444p-yuvj422p
delete mode 100644 tests/ref/pixfmt/yuv444p-yuvj440p
delete mode 100644 tests/ref/pixfmt/yuv444p-yuvj444p
delete mode 100644 tests/ref/pixfmt/yuv444p10-yuvj420p
delete mode 100644 tests/ref/pixfmt/yuv444p10-yuvj422p
delete mode 100644 tests/ref/pixfmt/yuv444p10-yuvj440p
delete mode 100644 tests/ref/pixfmt/yuv444p10-yuvj444p
delete mode 100644 tests/ref/pixfmt/yuv444p12-yuvj420p
delete mode 100644 tests/ref/pixfmt/yuv444p12-yuvj422p
delete mode 100644 tests/ref/pixfmt/yuv444p12-yuvj440p
delete mode 100644 tests/ref/pixfmt/yuv444p12-yuvj444p
delete mode 100644 tests/ref/pixfmt/yuvj420p
delete mode 100644 tests/ref/pixfmt/yuvj422p
delete mode 100644 tests/ref/pixfmt/yuvj440p
delete mode 100644 tests/ref/pixfmt/yuvj444p
diff --git a/Changelog b/Changelog
index 8cfac4c1a7..3a3e74b348 100644
--- a/Changelog
+++ b/Changelog
@@ -19,6 +19,7 @@ version <next>:
- Bitstream filter to split Dolby Vision multi-layer HEVC
- Add AMF hardware memory mapping support.
- ONNX Runtime DNN backend with GPU execution provider support
+- Remove YUVJ pixel formats
version 8.1:
diff --git a/libavcodec/amfdec.c b/libavcodec/amfdec.c
index 00a17360f5..c663563840 100644
--- a/libavcodec/amfdec.c
+++ b/libavcodec/amfdec.c
@@ -290,7 +290,6 @@ static int amf_decode_init(AVCodecContext *avctx)
// if bitness detection is not supported in legacy driver use format from container
switch (avctx->pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
surf_pix_fmt = AV_PIX_FMT_NV12; break;
case AV_PIX_FMT_YUV420P10:
surf_pix_fmt = AV_PIX_FMT_P010; break;
diff --git a/libavcodec/aom_film_grain.c b/libavcodec/aom_film_grain.c
index bb60c55774..bd94dad8e2 100644
--- a/libavcodec/aom_film_grain.c
+++ b/libavcodec/aom_film_grain.c
@@ -96,9 +96,6 @@ int ff_aom_apply_film_grain(AVFrame *out, const AVFrame *in,
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV444P:
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ444P:
return apply_film_grain_8(out, in, params);
case AV_PIX_FMT_GRAY9:
case AV_PIX_FMT_YUV420P9:
diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 56b2f4362b..adc64330c4 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -630,12 +630,6 @@ static int encode_preinit_video(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
- if (pix_fmts[i] == AV_PIX_FMT_YUVJ420P ||
- pix_fmts[i] == AV_PIX_FMT_YUVJ411P ||
- pix_fmts[i] == AV_PIX_FMT_YUVJ422P ||
- pix_fmts[i] == AV_PIX_FMT_YUVJ440P ||
- pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
- avctx->color_range = AVCOL_RANGE_JPEG;
}
if (pixdesc->flags & AV_PIX_FMT_FLAG_ALPHA) {
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index d7b713c7c4..151ae9a713 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *f,
}
}
- avctx->pix_fmt = version & 1 ? is_pal ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P;
+ avctx->pix_fmt = version & 1 ? is_pal ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUV420P;
avctx->color_range = version & 1 ? AVCOL_RANGE_UNSPECIFIED
: AVCOL_RANGE_JPEG;
avctx->colorspace = version & 1 ? AVCOL_SPC_UNSPECIFIED : AVCOL_SPC_BT709;
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 7e2c460293..a71c965a98 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -878,15 +878,10 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB)
*fmt++ = AV_PIX_FMT_GBRP;
- else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
- *fmt++ = AV_PIX_FMT_YUVJ444P;
else
*fmt++ = AV_PIX_FMT_YUV444P;
} else if (CHROMA422(h)) {
- if (h->avctx->color_range == AVCOL_RANGE_JPEG)
- *fmt++ = AV_PIX_FMT_YUVJ422P;
- else
- *fmt++ = AV_PIX_FMT_YUV422P;
+ *fmt++ = AV_PIX_FMT_YUV422P;
} else {
#if CONFIG_H264_DXVA2_HWACCEL
*fmt++ = AV_PIX_FMT_DXVA2_VLD;
@@ -901,10 +896,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
#if CONFIG_H264_VAAPI_HWACCEL
*fmt++ = AV_PIX_FMT_VAAPI;
#endif
- if (h->avctx->color_range == AVCOL_RANGE_JPEG)
- *fmt++ = AV_PIX_FMT_YUVJ420P;
- else
- *fmt++ = AV_PIX_FMT_YUV420P;
+ *fmt++ = AV_PIX_FMT_YUV420P;
}
break;
default:
@@ -1044,17 +1036,6 @@ fail:
return ret;
}
-static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a)
-{
- switch (a) {
- case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P;
- case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P;
- case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P;
- default:
- return a;
- }
-}
-
static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_slice)
{
const SPS *sps;
@@ -1087,8 +1068,7 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
|| h->mb_width != sps->mb_width
|| h->mb_height != sps->mb_height
));
- if (h->avctx->pix_fmt == AV_PIX_FMT_NONE
- || (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0))))
+ if (h->avctx->pix_fmt == AV_PIX_FMT_NONE || h->avctx->pix_fmt != get_pixel_format(h, 0))
must_reinit = 1;
if (first_slice && av_cmp_q(sps->vui.sar, h->avctx->sample_aspect_ratio))
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 304c7447ca..4b0a8152bd 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -552,7 +552,6 @@ static enum AVPixelFormat map_to_alpha_format(HEVCContext *s,
{
switch (pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
return AV_PIX_FMT_YUVA420P;
case AV_PIX_FMT_YUV420P10:
return AV_PIX_FMT_YUVA420P10;
@@ -594,7 +593,6 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
switch (sps->pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
#if CONFIG_HEVC_DXVA2_HWACCEL
*fmt++ = AV_PIX_FMT_DXVA2_VLD;
#endif
@@ -3240,20 +3238,6 @@ static int hevc_frame_start(HEVCContext *s, HEVCLayerContext *l,
return AVERROR_INVALIDDATA;
}
- // Files produced by Vision Pro lack VPS extension VUI,
- // so the secondary layer has no range information.
- // This check avoids failing in such a case.
- if (sps_base->pix_fmt == AV_PIX_FMT_YUVJ420P &&
- sps->pix_fmt == AV_PIX_FMT_YUV420P &&
- !sps->vui.common.video_signal_type_present_flag)
- pix_fmt = sps_base->pix_fmt;
-
- // Ignore range mismatch between base layer and alpha layer
- if (ff_hevc_is_alpha_video(s) &&
- sps_base->pix_fmt == AV_PIX_FMT_YUV420P &&
- pix_fmt == AV_PIX_FMT_YUVJ420P)
- pix_fmt = sps_base->pix_fmt;
-
if (pix_fmt != sps_base->pix_fmt ||
sps->width != sps_base->width ||
sps->height != sps_base->height) {
diff --git a/libavcodec/hevc/ps.c b/libavcodec/hevc/ps.c
index 8884192375..94f7693e4c 100644
--- a/libavcodec/hevc/ps.c
+++ b/libavcodec/hevc/ps.c
@@ -968,8 +968,6 @@ static void decode_vui(GetBitContext *gb, AVCodecContext *avctx,
ff_h2645_decode_common_vui_params(gb, &sps->vui.common, avctx);
if (vui->common.video_signal_type_present_flag) {
- if (vui->common.video_full_range_flag && sps->pix_fmt == AV_PIX_FMT_YUV420P)
- sps->pix_fmt = AV_PIX_FMT_YUVJ420P;
if (vui->common.colour_description_present_flag) {
if (vui->common.matrix_coeffs == AVCOL_SPC_RGB) {
switch (sps->pix_fmt) {
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 6f6f264636..06da46bbb4 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -303,10 +303,8 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
#if OPENH264_VER_AT_LEAST(1, 6)
param.sSpatialLayers[0].uiVideoFormat = VF_UNDEF;
- if (avctx->color_range != AVCOL_RANGE_UNSPECIFIED) {
+ if (avctx->color_range != AVCOL_RANGE_UNSPECIFIED)
param.sSpatialLayers[0].bFullRange = (avctx->color_range == AVCOL_RANGE_JPEG);
- } else if (avctx->pix_fmt == AV_PIX_FMT_YUVJ420P)
- param.sSpatialLayers[0].bFullRange = 1;
if (avctx->colorspace != AVCOL_SPC_UNSPECIFIED ||
avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
@@ -436,7 +434,7 @@ const FFCodec ff_libopenh264_encoder = {
.close = svc_encode_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_AUTO_THREADS,
- CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P),
+ CODEC_PIXFMTS(AV_PIX_FMT_YUV420P),
.color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG,
.defaults = svc_enc_defaults,
.p.priv_class = &class,
diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c
index 0db80830d8..889244f569 100644
--- a/libavcodec/librav1e.c
+++ b/libavcodec/librav1e.c
@@ -63,15 +63,8 @@ typedef struct FrameData {
AVBufferRef *frame_opaque_ref;
} FrameData;
-static inline RaPixelRange range_map(enum AVPixelFormat pix_fmt, enum AVColorRange range)
+static inline RaPixelRange range_map(enum AVColorRange range)
{
- switch (pix_fmt) {
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ444P:
- return RA_PIXEL_RANGE_FULL;
- }
-
switch (range) {
case AVCOL_RANGE_JPEG:
return RA_PIXEL_RANGE_FULL;
@@ -85,17 +78,14 @@ static inline RaChromaSampling pix_fmt_map(enum AVPixelFormat pix_fmt)
{
switch (pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P10:
case AV_PIX_FMT_YUV420P12:
return RA_CHROMA_SAMPLING_CS420;
case AV_PIX_FMT_YUV422P:
- case AV_PIX_FMT_YUVJ422P:
case AV_PIX_FMT_YUV422P10:
case AV_PIX_FMT_YUV422P12:
return RA_CHROMA_SAMPLING_CS422;
case AV_PIX_FMT_YUV444P:
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P10:
case AV_PIX_FMT_YUV444P12:
return RA_CHROMA_SAMPLING_CS444;
@@ -376,7 +366,7 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx)
rret = rav1e_config_set_pixel_format(cfg, desc->comp[0].depth,
pix_fmt_map(avctx->pix_fmt),
chroma_loc_map(avctx->chroma_sample_location),
- range_map(avctx->pix_fmt, avctx->color_range));
+ range_map(avctx->color_range));
if (rret < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed to set pixel format properties.\n");
ret = AVERROR_INVALIDDATA;
@@ -629,15 +619,12 @@ static const FFCodecDefault librav1e_defaults[] = {
const enum AVPixelFormat librav1e_pix_fmts[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV420P12,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV422P10,
AV_PIX_FMT_YUV422P12,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12,
AV_PIX_FMT_NONE
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index b688d4f321..46960fa332 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -809,14 +809,11 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
{
switch (pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P9:
case AV_PIX_FMT_YUV420P10: return X264_CSP_I420;
case AV_PIX_FMT_YUV422P:
- case AV_PIX_FMT_YUVJ422P:
case AV_PIX_FMT_YUV422P10: return X264_CSP_I422;
case AV_PIX_FMT_YUV444P:
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P9:
case AV_PIX_FMT_YUV444P10: return X264_CSP_I444;
case AV_PIX_FMT_BGR0:
@@ -1332,10 +1329,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->color_range != AVCOL_RANGE_UNSPECIFIED)
x4->params.vui.b_fullrange = avctx->color_range == AVCOL_RANGE_JPEG;
- else if (avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ444P)
- x4->params.vui.b_fullrange = 1;
if (avctx->colorspace != AVCOL_SPC_UNSPECIFIED)
x4->params.vui.i_colmatrix = avctx->colorspace;
@@ -1435,11 +1428,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
static const enum AVPixelFormat pix_fmts_8bit[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NV12,
AV_PIX_FMT_NV16,
#ifdef X264_CSP_NV21
@@ -1461,11 +1451,8 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
};
static const enum AVPixelFormat pix_fmts_all[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NV12,
AV_PIX_FMT_NV16,
#ifdef X264_CSP_NV21
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 7d488c0f4b..78798ce177 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -337,10 +337,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
avctx->color_range == AVCOL_RANGE_JPEG;
else
ctx->params->vui.bEnableVideoFullRangeFlag =
- (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ444P;
+ (desc->flags & AV_PIX_FMT_FLAG_RGB);
if (avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
@@ -954,11 +951,8 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static const enum AVPixelFormat x265_csp_eight[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_GRAY8,
#if X265_BUILD >= 210 && FF_X265_MAX_LAYERS > 1
@@ -969,11 +963,8 @@ static const enum AVPixelFormat x265_csp_eight[] = {
static const enum AVPixelFormat x265_csp_ten[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10,
@@ -990,11 +981,8 @@ static const enum AVPixelFormat x265_csp_ten[] = {
static const enum AVPixelFormat x265_csp_twelve[] = {
AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10,
diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
index ab37ab0d5c..41856139e2 100644
--- a/libavcodec/ljpegenc.c
+++ b/libavcodec/ljpegenc.c
@@ -324,7 +324,6 @@ const FFCodec ff_ljpeg_encoder = {
FF_CODEC_ENCODE_CB(ljpeg_encode_frame),
.close = ljpeg_encode_close,
CODEC_PIXFMTS(AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR0,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P),
.color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG,
};
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 6ea64a8a3b..b1244c280b 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -226,7 +226,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_permute_scantable(a->permutated_scantable, ff_zigzag_direct,
a->idsp.idct_permutation);
- avctx->pix_fmt = AV_PIX_FMT_YUVJ420P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->color_range = AVCOL_RANGE_JPEG;
/* init q matrix */
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 472431ec72..0545ca3d63 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -549,7 +549,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|| s->component_id[0] == 'R' && s->component_id[1] == 'G' && s->component_id[2] == 'B') {
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
} else {
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
else s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
@@ -613,7 +613,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s->component_id[1] == 'G' && s->component_id[2] == 'B') {
s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
} else {
- s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
break;
@@ -644,7 +644,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
} else {
if (pix_fmt_id == 0x14111100)
s->upscale_v[1] = s->upscale_v[2] = 1;
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV440P;
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -657,7 +657,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
goto unk_pixfmt;
s->upscale_h[1] = s->upscale_h[2] = 1;
} else {
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
else s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
}
@@ -674,14 +674,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
case 0x31111100:
if (s->bits > 8)
goto unk_pixfmt;
- s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
s->upscale_h[1] = s->upscale_h[2] = 2;
break;
case 0x22121100:
case 0x22111200:
case 0x41211100:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -690,7 +690,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
case 0x23111100:
case 0x42111100:
case 0x24111100:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
else s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
if (pix_fmt_id == 0x42111100) {
@@ -708,7 +708,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
}
break;
case 0x41111100:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV411P : AV_PIX_FMT_YUVJ411P;
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV411P;
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -2636,14 +2636,10 @@ the_end:
if (AV_RB32(s->upscale_h)) {
int p;
- av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ440P ||
+ av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
avctx->pix_fmt == AV_PIX_FMT_YUV440P ||
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P16||
avctx->pix_fmt == AV_PIX_FMT_YUVA420P ||
@@ -2717,14 +2713,10 @@ the_end:
}
if (AV_RB32(s->upscale_v)) {
int p;
- av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
- avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
+ av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
avctx->pix_fmt == AV_PIX_FMT_YUV440P ||
- avctx->pix_fmt == AV_PIX_FMT_YUVJ440P ||
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
avctx->pix_fmt == AV_PIX_FMT_YUVA420P ||
avctx->pix_fmt == AV_PIX_FMT_YUVA420P16||
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index ee70e17bcd..258369458d 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -696,8 +696,7 @@ const FFCodec ff_mjpeg_encoder = {
AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES,
- CODEC_PIXFMTS(AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P),
+ CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P),
.p.priv_class = &mjpeg_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
.get_supported_config = mjpeg_get_supported_config,
@@ -723,7 +722,7 @@ const FFCodec ff_amv_encoder = {
FF_CODEC_ENCODE_CB(amv_encode_picture),
.close = mjpeg_encode_close,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
- CODEC_PIXFMTS(AV_PIX_FMT_YUVJ420P),
+ CODEC_PIXFMTS(AV_PIX_FMT_YUV420P),
.color_ranges = AVCOL_RANGE_JPEG,
.p.priv_class = &amv_class,
};
diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index 5effbdbc32..8800d48527 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -256,7 +256,7 @@ void ff_mjpeg_init_hvsample(const AVCodecContext *avctx, int hsample[4], int vsa
vsample[1] = hsample[1] =
vsample[2] = hsample[2] =
vsample[3] = hsample[3] = 1;
- } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P) {
+ } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
vsample[0] = vsample[1] = vsample[2] = 2;
hsample[0] = hsample[1] = hsample[2] = 1;
} else {
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7751de8510..446c578b62 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -561,17 +561,14 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
mpv_encode_defaults(m);
switch (avctx->pix_fmt) {
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P:
s->c.chroma_format = CHROMA_444;
break;
- case AV_PIX_FMT_YUVJ422P:
case AV_PIX_FMT_YUV422P:
s->c.chroma_format = CHROMA_422;
break;
default:
av_unreachable("Already checked via CODEC_PIXFMTS");
- case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P:
s->c.chroma_format = CHROMA_420;
break;
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 257b6d3892..59006e193e 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1315,8 +1315,7 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
vui->colourMatrix = to_nv_color_matrix(IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace);
vui->colourPrimaries = to_nv_color_pri(avctx->color_primaries);
vui->transferCharacteristics = to_nv_color_trc(avctx->color_trc);
- vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
- || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
+ vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
}
vui->colourDescriptionPresentFlag =
@@ -1511,8 +1510,7 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
vui->colourMatrix = to_nv_color_matrix(IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace);
vui->colourPrimaries = to_nv_color_pri(avctx->color_primaries);
vui->transferCharacteristics = to_nv_color_trc(avctx->color_trc);
- vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
- || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
+ vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
}
vui->colourDescriptionPresentFlag =
@@ -1709,8 +1707,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx)
av1->matrixCoefficients = to_nv_color_matrix(IS_GBRP(ctx->data_pix_fmt) ? AVCOL_SPC_RGB : avctx->colorspace);
av1->colorPrimaries = to_nv_color_pri(avctx->color_primaries);
av1->transferCharacteristics = to_nv_color_trc(avctx->color_trc);
- av1->colorRange = (avctx->color_range == AVCOL_RANGE_JPEG
- || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
+ av1->colorRange = avctx->color_range == AVCOL_RANGE_JPEG;
}
if (IS_YUV444(ctx->data_pix_fmt)) {
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index cd5195a54b..c0fdcdfc68 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -229,7 +229,6 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shi
{
switch (format) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_NV12:
*fourcc = MFX_FOURCC_NV12;
*shift = 0;
diff --git a/libavcodec/raw_pix_fmt_tags.h b/libavcodec/raw_pix_fmt_tags.h
index bdde060cf7..4516451464 100644
--- a/libavcodec/raw_pix_fmt_tags.h
+++ b/libavcodec/raw_pix_fmt_tags.h
@@ -36,13 +36,6 @@ static const PixelFormatTag raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') },
{ AV_PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') },
{ AV_PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') },
- /* yuvjXXX formats are deprecated hacks specific to libav*,
- they are identical to yuvXXX */
- { AV_PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */
- { AV_PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') },
- { AV_PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') },
- { AV_PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') },
- { AV_PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') },
{ AV_PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') },
{ AV_PIX_FMT_GRAY8, MKTAG('Y', '8', ' ', ' ') },
@@ -104,11 +97,8 @@ static const PixelFormatTag raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_BGR24, MKTAG('B', 'G', 'R', 24 ) },
{ AV_PIX_FMT_YUV411P, MKTAG('4', '1', '1', 'P') },
{ AV_PIX_FMT_YUV422P, MKTAG('4', '2', '2', 'P') },
- { AV_PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') },
{ AV_PIX_FMT_YUV440P, MKTAG('4', '4', '0', 'P') },
- { AV_PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') },
{ AV_PIX_FMT_YUV444P, MKTAG('4', '4', '4', 'P') },
- { AV_PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') },
{ AV_PIX_FMT_MONOWHITE, MKTAG('B', '1', 'W', '0') },
{ AV_PIX_FMT_MONOBLACK, MKTAG('B', '0', 'W', '1') },
{ AV_PIX_FMT_BGR8, MKTAG('B', 'G', 'R', 8 ) },
@@ -270,10 +260,6 @@ static const PixelFormatTag raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_YUV422P, MKTAG('I', '4', '2', '2') },
{ AV_PIX_FMT_YUV440P, MKTAG('I', '4', '4', '0') },
{ AV_PIX_FMT_YUV444P, MKTAG('I', '4', '4', '4') },
- { AV_PIX_FMT_YUVJ420P, MKTAG('J', '4', '2', '0') },
- { AV_PIX_FMT_YUVJ422P, MKTAG('J', '4', '2', '2') },
- { AV_PIX_FMT_YUVJ440P, MKTAG('J', '4', '4', '0') },
- { AV_PIX_FMT_YUVJ444P, MKTAG('J', '4', '4', '4') },
{ AV_PIX_FMT_YUVA444P, MKTAG('Y', 'U', 'V', 'A') },
{ AV_PIX_FMT_YUVA420P, MKTAG('I', '4', '0', 'A') },
{ AV_PIX_FMT_YUVA422P, MKTAG('I', '4', '2', 'A') },
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index bfc69a65c9..50e14934b6 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -184,7 +184,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
if (!s->current_frame || !s->last_frame)
return AVERROR(ENOMEM);
- avctx->pix_fmt = AV_PIX_FMT_YUVJ444P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
avctx->color_range = AVCOL_RANGE_JPEG;
return 0;
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 03a1651c7f..5d640d3e42 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1126,7 +1126,7 @@ const FFCodec ff_roq_encoder = {
.init = roq_encode_init,
FF_CODEC_ENCODE_CB(roq_encode_frame),
.close = roq_encode_end,
- CODEC_PIXFMTS(AV_PIX_FMT_YUVJ444P),
+ CODEC_PIXFMTS(AV_PIX_FMT_YUV444P),
.color_ranges = AVCOL_RANGE_JPEG,
.p.priv_class = &roq_class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 296e81f322..b663360f8b 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1273,7 +1273,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
ff_hpeldsp_init(&s->hdsp, avctx->flags);
ff_tpeldsp_init(&s->tdsp);
- avctx->pix_fmt = AV_PIX_FMT_YUVJ420P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->color_range = AVCOL_RANGE_JPEG;
s->avctx = avctx;
diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index e8d37a4e3f..a5d5187e1f 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -357,7 +357,7 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size,
}
ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe);
- if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P ||
+ if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUV420P ||
w > ctx->jpgframe->width || h > ctx->jpgframe->height) {
av_log(avctx, AV_LOG_ERROR,
"JPEG decoding error (%d).\n", ret);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 550d818572..91fccb27af 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -164,10 +164,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
case AV_PIX_FMT_GRAY8:
case AV_PIX_FMT_GRAY16BE:
case AV_PIX_FMT_GRAY16LE:
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ440P:
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUVA420P:
case AV_PIX_FMT_YUVA422P:
case AV_PIX_FMT_YUVA444P:
@@ -247,7 +243,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
w_align = 16*2;
break;
case AV_PIX_FMT_YUV411P:
- case AV_PIX_FMT_YUVJ411P:
case AV_PIX_FMT_UYYVYY411:
w_align = 32;
h_align = 16 * 2;
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index e99ac5338d..4cb7728b3f 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -72,7 +72,6 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
/* See <vdpau/vdpau.h> for per-type alignment constraints. */
switch (avctx->sw_pix_fmt) {
case AV_PIX_FMT_YUV420P:
- case AV_PIX_FMT_YUVJ420P:
case AV_PIX_FMT_YUV420P10:
case AV_PIX_FMT_YUV420P12:
t = VDP_CHROMA_TYPE_420;
@@ -80,13 +79,11 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
h = (h + 3) & ~3;
break;
case AV_PIX_FMT_YUV422P:
- case AV_PIX_FMT_YUVJ422P:
t = VDP_CHROMA_TYPE_422;
w = (w + 1) & ~1;
h = (h + 1) & ~1;
break;
case AV_PIX_FMT_YUV444P:
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P10:
case AV_PIX_FMT_YUV444P12:
t = VDP_CHROMA_TYPE_444;
diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c
index dbb3c8386b..87c9a55170 100644
--- a/libavfilter/avf_showcwt.c
+++ b/libavfilter/avf_showcwt.c
@@ -228,7 +228,7 @@ static int query_formats(const AVFilterContext *ctx,
{
AVFilterFormats *formats = NULL;
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
- static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE };
+ static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE };
int ret;
formats = ff_make_sample_format_list(sample_fmts);
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 0345b4458d..076e2fe2d6 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -365,7 +365,7 @@ static int query_formats(const AVFilterContext *ctx,
{
AVFilterFormats *formats = NULL;
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
- static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE };
+ static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE };
int ret;
/* set input audio formats */
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index ad81d91bbc..3ae2275ff8 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -784,20 +784,6 @@ int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt)
}
-int ff_fmt_is_forced_full_range(enum AVPixelFormat fmt)
-{
- switch (fmt) {
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ444P:
- case AV_PIX_FMT_YUVJ440P:
- case AV_PIX_FMT_YUVJ411P:
- return 1;
- default:
- return 0;
- }
-}
-
static int pick_format(AVFilterLink *link, AVFilterLink *ref)
{
if (!link || !link->incfg.formats)
@@ -870,18 +856,14 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref)
link->incfg.color_spaces->nb_formats = 1;
link->colorspace = link->incfg.color_spaces->formats[0];
- if (ff_fmt_is_forced_full_range(swfmt)) {
- link->color_range = AVCOL_RANGE_JPEG;
- } else {
- if (!link->incfg.color_ranges->nb_formats) {
- av_log(link->src, AV_LOG_ERROR, "Cannot select color range for"
- " the link between filters %s and %s.\n", link->src->name,
- link->dst->name);
- return AVERROR(EINVAL);
- }
- link->incfg.color_ranges->nb_formats = 1;
- link->color_range = link->incfg.color_ranges->formats[0];
+ if (!link->incfg.color_ranges->nb_formats) {
+ av_log(link->src, AV_LOG_ERROR, "Cannot select color range for"
+ " the link between filters %s and %s.\n", link->src->name,
+ link->dst->name);
+ return AVERROR(EINVAL);
}
+ link->incfg.color_ranges->nb_formats = 1;
+ link->color_range = link->incfg.color_ranges->formats[0];
}
if (desc->flags & AV_PIX_FMT_FLAG_ALPHA) {
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index 16efa6e6c8..a292f75591 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -499,17 +499,12 @@ static int query_formats(const AVFilterContext *ctx,
if ((ret = ff_add_format(&color_spaces, c->color_space)) < 0 ||
(ret = ff_set_common_color_spaces2(ctx, cfg_in, cfg_out, color_spaces)) < 0)
return ret;
- if (ff_fmt_is_forced_full_range(swfmt)) {
- if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_JPEG)) < 0)
+ if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0)
+ return ret;
+ if (c->color_range == AVCOL_RANGE_UNSPECIFIED) {
+ /* allow implicitly promoting unspecified to mpeg */
+ if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_MPEG)) < 0)
return ret;
- } else {
- if ((ret = ff_add_format(&color_ranges, c->color_range)) < 0)
- return ret;
- if (c->color_range == AVCOL_RANGE_UNSPECIFIED) {
- /* allow implicitly promoting unspecified to mpeg */
- if ((ret = ff_add_format(&color_ranges, AVCOL_RANGE_MPEG)) < 0)
- return ret;
- }
}
if ((ret = ff_set_common_color_ranges2(ctx, cfg_in, cfg_out, color_ranges)) < 0)
return ret;
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 75bf8f4755..d9586ab518 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -114,10 +114,7 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp
if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp)))
return AVERROR(EINVAL);
if (range == AVCOL_RANGE_UNSPECIFIED)
- range = (format == AV_PIX_FMT_YUVJ420P || format == AV_PIX_FMT_YUVJ422P ||
- format == AV_PIX_FMT_YUVJ444P || format == AV_PIX_FMT_YUVJ411P ||
- format == AV_PIX_FMT_YUVJ440P || csp == AVCOL_SPC_RGB)
- ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
+ range = csp == AVCOL_SPC_RGB ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
if (range != AVCOL_RANGE_JPEG && range != AVCOL_RANGE_MPEG)
return AVERROR(EINVAL);
for (unsigned i = 0; i < desc->nb_components; i++) {
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 3f0c908d16..987b6541e1 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -522,8 +522,7 @@ static int query_formats(const AVFilterContext *ctx,
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c
index 8873062e23..0cfac3abb0 100644
--- a/libavfilter/vaf_spectrumsynth.c
+++ b/libavfilter/vaf_spectrumsynth.c
@@ -107,7 +107,7 @@ static int query_formats(const AVFilterContext *ctx,
AVFilterChannelLayouts *layout = NULL;
static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV444P16, AV_PIX_FMT_NONE };
int ret, sample_rates[] = { 48000, -1 };
@@ -296,7 +296,6 @@ static void read_fft_data(AVFilterContext *ctx, int x, int h, int ch)
read16_fft_bin(s, x, y, f, ch);
}
break;
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P:
case AV_PIX_FMT_GRAY8:
for (y = start, f = 0; y >= end; y--, f++) {
@@ -313,7 +312,6 @@ static void read_fft_data(AVFilterContext *ctx, int x, int h, int ch)
read16_fft_bin(s, y, x, f, ch);
}
break;
- case AV_PIX_FMT_YUVJ444P:
case AV_PIX_FMT_YUV444P:
case AV_PIX_FMT_GRAY8:
for (y = end, f = 0; y <= start; y++, f++) {
diff --git a/libavfilter/vf_amplify.c b/libavfilter/vf_amplify.c
index 56d55873cb..bff5742b2b 100644
--- a/libavfilter/vf_amplify.c
+++ b/libavfilter/vf_amplify.c
@@ -56,9 +56,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_atadenoise.c b/libavfilter/vf_atadenoise.c
index 7773df5615..ba5cd114e8 100644
--- a/libavfilter/vf_atadenoise.c
+++ b/libavfilter/vf_atadenoise.c
@@ -99,9 +99,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index 3bd4faa5f6..e3e7d2eae6 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -248,10 +248,8 @@ static void averageiir2d(AVFilterContext *ctx, AVFrame *in, AVFrame *out, int pl
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c
index 9631613ff4..599b9efd60 100644
--- a/libavfilter/vf_bbox.c
+++ b/libavfilter/vf_bbox.c
@@ -53,9 +53,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 0a08a6d6d6..47f703844b 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -69,10 +69,8 @@ AVFILTER_DEFINE_CLASS(bilateral);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_bitplanenoise.c b/libavfilter/vf_bitplanenoise.c
index 639d9cadb9..c06087d51e 100644
--- a/libavfilter/vf_bitplanenoise.c
+++ b/libavfilter/vf_bitplanenoise.c
@@ -49,8 +49,6 @@ AVFILTER_DEFINE_CLASS(bitplanenoise);
static const enum AVPixelFormat pixfmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index 30fc81c40c..8ae2471cbc 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -74,19 +74,12 @@ static const AVOption blackdetect_options[] = {
AVFILTER_DEFINE_CLASS(blackdetect);
-#define YUVJ_FORMATS \
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
-
#define YUVA_FORMATS \
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, \
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUVA444P16, \
AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA422P16, \
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16
-static const enum AVPixelFormat yuvj_formats[] = {
- YUVJ_FORMATS, AV_PIX_FMT_NONE
-};
-
static const enum AVPixelFormat yuva_formats[] = {
YUVA_FORMATS, AV_PIX_FMT_NONE
};
@@ -97,7 +90,6 @@ static const enum AVPixelFormat yuv_formats[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
- YUVJ_FORMATS,
AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14,
AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
@@ -186,9 +178,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
double picture_black_ratio = 0;
const int max = (1 << s->depth) - 1;
const int factor = (1 << (s->depth - 8));
- const int full = picref->color_range == AVCOL_RANGE_JPEG ||
- ff_pixfmt_is_in(picref->format, yuvj_formats) ||
- s->alpha;
+ const int full = picref->color_range == AVCOL_RANGE_JPEG || s->alpha;
s->pixel_black_th_i = full ? s->pixel_black_th * max :
// luminance_minimum_value + pixel_black_th * luminance_range_size
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 21f4b19091..429cbd71c3 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -261,7 +261,6 @@ static av_cold int init(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_blockdetect.c b/libavfilter/vf_blockdetect.c
index e957db6a24..71bdbd67be 100644
--- a/libavfilter/vf_blockdetect.c
+++ b/libavfilter/vf_blockdetect.c
@@ -261,8 +261,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_blurdetect.c b/libavfilter/vf_blurdetect.c
index 5c6728d22f..704436728d 100644
--- a/libavfilter/vf_blurdetect.c
+++ b/libavfilter/vf_blurdetect.c
@@ -342,8 +342,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_bm3d.c b/libavfilter/vf_bm3d.c
index 16f4d98ac6..d063549998 100644
--- a/libavfilter/vf_bm3d.c
+++ b/libavfilter/vf_bm3d.c
@@ -169,9 +169,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index dbe35a029b..f2894a6297 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -149,8 +149,6 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic,
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_cas.c b/libavfilter/vf_cas.c
index 0546b72197..2a85ad4470 100644
--- a/libavfilter/vf_cas.c
+++ b/libavfilter/vf_cas.c
@@ -207,9 +207,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_chromanr.c b/libavfilter/vf_chromanr.c
index 748cf34784..99a4f68b29 100644
--- a/libavfilter/vf_chromanr.c
+++ b/libavfilter/vf_chromanr.c
@@ -57,7 +57,6 @@ typedef struct ChromaNRContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV440P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV440P12, AV_PIX_FMT_YUV420P12,
diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c
index 29691afbdb..e6d79c8bb4 100644
--- a/libavfilter/vf_chromashift.c
+++ b/libavfilter/vf_chromashift.c
@@ -380,7 +380,6 @@ static const AVFilterPad inputs[] = {
static const enum AVPixelFormat yuv_pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_colorcorrect.c b/libavfilter/vf_colorcorrect.c
index b6c3d04331..ab4d7036fc 100644
--- a/libavfilter/vf_colorcorrect.c
+++ b/libavfilter/vf_colorcorrect.c
@@ -431,7 +431,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV440P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV440P12, AV_PIX_FMT_YUV420P12,
diff --git a/libavfilter/vf_colorize.c b/libavfilter/vf_colorize.c
index 3d0c423bfe..a889bee8b1 100644
--- a/libavfilter/vf_colorize.c
+++ b/libavfilter/vf_colorize.c
@@ -212,9 +212,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 5e78868064..acac2baad1 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -861,7 +861,6 @@ static int query_formats(const AVFilterContext *ctx,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NONE
};
int res;
diff --git a/libavfilter/vf_convolution.c b/libavfilter/vf_convolution.c
index 70cbe28475..cc88b1ac85 100644
--- a/libavfilter/vf_convolution.c
+++ b/libavfilter/vf_convolution.c
@@ -81,10 +81,8 @@ static const int same7x7[49] = {0, 0, 0, 0, 0, 0, 0,
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_convolve.c b/libavfilter/vf_convolve.c
index 80f1c52844..6a40615959 100644
--- a/libavfilter/vf_convolve.c
+++ b/libavfilter/vf_convolve.c
@@ -93,10 +93,8 @@ static const AVOption convolve_options[] = {
static const enum AVPixelFormat pixel_fmts_fftfilt[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_corr.c b/libavfilter/vf_corr.c
index e3234bd437..f5515c28db 100644
--- a/libavfilter/vf_corr.c
+++ b/libavfilter/vf_corr.c
@@ -276,8 +276,6 @@ static const enum AVPixelFormat pix_fmts[] = {
#define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c
index de6f4b07d1..830768e51d 100644
--- a/libavfilter/vf_cover_rect.c
+++ b/libavfilter/vf_cover_rect.c
@@ -206,7 +206,7 @@ static av_cold int init(AVFilterContext *ctx)
if (ret < 0)
return ret;
- if (cover->cover_frame->format != AV_PIX_FMT_YUV420P && cover->cover_frame->format != AV_PIX_FMT_YUVJ420P) {
+ if (cover->cover_frame->format != AV_PIX_FMT_YUV420P) {
av_log(ctx, AV_LOG_ERROR, "cover image is not a YUV420 image\n");
return AVERROR(EINVAL);
}
@@ -233,5 +233,5 @@ const FFFilter ff_vf_cover_rect = {
.uninit = uninit,
FILTER_INPUTS(cover_rect_inputs),
FILTER_OUTPUTS(ff_video_default_filterpad),
- FILTER_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P),
+ FILTER_PIXFMTS(AV_PIX_FMT_YUV420P),
};
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 7c14cd117e..974b698a82 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -60,9 +60,7 @@ typedef struct CropDetectContext {
} CropDetectContext;
static const enum AVPixelFormat pix_fmts[] = {
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9 , AV_PIX_FMT_YUV422P9 , AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_dblur.c b/libavfilter/vf_dblur.c
index 517d4e5617..e99c12f965 100644
--- a/libavfilter/vf_dblur.c
+++ b/libavfilter/vf_dblur.c
@@ -114,10 +114,8 @@ static void diriir2d(AVFilterContext *ctx, int plane)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_deband.c b/libavfilter/vf_deband.c
index 2ff4fca6fa..d6a5dc3e45 100644
--- a/libavfilter/vf_deband.c
+++ b/libavfilter/vf_deband.c
@@ -82,8 +82,6 @@ static int query_formats(const AVFilterContext *ctx,
AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
@@ -100,7 +98,7 @@ static int query_formats(const AVFilterContext *ctx,
};
static const enum AVPixelFormat cpix_fmts[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14,
diff --git a/libavfilter/vf_deblock.c b/libavfilter/vf_deblock.c
index e3f4c80ae1..0b047fc1c4 100644
--- a/libavfilter/vf_deblock.c
+++ b/libavfilter/vf_deblock.c
@@ -62,10 +62,8 @@ typedef struct DeblockContext {
static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c
index 9fee8a1472..30dfb9280f 100644
--- a/libavfilter/vf_decimate.c
+++ b/libavfilter/vf_decimate.c
@@ -371,8 +371,6 @@ static const enum AVPixelFormat pix_fmts[] = {
PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
AV_PIX_FMT_YUV440P10, AV_PIX_FMT_YUV440P12,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14,
AV_PIX_FMT_GRAY16,
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_dedot.c b/libavfilter/vf_dedot.c
index c37626a34a..5f98a6cf12 100644
--- a/libavfilter/vf_dedot.c
+++ b/libavfilter/vf_dedot.c
@@ -55,10 +55,8 @@ typedef struct DedotContext {
static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_deflicker.c b/libavfilter/vf_deflicker.c
index 38f838f088..5471ff484d 100644
--- a/libavfilter/vf_deflicker.c
+++ b/libavfilter/vf_deflicker.c
@@ -97,9 +97,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index afd0989e05..1379fd464e 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -426,8 +426,7 @@ static av_cold int init(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_NONE
};
static int config_props(AVFilterLink *link)
diff --git a/libavfilter/vf_displace.c b/libavfilter/vf_displace.c
index eef9a9970f..6060e9e097 100644
--- a/libavfilter/vf_displace.c
+++ b/libavfilter/vf_displace.c
@@ -63,10 +63,8 @@ AVFILTER_DEFINE_CLASS(displace);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR, AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0,
diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c
index 571988416c..c34947d867 100644
--- a/libavfilter/vf_drawbox.c
+++ b/libavfilter/vf_drawbox.c
@@ -257,8 +257,7 @@ static av_cold int init(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
diff --git a/libavfilter/vf_entropy.c b/libavfilter/vf_entropy.c
index 1d13bb484b..692e9020a4 100644
--- a/libavfilter/vf_entropy.c
+++ b/libavfilter/vf_entropy.c
@@ -55,8 +55,6 @@ AVFILTER_DEFINE_CLASS(entropy);
static const enum AVPixelFormat pixfmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c
index ae61e2bce6..fb4a3956bd 100644
--- a/libavfilter/vf_estdif.c
+++ b/libavfilter/vf_estdif.c
@@ -109,9 +109,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_GRAY8,
diff --git a/libavfilter/vf_extractplanes.c b/libavfilter/vf_extractplanes.c
index a50d978f79..08ac0b8fed 100644
--- a/libavfilter/vf_extractplanes.c
+++ b/libavfilter/vf_extractplanes.c
@@ -71,9 +71,6 @@ AVFILTER_DEFINE_CLASS(extractplanes);
AV_PIX_FMT_YUV440P, \
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, \
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, \
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, \
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, \
- AV_PIX_FMT_YUVJ411P, \
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, \
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, \
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, \
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index 08ef733787..04469a22fe 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -109,8 +109,7 @@ static int query_formats(const AVFilterContext *ctx,
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
diff --git a/libavfilter/vf_fftdnoiz.c b/libavfilter/vf_fftdnoiz.c
index 66a889776a..d577492b40 100644
--- a/libavfilter/vf_fftdnoiz.c
+++ b/libavfilter/vf_fftdnoiz.c
@@ -121,9 +121,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
index 043479b0c3..c059c05fd5 100644
--- a/libavfilter/vf_fftfilt.c
+++ b/libavfilter/vf_fftfilt.c
@@ -568,9 +568,9 @@ static const enum AVPixelFormat pixel_fmts_fftfilt[] = {
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12,
AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV420P14,
AV_PIX_FMT_YUV420P16,
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index d806910364..dcc6e19c0b 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -913,9 +913,6 @@ static int query_formats(const AVFilterContext *ctx,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_fillborders.c b/libavfilter/vf_fillborders.c
index 0ee4f14ab9..b635aae72a 100644
--- a/libavfilter/vf_fillborders.c
+++ b/libavfilter/vf_fillborders.c
@@ -56,10 +56,8 @@ typedef struct FillBordersContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_find_rect.c b/libavfilter/vf_find_rect.c
index 88dfecbe22..eb0808dbab 100644
--- a/libavfilter/vf_find_rect.c
+++ b/libavfilter/vf_find_rect.c
@@ -299,5 +299,5 @@ const FFFilter ff_vf_find_rect = {
.uninit = uninit,
FILTER_INPUTS(foc_inputs),
FILTER_OUTPUTS(ff_video_default_filterpad),
- FILTER_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P),
+ FILTER_PIXFMTS(AV_PIX_FMT_YUV420P),
};
diff --git a/libavfilter/vf_framepack.c b/libavfilter/vf_framepack.c
index 5480ef0fc1..b931de0208 100644
--- a/libavfilter/vf_framepack.c
+++ b/libavfilter/vf_framepack.c
@@ -58,9 +58,6 @@ static const enum AVPixelFormat formats_supported[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index 468042e7db..77024bb0be 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -217,11 +217,11 @@ static av_cold void uninit(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12,
AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_freezedetect.c b/libavfilter/vf_freezedetect.c
index 45b280ddfb..ef6ff215b0 100644
--- a/libavfilter/vf_freezedetect.c
+++ b/libavfilter/vf_freezedetect.c
@@ -66,10 +66,9 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUYV422, AV_PIX_FMT_RGB24,
AV_PIX_FMT_BGR24, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_UYVY422, AV_PIX_FMT_NV12, AV_PIX_FMT_NV21, AV_PIX_FMT_ARGB,
AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY16,
- AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
AV_PIX_FMT_YA8, AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
@@ -82,7 +81,7 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP16, AV_PIX_FMT_YUV420P12,
AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV422P14,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_GBRP12,
- AV_PIX_FMT_GBRP14, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV440P10,
+ AV_PIX_FMT_GBRP14, AV_PIX_FMT_YUV440P10,
AV_PIX_FMT_YUV440P12, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP10,
AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY9,
AV_PIX_FMT_GRAY14,
diff --git a/libavfilter/vf_fspp.c b/libavfilter/vf_fspp.c
index cbf2e06d67..2304ce24da 100644
--- a/libavfilter/vf_fspp.c
+++ b/libavfilter/vf_fspp.c
@@ -209,8 +209,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index 45320333fa..4b7e6aca88 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -139,10 +139,8 @@ static void gaussianiir2d(AVFilterContext *ctx, int plane)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c
index 005b2128f3..84d844184d 100644
--- a/libavfilter/vf_guided.c
+++ b/libavfilter/vf_guided.c
@@ -143,10 +143,8 @@ static int box_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c
index 0dfebc62d1..f59eb1e53b 100644
--- a/libavfilter/vf_histogram.c
+++ b/libavfilter/vf_histogram.c
@@ -105,11 +105,11 @@ static const AVOption histogram_options[] = {
AVFILTER_DEFINE_CLASS(histogram);
static const enum AVPixelFormat levels_in_pix_fmts[] = {
- AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c
index d880c2bdda..2960878930 100644
--- a/libavfilter/vf_hqdn3d.c
+++ b/libavfilter/vf_hqdn3d.c
@@ -231,7 +231,6 @@ static av_cold void uninit(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_hysteresis.c b/libavfilter/vf_hysteresis.c
index c4e8b1ba63..9838421a3e 100644
--- a/libavfilter/vf_hysteresis.c
+++ b/libavfilter/vf_hysteresis.c
@@ -60,10 +60,8 @@ static const AVOption hysteresis_options[] = {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_identity.c b/libavfilter/vf_identity.c
index 2e6c06ea7e..d68a61e718 100644
--- a/libavfilter/vf_identity.c
+++ b/libavfilter/vf_identity.c
@@ -249,8 +249,6 @@ static const enum AVPixelFormat pix_fmts[] = {
#define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index c217021ae9..0e99723af8 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -389,12 +389,8 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV411P,
AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUV422P9,
AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_lagfun.c b/libavfilter/vf_lagfun.c
index 1fdb1b66b0..808c05b74b 100644
--- a/libavfilter/vf_lagfun.c
+++ b/libavfilter/vf_lagfun.c
@@ -50,9 +50,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c
index 15c2e99e4b..4c64205c05 100644
--- a/libavfilter/vf_lenscorrection.c
+++ b/libavfilter/vf_lenscorrection.c
@@ -182,9 +182,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_limitdiff.c b/libavfilter/vf_limitdiff.c
index fe24df9cca..c8e74cf58f 100644
--- a/libavfilter/vf_limitdiff.c
+++ b/libavfilter/vf_limitdiff.c
@@ -65,10 +65,8 @@ static const AVOption limitdiff_options[] = {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_limiter.c b/libavfilter/vf_limiter.c
index 68e7e9d98d..bc3a65bc7d 100644
--- a/libavfilter/vf_limiter.c
+++ b/libavfilter/vf_limiter.c
@@ -67,10 +67,8 @@ static av_cold int init(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index a3fbb7b2a3..563e194406 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -116,8 +116,6 @@ static av_cold void uninit(AVFilterContext *ctx)
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, \
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, \
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, \
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \
- AV_PIX_FMT_YUVJ440P, \
AV_PIX_FMT_YUV444P9LE, AV_PIX_FMT_YUV422P9LE, AV_PIX_FMT_YUV420P9LE, \
AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV440P10LE, \
AV_PIX_FMT_YUV444P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV440P12LE, \
diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index cabdc980ea..64884fe292 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -110,10 +110,8 @@ static av_cold void uninit(AVFilterContext *ctx)
#define BIT8_FMTS \
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, \
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, \
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, \
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, \
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, \
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
#define BIT9_FMTS \
diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index f287c136a1..93eed47278 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -61,10 +61,8 @@ AVFILTER_DEFINE_CLASS(maskedclamp);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_maskedmerge.c b/libavfilter/vf_maskedmerge.c
index 299c05c1ba..6412369e2b 100644
--- a/libavfilter/vf_maskedmerge.c
+++ b/libavfilter/vf_maskedmerge.c
@@ -38,10 +38,8 @@ AVFILTER_DEFINE_CLASS(maskedmerge);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_maskedminmax.c b/libavfilter/vf_maskedminmax.c
index 5e630711e2..f88874194c 100644
--- a/libavfilter/vf_maskedminmax.c
+++ b/libavfilter/vf_maskedminmax.c
@@ -64,10 +64,8 @@ static av_cold int maskedmin_init(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_maskedthreshold.c b/libavfilter/vf_maskedthreshold.c
index 649b9558d9..dfebb0fbe9 100644
--- a/libavfilter/vf_maskedthreshold.c
+++ b/libavfilter/vf_maskedthreshold.c
@@ -61,10 +61,8 @@ static const AVOption maskedthreshold_options[] = {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_maskfun.c b/libavfilter/vf_maskfun.c
index f04fb40ae5..3cbede384f 100644
--- a/libavfilter/vf_maskfun.c
+++ b/libavfilter/vf_maskfun.c
@@ -63,10 +63,8 @@ AVFILTER_DEFINE_CLASS(maskfun);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_median.c b/libavfilter/vf_median.c
index 3b11adbcad..ccf442ff7a 100644
--- a/libavfilter/vf_median.c
+++ b/libavfilter/vf_median.c
@@ -85,10 +85,8 @@ static void hmuladd(htype *dst, const htype *src, int f, int bins)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9, AV_PIX_FMT_GBRP9,
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
diff --git a/libavfilter/vf_mestimate.c b/libavfilter/vf_mestimate.c
index 413838e956..31405c809b 100644
--- a/libavfilter/vf_mestimate.c
+++ b/libavfilter/vf_mestimate.c
@@ -69,9 +69,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_midequalizer.c b/libavfilter/vf_midequalizer.c
index 9720cefdf2..e2ed0fcd81 100644
--- a/libavfilter/vf_midequalizer.c
+++ b/libavfilter/vf_midequalizer.c
@@ -59,10 +59,8 @@ AVFILTER_DEFINE_CLASS(midequalizer);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index 27ac4a5d29..9ef6b02012 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -239,9 +239,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_monochrome.c b/libavfilter/vf_monochrome.c
index 1e6d6539c9..4d043ef740 100644
--- a/libavfilter/vf_monochrome.c
+++ b/libavfilter/vf_monochrome.c
@@ -225,9 +225,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index 342ead266c..3926f0c4f1 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -148,10 +148,8 @@ FRAMESYNC_DEFINE_CLASS(morpho, MorphoContext, fs);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9, AV_PIX_FMT_GBRP9,
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9,
diff --git a/libavfilter/vf_mpdecimate.c b/libavfilter/vf_mpdecimate.c
index 00bc6699c3..00e5b08791 100644
--- a/libavfilter/vf_mpdecimate.c
+++ b/libavfilter/vf_mpdecimate.c
@@ -185,8 +185,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_GBRP,
diff --git a/libavfilter/vf_negate.c b/libavfilter/vf_negate.c
index 8d5cfd16c0..309452397d 100644
--- a/libavfilter/vf_negate.c
+++ b/libavfilter/vf_negate.c
@@ -81,8 +81,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV440P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c
index b121a48562..7c2e6dc235 100644
--- a/libavfilter/vf_neighbor.c
+++ b/libavfilter/vf_neighbor.c
@@ -52,10 +52,8 @@ typedef struct NContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_nlmeans.c b/libavfilter/vf_nlmeans.c
index 35ff499d54..8810789094 100644
--- a/libavfilter/vf_nlmeans.c
+++ b/libavfilter/vf_nlmeans.c
@@ -78,9 +78,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index 148791f804..7d7c75aa9c 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -188,9 +188,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_ocr.c b/libavfilter/vf_ocr.c
index 16266373bf..bcdf1aa8b8 100644
--- a/libavfilter/vf_ocr.c
+++ b/libavfilter/vf_ocr.c
@@ -77,9 +77,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 43f6e736c3..3430fbe031 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -166,7 +166,7 @@ static int query_formats(const AVFilterContext *ctx,
/* overlay formats contains alpha, for avoiding conversion with alpha information loss */
static const enum AVPixelFormat main_pix_fmts_yuv420[] = {
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
AV_PIX_FMT_NONE
};
@@ -183,7 +183,7 @@ static int query_formats(const AVFilterContext *ctx,
};
static const enum AVPixelFormat main_pix_fmts_yuv422[] = {
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_NONE
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_NONE
};
static const enum AVPixelFormat overlay_pix_fmts_yuv422[] = {
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_NONE
@@ -197,7 +197,7 @@ static int query_formats(const AVFilterContext *ctx,
};
static const enum AVPixelFormat main_pix_fmts_yuv444[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE
};
static const enum AVPixelFormat overlay_pix_fmts_yuv444[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_perspective.c b/libavfilter/vf_perspective.c
index 58510f6f13..c6d853232a 100644
--- a/libavfilter/vf_perspective.c
+++ b/libavfilter/vf_perspective.c
@@ -96,7 +96,6 @@ AVFILTER_DEFINE_CLASS(perspective);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_phase.c b/libavfilter/vf_phase.c
index e021009794..1f8e8c9f4a 100644
--- a/libavfilter/vf_phase.c
+++ b/libavfilter/vf_phase.c
@@ -102,9 +102,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_pixelize.c b/libavfilter/vf_pixelize.c
index abde241d18..a4f9fd0073 100644
--- a/libavfilter/vf_pixelize.c
+++ b/libavfilter/vf_pixelize.c
@@ -66,9 +66,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c
index a2ad375227..bfc223913c 100644
--- a/libavfilter/vf_pp7.c
+++ b/libavfilter/vf_pp7.c
@@ -265,8 +265,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_premultiply.c b/libavfilter/vf_premultiply.c
index 1cea3cab7f..69f5b51971 100644
--- a/libavfilter/vf_premultiply.c
+++ b/libavfilter/vf_premultiply.c
@@ -73,7 +73,7 @@ static int query_formats(const AVFilterContext *ctx,
int ret;
static const enum AVPixelFormat no_alpha_pix_fmts[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14,
AV_PIX_FMT_YUV444P16,
@@ -562,10 +562,6 @@ static int filter_frame(AVFilterContext *ctx,
s->premultiply[0] = full ? unpremultiply8 : unpremultiply8offset;
s->premultiply[1] = s->premultiply[2] = unpremultiply8yuv;
break;
- case AV_PIX_FMT_YUVJ444P:
- s->premultiply[0] = unpremultiply8;
- s->premultiply[1] = s->premultiply[2] = unpremultiply8yuv;
- break;
case AV_PIX_FMT_GBRP:
case AV_PIX_FMT_GBRAP:
s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? unpremultiply8offset : unpremultiply8;
@@ -614,10 +610,6 @@ static int filter_frame(AVFilterContext *ctx,
s->premultiply[0] = full ? premultiply8 : premultiply8offset;
s->premultiply[1] = s->premultiply[2] = premultiply8yuv;
break;
- case AV_PIX_FMT_YUVJ444P:
- s->premultiply[0] = premultiply8;
- s->premultiply[1] = s->premultiply[2] = premultiply8yuv;
- break;
case AV_PIX_FMT_GBRP:
case AV_PIX_FMT_GBRAP:
s->premultiply[0] = s->premultiply[1] = s->premultiply[2] = limited ? premultiply8offset : premultiply8;
diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index baaf7605c2..e198dcbcf6 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -284,8 +284,6 @@ static const enum AVPixelFormat pix_fmts[] = {
#define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c
index 04acbadc4e..90b36417a9 100644
--- a/libavfilter/vf_pullup.c
+++ b/libavfilter/vf_pullup.c
@@ -53,12 +53,10 @@ static const AVOption pullup_options[] = {
AVFILTER_DEFINE_CLASS(pullup);
static const enum AVPixelFormat pix_fmts[] = {
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_quirc.c b/libavfilter/vf_quirc.c
index 59dc84caa8..aeb2242d3d 100644
--- a/libavfilter/vf_quirc.c
+++ b/libavfilter/vf_quirc.c
@@ -143,9 +143,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_readeia608.c b/libavfilter/vf_readeia608.c
index 605ca86d17..6226c12b8e 100644
--- a/libavfilter/vf_readeia608.c
+++ b/libavfilter/vf_readeia608.c
@@ -106,9 +106,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_readvitc.c b/libavfilter/vf_readvitc.c
index fa3953a426..43115410d3 100644
--- a/libavfilter/vf_readvitc.c
+++ b/libavfilter/vf_readvitc.c
@@ -197,11 +197,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUVA422P,
AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_remap.c b/libavfilter/vf_remap.c
index de83bb4671..59499759c8 100644
--- a/libavfilter/vf_remap.c
+++ b/libavfilter/vf_remap.c
@@ -90,7 +90,6 @@ static int query_formats(const AVFilterContext *ctx,
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
diff --git a/libavfilter/vf_removegrain.c b/libavfilter/vf_removegrain.c
index faaa6af712..aa5293b4c7 100644
--- a/libavfilter/vf_removegrain.c
+++ b/libavfilter/vf_removegrain.c
@@ -48,8 +48,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_rotate.c b/libavfilter/vf_rotate.c
index 740acfe3bd..79cd527031 100644
--- a/libavfilter/vf_rotate.c
+++ b/libavfilter/vf_rotate.c
@@ -141,8 +141,8 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUVA420P10LE,
AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUVA444P10LE,
diff --git a/libavfilter/vf_scdet.c b/libavfilter/vf_scdet.c
index 6b1de13610..ba14fb38e2 100644
--- a/libavfilter/vf_scdet.c
+++ b/libavfilter/vf_scdet.c
@@ -63,10 +63,10 @@ AVFILTER_DEFINE_CLASS(scdet);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGBA,
AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12,
AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_scroll.c b/libavfilter/vf_scroll.c
index d64ac2733d..7e0364e720 100644
--- a/libavfilter/vf_scroll.c
+++ b/libavfilter/vf_scroll.c
@@ -44,10 +44,8 @@ typedef struct ScrollContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_shear.c b/libavfilter/vf_shear.c
index 1c24a36478..fbeb720d65 100644
--- a/libavfilter/vf_shear.c
+++ b/libavfilter/vf_shear.c
@@ -92,9 +92,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 5859b46478..52a698ce4e 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -121,8 +121,6 @@ static av_cold void uninit(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 76fab4d6fa..115a1bb0c6 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -74,9 +74,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_siti.c b/libavfilter/vf_siti.c
index fde55b49a9..27968249c3 100644
--- a/libavfilter/vf_siti.c
+++ b/libavfilter/vf_siti.c
@@ -67,7 +67,6 @@ typedef struct SiTiContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10,
AV_PIX_FMT_NONE
};
@@ -141,15 +140,6 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
-// Determine whether the video is in full or limited range. If not defined, assume limited.
-static int is_full_range(AVFrame* frame)
-{
- // If color range not specified, fallback to pixel format
- if (frame->color_range == AVCOL_RANGE_UNSPECIFIED || frame->color_range == AVCOL_RANGE_NB)
- return frame->format == AV_PIX_FMT_YUVJ420P || frame->format == AV_PIX_FMT_YUVJ422P;
- return frame->color_range == AVCOL_RANGE_JPEG;
-}
-
// Check frame's color range and convert to full range if needed
static uint16_t convert_full_range(int factor, uint16_t y)
{
@@ -285,7 +275,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
float si;
float ti;
- s->full_range = is_full_range(frame);
+ s->full_range = frame->color_range == AVCOL_RANGE_JPEG;
s->nb_frames++;
// Calculate si and ti
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index 20c9fd4340..f700a62509 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -317,8 +317,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9,
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 85aa420683..bcceb346ae 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -428,8 +428,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
#define PF(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf, AV_PIX_FMT_GBR##suf
PF(P9), PF(P10), PF(P12), PF(P14), PF(P16),
diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c
index 6cd906423e..21b9dad35a 100644
--- a/libavfilter/vf_ssim360.c
+++ b/libavfilter/vf_ssim360.c
@@ -1722,8 +1722,6 @@ static const enum AVPixelFormat ssim360_pixfmts[] = {
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
PF(P9), PF(P10), PF(P12), PF(P14), PF(P16),
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c
index 15d6f31c11..7b72b53eff 100644
--- a/libavfilter/vf_stereo3d.c
+++ b/libavfilter/vf_stereo3d.c
@@ -247,11 +247,6 @@ static const enum AVPixelFormat other_pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P,
AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ411P,
- AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUV420P9LE, AV_PIX_FMT_YUVA420P9LE,
AV_PIX_FMT_YUV420P9BE, AV_PIX_FMT_YUVA420P9BE,
AV_PIX_FMT_YUV422P9LE, AV_PIX_FMT_YUVA422P9LE,
diff --git a/libavfilter/vf_threshold.c b/libavfilter/vf_threshold.c
index 5a1d37736b..ab6afc7b65 100644
--- a/libavfilter/vf_threshold.c
+++ b/libavfilter/vf_threshold.c
@@ -46,10 +46,8 @@ AVFILTER_DEFINE_CLASS(threshold);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV440P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV440P12, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_tiltandshift.c b/libavfilter/vf_tiltandshift.c
index f22f993bc5..149a001c62 100644
--- a/libavfilter/vf_tiltandshift.c
+++ b/libavfilter/vf_tiltandshift.c
@@ -75,8 +75,6 @@ typedef struct TiltandshiftContext {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_NONE
};
@@ -131,11 +129,7 @@ static int config_props(AVFilterLink *outlink)
if (!desc)
return AVERROR_BUG;
- if (outlink->format == AV_PIX_FMT_YUVJ420P ||
- outlink->format == AV_PIX_FMT_YUVJ422P ||
- outlink->format == AV_PIX_FMT_YUVJ444P ||
- outlink->format == AV_PIX_FMT_YUVJ440P ||
- outlink->color_range == AVCOL_RANGE_JPEG)
+ if (outlink->color_range == AVCOL_RANGE_JPEG)
black_data[0] = black_data[3] = 0;
ret = av_image_alloc(s->black_buffers, s->black_linesizes, 1,
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 2806e55752..3201146bed 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -76,13 +76,6 @@ static const AVOption interlace_options[] = {
AVFILTER_DEFINE_CLASS(interlace);
-#define FULL_SCALE_YUVJ_FORMATS \
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
-
-static const enum AVPixelFormat full_scale_yuvj_pix_fmts[] = {
- FULL_SCALE_YUVJ_FORMATS, AV_PIX_FMT_NONE
-};
-
static const AVRational standard_tbs[] = {
{1, 25},
{1, 30},
@@ -99,7 +92,7 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV440P12LE, AV_PIX_FMT_YUV444P12LE,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA444P10LE,
- AV_PIX_FMT_GRAY8, FULL_SCALE_YUVJ_FORMATS,
+ AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
@@ -235,14 +228,12 @@ static int config_out_props(AVFilterLink *outlink)
}
ff_draw_color(&tinterlace->draw, &tinterlace->color, black);
/* limited range */
- if (!ff_pixfmt_is_in(outlink->format, full_scale_yuvj_pix_fmts)) {
- ret = av_image_alloc(tinterlace->black_data[0], tinterlace->black_linesize,
- outlink->w, outlink->h, outlink->format, 16);
- if (ret < 0)
- return ret;
- ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data[0],
- tinterlace->black_linesize, 0, 0, outlink->w, outlink->h);
- }
+ ret = av_image_alloc(tinterlace->black_data[0], tinterlace->black_linesize,
+ outlink->w, outlink->h, outlink->format, 16);
+ if (ret < 0)
+ return ret;
+ ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data[0],
+ tinterlace->black_linesize, 0, 0, outlink->w, outlink->h);
/* full range */
tinterlace->color.comp[0].u8[0] = 0;
ret = av_image_alloc(tinterlace->black_data[1], tinterlace->black_linesize,
@@ -444,7 +435,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1));
field = (1 + l->frame_count_in) & 1 ? FIELD_UPPER : FIELD_LOWER;
- full = out->color_range == AVCOL_RANGE_JPEG || ff_pixfmt_is_in(out->format, full_scale_yuvj_pix_fmts);
+ full = out->color_range == AVCOL_RANGE_JPEG;
/* copy upper and lower fields */
copy_picture_field(tinterlace, out->data, out->linesize,
(const uint8_t **)cur->data, cur->linesize,
diff --git a/libavfilter/vf_tmidequalizer.c b/libavfilter/vf_tmidequalizer.c
index 102d7c244f..96209fae76 100644
--- a/libavfilter/vf_tmidequalizer.c
+++ b/libavfilter/vf_tmidequalizer.c
@@ -69,10 +69,8 @@ AVFILTER_DEFINE_CLASS(tmidequalizer);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c
index 6d2be4328d..d2d17ea7e3 100644
--- a/libavfilter/vf_unsharp.c
+++ b/libavfilter/vf_unsharp.c
@@ -248,12 +248,12 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P12, AV_PIX_FMT_YUVA422P16,
AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV440P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
+ AV_PIX_FMT_NONE
};
static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const char *effect_type, int width)
diff --git a/libavfilter/vf_uspp.c b/libavfilter/vf_uspp.c
index c5efd44f92..cde8b67454 100644
--- a/libavfilter/vf_uspp.c
+++ b/libavfilter/vf_uspp.c
@@ -341,8 +341,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index c502bd5587..addce9a398 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -192,11 +192,6 @@ static int query_formats(const AVFilterContext *ctx,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA420P9,
AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA420P16,
- // YUVJ
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
-
// YUV444
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_vaguedenoiser.c b/libavfilter/vf_vaguedenoiser.c
index 9a9bf77233..3ba5ce0e9e 100644
--- a/libavfilter/vf_vaguedenoiser.c
+++ b/libavfilter/vf_vaguedenoiser.c
@@ -110,9 +110,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_varblur.c b/libavfilter/vf_varblur.c
index 74efa0c6b3..de67533930 100644
--- a/libavfilter/vf_varblur.c
+++ b/libavfilter/vf_varblur.c
@@ -74,10 +74,8 @@ FRAMESYNC_DEFINE_CLASS(varblur, VarBlurContext, fs);
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index db9b5f9e8c..1c149d1c79 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -181,7 +181,7 @@ static const enum AVPixelFormat out_rgb12_pix_fmts[] = {
};
static const enum AVPixelFormat in1_pix_fmts[] = {
- AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10,
AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_YUV444P12,
@@ -192,10 +192,10 @@ static const enum AVPixelFormat in1_pix_fmts[] = {
};
static const enum AVPixelFormat in2_pix_fmts[] = {
- AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRP,
AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10,
diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c
index 64eb39699f..a143e15adf 100644
--- a/libavfilter/vf_vif.c
+++ b/libavfilter/vf_vif.c
@@ -471,8 +471,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
#define PF(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf
PF(P9), PF(P10), PF(P12), PF(P14), PF(P16),
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index 465453db25..c3dded0e8e 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -77,9 +77,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_GRAY8,
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index 8c8fdae796..d5abc049d1 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -211,8 +211,6 @@ static const enum AVPixelFormat in_lowpass_pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
@@ -230,8 +228,6 @@ static const enum AVPixelFormat in_color_pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV411P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9,
@@ -246,8 +242,6 @@ static const enum AVPixelFormat in_flat_pix_fmts[] = {
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUV411P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV420P9,
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA420P9,
@@ -279,7 +273,7 @@ static const enum AVPixelFormat out_rgb12_lowpass_pix_fmts[] = {
};
static const enum AVPixelFormat out_yuv8_lowpass_pix_fmts[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P,
+ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P,
AV_PIX_FMT_NONE
};
diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index 53dcf3e1e5..c9ff13747b 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -140,7 +140,6 @@ typedef struct ThreadData {
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P,
- AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUV444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY8,
AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_GBRP9,
diff --git a/libavfilter/vf_xmedian.c b/libavfilter/vf_xmedian.c
index 7f64a96c94..9ab7952c2e 100644
--- a/libavfilter/vf_xmedian.c
+++ b/libavfilter/vf_xmedian.c
@@ -74,9 +74,6 @@ static const enum AVPixelFormat pixel_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV440P10,
diff --git a/libavfilter/vf_xpsnr.c b/libavfilter/vf_xpsnr.c
index 34c875456e..dbf422752b 100644
--- a/libavfilter/vf_xpsnr.c
+++ b/libavfilter/vf_xpsnr.c
@@ -537,8 +537,6 @@ static const enum AVPixelFormat xpsnr_formats[] = {
#define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf)
PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16),
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16,
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index 41ba056ad4..ea4ef4663f 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -255,8 +255,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/vf_yaepblur.c b/libavfilter/vf_yaepblur.c
index 59f3501f35..4c6bcbe25d 100644
--- a/libavfilter/vf_yaepblur.c
+++ b/libavfilter/vf_yaepblur.c
@@ -63,10 +63,8 @@ static av_cold void uninit(AVFilterContext *ctx)
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV440P12,
diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c
index 762f1d213d..21358a8d6b 100644
--- a/libavfilter/vf_zoompan.c
+++ b/libavfilter/vf_zoompan.c
@@ -333,9 +333,6 @@ static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P,
AV_PIX_FMT_YUVA420P,
- AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
- AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
diff --git a/libavfilter/vf_zscale.c b/libavfilter/vf_zscale.c
index b14d704663..9a28bc218d 100644
--- a/libavfilter/vf_zscale.c
+++ b/libavfilter/vf_zscale.c
@@ -185,9 +185,6 @@ static int query_formats(const AVFilterContext *ctx,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
- AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
- AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUVJ411P,
AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12,
diff --git a/libavfilter/video.h b/libavfilter/video.h
index f44d3445dc..77f27fdf7c 100644
--- a/libavfilter/video.h
+++ b/libavfilter/video.h
@@ -51,9 +51,4 @@ AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h);
*/
int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt);
-/**
- * Returns true if a YUV pixel format is forced full range (i.e. YUVJ).
- */
-int ff_fmt_is_forced_full_range(enum AVPixelFormat fmt);
-
#endif /* AVFILTER_VIDEO_H */
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 697b94d4e8..5ddf5272fd 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -1235,7 +1235,6 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
dstp[3][i + j*dst_linesizep[3]] = a;
av_fallthrough;
case AV_PIX_FMT_YUV444P:
- case AV_PIX_FMT_YUVJ444P:
dstp[0][i + j*dst_linesizep[0]] = y;
dstp[1][i + j*dst_linesizep[1]] = u;
dstp[2][i + j*dst_linesizep[2]] = v;
@@ -1314,7 +1313,7 @@ static av_cold int yuvtest_init(AVFilterContext *ctx)
}
static const enum AVPixelFormat yuvtest_pix_fmts[] = {
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14,
AV_PIX_FMT_YUV444P16, AV_PIX_FMT_VYU444,
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index 493ddd1e38..b4fed6865f 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -90,18 +90,6 @@ static int yuv4_write_header(AVFormatContext *s)
case AV_PIX_FMT_YUV411P:
colorspace = " C411 XYSCSS=411";
break;
- case AV_PIX_FMT_YUVJ420P:
- colorspace = " C420jpeg XYSCSS=420JPEG";
- colorrange = " XCOLORRANGE=FULL";
- break;
- case AV_PIX_FMT_YUVJ422P:
- colorspace = " C422 XYSCSS=422";
- colorrange = " XCOLORRANGE=FULL";
- break;
- case AV_PIX_FMT_YUVJ444P:
- colorspace = " C444 XYSCSS=444";
- colorrange = " XCOLORRANGE=FULL";
- break;
case AV_PIX_FMT_YUV420P:
switch (st->codecpar->chroma_location) {
case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;
@@ -239,10 +227,6 @@ static int yuv4_init(AVFormatContext *s)
case AV_PIX_FMT_YUV420P:
case AV_PIX_FMT_YUV422P:
case AV_PIX_FMT_YUV444P:
- // TODO: remove YUVJ pixel formats when they are completely removed from the codebase.
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ444P:
break;
case AV_PIX_FMT_GRAY9:
case AV_PIX_FMT_GRAY10:
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 90f9596def..4327e44f03 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -382,18 +382,6 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
- [AV_PIX_FMT_YUVJ411P] = {
- .name = "yuvj411p",
- .nb_components = 3,
- .log2_chroma_w = 2,
- .log2_chroma_h = 0,
- .comp = {
- { 0, 1, 0, 0, 8 }, /* Y */
- { 1, 1, 0, 0, 8 }, /* U */
- { 2, 1, 0, 0, 8 }, /* V */
- },
- .flags = AV_PIX_FMT_FLAG_PLANAR,
- },
[AV_PIX_FMT_GRAY8] = {
.name = "gray",
.nb_components = 1,
@@ -434,42 +422,6 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_ALPHA,
},
- [AV_PIX_FMT_YUVJ420P] = {
- .name = "yuvj420p",
- .nb_components = 3,
- .log2_chroma_w = 1,
- .log2_chroma_h = 1,
- .comp = {
- { 0, 1, 0, 0, 8 }, /* Y */
- { 1, 1, 0, 0, 8 }, /* U */
- { 2, 1, 0, 0, 8 }, /* V */
- },
- .flags = AV_PIX_FMT_FLAG_PLANAR,
- },
- [AV_PIX_FMT_YUVJ422P] = {
- .name = "yuvj422p",
- .nb_components = 3,
- .log2_chroma_w = 1,
- .log2_chroma_h = 0,
- .comp = {
- { 0, 1, 0, 0, 8 }, /* Y */
- { 1, 1, 0, 0, 8 }, /* U */
- { 2, 1, 0, 0, 8 }, /* V */
- },
- .flags = AV_PIX_FMT_FLAG_PLANAR,
- },
- [AV_PIX_FMT_YUVJ444P] = {
- .name = "yuvj444p",
- .nb_components = 3,
- .log2_chroma_w = 0,
- .log2_chroma_h = 0,
- .comp = {
- { 0, 1, 0, 0, 8 }, /* Y */
- { 1, 1, 0, 0, 8 }, /* U */
- { 2, 1, 0, 0, 8 }, /* V */
- },
- .flags = AV_PIX_FMT_FLAG_PLANAR,
- },
[AV_PIX_FMT_UYVY422] = {
.name = "uyvy422",
.nb_components = 3,
@@ -830,18 +782,6 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
- [AV_PIX_FMT_YUVJ440P] = {
- .name = "yuvj440p",
- .nb_components = 3,
- .log2_chroma_w = 0,
- .log2_chroma_h = 1,
- .comp = {
- { 0, 1, 0, 0, 8 }, /* Y */
- { 1, 1, 0, 0, 8 }, /* U */
- { 2, 1, 0, 0, 8 }, /* V */
- },
- .flags = AV_PIX_FMT_FLAG_PLANAR,
- },
[AV_PIX_FMT_YUV440P10LE] = {
.name = "yuv440p10le",
.nb_components = 3,
@@ -3544,11 +3484,6 @@ static int get_color_type(const AVPixFmtDescriptor *desc) {
if(desc->nb_components == 1 || desc->nb_components == 2)
return FF_COLOR_GRAY;
- if (desc->name) {
- if (av_strstart(desc->name, "yuvj", NULL))
- return FF_COLOR_YUV_JPEG;
- }
-
if(desc->flags & AV_PIX_FMT_FLAG_RGB)
return FF_COLOR_RGB;
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 2e7b6457e0..e70bdc47e5 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -82,9 +82,6 @@ enum AVPixelFormat {
AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette
- AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range
- AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range
- AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range
AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
@@ -104,7 +101,6 @@ enum AVPixelFormat {
AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
- AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
@@ -280,7 +276,6 @@ enum AVPixelFormat {
AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian
AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian
AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian
- AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range
AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples
AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
diff --git a/libswscale/aarch64/ops_entries.c b/libswscale/aarch64/ops_entries.c
index 9466c800e6..7cc10a4b8a 100644
--- a/libswscale/aarch64/ops_entries.c
+++ b/libswscale/aarch64/ops_entries.c
@@ -267,7 +267,6 @@
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 8, .type = AARCH64_PIXEL_U32, .mask = 0x1101 },
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U8, .mask = 0x0001 },
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U8, .mask = 0x0010 },
-{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U8, .mask = 0x0110 },
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U8, .mask = 0x1000 },
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U16, .mask = 0x0001 },
{ .op = AARCH64_SWS_OP_CLEAR, .block_size = 16, .type = AARCH64_PIXEL_U16, .mask = 0x0010 },
@@ -354,16 +353,12 @@
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x00000000ffULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0001 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000000c000ULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0010 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000000c000ULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0010 },
-{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000373dcc7ULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
-{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000373dcc7ULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x0003f3fccfULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x0003f3fccfULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000c00c00cULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000c00c00cULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000c30cc0fULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000c30cc0fULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
-{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000ff3fcfcULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
-{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000ff3fcfcULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000ff3fcffULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0x000ff3fcffULL, .linear.fmla = 1, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x0111 },
{ .op = AARCH64_SWS_OP_LINEAR, .linear.mask = 0xc000000000ULL, .linear.fmla = 0, .block_size = 8, .type = AARCH64_PIXEL_F32, .mask = 0x1000 },
diff --git a/libswscale/format.c b/libswscale/format.c
index a424bb2cfc..3c86be4caf 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -64,10 +64,6 @@ static const LegacyFormatEntry legacy_format_entries[] = {
[AV_PIX_FMT_MONOWHITE] = { 1, 1 },
[AV_PIX_FMT_MONOBLACK] = { 1, 1 },
[AV_PIX_FMT_PAL8] = { 1, 0 },
- [AV_PIX_FMT_YUVJ420P] = { 1, 1 },
- [AV_PIX_FMT_YUVJ411P] = { 1, 1 },
- [AV_PIX_FMT_YUVJ422P] = { 1, 1 },
- [AV_PIX_FMT_YUVJ444P] = { 1, 1 },
[AV_PIX_FMT_YVYU422] = { 1, 1 },
[AV_PIX_FMT_UYVY422] = { 1, 1 },
[AV_PIX_FMT_UYYVYY411] = { 1, 0 },
@@ -98,7 +94,6 @@ static const LegacyFormatEntry legacy_format_entries[] = {
[AV_PIX_FMT_GRAY16BE] = { 1, 1 },
[AV_PIX_FMT_GRAY16LE] = { 1, 1 },
[AV_PIX_FMT_YUV440P] = { 1, 1 },
- [AV_PIX_FMT_YUVJ440P] = { 1, 1 },
[AV_PIX_FMT_YUV440P10LE] = { 1, 1 },
[AV_PIX_FMT_YUV440P10BE] = { 1, 1 },
[AV_PIX_FMT_YUV440P12LE] = { 1, 1 },
@@ -328,16 +323,6 @@ static void sanitize_fmt(SwsFormat *fmt, const AVPixFmtDescriptor *desc)
fmt->range = AVCOL_RANGE_JPEG; // FIXME: this restriction should be lifted
}
- switch (av_pix_fmt_desc_get_id(desc)) {
- case AV_PIX_FMT_YUVJ420P:
- case AV_PIX_FMT_YUVJ411P:
- case AV_PIX_FMT_YUVJ422P:
- case AV_PIX_FMT_YUVJ444P:
- case AV_PIX_FMT_YUVJ440P:
- fmt->range = AVCOL_RANGE_JPEG;
- break;
- }
-
if (!desc->log2_chroma_w && !desc->log2_chroma_h)
fmt->loc = AVCHROMA_LOC_UNSPECIFIED;
}
diff --git a/libswscale/uops_macros.h b/libswscale/uops_macros.h
index a382988361..c583636c5f 100644
--- a/libswscale/uops_macros.h
+++ b/libswscale/uops_macros.h
@@ -311,7 +311,6 @@
MACRO(__VA_ARGS__, u8_clear_y_1 , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x2, 0x00002, 0x00000) \
MACRO(__VA_ARGS__, u8_clear_xy_xx , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x3, 0x00000, 0x00000) \
MACRO(__VA_ARGS__, u8_clear_xz_xx , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x5, 0x00000, 0x00000) \
- MACRO(__VA_ARGS__, u8_clear_yz_xx , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x6, 0x00000, 0x00000) \
MACRO(__VA_ARGS__, u8_clear_xyz_1xx , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x7, 0x00001, 0x00000) \
MACRO(__VA_ARGS__, u8_clear_w_0 , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x8, 0x00000, 0x00008) \
MACRO(__VA_ARGS__, u8_clear_w_1 , SWS_PIXEL_U8 , SWS_UOP_CLEAR , 0x8, 0x00008, 0x00000) \
@@ -326,7 +325,6 @@
MACRO(__VA_ARGS__, u8_clear_y_1 , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x2, .par.clear.one = 0x2, .par.clear.zero = 0x0) \
MACRO(__VA_ARGS__, u8_clear_xy_xx , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x3, .par.clear.one = 0x0, .par.clear.zero = 0x0) \
MACRO(__VA_ARGS__, u8_clear_xz_xx , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x5, .par.clear.one = 0x0, .par.clear.zero = 0x0) \
- MACRO(__VA_ARGS__, u8_clear_yz_xx , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x6, .par.clear.one = 0x0, .par.clear.zero = 0x0) \
MACRO(__VA_ARGS__, u8_clear_xyz_1xx , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x7, .par.clear.one = 0x1, .par.clear.zero = 0x0) \
MACRO(__VA_ARGS__, u8_clear_w_0 , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x8, .par.clear.one = 0x0, .par.clear.zero = 0x8) \
MACRO(__VA_ARGS__, u8_clear_w_1 , .type = SWS_PIXEL_U8 , .uop = SWS_UOP_CLEAR , .mask = 0x8, .par.clear.one = 0x8, .par.clear.zero = 0x0) \
@@ -1086,10 +1084,8 @@
MACRO(__VA_ARGS__, f32_linear_y_0x000 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x2, 0x41001, 0xbefbe) \
MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xba108) \
MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xba118) \
MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbadae) \
MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40421, 0xbb10a) \
MACRO(__VA_ARGS__, f32_linear_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x8, 0x01041, 0xbefbe) \
MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x01040, 0xbefae) \
MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x01040, 0xbefb8) \
@@ -1103,10 +1099,8 @@
MACRO(__VA_ARGS__, f32_linear_y_0x000 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x2, .par.lin.one = 0x41001, .par.lin.zero = 0xbefbe) \
MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108) \
MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118) \
MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbadae) \
MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40421, .par.lin.zero = 0xbb10a) \
MACRO(__VA_ARGS__, f32_linear_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x8, .par.lin.one = 0x1041, .par.lin.zero = 0xbefbe) \
MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae) \
MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefb8) \
@@ -1127,12 +1121,8 @@
MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba108, 0xfbdaf) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba108, 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbb10a, 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfa118) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfbdbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfbdfe) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbadae, 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbefbe, 0xfefbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40421, 0xbb10a, 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x8, 0x01041, 0xbefbe, 0xbffff) \
MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefae, 0xbffee) \
MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefae, 0xbffef) \
@@ -1156,12 +1146,8 @@
MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108, .par.lin.exact = 0xfbdaf) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108, .par.lin.exact = 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbb10a, .par.lin.exact = 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfa118) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfbdbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfbdfe) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbadae, .par.lin.exact = 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbefbe, .par.lin.exact = 0xfefbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40421, .par.lin.zero = 0xbb10a, .par.lin.exact = 0xfbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x8, .par.lin.one = 0x1041, .par.lin.zero = 0xbefbe, .par.lin.exact = 0xbffff) \
MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xbffee) \
MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xbffef) \
diff --git a/libswscale/utils.c b/libswscale/utils.c
index fa070c270a..8fa95a4410 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -781,24 +781,9 @@ av_cold int ff_sws_fill_xyztables(SwsInternal *c)
return 0;
}
-static int handle_jpeg(/* enum AVPixelFormat */ int *format)
+static int is_full_range(enum AVPixelFormat format)
{
- switch (*format) {
- case AV_PIX_FMT_YUVJ420P:
- *format = AV_PIX_FMT_YUV420P;
- return 1;
- case AV_PIX_FMT_YUVJ411P:
- *format = AV_PIX_FMT_YUV411P;
- return 1;
- case AV_PIX_FMT_YUVJ422P:
- *format = AV_PIX_FMT_YUV422P;
- return 1;
- case AV_PIX_FMT_YUVJ444P:
- *format = AV_PIX_FMT_YUV444P;
- return 1;
- case AV_PIX_FMT_YUVJ440P:
- *format = AV_PIX_FMT_YUV440P;
- return 1;
+ switch (format) {
case AV_PIX_FMT_GRAY8:
case AV_PIX_FMT_YA8:
case AV_PIX_FMT_GRAY9LE:
@@ -1947,8 +1932,8 @@ av_cold int sws_init_context(SwsContext *sws, SwsFilter *srcFilter,
src_format = sws->src_format;
dst_format = sws->dst_format;
- sws->src_range |= handle_jpeg(&sws->src_format);
- sws->dst_range |= handle_jpeg(&sws->dst_format);
+ sws->src_range |= is_full_range(sws->src_format);
+ sws->dst_range |= is_full_range(sws->dst_format);
if (src_format != sws->src_format || dst_format != sws->dst_format)
av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n");
diff --git a/tests/fate/lavf-image.mak b/tests/fate/lavf-image.mak
index 4177e091b3..d6113f9071 100644
--- a/tests/fate/lavf-image.mak
+++ b/tests/fate/lavf-image.mak
@@ -72,7 +72,7 @@ fate-lavf-none.gbrapf32le.exr: CMD = lavf_image "-compression none -pix_fmt gb
fate-lavf-rle.gbrapf32le.exr: CMD = lavf_image "-compression rle -pix_fmt gbrapf32le" "" "no_file_checksums"
fate-lavf-zip1.gbrapf32le.exr: CMD = lavf_image "-compression zip1 -pix_fmt gbrapf32le" "" "no_file_checksums"
fate-lavf-zip16.gbrapf32le.exr: CMD = lavf_image "-compression zip16 -pix_fmt gbrapf32le" "" "no_file_checksums"
-fate-lavf-jpg: CMD = lavf_image "-pix_fmt yuvj420p"
+fate-lavf-jpg: CMD = lavf_image "-pix_fmt yuv420p"
fate-lavf-tiff: CMD = lavf_image "-pix_fmt rgb24"
fate-lavf-gbrp10le.dpx: CMD = lavf_image "-pix_fmt gbrp10le" "-pix_fmt gbrp10le"
fate-lavf-gbrp12le.dpx: CMD = lavf_image "-pix_fmt gbrp12le" "-pix_fmt gbrp12le"
diff --git a/tests/fate/pixfmt.mak b/tests/fate/pixfmt.mak
index 504f9e541b..b6107554ec 100644
--- a/tests/fate/pixfmt.mak
+++ b/tests/fate/pixfmt.mak
@@ -17,10 +17,6 @@ PIXFMT_8_LIST = bgr24 \
yuv422p \
yuv440p \
yuv444p \
- yuvj420p \
- yuvj422p \
- yuvj440p \
- yuvj444p \
yuyv422 \
yvyu422 \
uyvy422 \
diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index 895d5d55bc..3b509d700c 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -246,12 +246,12 @@ fate-vsynth_lena-magicyuv: ENCOPTS = -slices 3 -pix_fmt gray -pred le
fate-vsynth%-magicyuv: DECOPTS = -sws_flags neighbor+bitexact
FATE_VCODEC_SCALE-$(call ENCDEC, MJPEG, AVI) += mjpeg mjpeg-422 mjpeg-444 mjpeg-trell mjpeg-huffman mjpeg-trell-huffman
-fate-vsynth%-mjpeg: ENCOPTS = -qscale 9 -pix_fmt yuvj420p -huffman default -threads 5 -thread_type slice
-fate-vsynth%-mjpeg-422: ENCOPTS = -qscale 9 -pix_fmt yuvj422p
-fate-vsynth%-mjpeg-444: ENCOPTS = -qscale 9 -pix_fmt yuvj444p
-fate-vsynth%-mjpeg-trell: ENCOPTS = -qscale 9 -pix_fmt yuvj420p -trellis 1 -huffman default
-fate-vsynth%-mjpeg-huffman: ENCOPTS = -qscale 9 -pix_fmt yuvj420p -huffman optimal
-fate-vsynth%-mjpeg-trell-huffman: ENCOPTS = -qscale 9 -pix_fmt yuvj420p -trellis 1 -huffman optimal
+fate-vsynth%-mjpeg: ENCOPTS = -qscale 9 -pix_fmt yuv420p -huffman default -threads 5 -thread_type slice
+fate-vsynth%-mjpeg-422: ENCOPTS = -qscale 9 -pix_fmt yuv422p
+fate-vsynth%-mjpeg-444: ENCOPTS = -qscale 9 -pix_fmt yuv444p
+fate-vsynth%-mjpeg-trell: ENCOPTS = -qscale 9 -pix_fmt yuv420p -trellis 1 -huffman default
+fate-vsynth%-mjpeg-huffman: ENCOPTS = -qscale 9 -pix_fmt yuv420p -huffman optimal
+fate-vsynth%-mjpeg-trell-huffman: ENCOPTS = -qscale 9 -pix_fmt yuv420p -trellis 1 -huffman optimal
FATE_VCODEC-$(call ENCDEC, MPEG1VIDEO, MPEG1VIDEO MPEGVIDEO) += mpeg1 mpeg1b
fate-vsynth%-mpeg1: FMT = mpeg1video
diff --git a/tests/ref/fate/exif-image-embedded b/tests/ref/fate/exif-image-embedded
index d663368394..395553a221 100644
--- a/tests/ref/fate/exif-image-embedded
+++ b/tests/ref/fate/exif-image-embedded
@@ -18,7 +18,7 @@ crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
-pix_fmt=yuvj420p
+pix_fmt=yuv420p
sample_aspect_ratio=1:1
pict_type=I
interlaced_frame=0
diff --git a/tests/ref/fate/exif-image-jpg b/tests/ref/fate/exif-image-jpg
index f1a5ef00e8..9503346ed4 100644
--- a/tests/ref/fate/exif-image-jpg
+++ b/tests/ref/fate/exif-image-jpg
@@ -18,7 +18,7 @@ crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
-pix_fmt=yuvj422p
+pix_fmt=yuv422p
sample_aspect_ratio=1:1
pict_type=I
interlaced_frame=0
@@ -31,29 +31,29 @@ color_primaries=unknown
color_transfer=unknown
chroma_location=center
alpha_mode=unspecified
-TAG:ImageDescription=
+TAG:ImageDescription=
TAG:Make=Canon
TAG:Model=Canon PowerShot SX200 IS
-TAG:XResolution= 180:1
-TAG:YResolution= 180:1
+TAG:XResolution= 180:1
+TAG:YResolution= 180:1
TAG:ResolutionUnit= 2
TAG:DateTime=2013:07:18 13:12:03
TAG:YCbCrPositioning= 2
-TAG:ExifIFD/ExposureTime= 1:1250
-TAG:ExifIFD/FNumber= 40:10
+TAG:ExifIFD/ExposureTime= 1:1250
+TAG:ExifIFD/FNumber= 40:10
TAG:ExifIFD/ISOSpeedRatings= 160
TAG:ExifIFD/ExifVersion= 48, 50, 50, 49
TAG:ExifIFD/DateTimeOriginal=2013:07:18 13:12:03
TAG:ExifIFD/DateTimeDigitized=2013:07:18 13:12:03
TAG:ExifIFD/ComponentsConfiguration= 1, 2, 3, 0
-TAG:ExifIFD/CompressedBitsPerPixel= 3:1
-TAG:ExifIFD/ShutterSpeedValue= 329:32
-TAG:ExifIFD/ApertureValue= 128:32
-TAG:ExifIFD/ExposureBiasValue= 0:3
-TAG:ExifIFD/MaxApertureValue= 113:32
+TAG:ExifIFD/CompressedBitsPerPixel= 3:1
+TAG:ExifIFD/ShutterSpeedValue= 329:32
+TAG:ExifIFD/ApertureValue= 128:32
+TAG:ExifIFD/ExposureBiasValue= 0:3
+TAG:ExifIFD/MaxApertureValue= 113:32
TAG:ExifIFD/MeteringMode= 5
TAG:ExifIFD/Flash= 16
-TAG:ExifIFD/FocalLength= 5000:1000
+TAG:ExifIFD/FocalLength= 5000:1000
TAG:ExifIFD/MakerNote/GPSLatitudeRef= 96, 2, 0, 3, 0, 0, 0, 4
65535, 1, 9, 0, 0, 0, 0, 0
15, 3, 1, 16390, 0, 32767, 65535, 60000
@@ -187,19 +187,19 @@ TAG:ExifIFD/InteropIFD/GPSLatitudeRef=R98
TAG:ExifIFD/InteropIFD/GPSLatitude= 48, 49, 48, 48
TAG:ExifIFD/InteropIFD/RelatedImageWidth= 4000
TAG:ExifIFD/InteropIFD/RelatedImageLength= 2248
-TAG:ExifIFD/FocalPlaneXResolution=4000000:244
-TAG:ExifIFD/FocalPlaneYResolution=2248000:183
+TAG:ExifIFD/FocalPlaneXResolution=4000000:244
+TAG:ExifIFD/FocalPlaneYResolution=2248000:183
TAG:ExifIFD/FocalPlaneResolutionUnit= 2
TAG:ExifIFD/SensingMethod= 2
TAG:ExifIFD/FileSource= 3
TAG:ExifIFD/CustomRendered= 0
TAG:ExifIFD/ExposureMode= 0
TAG:ExifIFD/WhiteBalance= 0
-TAG:ExifIFD/DigitalZoomRatio= 4000:4000
+TAG:ExifIFD/DigitalZoomRatio= 4000:4000
TAG:ExifIFD/SceneCaptureType= 0
TAG:IFD1/Compression= 6
-TAG:IFD1/XResolution= 180:1
-TAG:IFD1/YResolution= 180:1
+TAG:IFD1/XResolution= 180:1
+TAG:IFD1/YResolution= 180:1
TAG:IFD1/ResolutionUnit= 2
TAG:IFD1/JPEGInterchangeFormat= 5108
TAG:IFD1/JPEGInterchangeFormatLength= 4214
diff --git a/tests/ref/fate/filter-pixdesc-yuvj411p b/tests/ref/fate/filter-pixdesc-yuvj411p
index 5937eac088..174a5c6328 100644
--- a/tests/ref/fate/filter-pixdesc-yuvj411p
+++ b/tests/ref/fate/filter-pixdesc-yuvj411p
@@ -1 +1 @@
-pixdesc-yuvj411p 18a0102c91a902b35cdcd4518fd0d5f6
+pixdesc-yuv411p 18a0102c91a902b35cdcd4518fd0d5f6
diff --git a/tests/ref/fate/filter-pixdesc-yuvj420p b/tests/ref/fate/filter-pixdesc-yuvj420p
index d63b26ae66..d191eab8cb 100644
--- a/tests/ref/fate/filter-pixdesc-yuvj420p
+++ b/tests/ref/fate/filter-pixdesc-yuvj420p
@@ -1 +1 @@
-pixdesc-yuvj420p feb0bb45dd8b42cbd2f0d11f83788475
+pixdesc-yuv420p feb0bb45dd8b42cbd2f0d11f83788475
diff --git a/tests/ref/fate/filter-pixdesc-yuvj422p b/tests/ref/fate/filter-pixdesc-yuvj422p
index cc805d911d..ec11007953 100644
--- a/tests/ref/fate/filter-pixdesc-yuvj422p
+++ b/tests/ref/fate/filter-pixdesc-yuvj422p
@@ -1 +1 @@
-pixdesc-yuvj422p ba25ea3750108640dd88c385c6ed0175
+pixdesc-yuv422p ba25ea3750108640dd88c385c6ed0175
diff --git a/tests/ref/fate/filter-pixdesc-yuvj440p b/tests/ref/fate/filter-pixdesc-yuvj440p
index 94317a62a7..3efa1b924c 100644
--- a/tests/ref/fate/filter-pixdesc-yuvj440p
+++ b/tests/ref/fate/filter-pixdesc-yuvj440p
@@ -1 +1 @@
-pixdesc-yuvj440p afaf46d13fb4d4c1f0164fabed463711
+pixdesc-yuv440p afaf46d13fb4d4c1f0164fabed463711
diff --git a/tests/ref/fate/filter-pixdesc-yuvj444p b/tests/ref/fate/filter-pixdesc-yuvj444p
index 9683da88e9..4be85566d0 100644
--- a/tests/ref/fate/filter-pixdesc-yuvj444p
+++ b/tests/ref/fate/filter-pixdesc-yuvj444p
@@ -1 +1 @@
-pixdesc-yuvj444p 4cded942b533c402bea4c7d4cf3b739c
+pixdesc-yuv444p 4cded942b533c402bea4c7d4cf3b739c
diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy
index 1b6e658fe8..d1f67ba18f 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -194,10 +194,5 @@ yuva444p16be c80c1899789a6411d0025730efc8f01c
yuva444p16le 2ed56ea50fafda4d226c9b133755dad8
yuva444p9be 4903fde22b15d28da90761ac1cfcb1c5
yuva444p9le 4eeb5988df0740fea720da1e31bbb829
-yuvj411p 67dbbd68435f69091d72e253a61a3641
-yuvj420p 0a9cf3fd82e21a41c374f2507e13e193
-yuvj422p 0b289e2ecb8a195fa3388a4beba3b1db
-yuvj440p 4ed2c2d7308200866b203938d2e68750
-yuvj444p 8ca4bda333cecce561e393f608d8f21c
yuyv422 435c92283b538aa3d8fa2a020b0afd49
yvyu422 8436c2a760291cc979e0dd62ab8cede0
diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop
index aac5fe298b..c7f42d1315 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -188,8 +188,3 @@ yuva444p16be f817caf234aaf5848b2bc9679582ed56
yuva444p16le b32ad623fc423f897ff31c4073ea2a6f
yuva444p9be 48498d994c3c9070f31773e39da306dd
yuva444p9le 431b0ac211a8f81c15f38fb57a73530c
-yuvj411p f349428b1f2432d21d998a068b00900a
-yuvj420p 34be9c2f1c40043895f5cf0de5e018ec
-yuvj422p 0ca9d0dd14049138fb82299efb898753
-yuvj440p 9480dd81040fb3b8c68df691e59c7a72
-yuvj444p 3acac763142b746d88fd4ad72c490b53
diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field
index 603bc22615..4052637faa 100644
--- a/tests/ref/fate/filter-pixfmts-field
+++ b/tests/ref/fate/filter-pixfmts-field
@@ -194,10 +194,5 @@ yuva444p16be b10fd7c1b61ac22bdb285f0d91a390f1
yuva444p16le cac82ffc36b7052747407663fc5ed510
yuva444p9be a6f66d08b3370fdd90987a6143b7b91c
yuva444p9le 8d0f0b0840096127613920984078ce53
-yuvj411p 88f53643aa680daea2caa4f256c1b25b
-yuvj420p ca255b8e8d54164aa22767b0023c74a5
-yuvj422p ff0af01feebeccfca582516985e69bd5
-yuvj440p f47ecb3d2a6307bf19d220f4b3b2d444
-yuvj444p ff0ced6cbedba2287e5c228ff770e6b0
yuyv422 449ca8d4b5a28ccaaa342860b24aeb3c
yvyu422 6b226a0d4fce5478294d3bd4ecfb46a5
diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder
index 2e9ab58d58..b6be0af23b 100644
--- a/tests/ref/fate/filter-pixfmts-fieldorder
+++ b/tests/ref/fate/filter-pixfmts-fieldorder
@@ -159,8 +159,5 @@ yuva444p16be 2f80d411847856e1364659dee8b23485
yuva444p16le 5796be8d66371b60037fc8053c27e900
yuva444p9be a83599c0e9fca08f6b7c6e02c2413fcf
yuva444p9le 390fcd8f72ee407a8c338667944e3f72
-yuvj411p 04ef16621d2d15181abf0a4a7ac54911
-yuvj422p 726ed34be6c17fc06a6578938e521cef
-yuvj444p 96b58313489871e23be315c8b55a07ea
yuyv422 a923c5bd4889bec92d872237f6a578ec
yvyu422 d7a8697f1f5e6a2a27b0df17811b2613
diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip
index 5889c6caa4..bff4e5a348 100644
--- a/tests/ref/fate/filter-pixfmts-hflip
+++ b/tests/ref/fate/filter-pixfmts-hflip
@@ -188,8 +188,3 @@ yuva444p16be 635fb2720470e0042a7c9b70bf908a2c
yuva444p16le 6d5bd13f8bb804bd1158c1af732a24e1
yuva444p9be 3d3e7491192aa4e396015bf8e3755a24
yuva444p9le 31727b34bc3d5ce726681e90557d39e4
-yuvj411p f82636855f2597a3345952904e90560d
-yuvj420p 1add091d3bf99bbe2fc9baa5ed18584a
-yuvj422p 473662bcf83634f9942f3909394d2d74
-yuvj440p 15ebc6787b99d3901d2891bf23020ac8
-yuvj444p 959fc8c56f2fe80350deec13d9eef3f8
diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il
index 03ff9c9224..9186ee7bfe 100644
--- a/tests/ref/fate/filter-pixfmts-il
+++ b/tests/ref/fate/filter-pixfmts-il
@@ -193,10 +193,5 @@ yuva444p16be 97f8cb6ed835c7c5cd2fb112b1e135c7
yuva444p16le 47170401a8c348d3f05f6530607d066b
yuva444p9be d5c0170b41221a9607e6ae586880a383
yuva444p9le 4948983313f46180666dec85ef30130c
-yuvj411p 1bdc97d882ca5372114b0792ce19bdbc
-yuvj420p 7214579275e6a21effb362373701d205
-yuvj422p 089ad550804d0596d6134d1331a5707e
-yuvj440p 7be4c15f306fc54691268f04ae6894ee
-yuvj444p d8de19b4639781f794853b6615b4b697
yuyv422 09af5b85deecfeaef2e00e00fbc12a49
yvyu422 62c62a80939c34fb7890c0e7791a0321
diff --git a/tests/ref/fate/filter-pixfmts-lut b/tests/ref/fate/filter-pixfmts-lut
index c7e994fac0..7cda0bf70f 100644
--- a/tests/ref/fate/filter-pixfmts-lut
+++ b/tests/ref/fate/filter-pixfmts-lut
@@ -51,7 +51,3 @@ yuva422p 5938a7c7588febb069bd0cd4c447305e
yuva422p16le c5ccfdc1a0dc6cb130c07ea61df6f727
yuva444p fbcbdc3521d17c702ee521b0893098e4
yuva444p16le b7142d28d4d069d7eb019dcaf8b323b1
-yuvj420p 71bcdc1f65570d299b7390168e69584f
-yuvj422p afcafe8c191d87c3f28a1aab476130f4
-yuvj440p 47e5b1d78e946a78c6b00a5896428146
-yuvj444p e209853f9c77e043a68f6e4ce004c60b
diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null
index 1b6e658fe8..d1f67ba18f 100644
--- a/tests/ref/fate/filter-pixfmts-null
+++ b/tests/ref/fate/filter-pixfmts-null
@@ -194,10 +194,5 @@ yuva444p16be c80c1899789a6411d0025730efc8f01c
yuva444p16le 2ed56ea50fafda4d226c9b133755dad8
yuva444p9be 4903fde22b15d28da90761ac1cfcb1c5
yuva444p9le 4eeb5988df0740fea720da1e31bbb829
-yuvj411p 67dbbd68435f69091d72e253a61a3641
-yuvj420p 0a9cf3fd82e21a41c374f2507e13e193
-yuvj422p 0b289e2ecb8a195fa3388a4beba3b1db
-yuvj440p 4ed2c2d7308200866b203938d2e68750
-yuvj444p 8ca4bda333cecce561e393f608d8f21c
yuyv422 435c92283b538aa3d8fa2a020b0afd49
yvyu422 8436c2a760291cc979e0dd62ab8cede0
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 8298a466de..2c5c13ada4 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -90,8 +90,3 @@ yuva444p10le 89491ef450706faf23341e401750d907
yuva444p12le 06c47dba21328165dbb7ebb3da0a2fde
yuva444p16le d089b119c8dc964de9af12bfb38f89a0
yuva444p9le b824d34ac49a1dc483c772e15310afcd
-yuvj411p 3641e9cfcd38752ca4b1a242d2a1fc0b
-yuvj420p 88db26ee91dd2990bfdf06ff8c8c8f57
-yuvj422p 26cae841df5895d608beb503b907140e
-yuvj440p 7ff2535d39422812244eeff1063e914a
-yuvj444p 60ecc271b6970ece77e3a56e2486dbbf
diff --git a/tests/ref/fate/filter-pixfmts-pullup b/tests/ref/fate/filter-pixfmts-pullup
index 0bd6a6d404..d2f927a0c9 100644
--- a/tests/ref/fate/filter-pixfmts-pullup
+++ b/tests/ref/fate/filter-pixfmts-pullup
@@ -5,8 +5,3 @@ yuv420p dba6303cd02cc39cb0db7b546793d565
yuv422p d7d3224dd900bb1b96608a28a704360d
yuv440p d4c5f20701cfceb4bbf7d75cfcc13514
yuv444p 7e405274037e7f2ab845d7413a71e16d
-yuvj411p fc9379ec7366590d30969edcf3b57a34
-yuvj420p 41805a9270bdc49f37f049630c9d093e
-yuvj422p 69ecb8337053d99addbeb02274905278
-yuvj440p 160220c47348613e633ffabffa2680d2
-yuvj444p 1cab9e5cfd0cebc27685a6389b3ca628
diff --git a/tests/ref/fate/filter-pixfmts-rotate b/tests/ref/fate/filter-pixfmts-rotate
index d20f69e35d..3aa21aff77 100644
--- a/tests/ref/fate/filter-pixfmts-rotate
+++ b/tests/ref/fate/filter-pixfmts-rotate
@@ -30,5 +30,3 @@ yuva444p 459fad5abfd16db9bb6a52761dc74cc1
yuva444p10le 92f820d3481b7ebcb48b98a73e7b4c90
yuva444p16le 2ed56ea50fafda4d226c9b133755dad8
yuva444p9le 4eeb5988df0740fea720da1e31bbb829
-yuvj420p 0a9cf3fd82e21a41c374f2507e13e193
-yuvj444p 8ca4bda333cecce561e393f608d8f21c
diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale
index a6520f25ed..c7037f93bd 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -194,10 +194,5 @@ yuva444p16be 39ca2e32aa61b210b6c528855d24a16b
yuva444p16le cd2e0a001d8175f2204b2eb411c6a801
yuva444p9be 58add24afbf43ff0ff7079cc1948fb56
yuva444p9le 077c8cec2c374163d7f7eae27e797bdb
-yuvj411p 2401636f58cf8e911c9cdf1431a915d8
-yuvj420p 167c8934870f1ca5f35cb3a759787ab5
-yuvj422p 66cd02c88bf976a2c43169d754c926df
-yuvj440p 5f5c9b6409c72763bfadd0d8a7c6d2a2
-yuvj444p 38f6673abdda019da95c599fc8d97a95
yuyv422 1704675eff94ad0a03a9a6a3ddf5e0df
yvyu422 516705a40f43d00e9c41ff47f4f7b802
diff --git a/tests/ref/fate/filter-pixfmts-swapuv b/tests/ref/fate/filter-pixfmts-swapuv
index ad920a30a6..bf6e5c08c3 100644
--- a/tests/ref/fate/filter-pixfmts-swapuv
+++ b/tests/ref/fate/filter-pixfmts-swapuv
@@ -63,8 +63,3 @@ yuva444p16be 356d72791dfd91861b21630e315d40cb
yuva444p16le 176591ce074ba8befc5fb279446ca1be
yuva444p9be 675f0ed3e6572b05f06d9e44611bdff5
yuva444p9le bf3ea2bf123a3a1ceedf587682b85cb9
-yuvj411p 85ae008a292a2b842cbea92e6a63ed37
-yuvj420p b66294e68ef7b7d4b5837eeb17d588d4
-yuvj422p 2aa36cf2b98c09cfd1f03ccd85f1c0fd
-yuvj440p 367b9512d35ad577235ee6961901c6cb
-yuvj444p a09280cac36de6900600c1e0d65be773
diff --git a/tests/ref/fate/filter-pixfmts-tinterlace_cvlpf b/tests/ref/fate/filter-pixfmts-tinterlace_cvlpf
index b05940b301..df269b9a7c 100644
--- a/tests/ref/fate/filter-pixfmts-tinterlace_cvlpf
+++ b/tests/ref/fate/filter-pixfmts-tinterlace_cvlpf
@@ -19,7 +19,3 @@ yuva422p a8da2806e21a88449079faa7f4303ffa
yuva422p10le d2965b5b5a43a7165badaff0718a17d8
yuva444p a3f57734d6f72bdf37f8f612ea7cce63
yuva444p10le e020512901fd9ac7088898a4e3a8c7c1
-yuvj420p 44a5ce08fb8eed18a2ceed2959e67e40
-yuvj422p 31de0ff3ff4e4ca2cf503b782f69070e
-yuvj440p 463d3d8f56d8af6ea280e9a4911ba331
-yuvj444p 8389c81a4fa361eb6478f3334fb2bb5d
diff --git a/tests/ref/fate/filter-pixfmts-tinterlace_merge b/tests/ref/fate/filter-pixfmts-tinterlace_merge
index 25b56447e5..7b0026faee 100644
--- a/tests/ref/fate/filter-pixfmts-tinterlace_merge
+++ b/tests/ref/fate/filter-pixfmts-tinterlace_merge
@@ -19,7 +19,3 @@ yuva422p ca200be80e5bfdb159e1aea57129ed3a
yuva422p10le 06d4f79ee2ddf31d9fe15af8ca573f46
yuva444p 9f39c35d6899dcb8b9a9b07c339ca365
yuva444p10le b0c54fc3efad73f252d86127407aa1fd
-yuvj420p f933fa05b7fe09fea0f1a90b279a7194
-yuvj422p 3aa4f861ea20059bb5deb161a3001535
-yuvj440p ac226a62a32b15896ca618b081c90b0d
-yuvj444p c0a55eee0091813bb82953e3cef4a468
diff --git a/tests/ref/fate/filter-pixfmts-tinterlace_pad b/tests/ref/fate/filter-pixfmts-tinterlace_pad
index 7239a66b90..5cf2bc95dd 100644
--- a/tests/ref/fate/filter-pixfmts-tinterlace_pad
+++ b/tests/ref/fate/filter-pixfmts-tinterlace_pad
@@ -19,7 +19,3 @@ yuva422p 3426ed1ac9429202d8c29fa62a04d4c3
yuva422p10le 5c62eaf71afec3f7bc7ae5a327431434
yuva444p 1b9fc791c7d774b4ba8c9dc836f78cf5
yuva444p10le b6161c0f6f5548ba4346a9fda20ea8a8
-yuvj420p a3accf17383fc63684592f1d81a7da25
-yuvj422p b47bf3bd7f3f7f0e071f49e2cb7012df
-yuvj440p 1a499b6ea885c7a45ca3513b77984c98
-yuvj444p ed0f04a897d3e64e936c46a782f356d6
diff --git a/tests/ref/fate/filter-pixfmts-tinterlace_vlpf b/tests/ref/fate/filter-pixfmts-tinterlace_vlpf
index cd925988b9..0f64dd882c 100644
--- a/tests/ref/fate/filter-pixfmts-tinterlace_vlpf
+++ b/tests/ref/fate/filter-pixfmts-tinterlace_vlpf
@@ -19,7 +19,3 @@ yuva422p ef8fdbe910d68e88e98227b0e99fb5a6
yuva422p10le 257a4aec41f9b5412179272d8a7fb6f7
yuva444p 3662eadd5f61a6edbc9d715ea8591415
yuva444p10le 0905cf5b7f42c11be3f0486a66533c71
-yuvj420p 0dd3b4d6e6c3d2e8f5420b27b6f9d8e8
-yuvj422p 3499d87db825261e5189ab572d1a08b7
-yuvj440p c63819b04a68e3803665750784af0782
-yuvj444p 49944ca98c5cc5c402dbce8b6a2b99c0
diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose
index ebb70d15ed..736315cda2 100644
--- a/tests/ref/fate/filter-pixfmts-transpose
+++ b/tests/ref/fate/filter-pixfmts-transpose
@@ -152,5 +152,3 @@ yuva444p16be 9fd2f00ea9bef8e488228bc0b47b28cb
yuva444p16le ae9fd8d1baea0f8626b963816d667d2d
yuva444p9be 4ce11ae57780f74c78cdd5c06be4bded
yuva444p9le 1b9cc85fd6ab0c7e240915a99e98d1c1
-yuvj420p fb2ebba474f99a55ac838c4e0f950f6a
-yuvj444p 835a79483337d82d718175d8c6dc518c
diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip
index e86e9d84e5..3a142e072e 100644
--- a/tests/ref/fate/filter-pixfmts-vflip
+++ b/tests/ref/fate/filter-pixfmts-vflip
@@ -194,10 +194,5 @@ yuva444p16be b8801dccf64b3eadc2a5b5db67ae0b0f
yuva444p16le 8e72ae66754badf5d1eeb094e6bf0ddc
yuva444p9be bcd845394351ca6d15e947342802957d
yuva444p9le 7727a93765ed38dfd25e3d6b7a38fa63
-yuvj411p fa5da1f6226569c94efccbc671df3d84
-yuvj420p 8bd847bf657dd9fe56a51643e36414d7
-yuvj422p dac8e174636fc8fab7c7eb3696a89051
-yuvj440p 2ebca25177e3a4ae7f2c18171ce487c7
-yuvj444p ee369e7f804a26a992e4d353c78b5126
yuyv422 8f02b2332fe9bb782f88627c99f32ee8
yvyu422 bd8cb985c2e1f9c32dc6b865bdf20637
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index ccd1522ef2..3293c95901 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -67,9 +67,6 @@ gray planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0
monow planes: 1, linesizes: 8 0 0 0, plane_sizes: 384 0 0 0, plane_offsets: 0 0 0, total_size: 384
monob planes: 1, linesizes: 8 0 0 0, plane_sizes: 384 0 0 0, plane_offsets: 0 0 0, total_size: 384
pal8 planes: 2, linesizes: 64 0 0 0, plane_sizes: 3072 1024 0 0, plane_offsets: 3072 0 0, total_size: 4096
-yuvj420p planes: 3, linesizes: 64 32 32 0, plane_sizes: 3072 768 768 0, plane_offsets: 3072 768 0, total_size: 4608
-yuvj422p planes: 3, linesizes: 64 32 32 0, plane_sizes: 3072 1536 1536 0, plane_offsets: 3072 1536 0, total_size: 6144
-yuvj444p planes: 3, linesizes: 64 64 64 0, plane_sizes: 3072 3072 3072 0, plane_offsets: 3072 3072 0, total_size: 9216
uyvy422 planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144
uyyvyy411 planes: 1, linesizes: 96 0 0 0, plane_sizes: 4608 0 0 0, plane_offsets: 0 0 0, total_size: 4608
bgr8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072
@@ -87,7 +84,6 @@ bgra planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0
gray16be planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144
gray16le planes: 1, linesizes: 128 0 0 0, plane_sizes: 6144 0 0 0, plane_offsets: 0 0 0, total_size: 6144
yuv440p planes: 3, linesizes: 64 64 64 0, plane_sizes: 3072 1536 1536 0, plane_offsets: 3072 1536 0, total_size: 6144
-yuvj440p planes: 3, linesizes: 64 64 64 0, plane_sizes: 3072 1536 1536 0, plane_offsets: 3072 1536 0, total_size: 6144
yuva420p planes: 4, linesizes: 64 32 32 64, plane_sizes: 3072 768 768 3072, plane_offsets: 3072 768 768, total_size: 7680
rgb48be planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
rgb48le planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
@@ -186,7 +182,6 @@ gbrp12be planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144
gbrp12le planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432
gbrp14be planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432
gbrp14le planes: 3, linesizes: 128 128 128 0, plane_sizes: 6144 6144 6144 0, plane_offsets: 6144 6144 0, total_size: 18432
-yuvj411p planes: 3, linesizes: 64 16 16 0, plane_sizes: 3072 768 768 0, plane_offsets: 3072 768 0, total_size: 4608
bayer_bggr8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072
bayer_rggb8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072
bayer_gbrg8 planes: 1, linesizes: 64 0 0 0, plane_sizes: 3072 0 0 0, plane_offsets: 0 0 0, total_size: 3072
@@ -320,9 +315,6 @@ gray total_size: 3072, black_unknown_crc: 0x63e301a2, black_tv_cr
monow total_size: 384, black_unknown_crc: 0x1ba3e150, black_tv_crc: 0x1ba3e150, black_pc_crc: 0x1ba3e150
monob total_size: 384, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
pal8 total_size: 4096, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
-yuvj420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
-yuvj422p total_size: 6144, black_unknown_crc: 0x71fcc79c, black_tv_crc: 0x71fcc79c, black_pc_crc: 0xa9fa0192
-yuvj444p total_size: 9216, black_unknown_crc: 0x1c302b58, black_tv_crc: 0x1c302b58, black_pc_crc: 0xdf792ea7
uyvy422 total_size: 6144, black_unknown_crc: 0xaf9476bb, black_tv_crc: 0xaf9476bb, black_pc_crc: 0x16a51378
uyyvyy411 total_size: 4608, black_unknown_crc: 0x6f8b7288, black_tv_crc: 0x6f8b7288, black_pc_crc: 0x9f9c5552
bgr8 total_size: 3072, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
@@ -340,7 +332,6 @@ bgra total_size: 12288, black_unknown_crc: 0xf15ae524, black_tv_cr
gray16be total_size: 6144, black_unknown_crc: 0x02d4a26f, black_tv_crc: 0x02d4a26f, black_pc_crc: 0x00000000
gray16le total_size: 6144, black_unknown_crc: 0xb93165c3, black_tv_crc: 0xb93165c3, black_pc_crc: 0x00000000
yuv440p total_size: 6144, black_unknown_crc: 0x71fcc79c, black_tv_crc: 0x71fcc79c, black_pc_crc: 0xa9fa0192
-yuvj440p total_size: 6144, black_unknown_crc: 0x71fcc79c, black_tv_crc: 0x71fcc79c, black_pc_crc: 0xa9fa0192
yuva420p total_size: 7680, black_unknown_crc: 0x0bcc140f, black_tv_crc: 0x0bcc140f, black_pc_crc: 0xa724ab23
rgb48be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
rgb48le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
@@ -439,7 +430,6 @@ gbrp12be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_cr
gbrp12le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
gbrp14be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
gbrp14le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
-yuvj411p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
bayer_bggr8 total_size: 3072, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
bayer_rggb8 total_size: 3072, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
bayer_gbrg8 total_size: 3072, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
diff --git a/tests/ref/fate/jpg-icc b/tests/ref/fate/jpg-icc
index 048a02c084..7e2ef334fc 100644
--- a/tests/ref/fate/jpg-icc
+++ b/tests/ref/fate/jpg-icc
@@ -26,7 +26,7 @@ crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
-pix_fmt=yuvj444p
+pix_fmt=yuv444p
sample_aspect_ratio=1:1
pict_type=I
interlaced_frame=0
diff --git a/tests/ref/fate/sws-ops-list b/tests/ref/fate/sws-ops-list
index b5fc179208..15819c4d6b 100644
--- a/tests/ref/fate/sws-ops-list
+++ b/tests/ref/fate/sws-ops-list
@@ -1 +1 @@
-133f2f3066e2a853f6e77be084c9cd75
+284df999a27e36baa7607d7f0e771f1f
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index a062088d54..5d5a069c4b 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -385,11 +385,6 @@ isYUV:
yuva444p16le
yuva444p9be
yuva444p9le
- yuvj411p
- yuvj420p
- yuvj422p
- yuvj440p
- yuvj444p
yuyv422
yvyu422
@@ -488,11 +483,6 @@ isPlanarYUV:
yuva444p16le
yuva444p9be
yuva444p9le
- yuvj411p
- yuvj420p
- yuvj422p
- yuvj440p
- yuvj444p
isSemiPlanarYUV:
nv12
@@ -1104,11 +1094,6 @@ Planar:
yuva444p16le
yuva444p9be
yuva444p9le
- yuvj411p
- yuvj420p
- yuvj422p
- yuvj440p
- yuvj444p
PackedRGB:
0bgr
diff --git a/tests/ref/pixfmt/gbrp-yuvj420p b/tests/ref/pixfmt/gbrp-yuvj420p
deleted file mode 100644
index 7f64d13e06..0000000000
--- a/tests/ref/pixfmt/gbrp-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-301e909b668c2e0af61bf3c6b0e0989f *tests/data/pixfmt/gbrp-yuvj420p.yuv
-7603200 tests/data/pixfmt/gbrp-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/gbrp-yuvj422p b/tests/ref/pixfmt/gbrp-yuvj422p
deleted file mode 100644
index d8617c5027..0000000000
--- a/tests/ref/pixfmt/gbrp-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-b840b315cd2b85dac8a9882c8baa0584 *tests/data/pixfmt/gbrp-yuvj422p.yuv
-7603200 tests/data/pixfmt/gbrp-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/gbrp-yuvj440p b/tests/ref/pixfmt/gbrp-yuvj440p
deleted file mode 100644
index 8fb57c8d35..0000000000
--- a/tests/ref/pixfmt/gbrp-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-efc096da207463eac84598273a2452f3 *tests/data/pixfmt/gbrp-yuvj440p.yuv
-7603200 tests/data/pixfmt/gbrp-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/gbrp-yuvj444p b/tests/ref/pixfmt/gbrp-yuvj444p
deleted file mode 100644
index 268f8540d0..0000000000
--- a/tests/ref/pixfmt/gbrp-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-f1f74a234b8600021062612c49651890 *tests/data/pixfmt/gbrp-yuvj444p.yuv
-7603200 tests/data/pixfmt/gbrp-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/gbrp10-yuvj420p b/tests/ref/pixfmt/gbrp10-yuvj420p
deleted file mode 100644
index 911b2443f1..0000000000
--- a/tests/ref/pixfmt/gbrp10-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-ab5222406f8d46e0db8cddff1a3ca275 *tests/data/pixfmt/gbrp10-yuvj420p.yuv
-15206400 tests/data/pixfmt/gbrp10-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/gbrp10-yuvj422p b/tests/ref/pixfmt/gbrp10-yuvj422p
deleted file mode 100644
index f982547d41..0000000000
--- a/tests/ref/pixfmt/gbrp10-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-4090017583e5a9ef6257f6d5056f7907 *tests/data/pixfmt/gbrp10-yuvj422p.yuv
-15206400 tests/data/pixfmt/gbrp10-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/gbrp10-yuvj440p b/tests/ref/pixfmt/gbrp10-yuvj440p
deleted file mode 100644
index 848da65dcb..0000000000
--- a/tests/ref/pixfmt/gbrp10-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-8349bf8b6f8832cede89929f05b5c31e *tests/data/pixfmt/gbrp10-yuvj440p.yuv
-15206400 tests/data/pixfmt/gbrp10-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/gbrp10-yuvj444p b/tests/ref/pixfmt/gbrp10-yuvj444p
deleted file mode 100644
index ffd360461d..0000000000
--- a/tests/ref/pixfmt/gbrp10-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-006c42647ec64eb0a8277095261fa8c9 *tests/data/pixfmt/gbrp10-yuvj444p.yuv
-15206400 tests/data/pixfmt/gbrp10-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/gbrp12-yuvj420p b/tests/ref/pixfmt/gbrp12-yuvj420p
deleted file mode 100644
index ab62af0f42..0000000000
--- a/tests/ref/pixfmt/gbrp12-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-f4f1efb89df5a71a4399d63772699ed8 *tests/data/pixfmt/gbrp12-yuvj420p.yuv
-15206400 tests/data/pixfmt/gbrp12-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/gbrp12-yuvj422p b/tests/ref/pixfmt/gbrp12-yuvj422p
deleted file mode 100644
index 4d23075013..0000000000
--- a/tests/ref/pixfmt/gbrp12-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-c54457dbabb20263d6f170e8e232e91c *tests/data/pixfmt/gbrp12-yuvj422p.yuv
-15206400 tests/data/pixfmt/gbrp12-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/gbrp12-yuvj440p b/tests/ref/pixfmt/gbrp12-yuvj440p
deleted file mode 100644
index a69d410eb3..0000000000
--- a/tests/ref/pixfmt/gbrp12-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-8b9c2b3189a51b74253a791789e08f67 *tests/data/pixfmt/gbrp12-yuvj440p.yuv
-15206400 tests/data/pixfmt/gbrp12-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/gbrp12-yuvj444p b/tests/ref/pixfmt/gbrp12-yuvj444p
deleted file mode 100644
index 239a5a4f41..0000000000
--- a/tests/ref/pixfmt/gbrp12-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-c7dcfb73355e6eeb7df2a8962ef461e1 *tests/data/pixfmt/gbrp12-yuvj444p.yuv
-15206400 tests/data/pixfmt/gbrp12-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/nv24-yuvj420p b/tests/ref/pixfmt/nv24-yuvj420p
deleted file mode 100644
index 1e343358f2..0000000000
--- a/tests/ref/pixfmt/nv24-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-3e63bf34939dc4407ee53a77bb215984 *tests/data/pixfmt/nv24-yuvj420p.yuv
-7603200 tests/data/pixfmt/nv24-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/nv24-yuvj422p b/tests/ref/pixfmt/nv24-yuvj422p
deleted file mode 100644
index a14e423807..0000000000
--- a/tests/ref/pixfmt/nv24-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-253a47902a3218c394ae1d509781e5c4 *tests/data/pixfmt/nv24-yuvj422p.yuv
-7603200 tests/data/pixfmt/nv24-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/nv24-yuvj440p b/tests/ref/pixfmt/nv24-yuvj440p
deleted file mode 100644
index 68e540a421..0000000000
--- a/tests/ref/pixfmt/nv24-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-3357f7089e57f9b7f938eeaaf09258e3 *tests/data/pixfmt/nv24-yuvj440p.yuv
-7603200 tests/data/pixfmt/nv24-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/nv24-yuvj444p b/tests/ref/pixfmt/nv24-yuvj444p
deleted file mode 100644
index 66a275feaf..0000000000
--- a/tests/ref/pixfmt/nv24-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-7fef653839fbdeb2d94aa3751d39aa39 *tests/data/pixfmt/nv24-yuvj444p.yuv
-7603200 tests/data/pixfmt/nv24-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/p410-yuvj420p b/tests/ref/pixfmt/p410-yuvj420p
deleted file mode 100644
index 55c8c1b49f..0000000000
--- a/tests/ref/pixfmt/p410-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-9dcc222fab763c49979e6fd4fcff1e85 *tests/data/pixfmt/p410-yuvj420p.yuv
-15206400 tests/data/pixfmt/p410-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/p410-yuvj422p b/tests/ref/pixfmt/p410-yuvj422p
deleted file mode 100644
index 8f218651f0..0000000000
--- a/tests/ref/pixfmt/p410-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-260a1b411057a74d34c3ce6c2b1c97fd *tests/data/pixfmt/p410-yuvj422p.yuv
-15206400 tests/data/pixfmt/p410-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/p410-yuvj440p b/tests/ref/pixfmt/p410-yuvj440p
deleted file mode 100644
index bf901bedf2..0000000000
--- a/tests/ref/pixfmt/p410-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-a8e2b0dec03135484c33021ea56ee21a *tests/data/pixfmt/p410-yuvj440p.yuv
-15206400 tests/data/pixfmt/p410-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/p410-yuvj444p b/tests/ref/pixfmt/p410-yuvj444p
deleted file mode 100644
index 690b793fb4..0000000000
--- a/tests/ref/pixfmt/p410-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-84a4c14c57b7e45e14c4f5496cd159b7 *tests/data/pixfmt/p410-yuvj444p.yuv
-15206400 tests/data/pixfmt/p410-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/p412-yuvj420p b/tests/ref/pixfmt/p412-yuvj420p
deleted file mode 100644
index 4810a40fb8..0000000000
--- a/tests/ref/pixfmt/p412-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-d740329c080a1cc794bdf82a7e838895 *tests/data/pixfmt/p412-yuvj420p.yuv
-15206400 tests/data/pixfmt/p412-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/p412-yuvj422p b/tests/ref/pixfmt/p412-yuvj422p
deleted file mode 100644
index 39b3dea5f1..0000000000
--- a/tests/ref/pixfmt/p412-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-4327fbcd768af3da38606dc904c59ff8 *tests/data/pixfmt/p412-yuvj422p.yuv
-15206400 tests/data/pixfmt/p412-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/p412-yuvj440p b/tests/ref/pixfmt/p412-yuvj440p
deleted file mode 100644
index 718c727217..0000000000
--- a/tests/ref/pixfmt/p412-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-84f6469577c0d6eb62f326b4a2e7464c *tests/data/pixfmt/p412-yuvj440p.yuv
-15206400 tests/data/pixfmt/p412-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/p412-yuvj444p b/tests/ref/pixfmt/p412-yuvj444p
deleted file mode 100644
index 244c538088..0000000000
--- a/tests/ref/pixfmt/p412-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-5eb24f94a474f6cc73e66b2822d792c6 *tests/data/pixfmt/p412-yuvj444p.yuv
-15206400 tests/data/pixfmt/p412-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/rgb24-yuvj420p b/tests/ref/pixfmt/rgb24-yuvj420p
deleted file mode 100644
index af9a3e81cd..0000000000
--- a/tests/ref/pixfmt/rgb24-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-73c49bd42141d70395222c9824ce818f *tests/data/pixfmt/rgb24-yuvj420p.yuv
-7603200 tests/data/pixfmt/rgb24-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/rgb24-yuvj422p b/tests/ref/pixfmt/rgb24-yuvj422p
deleted file mode 100644
index 4e35dfc60e..0000000000
--- a/tests/ref/pixfmt/rgb24-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-92ef01928b33be7cae8423d45465d4a9 *tests/data/pixfmt/rgb24-yuvj422p.yuv
-7603200 tests/data/pixfmt/rgb24-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/rgb24-yuvj440p b/tests/ref/pixfmt/rgb24-yuvj440p
deleted file mode 100644
index 041ca0a735..0000000000
--- a/tests/ref/pixfmt/rgb24-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-2289d30c9609177364f9959c2b3c2ac8 *tests/data/pixfmt/rgb24-yuvj440p.yuv
-7603200 tests/data/pixfmt/rgb24-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/rgb24-yuvj444p b/tests/ref/pixfmt/rgb24-yuvj444p
deleted file mode 100644
index b274f7b670..0000000000
--- a/tests/ref/pixfmt/rgb24-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-627b869a34c9043c84a2affc477be6a7 *tests/data/pixfmt/rgb24-yuvj444p.yuv
-7603200 tests/data/pixfmt/rgb24-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/rgb48-yuvj420p b/tests/ref/pixfmt/rgb48-yuvj420p
deleted file mode 100644
index c97a7145d9..0000000000
--- a/tests/ref/pixfmt/rgb48-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-78bddf2ca95ec35f25ea8b4633563303 *tests/data/pixfmt/rgb48-yuvj420p.yuv
-15206400 tests/data/pixfmt/rgb48-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/rgb48-yuvj422p b/tests/ref/pixfmt/rgb48-yuvj422p
deleted file mode 100644
index 1efd6668b3..0000000000
--- a/tests/ref/pixfmt/rgb48-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-0514ff97ed7363523df0836be9a4c1de *tests/data/pixfmt/rgb48-yuvj422p.yuv
-15206400 tests/data/pixfmt/rgb48-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/rgb48-yuvj440p b/tests/ref/pixfmt/rgb48-yuvj440p
deleted file mode 100644
index 5333f4792b..0000000000
--- a/tests/ref/pixfmt/rgb48-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-554cf4ab9aecc476ef1112fcec2cb9a9 *tests/data/pixfmt/rgb48-yuvj440p.yuv
-15206400 tests/data/pixfmt/rgb48-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/rgb48-yuvj444p b/tests/ref/pixfmt/rgb48-yuvj444p
deleted file mode 100644
index 6ef1359157..0000000000
--- a/tests/ref/pixfmt/rgb48-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-b7c6bc24321536651cc787ef61a1faa7 *tests/data/pixfmt/rgb48-yuvj444p.yuv
-15206400 tests/data/pixfmt/rgb48-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/yuv444p-yuvj420p b/tests/ref/pixfmt/yuv444p-yuvj420p
deleted file mode 100644
index 528c01a6ed..0000000000
--- a/tests/ref/pixfmt/yuv444p-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-fa51ff35c52d3fabf6f0469c135148ed *tests/data/pixfmt/yuv444p-yuvj420p.yuv
-7603200 tests/data/pixfmt/yuv444p-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/yuv444p-yuvj422p b/tests/ref/pixfmt/yuv444p-yuvj422p
deleted file mode 100644
index c7e48bcb21..0000000000
--- a/tests/ref/pixfmt/yuv444p-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-feb48733429d0f12e80b2eca5bdfddc6 *tests/data/pixfmt/yuv444p-yuvj422p.yuv
-7603200 tests/data/pixfmt/yuv444p-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/yuv444p-yuvj440p b/tests/ref/pixfmt/yuv444p-yuvj440p
deleted file mode 100644
index c1f1f62bb9..0000000000
--- a/tests/ref/pixfmt/yuv444p-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-ec09941423086ed7510394b7a82d730a *tests/data/pixfmt/yuv444p-yuvj440p.yuv
-7603200 tests/data/pixfmt/yuv444p-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/yuv444p-yuvj444p b/tests/ref/pixfmt/yuv444p-yuvj444p
deleted file mode 100644
index 7aa38f41ee..0000000000
--- a/tests/ref/pixfmt/yuv444p-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-754c5309c258ecefab46388da7ba2b05 *tests/data/pixfmt/yuv444p-yuvj444p.yuv
-7603200 tests/data/pixfmt/yuv444p-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/yuv444p10-yuvj420p b/tests/ref/pixfmt/yuv444p10-yuvj420p
deleted file mode 100644
index c233674948..0000000000
--- a/tests/ref/pixfmt/yuv444p10-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-c787b8e538fb904f9a3f40c1ee9d7586 *tests/data/pixfmt/yuv444p10-yuvj420p.yuv
-15206400 tests/data/pixfmt/yuv444p10-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/yuv444p10-yuvj422p b/tests/ref/pixfmt/yuv444p10-yuvj422p
deleted file mode 100644
index 7cfca710d1..0000000000
--- a/tests/ref/pixfmt/yuv444p10-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-84404969f48125ab0f343b9395d2cd11 *tests/data/pixfmt/yuv444p10-yuvj422p.yuv
-15206400 tests/data/pixfmt/yuv444p10-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/yuv444p10-yuvj440p b/tests/ref/pixfmt/yuv444p10-yuvj440p
deleted file mode 100644
index 4b331adc1e..0000000000
--- a/tests/ref/pixfmt/yuv444p10-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-21d55776587d4e35688c105a36191467 *tests/data/pixfmt/yuv444p10-yuvj440p.yuv
-15206400 tests/data/pixfmt/yuv444p10-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/yuv444p10-yuvj444p b/tests/ref/pixfmt/yuv444p10-yuvj444p
deleted file mode 100644
index 3818602560..0000000000
--- a/tests/ref/pixfmt/yuv444p10-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-02c3d975c0ffa8c249b8b13690563bd0 *tests/data/pixfmt/yuv444p10-yuvj444p.yuv
-15206400 tests/data/pixfmt/yuv444p10-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/yuv444p12-yuvj420p b/tests/ref/pixfmt/yuv444p12-yuvj420p
deleted file mode 100644
index d7f544c8f1..0000000000
--- a/tests/ref/pixfmt/yuv444p12-yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-11ed85246a91ad73aca13db210b7ebc4 *tests/data/pixfmt/yuv444p12-yuvj420p.yuv
-15206400 tests/data/pixfmt/yuv444p12-yuvj420p.yuv
diff --git a/tests/ref/pixfmt/yuv444p12-yuvj422p b/tests/ref/pixfmt/yuv444p12-yuvj422p
deleted file mode 100644
index 84fc7a3c3a..0000000000
--- a/tests/ref/pixfmt/yuv444p12-yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-f011299144cd0ef576d36a3de080b954 *tests/data/pixfmt/yuv444p12-yuvj422p.yuv
-15206400 tests/data/pixfmt/yuv444p12-yuvj422p.yuv
diff --git a/tests/ref/pixfmt/yuv444p12-yuvj440p b/tests/ref/pixfmt/yuv444p12-yuvj440p
deleted file mode 100644
index 614a954427..0000000000
--- a/tests/ref/pixfmt/yuv444p12-yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-3b9814f03677c564dda7a0b1ad119ef3 *tests/data/pixfmt/yuv444p12-yuvj440p.yuv
-15206400 tests/data/pixfmt/yuv444p12-yuvj440p.yuv
diff --git a/tests/ref/pixfmt/yuv444p12-yuvj444p b/tests/ref/pixfmt/yuv444p12-yuvj444p
deleted file mode 100644
index 56494adca5..0000000000
--- a/tests/ref/pixfmt/yuv444p12-yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-3eeaeaca2526cb1fa7a342da4ef79a95 *tests/data/pixfmt/yuv444p12-yuvj444p.yuv
-15206400 tests/data/pixfmt/yuv444p12-yuvj444p.yuv
diff --git a/tests/ref/pixfmt/yuvj420p b/tests/ref/pixfmt/yuvj420p
deleted file mode 100644
index c977c32319..0000000000
--- a/tests/ref/pixfmt/yuvj420p
+++ /dev/null
@@ -1,2 +0,0 @@
-7d78d9b9eb4234cc5c1ca89239764794 *tests/data/pixfmt/yuvj420p.yuv
-304128 tests/data/pixfmt/yuvj420p.yuv
diff --git a/tests/ref/pixfmt/yuvj422p b/tests/ref/pixfmt/yuvj422p
deleted file mode 100644
index 05730adece..0000000000
--- a/tests/ref/pixfmt/yuvj422p
+++ /dev/null
@@ -1,2 +0,0 @@
-130613d20f324fd87e2b7425ff21179b *tests/data/pixfmt/yuvj422p.yuv
-304128 tests/data/pixfmt/yuvj422p.yuv
diff --git a/tests/ref/pixfmt/yuvj440p b/tests/ref/pixfmt/yuvj440p
deleted file mode 100644
index d2451964a9..0000000000
--- a/tests/ref/pixfmt/yuvj440p
+++ /dev/null
@@ -1,2 +0,0 @@
-421526f807bfec556780dfe85ea2375e *tests/data/pixfmt/yuvj440p.yuv
-304128 tests/data/pixfmt/yuvj440p.yuv
diff --git a/tests/ref/pixfmt/yuvj444p b/tests/ref/pixfmt/yuvj444p
deleted file mode 100644
index ef3f84bbff..0000000000
--- a/tests/ref/pixfmt/yuvj444p
+++ /dev/null
@@ -1,2 +0,0 @@
-8110de1663e6d3c69fcdfa6b5ba3de0e *tests/data/pixfmt/yuvj444p.yuv
-304128 tests/data/pixfmt/yuvj444p.yuv
--
2.52.0
1
0
I am writing on behalf of the U.S. National Park Service (NPS), representing staff who find ffmpeg/ffplay/ffprobe useful for scientific or audio/visual work. We work with ffmpeg both in the CLI and also as a way to extend file export in Audacity. We use ffprobe to quickly glean audio attributes.
Recently our agency adopted a policy which requires all software we use to be digitally signed. Does anyone in the community have the capacity to address this need? It would facilitate the mission of the NPS.
Thank you,
Halyn Betchkal
Biologist/Acoustician
5
9
23 Jun '26
PR #23566 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23566
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23566.patch
These helpers are also needed for uops.
From 82032d01f8a870aadf57ed933aa2376695b24ad3 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla(a)gmail.com>
Date: Tue, 23 Jun 2026 17:16:48 +0200
Subject: [PATCH] swscale/uops: move SWS_MASK* from ops.h to uops.h
These helpers are also needed for uops.
---
libswscale/ops.h | 21 ---------------------
libswscale/uops.h | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/libswscale/ops.h b/libswscale/ops.h
index 38e9fbcc26..f2a57612b4 100644
--- a/libswscale/ops.h
+++ b/libswscale/ops.h
@@ -198,27 +198,6 @@ typedef struct SwsLinearOp {
uint32_t mask; /* m[i][j] <-> 1 << (5 * i + j) */
} SwsLinearOp;
-#define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
-#define SWS_MASK_OFF(I) SWS_MASK(I, 4)
-#define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
-#define SWS_MASK_COL(J) (0x8421 << J)
-
-enum {
- SWS_MASK_ALL = (1 << 20) - 1,
- SWS_MASK_LUMA = SWS_MASK(0, 0) | SWS_MASK_OFF(0),
- SWS_MASK_ALPHA = SWS_MASK(3, 3),
-
- SWS_MASK_DIAG3 = SWS_MASK(0, 0) | SWS_MASK(1, 1) | SWS_MASK(2, 2),
- SWS_MASK_OFF3 = SWS_MASK_OFF(0) | SWS_MASK_OFF(1) | SWS_MASK_OFF(2),
- SWS_MASK_MAT3 = SWS_MASK(0, 0) | SWS_MASK(0, 1) | SWS_MASK(0, 2) |
- SWS_MASK(1, 0) | SWS_MASK(1, 1) | SWS_MASK(1, 2) |
- SWS_MASK(2, 0) | SWS_MASK(2, 1) | SWS_MASK(2, 2),
-
- SWS_MASK_DIAG4 = SWS_MASK_DIAG3 | SWS_MASK(3, 3),
- SWS_MASK_OFF4 = SWS_MASK_OFF3 | SWS_MASK_OFF(3),
- SWS_MASK_MAT4 = SWS_MASK_ALL & ~SWS_MASK_OFF4,
-};
-
/* Helper function to compute the correct mask */
uint32_t ff_sws_linear_mask(const SwsLinearOp *c);
diff --git a/libswscale/uops.h b/libswscale/uops.h
index 0098c46e05..c670c1f6ec 100644
--- a/libswscale/uops.h
+++ b/libswscale/uops.h
@@ -190,6 +190,27 @@ typedef struct SwsLinearUOp {
uint32_t exact; /* mask of coefficients whose product is exact */
} SwsLinearUOp;
+#define SWS_MASK(I, J) (1 << (5 * (I) + (J)))
+#define SWS_MASK_OFF(I) SWS_MASK(I, 4)
+#define SWS_MASK_ROW(I) (0x1F << (5 * (I)))
+#define SWS_MASK_COL(J) (0x8421 << J)
+
+enum {
+ SWS_MASK_ALL = (1 << 20) - 1,
+ SWS_MASK_LUMA = SWS_MASK(0, 0) | SWS_MASK_OFF(0),
+ SWS_MASK_ALPHA = SWS_MASK(3, 3),
+
+ SWS_MASK_DIAG3 = SWS_MASK(0, 0) | SWS_MASK(1, 1) | SWS_MASK(2, 2),
+ SWS_MASK_OFF3 = SWS_MASK_OFF(0) | SWS_MASK_OFF(1) | SWS_MASK_OFF(2),
+ SWS_MASK_MAT3 = SWS_MASK(0, 0) | SWS_MASK(0, 1) | SWS_MASK(0, 2) |
+ SWS_MASK(1, 0) | SWS_MASK(1, 1) | SWS_MASK(1, 2) |
+ SWS_MASK(2, 0) | SWS_MASK(2, 1) | SWS_MASK(2, 2),
+
+ SWS_MASK_DIAG4 = SWS_MASK_DIAG3 | SWS_MASK(3, 3),
+ SWS_MASK_OFF4 = SWS_MASK_OFF3 | SWS_MASK_OFF(3),
+ SWS_MASK_MAT4 = SWS_MASK_ALL & ~SWS_MASK_OFF4,
+};
+
typedef struct SwsDitherUOp {
uint8_t y_offset[4];
uint8_t size_log2;
--
2.52.0
1
0
23 Jun '26
PR #23565 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23565
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23565.patch
Uses an offset into the full name to get the macro name. Also spells
out the names of the types (not going through a macro) to make the code
easier to grep.
From 0e8d92399d01c0ab09b67e7c6d9db710a6ea76a9 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla(a)gmail.com>
Date: Tue, 23 Jun 2026 18:02:03 +0200
Subject: [PATCH] swscale/uops: reduce size of uop_names[] array
Uses an offset into the full name to get the macro name. Also spells
out the names of the types (not going through a macro) to make the code
easier to grep.
---
libswscale/uops.c | 77 +++++++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/libswscale/uops.c b/libswscale/uops.c
index 096621466c..c77a56b913 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -43,46 +43,43 @@ int ff_sws_uop_cmp(const SwsUOp *a, const SwsUOp *b)
static const struct {
char full[32];
char abbr[32];
- char macro[32];
} uop_names[SWS_UOP_TYPE_NB] = {
-#define UOP_NAME(OP, ABBR) [SWS_UOP_##OP] = { "SWS_UOP_" #OP, ABBR, #OP }
- UOP_NAME(INVALID, "invalid"),
- UOP_NAME(READ_PLANAR, "read_planar"),
- UOP_NAME(READ_PLANAR_FH, "read_planar_fh"),
- UOP_NAME(READ_PLANAR_FV, "read_planar_fv"),
- UOP_NAME(READ_PLANAR_FV_FMA,"read_planar_fv_fma"),
- UOP_NAME(READ_PACKED, "read_packed"),
- UOP_NAME(READ_NIBBLE, "read_nibble"),
- UOP_NAME(READ_BIT, "read_bit"),
- UOP_NAME(READ_PALETTE, "read_palette"),
- UOP_NAME(WRITE_PLANAR, "write_planar"),
- UOP_NAME(WRITE_PACKED, "write_packed"),
- UOP_NAME(WRITE_NIBBLE, "write_nibble"),
- UOP_NAME(WRITE_BIT, "write_bit"),
- UOP_NAME(PERMUTE, "permute"),
- UOP_NAME(COPY, "copy"),
- UOP_NAME(MOVE, "move"),
- UOP_NAME(SWAP_BYTES, "swap_bytes"),
- UOP_NAME(EXPAND_BIT, "expand_bit"),
- UOP_NAME(EXPAND_PAIR, "expand_pair"),
- UOP_NAME(EXPAND_QUAD, "expand_quad"),
- UOP_NAME(TO_U8, "to_u8"),
- UOP_NAME(TO_U16, "to_u16"),
- UOP_NAME(TO_U32, "to_u32"),
- UOP_NAME(TO_F32, "to_f32"),
- UOP_NAME(SCALE, "scale"),
- UOP_NAME(LINEAR, "linear"),
- UOP_NAME(LINEAR_FMA, "linear_fma"),
- UOP_NAME(ADD, "add"),
- UOP_NAME(MIN, "min"),
- UOP_NAME(MAX, "max"),
- UOP_NAME(UNPACK, "unpack"),
- UOP_NAME(PACK, "pack"),
- UOP_NAME(LSHIFT, "lshift"),
- UOP_NAME(RSHIFT, "rshift"),
- UOP_NAME(CLEAR, "clear"),
- UOP_NAME(DITHER, "dither"),
-#undef UOP_NAME
+ [SWS_UOP_INVALID] = { "SWS_UOP_INVALID", "invalid" },
+ [SWS_UOP_READ_PLANAR] = { "SWS_UOP_READ_PLANAR", "read_planar" },
+ [SWS_UOP_READ_PLANAR_FH] = { "SWS_UOP_READ_PLANAR_FH", "read_planar_fh" },
+ [SWS_UOP_READ_PLANAR_FV] = { "SWS_UOP_READ_PLANAR_FV", "read_planar_fv" },
+ [SWS_UOP_READ_PLANAR_FV_FMA] = { "SWS_UOP_READ_PLANAR_FV_FMA", "read_planar_fv_fma" },
+ [SWS_UOP_READ_PACKED] = { "SWS_UOP_READ_PACKED", "read_packed" },
+ [SWS_UOP_READ_NIBBLE] = { "SWS_UOP_READ_NIBBLE", "read_nibble" },
+ [SWS_UOP_READ_BIT] = { "SWS_UOP_READ_BIT", "read_bit" },
+ [SWS_UOP_READ_PALETTE] = { "SWS_UOP_READ_PALETTE", "read_palette" },
+ [SWS_UOP_WRITE_PLANAR] = { "SWS_UOP_WRITE_PLANAR", "write_planar" },
+ [SWS_UOP_WRITE_PACKED] = { "SWS_UOP_WRITE_PACKED", "write_packed" },
+ [SWS_UOP_WRITE_NIBBLE] = { "SWS_UOP_WRITE_NIBBLE", "write_nibble" },
+ [SWS_UOP_WRITE_BIT] = { "SWS_UOP_WRITE_BIT", "write_bit" },
+ [SWS_UOP_PERMUTE] = { "SWS_UOP_PERMUTE", "permute" },
+ [SWS_UOP_COPY] = { "SWS_UOP_COPY", "copy" },
+ [SWS_UOP_MOVE] = { "SWS_UOP_MOVE", "move" },
+ [SWS_UOP_SWAP_BYTES] = { "SWS_UOP_SWAP_BYTES", "swap_bytes" },
+ [SWS_UOP_EXPAND_BIT] = { "SWS_UOP_EXPAND_BIT", "expand_bit" },
+ [SWS_UOP_EXPAND_PAIR] = { "SWS_UOP_EXPAND_PAIR", "expand_pair" },
+ [SWS_UOP_EXPAND_QUAD] = { "SWS_UOP_EXPAND_QUAD", "expand_quad" },
+ [SWS_UOP_TO_U8] = { "SWS_UOP_TO_U8", "to_u8" },
+ [SWS_UOP_TO_U16] = { "SWS_UOP_TO_U16", "to_u16" },
+ [SWS_UOP_TO_U32] = { "SWS_UOP_TO_U32", "to_u32" },
+ [SWS_UOP_TO_F32] = { "SWS_UOP_TO_F32", "to_f32" },
+ [SWS_UOP_SCALE] = { "SWS_UOP_SCALE", "scale" },
+ [SWS_UOP_LINEAR] = { "SWS_UOP_LINEAR", "linear" },
+ [SWS_UOP_LINEAR_FMA] = { "SWS_UOP_LINEAR_FMA", "linear_fma" },
+ [SWS_UOP_ADD] = { "SWS_UOP_ADD", "add" },
+ [SWS_UOP_MIN] = { "SWS_UOP_MIN", "min" },
+ [SWS_UOP_MAX] = { "SWS_UOP_MAX", "max" },
+ [SWS_UOP_UNPACK] = { "SWS_UOP_UNPACK", "unpack" },
+ [SWS_UOP_PACK] = { "SWS_UOP_PACK", "pack" },
+ [SWS_UOP_LSHIFT] = { "SWS_UOP_LSHIFT", "lshift" },
+ [SWS_UOP_RSHIFT] = { "SWS_UOP_RSHIFT", "rshift" },
+ [SWS_UOP_CLEAR] = { "SWS_UOP_CLEAR", "clear" },
+ [SWS_UOP_DITHER] = { "SWS_UOP_DITHER", "dither" },
};
static const struct {
@@ -1057,7 +1054,7 @@ int ff_sws_uops_macros_gen(char **out_str)
SwsUOp key = { .data.opaque = bp };
for (key.type = SWS_PIXEL_NONE + 1; key.type < SWS_PIXEL_TYPE_NB; key.type++) {
for (key.uop = SWS_UOP_INVALID + 1; key.uop < SWS_UOP_TYPE_NB; key.uop++) {
- const char *macro = uop_names[key.uop].macro;
+ const char *macro = uop_names[key.uop].full + 8;
const char *prefix = pixel_types[key.type].prefix;
av_bprintf(bp, "#define SWS_FOR_%s%s(MACRO, ...)", prefix, macro);
av_tree_enumerate(root, &key, enum_type, generate_entry_args);
--
2.52.0
1
0
[PR] avutil/avcodec/avfilter: add CUARRAY (block-linear) CUDA surface support for zero-copy NVDEC→NVENC (PR #23564)
by Diego de Souza 23 Jun '26
by Diego de Souza 23 Jun '26
23 Jun '26
PR #23564 opened by Diego de Souza (ddesouza)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23564
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23564.patch
This series introduces a new opaque hardware pixel format, AV_PIX_FMT_CUARRAY, representing block-linear CUDA arrays (CUarray), and threads support for it through the CUDA hwcontext, NVDEC, CUVID, NVENC, and the CUDA hwupload filter. The goal is a fully zero-copy GPU transcode pipeline:
Input → NVDEC → CUarray pool → NVENC → Output
Unlike AV_PIX_FMT_CUDA (pitched-linear), CUARRAY surfaces are block-linear and cannot be accessed from the CPU. NVDEC can decode directly into CUarray surfaces registered via cuvidRegisterDecodeSurfaces, and NVENC can consume them directly as NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY, eliminating the
pitched-linear intermediate copy that the existing AV_PIX_FMT_CUDA path requires.
All SDK-version-specific code is gated behind feature macros (NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT, NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT), so building against older Video Codec SDKs is unaffected (graceful AVERROR(ENOSYS) fallback). Requires Video Codec SDK 13.1+.
Commits (8)
1. avutil/pixfmt — add AV_PIX_FMT_CUARRAY opaque pixel format; bump libavutil minor.
2. avutil/hwcontext_cuda — extend the CUDA frames context to allocate and manage CUarray surface pools; add cuda_transfer_data_from_cuarray() for hwdownload.
3. avcodec/nvdec — opaque CUARRAY output with zero-copy (direct surface exposure + surface_in_use[] locking) and safe-copy (av_frame_make_writable()) modes.
4. avcodec/nvdec — register CUARRAY hwaccel variants for all supported codecs (H.264, HEVC, AV1, MPEG-1/2/4, VC-1, WMV3, VP8, VP9).
5. avcodec/cuviddec — CUARRAY opaque output for the standalone CUVID decoder, including deferred decoder cleanup, 444→semi-planar remapping, and per-plane linesize derivation.
6. avcodec/nvenc — accept AV_PIX_FMT_CUARRAY (and semi-planar 444) input as CUDA array resources.
7. fftools/ffmpeg_dec — honor the user's hwaccel_output_format when negotiating between CUDA and CUARRAY in get_format().
8. avfilter/hwupload_cuda — add output_format option (cuda | cuarray) for host→device upload into block-linear surfaces.
Testing
- Zero-copy h264_cuvid/NVDEC → *_nvenc transcode validated on SDK 13.1.
- Safe-copy path validated for decode/encode surface lifetime decoupling under encoder buffering.
- hwupload→download round-trip and 444 semi-planar format handling.
Notes
- Builds against SDKs older than 13.1 are unaffected — CUARRAY paths compile out and fall back to ENOSYS.
- doc/APIchanges and libavutil/version.h updated for the new public pixel format.
From 61cd21619ceeb66bc4cdcb06d810ec9a50a81ce3 Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:11:31 +0100
Subject: [PATCH 1/8] avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA
block-linear surfaces
Add a new hardware pixel format representing opaque block-linear CUDA
arrays (CUarray). This format is used by NVDEC when decoding into
opaque surfaces registered with cuvidRegisterDecodeSurfaces, and can
be consumed directly by NVENC as CUDA array input without requiring
a pitch-linear copy.
Bump libavutil minor version.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
doc/APIchanges | 3 +++
libavutil/pixdesc.c | 4 ++++
libavutil/pixfmt.h | 6 ++++++
libavutil/version.h | 4 ++--
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index baba5918e6..4dcd10fb7b 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -54,6 +54,9 @@ Add IAMF frame side data types to enum AVFrameSideDataType:
Add AVDynamicHDRSmpte2094App5 struct and functions.
Add AV_FRAME_DATA_DYNAMIC_HDR_SMPTE_2094_APP5 side data type.
+2026-03-xx - xxxxxxxxxx - lavu 60.30.100 - pixfmt.h
+ Add AV_PIX_FMT_CUARRAY.
+
2026-03-14 - xxxxxxxxxx - lavu 60.29.100 - hwcontext_vulkan.h
Deprecate AVVulkanDeviceContext.lock_queue and
AVVulkanDeviceContext.unlock_queue without replacement.
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 90f9596def..9152afd554 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -3267,6 +3267,10 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "ohcodec",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
+ [AV_PIX_FMT_CUARRAY] = {
+ .name = "cuarray",
+ .flags = AV_PIX_FMT_FLAG_HWACCEL,
+ },
};
static const char * const color_range_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 2e7b6457e0..b08881cc1f 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -499,6 +499,12 @@ enum AVPixelFormat {
AV_PIX_FMT_OHCODEC, /// hardware decoding through openharmony
+ /**
+ * CUDA block-linear (opaque). data[0] is a CUarray in block-linear layout,
+ * e.g. from NVDEC opaque decode. Use for zero-copy to NVENC (CUDA array input).
+ */
+ AV_PIX_FMT_CUARRAY,
+
AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};
diff --git a/libavutil/version.h b/libavutil/version.h
index 429e65d77f..b68508a34b 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,8 +79,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 60
-#define LIBAVUTIL_VERSION_MINOR 33
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR 34
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
--
2.52.0
From 0ddcd2d98435dba585a24cd3ebd6c6071786a143 Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler <timo(a)rothenpieler.org>
Date: Mon, 16 Mar 2026 16:11:32 +0100
Subject: [PATCH 2/8] avutil/hwcontext_cuda: add CUarray surface pool support
Extend the internal CUDA frames context (CUDAFramesContext) to manage
block-linear CUarray surfaces alongside the existing pitched-linear
allocations.
When the frames context format is AV_PIX_FMT_CUARRAY, the caller
(e.g. NVDEC) can fill cuarray_desc and cuarray_num_surfaces before
calling av_hwframe_ctx_init(), which then allocates the CUarray
surfaces.
Also add cuda_transfer_data_from_cuarray() to support hwdownload
from CUarray frames to host memory via cuMemcpy2DAsync.
Co-authored-by: Diego de Souza <ddesouza(a)nvidia.com>
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
doc/APIchanges | 3 +
libavutil/hwcontext_cuda.c | 394 +++++++++++++++++++++++++---
libavutil/hwcontext_cuda.h | 74 +++++-
libavutil/hwcontext_cuda_internal.h | 21 ++
libavutil/version.h | 2 +-
5 files changed, 455 insertions(+), 39 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 4dcd10fb7b..5b9623ae68 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -54,6 +54,9 @@ Add IAMF frame side data types to enum AVFrameSideDataType:
Add AVDynamicHDRSmpte2094App5 struct and functions.
Add AV_FRAME_DATA_DYNAMIC_HDR_SMPTE_2094_APP5 side data type.
+2026-03-xx - xxxxxxxxxx - lavu 60.35.100 - hwcontext_cuda.h
+ Add AVCUDAFramesContext and AVCUDAArrayFrameDescriptor.
+
2026-03-xx - xxxxxxxxxx - lavu 60.30.100 - pixfmt.h
Add AV_PIX_FMT_CUARRAY.
diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index b0b65b2446..5f21082960 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -31,8 +31,12 @@
#include "imgutils.h"
typedef struct CUDAFramesContext {
+ AVCUDAFramesContext p;
+
int shift_width, shift_height;
int tex_alignment;
+
+ int cuarray_num_surfaces_used;
} CUDAFramesContext;
typedef struct CUDADeviceContext {
@@ -46,10 +50,14 @@ static const enum AVPixelFormat supported_formats[] = {
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUVA420P,
AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NV24,
AV_PIX_FMT_P010,
AV_PIX_FMT_P016,
AV_PIX_FMT_P210,
AV_PIX_FMT_P216,
+ AV_PIX_FMT_P410,
+ AV_PIX_FMT_P412,
+ AV_PIX_FMT_P416,
AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10,
@@ -68,27 +76,46 @@ static const enum AVPixelFormat supported_formats[] = {
#define CHECK_CU(x) FF_CUDA_CHECK_DL(device_ctx, cu, x)
+static CUarray_format cuda_array_format_for_pix_fmt(enum AVPixelFormat fmt);
+static unsigned int cuda_array_numchannels_for_pix_fmt(enum AVPixelFormat fmt);
+
static int cuda_frames_get_constraints(AVHWDeviceContext *ctx,
const void *hwconfig,
AVHWFramesConstraints *constraints)
{
- int i;
+ const AVCUDAHWConfig *config = hwconfig;
+ enum AVPixelFormat req_fmt = config ? config->hw_format : AV_PIX_FMT_NONE;
+ int i, nb_sw_formats = 0;
constraints->valid_sw_formats = av_malloc_array(FF_ARRAY_ELEMS(supported_formats) + 1,
sizeof(*constraints->valid_sw_formats));
if (!constraints->valid_sw_formats)
return AVERROR(ENOMEM);
- for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++)
- constraints->valid_sw_formats[i] = supported_formats[i];
- constraints->valid_sw_formats[FF_ARRAY_ELEMS(supported_formats)] = AV_PIX_FMT_NONE;
+ for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) {
+ if (req_fmt == AV_PIX_FMT_CUARRAY &&
+ !cuda_array_format_for_pix_fmt(supported_formats[i]))
+ continue;
+ constraints->valid_sw_formats[nb_sw_formats++] = supported_formats[i];
+ }
+ constraints->valid_sw_formats[nb_sw_formats] = AV_PIX_FMT_NONE;
- constraints->valid_hw_formats = av_malloc_array(2, sizeof(*constraints->valid_hw_formats));
- if (!constraints->valid_hw_formats)
- return AVERROR(ENOMEM);
+ if (req_fmt == AV_PIX_FMT_CUDA || req_fmt == AV_PIX_FMT_CUARRAY) {
+ constraints->valid_hw_formats = av_malloc_array(2, sizeof(*constraints->valid_hw_formats));
+ if (!constraints->valid_hw_formats)
+ return AVERROR(ENOMEM);
- constraints->valid_hw_formats[0] = AV_PIX_FMT_CUDA;
- constraints->valid_hw_formats[1] = AV_PIX_FMT_NONE;
+ constraints->valid_hw_formats[0] = req_fmt;
+ constraints->valid_hw_formats[1] = AV_PIX_FMT_NONE;
+ } else {
+ constraints->valid_hw_formats = av_malloc_array(3, sizeof(*constraints->valid_hw_formats));
+ if (!constraints->valid_hw_formats)
+ return AVERROR(ENOMEM);
+
+ constraints->valid_hw_formats[0] = AV_PIX_FMT_CUDA;
+ constraints->valid_hw_formats[1] = AV_PIX_FMT_CUARRAY;
+ constraints->valid_hw_formats[2] = AV_PIX_FMT_NONE;
+ }
return 0;
}
@@ -104,7 +131,13 @@ static void cuda_buffer_free(void *opaque, uint8_t *data)
CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
- CHECK_CU(cu->cuMemFree((CUdeviceptr)data));
+ if (ctx->format == AV_PIX_FMT_CUARRAY) {
+ AVCUDAArrayFrameDescriptor *desc = (AVCUDAArrayFrameDescriptor*)data;
+ CHECK_CU(cu->cuArrayDestroy(desc->array));
+ av_free(desc);
+ } else {
+ CHECK_CU(cu->cuMemFree((CUdeviceptr)data));
+ }
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
}
@@ -112,6 +145,7 @@ static void cuda_buffer_free(void *opaque, uint8_t *data)
static AVBufferRef *cuda_pool_alloc(void *opaque, size_t size)
{
AVHWFramesContext *ctx = opaque;
+ CUDAFramesContext *priv = ctx->hwctx;
AVHWDeviceContext *device_ctx = ctx->device_ctx;
AVCUDADeviceContext *hwctx = device_ctx->hwctx;
CudaFunctions *cu = hwctx->internal->cuda_dl;
@@ -125,21 +159,120 @@ static AVBufferRef *cuda_pool_alloc(void *opaque, size_t size)
if (err < 0)
return NULL;
+ if (ctx->format == AV_PIX_FMT_CUARRAY) {
+ AVCUDAArrayFrameDescriptor *desc = av_mallocz(sizeof(*desc));
+ if (!desc)
+ goto done;
+
+ if (priv->p.cuarray_num_surfaces > 0) {
+ if (priv->cuarray_num_surfaces_used >= priv->p.cuarray_num_surfaces) {
+ av_log(ctx, AV_LOG_ERROR, "Static surface pool size exceeded.\n");
+ av_free(desc);
+ goto done;
+ }
+ desc->index = priv->cuarray_num_surfaces_used++;
+ desc->array = priv->p.cuarray_surfaces[desc->index];
+ } else {
+ err = CHECK_CU(cu->cuArray3DCreate(&desc->array, &priv->p.cuarray_desc));
+ if (err < 0) {
+ av_free(desc);
+ goto done;
+ }
+ }
+
+ ret = av_buffer_create((uint8_t*)desc, sizeof(*desc), cuda_buffer_free, ctx, 0);
+ if (!ret) {
+ // It is okay (and neccesary) to free a pool array here,
+ // since cuarray_num_surfaces_used is already incremented.
+ CHECK_CU(cu->cuArrayDestroy(desc->array));
+ av_free(desc);
+ goto done;
+ }
+
+ goto done;
+ }
+
err = CHECK_CU(cu->cuMemAlloc(&data, size));
if (err < 0)
- goto fail;
+ goto done;
ret = av_buffer_create((uint8_t*)data, size, cuda_buffer_free, ctx, 0);
if (!ret) {
CHECK_CU(cu->cuMemFree(data));
- goto fail;
+ goto done;
}
-fail:
+ // Common exit: reached on both success (ret holds the buffer) and
+ // failure (ret == NULL); restores the CUDA context and returns ret.
+done:
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
return ret;
}
+static void cuda_frames_uninit(AVHWFramesContext *ctx)
+{
+ AVHWDeviceContext *device_ctx = ctx->device_ctx;
+ AVCUDADeviceContext *hwctx = device_ctx->hwctx;
+ CUDAFramesContext *priv = ctx->hwctx;
+ CudaFunctions *cu = hwctx->internal->cuda_dl;
+
+ if (priv->p.cuarray_surfaces) {
+ CUcontext dummy;
+ CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
+
+ // Make sure we don't free surfaces that have been adopted by the pool already
+ for (int i = priv->cuarray_num_surfaces_used; i < priv->p.cuarray_num_surfaces; i++)
+ if (priv->p.cuarray_surfaces[i])
+ CHECK_CU(cu->cuArrayDestroy(priv->p.cuarray_surfaces[i]));
+
+ CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+
+ av_freep(&priv->p.cuarray_surfaces);
+ priv->p.cuarray_num_surfaces = 0;
+ }
+}
+
+static CUarray_format cuda_array_format_for_pix_fmt(enum AVPixelFormat fmt)
+{
+ switch (fmt) {
+ case AV_PIX_FMT_NV12: return CU_AD_FORMAT_NV12;
+ case AV_PIX_FMT_P010:
+ case AV_PIX_FMT_P016: return CU_AD_FORMAT_P016;
+ case AV_PIX_FMT_NV16: return CU_AD_FORMAT_NV16;
+ case AV_PIX_FMT_P210:
+ case AV_PIX_FMT_P216: return CU_AD_FORMAT_P216;
+ case AV_PIX_FMT_NV24: return CU_AD_FORMAT_YUV444_8BIT_SEMIPLANAR;
+ case AV_PIX_FMT_P410:
+ case AV_PIX_FMT_P412:
+ case AV_PIX_FMT_P416: return CU_AD_FORMAT_YUV444_16BIT_SEMIPLANAR;
+ case AV_PIX_FMT_YUV420P: return CU_AD_FORMAT_UINT8_PLANAR_420;
+ case AV_PIX_FMT_YUV422P: return CU_AD_FORMAT_UINT8_PLANAR_422;
+ case AV_PIX_FMT_YUV444P: return CU_AD_FORMAT_UINT8_PLANAR_444;
+ case AV_PIX_FMT_YUV420P10: return CU_AD_FORMAT_UINT16_PLANAR_420;
+ case AV_PIX_FMT_YUV422P10: return CU_AD_FORMAT_UINT16_PLANAR_422;
+ case AV_PIX_FMT_YUV444P10:
+ case AV_PIX_FMT_YUV444P10MSB:
+ case AV_PIX_FMT_YUV444P12MSB:
+ case AV_PIX_FMT_YUV444P16: return CU_AD_FORMAT_UINT16_PLANAR_444;
+ case AV_PIX_FMT_0RGB32:
+ case AV_PIX_FMT_0BGR32:
+ case AV_PIX_FMT_RGB32:
+ case AV_PIX_FMT_BGR32: return CU_AD_FORMAT_UNSIGNED_INT8;
+ default: return 0;
+ }
+}
+
+static unsigned int cuda_array_numchannels_for_pix_fmt(enum AVPixelFormat fmt)
+{
+ switch (fmt) {
+ case AV_PIX_FMT_0RGB32:
+ case AV_PIX_FMT_0BGR32:
+ case AV_PIX_FMT_RGB32:
+ case AV_PIX_FMT_BGR32: return 4;
+ default: return 3;
+ }
+}
+
static int cuda_frames_init(AVHWFramesContext *ctx)
{
AVHWDeviceContext *device_ctx = ctx->device_ctx;
@@ -148,6 +281,8 @@ static int cuda_frames_init(AVHWFramesContext *ctx)
CudaFunctions *cu = hwctx->internal->cuda_dl;
int err, i;
+ CUcontext dummy;
+
for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) {
if (ctx->sw_format == supported_formats[i])
break;
@@ -158,6 +293,11 @@ static int cuda_frames_init(AVHWFramesContext *ctx)
return AVERROR(ENOSYS);
}
+ if (ctx->format == AV_PIX_FMT_CUARRAY && !cu->cuArrayGetPlane) {
+ av_log(ctx, AV_LOG_ERROR, "cuArrayGetPlane not available, update your driver\n");
+ return AVERROR(ENOSYS);
+ }
+
err = CHECK_CU(cu->cuDeviceGetAttribute(&priv->tex_alignment,
14 /* CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT */,
hwctx->internal->cuda_device));
@@ -174,47 +314,184 @@ static int cuda_frames_init(AVHWFramesContext *ctx)
av_pix_fmt_get_chroma_sub_sample(ctx->sw_format, &priv->shift_width, &priv->shift_height);
+ if (ctx->format == AV_PIX_FMT_CUARRAY) {
+ if (!priv->p.cuarray_desc.Width)
+ priv->p.cuarray_desc.Width = ctx->width;
+ if (!priv->p.cuarray_desc.Height)
+ priv->p.cuarray_desc.Height = ctx->height;
+ if (!priv->p.cuarray_desc.NumChannels)
+ priv->p.cuarray_desc.NumChannels = cuda_array_numchannels_for_pix_fmt(ctx->sw_format);
+
+ if (priv->p.cuarray_desc.Depth) {
+ av_log(ctx, AV_LOG_ERROR, "CUarrays with non-zero depth are not supported.\n");
+ return AVERROR(EINVAL);
+ }
+
+ if (!priv->p.cuarray_desc.Format)
+ priv->p.cuarray_desc.Format = cuda_array_format_for_pix_fmt(ctx->sw_format);
+ if (!priv->p.cuarray_desc.Format) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid CUarray pixel format\n");
+ return AVERROR_BUG;
+ }
+
+ priv->p.cuarray_desc.Flags |= CUDA_ARRAY3D_SURFACE_LDST | CUDA_ARRAY3D_VIDEO_ENCODE_DECODE;
+ }
+
+ if (ctx->format == AV_PIX_FMT_CUARRAY && priv->p.cuarray_num_surfaces > 0) {
+ priv->p.cuarray_surfaces = av_calloc(priv->p.cuarray_num_surfaces, sizeof(*priv->p.cuarray_surfaces));
+ if (!priv->p.cuarray_surfaces)
+ return AVERROR(ENOMEM);
+
+ err = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
+ if (err < 0) {
+ av_freep(&priv->p.cuarray_surfaces);
+ return err;
+ }
+
+ for (i = 0; i < priv->p.cuarray_num_surfaces; i++) {
+ err = CHECK_CU(cu->cuArray3DCreate(&priv->p.cuarray_surfaces[i], &priv->p.cuarray_desc));
+ if (err < 0) {
+ for (i = i - 1; i >= 0; i--)
+ CHECK_CU(cu->cuArrayDestroy(priv->p.cuarray_surfaces[i]));
+ CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+
+ av_freep(&priv->p.cuarray_surfaces);
+ return err;
+ }
+ }
+
+ err = CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+ if (err < 0)
+ goto fail;
+
+ av_log(ctx, AV_LOG_DEBUG, "allocated %d CUarray surfaces (%zux%zu)\n",
+ priv->p.cuarray_num_surfaces, priv->p.cuarray_desc.Width, priv->p.cuarray_desc.Height);
+ }
+
if (!ctx->pool) {
int size = av_image_get_buffer_size(ctx->sw_format, ctx->width, ctx->height, priv->tex_alignment);
- if (size < 0)
- return size;
+ if (size < 0) {
+ err = size;
+ goto fail;
+ }
ffhwframesctx(ctx)->pool_internal =
av_buffer_pool_init2(size, ctx, cuda_pool_alloc, NULL);
- if (!ffhwframesctx(ctx)->pool_internal)
- return AVERROR(ENOMEM);
+ if (!ffhwframesctx(ctx)->pool_internal) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
}
return 0;
+
+fail:
+ cuda_frames_uninit(ctx);
+ return err;
+}
+
+static int cuda_cuarray_element_size(CUarray_format fmt)
+{
+ return ff_cuda_cuarray_elem_size(fmt);
}
static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
{
- CUDAFramesContext *priv = ctx->hwctx;
+ AVHWDeviceContext *device_ctx = ctx->device_ctx;
+ AVCUDADeviceContext *hwctx = device_ctx->hwctx;
+ CUDAFramesContext *priv = ctx->hwctx;
+ CudaFunctions *cu = hwctx->internal->cuda_dl;
+
+ CUcontext dummy;
int res;
frame->buf[0] = av_buffer_pool_get(ctx->pool);
if (!frame->buf[0])
return AVERROR(ENOMEM);
- res = av_image_fill_arrays(frame->data, frame->linesize, frame->buf[0]->data,
- ctx->sw_format, ctx->width, ctx->height, priv->tex_alignment);
- if (res < 0)
- return res;
+ if (ctx->format == AV_PIX_FMT_CUARRAY) {
+ AVCUDAArrayFrameDescriptor *desc = (AVCUDAArrayFrameDescriptor*)frame->buf[0]->data;
+ if (!desc) {
+ frame->format = ctx->format;
+ frame->width = ctx->width;
+ frame->height = ctx->height;
+ return 0;
+ }
+ frame->data[0] = (uint8_t*)desc->array;
+ frame->data[1] = (uint8_t*)desc->index;
- // YUV420P is a special case.
- // Nvenc expects the U/V planes in swapped order from how ffmpeg expects them, also chroma is half-aligned
- if (ctx->sw_format == AV_PIX_FMT_YUV420P) {
- frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
- frame->data[2] = frame->data[1];
- frame->data[1] = frame->data[2] + frame->linesize[2] * (ctx->height / 2);
+ res = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
+ if (res < 0)
+ return res;
+
+ for (int i = 0; i < FF_ARRAY_ELEMS(frame->linesize); i++) {
+ CUDA_ARRAY3D_DESCRIPTOR plane_desc = { 0 };
+ CUarray plane_array;
+ CUresult arr_plane_res = cu->cuArrayGetPlane(&plane_array, desc->array, i);
+
+ if (arr_plane_res == CUDA_ERROR_INVALID_VALUE) {
+ if (i > 0)
+ break;
+ /* Non-planar format (e.g. UNSIGNED_INT8 x4 for packed RGB):
+ * cuArrayGetPlane is unsupported, query the array directly. */
+ res = CHECK_CU(cu->cuArray3DGetDescriptor(&plane_desc, desc->array));
+ if (res < 0)
+ goto fail;
+ } else if (arr_plane_res != CUDA_SUCCESS) {
+ res = CHECK_CU(arr_plane_res);
+ goto fail;
+ } else {
+ res = CHECK_CU(cu->cuArray3DGetDescriptor(&plane_desc, plane_array));
+ if (res < 0)
+ goto fail;
+ }
+
+ int elem_size = cuda_cuarray_element_size(plane_desc.Format);
+ if (elem_size <= 0) {
+ res = AVERROR_BUG;
+ goto fail;
+ }
+
+ frame->linesize[i] = plane_desc.Width * plane_desc.NumChannels * elem_size;
+
+ if (arr_plane_res == CUDA_ERROR_INVALID_VALUE)
+ break;
+ }
+
+ res = CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+ if (res < 0)
+ return res;
+ } else {
+ res = av_image_fill_arrays(frame->data, frame->linesize, frame->buf[0]->data,
+ ctx->sw_format, ctx->width, ctx->height, priv->tex_alignment);
+ if (res < 0)
+ return res;
+
+ // YUV420P is a special case.
+ // Nvenc expects the U/V planes in swapped order from how ffmpeg expects them, also chroma is half-aligned
+ if (ctx->sw_format == AV_PIX_FMT_YUV420P) {
+ frame->linesize[1] = frame->linesize[2] = frame->linesize[0] / 2;
+ frame->data[2] = frame->data[1];
+ frame->data[1] = frame->data[2] + frame->linesize[2] * (ctx->height / 2);
+ }
}
- frame->format = AV_PIX_FMT_CUDA;
+ frame->format = ctx->format;
frame->width = ctx->width;
frame->height = ctx->height;
return 0;
+
+fail:
+ CHECK_CU(cu->cuCtxPopCurrent(&dummy));
+ return res;
+}
+
+static enum AVPixelFormat cuda_frame_hw_format(const AVFrame *frame)
+{
+ if (!frame->hw_frames_ctx)
+ return AV_PIX_FMT_NONE;
+ return ((AVHWFramesContext *)frame->hw_frames_ctx->data)->format;
}
static int cuda_transfer_get_formats(AVHWFramesContext *ctx,
@@ -246,15 +523,24 @@ static int cuda_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
CUcontext dummy;
int i, ret;
- if ((src->hw_frames_ctx && ((AVHWFramesContext*)src->hw_frames_ctx->data)->format != AV_PIX_FMT_CUDA) ||
- (dst->hw_frames_ctx && ((AVHWFramesContext*)dst->hw_frames_ctx->data)->format != AV_PIX_FMT_CUDA))
- return AVERROR(ENOSYS);
+ {
+ enum AVPixelFormat src_fmt = cuda_frame_hw_format(src);
+ enum AVPixelFormat dst_fmt = cuda_frame_hw_format(dst);
+ if ((src_fmt != AV_PIX_FMT_NONE &&
+ src_fmt != AV_PIX_FMT_CUDA && src_fmt != AV_PIX_FMT_CUARRAY) ||
+ (dst_fmt != AV_PIX_FMT_NONE &&
+ dst_fmt != AV_PIX_FMT_CUDA && dst_fmt != AV_PIX_FMT_CUARRAY))
+ return AVERROR(ENOSYS);
+ }
ret = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx));
if (ret < 0)
return ret;
- for (i = 0; i < FF_ARRAY_ELEMS(src->data) && src->data[i]; i++) {
+ for (i = 0; i < FF_ARRAY_ELEMS(src->data) && src->linesize[i]; i++) {
+ int src_is_nonplanar_cuarray = 0;
+ int dst_is_nonplanar_cuarray = 0;
+
CUDA_MEMCPY2D cpy = {
.srcPitch = src->linesize[i],
.dstPitch = dst->linesize[i],
@@ -262,17 +548,47 @@ static int cuda_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
.Height = src->height >> ((i == 0 || i == 3) ? 0 : priv->shift_height),
};
- if (src->hw_frames_ctx) {
+ if (src->format == AV_PIX_FMT_CUDA) {
cpy.srcMemoryType = CU_MEMORYTYPE_DEVICE;
cpy.srcDevice = (CUdeviceptr)src->data[i];
+ } else if (src->format == AV_PIX_FMT_CUARRAY) {
+ CUarray array;
+ CUresult cures = cu->cuArrayGetPlane(&array, (CUarray)src->data[0], i);
+ if (cures == CUDA_ERROR_INVALID_VALUE) {
+ if (i > 0)
+ break;
+ array = (CUarray)src->data[0];
+ src_is_nonplanar_cuarray = 1;
+ } else if (cures != CUDA_SUCCESS) {
+ ret = CHECK_CU(cures);
+ goto exit;
+ }
+
+ cpy.srcMemoryType = CU_MEMORYTYPE_ARRAY;
+ cpy.srcArray = array;
} else {
cpy.srcMemoryType = CU_MEMORYTYPE_HOST;
cpy.srcHost = src->data[i];
}
- if (dst->hw_frames_ctx) {
+ if (dst->format == AV_PIX_FMT_CUDA) {
cpy.dstMemoryType = CU_MEMORYTYPE_DEVICE;
cpy.dstDevice = (CUdeviceptr)dst->data[i];
+ } else if (dst->format == AV_PIX_FMT_CUARRAY) {
+ CUarray array;
+ CUresult cures = cu->cuArrayGetPlane(&array, (CUarray)dst->data[0], i);
+ if (cures == CUDA_ERROR_INVALID_VALUE) {
+ if (i > 0)
+ break;
+ array = (CUarray)dst->data[0];
+ dst_is_nonplanar_cuarray = 1;
+ } else if (cures != CUDA_SUCCESS) {
+ ret = CHECK_CU(cures);
+ goto exit;
+ }
+
+ cpy.dstMemoryType = CU_MEMORYTYPE_ARRAY;
+ cpy.dstArray = array;
} else {
cpy.dstMemoryType = CU_MEMORYTYPE_HOST;
cpy.dstHost = dst->data[i];
@@ -281,6 +597,9 @@ static int cuda_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
ret = CHECK_CU(cu->cuMemcpy2DAsync(&cpy, hwctx->stream));
if (ret < 0)
goto exit;
+
+ if (src_is_nonplanar_cuarray || dst_is_nonplanar_cuarray)
+ break;
}
if (!dst->hw_frames_ctx) {
@@ -292,7 +611,7 @@ static int cuda_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
exit:
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
- return 0;
+ return ret;
}
static void cuda_device_uninit(AVHWDeviceContext *device_ctx)
@@ -582,10 +901,11 @@ const HWContextType ff_hwcontext_type_cuda = {
.device_uninit = cuda_device_uninit,
.frames_get_constraints = cuda_frames_get_constraints,
.frames_init = cuda_frames_init,
+ .frames_uninit = cuda_frames_uninit,
.frames_get_buffer = cuda_get_buffer,
.transfer_get_formats = cuda_transfer_get_formats,
.transfer_data_to = cuda_transfer_data,
.transfer_data_from = cuda_transfer_data,
- .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE },
+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, AV_PIX_FMT_CUARRAY, AV_PIX_FMT_NONE },
};
diff --git a/libavutil/hwcontext_cuda.h b/libavutil/hwcontext_cuda.h
index cbad434fea..38e5369794 100644
--- a/libavutil/hwcontext_cuda.h
+++ b/libavutil/hwcontext_cuda.h
@@ -24,6 +24,8 @@
#include <cuda.h>
#endif
+#include <stdint.h>
+
#include "pixfmt.h"
/**
@@ -46,8 +48,78 @@ typedef struct AVCUDADeviceContext {
} AVCUDADeviceContext;
/**
- * AVHWFramesContext.hwctx is currently not used
+ * CUDA frame descriptor for pool allocation of AV_PIX_FMT_CUARRAY frames.
+ *
+ * In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
+ * with the data pointer pointing at an object of this type describing the
+ * planes of the frame.
+ *
+ * This has no use outside of custom allocation, and AVFrame AVBufferRef do not
+ * necessarily point to an instance of this struct.
*/
+typedef struct AVCUDAArrayFrameDescriptor {
+ /**
+ * The CUarray containing the frame data.
+ *
+ * Normally stored in AVFrame.data[0].
+ */
+ CUarray array;
+
+ /**
+ * The index into AVCUDAFramesContext.cuarray_surfaces, or 0 if not applicable.
+ *
+ * Normally stored in AVFrame.data[1] (cast from intptr_t).
+ */
+ intptr_t index;
+} AVCUDAArrayFrameDescriptor;
+
+/**
+ * This struct is allocated as AVHWFramesContext.hwctx
+ */
+typedef struct AVCUDAFramesContext {
+ /**
+ * CUDA_ARRAY3D_DESCRIPTOR CUarrays will be initialized with.
+ * Mostly used to provide external Flags.
+ *
+ * Width, Height and Format only honored if != 0.
+ * Filled with default parameters from the FramesContext otherwise.
+ *
+ * Only applicable for AV_PIX_FMT_CUARRAY.
+ */
+ CUDA_ARRAY3D_DESCRIPTOR cuarray_desc;
+
+ /**
+ * If >0, pre-allocate a fixed pool of surfaces.
+ * The surfaces will be available via cuarray_surfaces after init.
+ * Size of the pool cannot be changed afterwards.
+ *
+ * Only applicable for AV_PIX_FMT_CUARRAY.
+ */
+ int cuarray_num_surfaces;
+
+ /**
+ * If cuarray_num_surfaces is >0, this contains the array of pre-allocated surfaces.
+ *
+ * Only applicable for AV_PIX_FMT_CUARRAY.
+ */
+ CUarray *cuarray_surfaces;
+} AVCUDAFramesContext;
+
+/**
+ * CUDA hardware pipeline configuration details.
+ *
+ * Passed to av_hwdevice_get_hwframe_constraints() to query
+ * per-hw-format constraints. When provided, valid_sw_formats
+ * will be filtered to only those compatible with the specified
+ * hw_format.
+ */
+typedef struct AVCUDAHWConfig {
+ /**
+ * The hardware pixel format to query constraints for.
+ * Must be AV_PIX_FMT_CUDA or AV_PIX_FMT_CUARRAY.
+ */
+ enum AVPixelFormat hw_format;
+} AVCUDAHWConfig;
/**
* @defgroup hwcontext_cuda Device context creation flags
diff --git a/libavutil/hwcontext_cuda_internal.h b/libavutil/hwcontext_cuda_internal.h
index a989c45861..9ca6edf7d3 100644
--- a/libavutil/hwcontext_cuda_internal.h
+++ b/libavutil/hwcontext_cuda_internal.h
@@ -35,4 +35,25 @@ struct AVCUDADeviceContextInternal {
int flags;
};
+/**
+ * Return the element size in bytes for a CUarray_format, or 0 for unknown.
+ *
+ * Used to compute frame->linesize[] for CUarray frames (block-linear).
+ * Callers that need a fallback should treat a 0 return as an error.
+ */
+static inline int ff_cuda_cuarray_elem_size(CUarray_format fmt)
+{
+ switch (fmt) {
+ case CU_AD_FORMAT_UNSIGNED_INT8:
+ case CU_AD_FORMAT_SIGNED_INT8: return 1;
+ case CU_AD_FORMAT_UNSIGNED_INT16:
+ case CU_AD_FORMAT_SIGNED_INT16:
+ case CU_AD_FORMAT_HALF: return 2;
+ case CU_AD_FORMAT_UNSIGNED_INT32:
+ case CU_AD_FORMAT_SIGNED_INT32:
+ case CU_AD_FORMAT_FLOAT: return 4;
+ default: return 0;
+ }
+}
+
#endif /* AVUTIL_HWCONTEXT_CUDA_INTERNAL_H */
diff --git a/libavutil/version.h b/libavutil/version.h
index b68508a34b..9ddb736f19 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 60
-#define LIBAVUTIL_VERSION_MINOR 34
+#define LIBAVUTIL_VERSION_MINOR 35
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
--
2.52.0
From 4707b518c9b2c4e920e96255c0a859af3cc04a6f Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:24:24 +0100
Subject: [PATCH 3/8] avcodec/nvdec: add opaque CUARRAY output and zero-copy
decode support
Add support for NVDEC opaque output using block-linear CUarray surfaces
registered with cuvidRegisterDecodeSurfaces (Video Codec SDK 13.1+).
Two output modes are implemented:
- Zero-copy (unsafe_output): decode surfaces are exposed directly
to the consumer (e.g. NVENC). The surface is locked via
surface_in_use[] and released when the downstream AVBufferRef
is freed.
- Safe copy (!unsafe_output): the frame is set up pointing to the
decode CUarray, then av_frame_make_writable() copies it into a
new CUarray from the output hwframes pool via cuda_transfer_data().
This decouples the decode and encode surface lifetimes.
All opaque-specific code is guarded by NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT,
with a AVERROR(ENOSYS) fallback when building against older SDK versions.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
libavcodec/nvdec.c | 446 ++++++++++++++++++++++++++++++++++++++++++---
libavcodec/nvdec.h | 11 ++
2 files changed, 436 insertions(+), 21 deletions(-)
diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c
index e64ee7a9d6..32c3784ced 100644
--- a/libavcodec/nvdec.c
+++ b/libavcodec/nvdec.c
@@ -23,6 +23,9 @@
#include "config.h"
#include "config_components.h"
+#include <stdatomic.h>
+
+#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/error.h"
#include "libavutil/hwcontext.h"
@@ -47,6 +50,7 @@ typedef struct NVDECDecoder {
CUvideodecoder decoder;
AVBufferRef *hw_device_ref;
+ AVBufferRef *decode_hw_frames_ref;
AVBufferRef *real_hw_frames_ref;
CUcontext cuda_ctx;
CUstream stream;
@@ -55,6 +59,11 @@ typedef struct NVDECDecoder {
CuvidFunctions *cvdl;
int unsafe_output;
+ int opaque_output;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ atomic_int *surface_in_use;
+ int num_surfaces;
+#endif
} NVDECDecoder;
typedef struct NVDECFramePool {
@@ -166,15 +175,44 @@ static int nvdec_test_capabilities(NVDECDecoder *decoder,
static void nvdec_decoder_free(AVRefStructOpaque unused, void *obj)
{
NVDECDecoder *decoder = obj;
+ void *logctx = decoder->hw_device_ref ? decoder->hw_device_ref->data : NULL;
if (decoder->decoder) {
- void *logctx = decoder->hw_device_ref->data;
CUcontext dummy;
CHECK_CU(decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx));
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (decoder->opaque_output) {
+ /*
+ * Every opaque output frame holds a reference to this decoder
+ * (NVDECOpaqueRelease.decoder, attached as frame->buf[0]) and only
+ * clears its surface_in_use slot when that buffer is released. This
+ * RefStruct free callback therefore cannot run until all surfaces
+ * have been handed back, so the decoder always outlives its
+ * surfaces and is safe to destroy unconditionally. The check below
+ * is purely a guard against a future regression of that invariant;
+ * it must never defer destruction (which would leak the decoder).
+ */
+ decoder->cudl->cuCtxSynchronize();
+ if (decoder->surface_in_use) {
+ int busy = 0;
+ for (int i = 0; i < decoder->num_surfaces; i++)
+ busy += atomic_load_explicit(&decoder->surface_in_use[i],
+ memory_order_acquire) != 0;
+ if (busy)
+ av_log(logctx, AV_LOG_ERROR,
+ "%d CUarray surface(s) unexpectedly still in use at "
+ "decoder teardown; destroying anyway\n", busy);
+ }
+ }
+#endif
CHECK_CU(decoder->cvdl->cuvidDestroyDecoder(decoder->decoder));
CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy));
}
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ av_freep(&decoder->surface_in_use);
+#endif
+ av_buffer_unref(&decoder->decode_hw_frames_ref);
av_buffer_unref(&decoder->real_hw_frames_ref);
av_buffer_unref(&decoder->hw_device_ref);
@@ -324,12 +362,52 @@ static int nvdec_init_hwframes(AVCodecContext *avctx, AVBufferRef **out_frames_r
return 0;
}
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+void ff_nvdec_fill_cuarray_desc(CUDA_ARRAY3D_DESCRIPTOR *desc,
+ AVCodecContext *avctx,
+ cudaVideoSurfaceFormat output_format)
+{
+ CUarray_format arr_fmt;
+
+ switch (output_format) {
+ case cudaVideoSurfaceFormat_NV12:
+ case cudaVideoSurfaceFormat_NV12_Opaque: arr_fmt = CU_AD_FORMAT_NV12; break;
+ case cudaVideoSurfaceFormat_P016:
+ case cudaVideoSurfaceFormat_P016_Opaque: arr_fmt = CU_AD_FORMAT_P016; break;
+ case cudaVideoSurfaceFormat_NV16:
+ case cudaVideoSurfaceFormat_NV16_Opaque: arr_fmt = CU_AD_FORMAT_NV16; break;
+ case cudaVideoSurfaceFormat_P216:
+ case cudaVideoSurfaceFormat_P216_Opaque: arr_fmt = CU_AD_FORMAT_P216; break;
+ case cudaVideoSurfaceFormat_YUV444:
+ case cudaVideoSurfaceFormat_YUV444_Opaque: arr_fmt = CU_AD_FORMAT_YUV444_8BIT_SEMIPLANAR; break;
+ case cudaVideoSurfaceFormat_YUV444_16Bit:
+ case cudaVideoSurfaceFormat_YUV444_16Bit_Opaque: arr_fmt = CU_AD_FORMAT_YUV444_16BIT_SEMIPLANAR; break;
+ default:
+ /* The caller's bit-depth/chroma switch only ever yields the formats
+ * handled above (and errors out otherwise), so this is unreachable;
+ * assert rather than silently producing a wrong descriptor. */
+ av_assert0(0);
+ }
+
+ memset(desc, 0, sizeof(*desc));
+ desc->Width = avctx->coded_width;
+ desc->Height = avctx->coded_height;
+ desc->Depth = 0;
+ desc->Format = arr_fmt;
+ desc->NumChannels = 3;
+ desc->Flags = CUDA_ARRAY3D_SURFACE_LDST |
+ CUDA_ARRAY3D_VIDEO_ENCODE_DECODE;
+}
+
+#endif
+
int ff_nvdec_decode_init(AVCodecContext *avctx)
{
NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
NVDECDecoder *decoder;
- AVBufferRef *real_hw_frames_ref;
+ AVBufferRef *decode_hw_frames_ref = NULL;
+ AVBufferRef *real_hw_frames_ref = NULL;
NVDECFramePool *pool;
AVHWFramesContext *frames_ctx;
const AVPixFmtDescriptor *sw_desc;
@@ -339,9 +417,13 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
cudaVideoSurfaceFormat output_format;
int cuvid_codec_type, cuvid_chroma_format, chroma_444;
int ret = 0;
+ int need_real_hwframes = 0;
int unsafe_output = !!(avctx->hwaccel_flags & AV_HWACCEL_FLAG_UNSAFE_OUTPUT);
+ int opaque_output = 0;
+ int decode_pool_size;
+
sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
if (!sw_desc)
return AVERROR_BUG;
@@ -363,47 +445,196 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
ret = nvdec_init_hwframes(avctx, &avctx->hw_frames_ctx, 1);
if (ret < 0)
return ret;
-
- ret = nvdec_init_hwframes(avctx, &real_hw_frames_ref, 0);
- if (ret < 0)
- return ret;
- } else {
- real_hw_frames_ref = av_buffer_ref(avctx->hw_frames_ctx);
- if (!real_hw_frames_ref)
- return AVERROR(ENOMEM);
+ need_real_hwframes = 1;
}
+ frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
+
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (frames_ctx->format == AV_PIX_FMT_CUARRAY) {
+ opaque_output = 1;
+ }
+#else
+ if (frames_ctx->format == AV_PIX_FMT_CUARRAY) {
+ av_log(avctx, AV_LOG_ERROR,
+ "CUarray opaque output requires Video Codec SDK 13.1 or later\n");
+ return AVERROR(ENOSYS);
+ }
+#endif
+
+ decode_pool_size = frames_ctx->initial_pool_size;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) {
+ if (unsafe_output) {
+ decode_pool_size = FFMIN(frames_ctx->initial_pool_size + 16,
+ MAX_NUM_REGISTERED_DECODE_SURFACES);
+ av_log(avctx, AV_LOG_VERBOSE,
+ "unsafe_output + cuarray: %d decode surfaces (pool=%d, max=%d)\n",
+ decode_pool_size, frames_ctx->initial_pool_size,
+ MAX_NUM_REGISTERED_DECODE_SURFACES);
+ } else if (avctx->extra_hw_frames > 0) {
+ decode_pool_size = frames_ctx->initial_pool_size - avctx->extra_hw_frames;
+ if (decode_pool_size < 1)
+ decode_pool_size = 1;
+ av_log(avctx, AV_LOG_VERBOSE,
+ "Opaque copy mode: %d decode surfaces, "
+ "%d extra surfaces reserved for output pool\n",
+ decode_pool_size, avctx->extra_hw_frames);
+ }
+ }
+#endif
+
switch (sw_desc->comp[0].depth) {
case 8:
if (chroma_444) {
output_format = cudaVideoSurfaceFormat_YUV444;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_YUV444_Opaque;
+#endif
#ifdef NVDEC_HAVE_422_SUPPORT
} else if (cuvid_chroma_format == cudaVideoChromaFormat_422) {
output_format = cudaVideoSurfaceFormat_NV16;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_NV16_Opaque;
+#endif
#endif
} else {
output_format = cudaVideoSurfaceFormat_NV12;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_NV12_Opaque;
+#endif
}
break;
case 10:
case 12:
if (chroma_444) {
output_format = cudaVideoSurfaceFormat_YUV444_16Bit;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_YUV444_16Bit_Opaque;
+#endif
#ifdef NVDEC_HAVE_422_SUPPORT
} else if (cuvid_chroma_format == cudaVideoChromaFormat_422) {
output_format = cudaVideoSurfaceFormat_P216;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_P216_Opaque;
+#endif
#endif
} else {
output_format = cudaVideoSurfaceFormat_P016;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output) output_format = cudaVideoSurfaceFormat_P016_Opaque;
+#endif
}
break;
default:
av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth\n");
- av_buffer_unref(&real_hw_frames_ref);
return AVERROR(ENOSYS);
}
- frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
+ if (need_real_hwframes) {
+ if (frames_ctx->format == AV_PIX_FMT_CUARRAY) {
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ AVHWFramesContext *real_ctx;
+ AVCUDAFramesContext *cuda_priv;
+
+ ret = avcodec_get_hw_frames_parameters(avctx, avctx->hw_device_ctx,
+ avctx->hwaccel->pix_fmt,
+ &real_hw_frames_ref);
+ if (ret < 0)
+ return ret;
+
+ real_ctx = (AVHWFramesContext*)real_hw_frames_ref->data;
+ real_ctx->initial_pool_size = 0;
+
+ cuda_priv = real_ctx->hwctx;
+ ff_nvdec_fill_cuarray_desc(&cuda_priv->cuarray_desc, avctx, output_format);
+ cuda_priv->cuarray_num_surfaces = unsafe_output ? decode_pool_size
+ : frames_ctx->initial_pool_size;
+
+ ret = av_hwframe_ctx_init(real_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&real_hw_frames_ref);
+ return ret;
+ }
+
+ if (unsafe_output) {
+ decode_hw_frames_ref = av_buffer_ref(real_hw_frames_ref);
+ if (!decode_hw_frames_ref) {
+ av_buffer_unref(&real_hw_frames_ref);
+ return AVERROR(ENOMEM);
+ }
+ } else {
+ ret = avcodec_get_hw_frames_parameters(avctx, avctx->hw_device_ctx,
+ avctx->hwaccel->pix_fmt,
+ &decode_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&real_hw_frames_ref);
+ return ret;
+ }
+
+ real_ctx = (AVHWFramesContext*)decode_hw_frames_ref->data;
+ real_ctx->initial_pool_size = 0;
+
+ cuda_priv = real_ctx->hwctx;
+ ff_nvdec_fill_cuarray_desc(&cuda_priv->cuarray_desc, avctx, output_format);
+ cuda_priv->cuarray_num_surfaces = decode_pool_size;
+
+ ret = av_hwframe_ctx_init(decode_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&decode_hw_frames_ref);
+ av_buffer_unref(&real_hw_frames_ref);
+ return ret;
+ }
+ }
+#endif
+ } else {
+ ret = nvdec_init_hwframes(avctx, &real_hw_frames_ref, 0);
+ if (ret < 0)
+ return ret;
+ }
+ } else {
+ real_hw_frames_ref = av_buffer_ref(avctx->hw_frames_ctx);
+ if (!real_hw_frames_ref)
+ return AVERROR(ENOMEM);
+
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (frames_ctx->format == AV_PIX_FMT_CUARRAY) {
+ if (unsafe_output) {
+ decode_hw_frames_ref = av_buffer_ref(real_hw_frames_ref);
+ } else {
+ AVHWFramesContext *real_ctx;
+ AVCUDAFramesContext *cuda_priv;
+
+ ret = avcodec_get_hw_frames_parameters(avctx, frames_ctx->device_ref,
+ avctx->hwaccel->pix_fmt,
+ &decode_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&real_hw_frames_ref);
+ return ret;
+ }
+
+ real_ctx = (AVHWFramesContext*)decode_hw_frames_ref->data;
+ real_ctx->initial_pool_size = 0;
+
+ cuda_priv = real_ctx->hwctx;
+ ff_nvdec_fill_cuarray_desc(&cuda_priv->cuarray_desc, avctx, output_format);
+ cuda_priv->cuarray_num_surfaces = decode_pool_size;
+
+ ret = av_hwframe_ctx_init(decode_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&decode_hw_frames_ref);
+ av_buffer_unref(&real_hw_frames_ref);
+ return ret;
+ }
+ }
+
+ if (!decode_hw_frames_ref) {
+ av_buffer_unref(&real_hw_frames_ref);
+ return AVERROR(ENOMEM);
+ }
+ }
+#endif
+ }
params.ulWidth = avctx->coded_width;
params.ulHeight = avctx->coded_height;
@@ -413,8 +644,8 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
params.OutputFormat = output_format;
params.CodecType = cuvid_codec_type;
params.ChromaFormat = cuvid_chroma_format;
- params.ulNumDecodeSurfaces = FFMIN(frames_ctx->initial_pool_size, 32);
- params.ulNumOutputSurfaces = unsafe_output ? FFMIN(frames_ctx->initial_pool_size, 64) : 1;
+ params.ulNumDecodeSurfaces = FFMIN(decode_pool_size, 32);
+ params.ulNumOutputSurfaces = opaque_output ? 0 : (unsafe_output ? FFMIN(frames_ctx->initial_pool_size, 64) : 1);
ret = nvdec_decoder_create(&ctx->decoder, frames_ctx->device_ref, ¶ms, avctx);
if (ret < 0) {
@@ -424,12 +655,57 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_WARNING, "Try lowering the amount of threads. Using %d right now.\n",
avctx->thread_count);
}
+ av_buffer_unref(&decode_hw_frames_ref);
av_buffer_unref(&real_hw_frames_ref);
return ret;
}
decoder = ctx->decoder;
decoder->unsafe_output = unsafe_output;
+ decoder->opaque_output = opaque_output;
+
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (opaque_output && decoder->cvdl->cuvidRegisterDecodeSurfaces) {
+ void *logctx = avctx;
+ AVHWFramesContext *real_ctx = (AVHWFramesContext*)decode_hw_frames_ref->data;
+ AVCUDAFramesContext *cuda_priv = real_ctx->hwctx;
+ CUVIDREGISTERDECODESURFACESINFO reg_info = { 0 };
+ CUcontext dummy;
+
+ ret = CHECK_CU(decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx));
+ if (ret < 0) {
+ av_buffer_unref(&decode_hw_frames_ref);
+ av_buffer_unref(&real_hw_frames_ref);
+ ff_nvdec_decode_uninit(avctx);
+ return ret;
+ }
+
+ reg_info.ulNumDecodeSurfaces = FFMIN(cuda_priv->cuarray_num_surfaces,
+ (unsigned)decode_pool_size);
+ reg_info.pDecodeSurfaces = cuda_priv->cuarray_surfaces;
+ ret = CHECK_CU(decoder->cvdl->cuvidRegisterDecodeSurfaces(decoder->decoder, ®_info));
+ CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy));
+ if (ret < 0) {
+ av_buffer_unref(&decode_hw_frames_ref);
+ av_buffer_unref(&real_hw_frames_ref);
+ ff_nvdec_decode_uninit(avctx);
+ return ret;
+ }
+
+ decoder->num_surfaces = reg_info.ulNumDecodeSurfaces;
+ decoder->surface_in_use = av_calloc(decoder->num_surfaces,
+ sizeof(*decoder->surface_in_use));
+ if (!decoder->surface_in_use) {
+ av_buffer_unref(&decode_hw_frames_ref);
+ av_buffer_unref(&real_hw_frames_ref);
+ ff_nvdec_decode_uninit(avctx);
+ return AVERROR(ENOMEM);
+ }
+ }
+#endif
+
+ decoder->decode_hw_frames_ref = decode_hw_frames_ref;
+ decode_hw_frames_ref = NULL;
decoder->real_hw_frames_ref = real_hw_frames_ref;
real_hw_frames_ref = NULL;
@@ -438,7 +714,7 @@ int ff_nvdec_decode_init(AVCodecContext *avctx)
ret = AVERROR(ENOMEM);
goto fail;
}
- pool->dpb_size = FFMIN(frames_ctx->initial_pool_size, 32);
+ pool->dpb_size = FFMIN(decode_pool_size, 32);
ctx->decoder_pool = av_refstruct_pool_alloc_ext(sizeof(unsigned int), 0, pool,
nvdec_decoder_frame_init,
@@ -492,6 +768,25 @@ finish:
av_free(unmap_data);
}
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+typedef struct NVDECOpaqueRelease {
+ NVDECDecoder *decoder;
+ int idx;
+ unsigned int *idx_ref; ///< RefStruct reference keeping the surface index locked
+} NVDECOpaqueRelease;
+
+static void nvdec_opaque_release_slot(void *opaque, uint8_t *data)
+{
+ NVDECOpaqueRelease *r = (NVDECOpaqueRelease *)opaque;
+ if (r->decoder->surface_in_use)
+ atomic_store_explicit(&r->decoder->surface_in_use[r->idx], 0,
+ memory_order_release);
+ av_refstruct_unref(&r->idx_ref);
+ av_refstruct_unref(&r->decoder);
+ av_free(r);
+}
+#endif
+
static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
{
FrameDecodeData *fdd = frame->private_ref;
@@ -511,6 +806,102 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
int shift_h = 0, shift_v = 0;
int ret = 0;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (decoder->opaque_output) {
+ AVHWFramesContext *decode_ctx = (AVHWFramesContext *)decoder->decode_hw_frames_ref->data;
+ AVCUDAFramesContext *cuda_priv = decode_ctx->hwctx;
+
+ if (cf->idx >= (unsigned)cuda_priv->cuarray_num_surfaces) {
+ av_log(logctx, AV_LOG_ERROR,
+ "NVDEC opaque surface index %u out of range (%d surfaces)\n",
+ cf->idx, cuda_priv->cuarray_num_surfaces);
+ return AVERROR_BUG;
+ }
+
+ {
+ CUarray arr = cuda_priv->cuarray_surfaces[cf->idx];
+ AVBufferRef *buf0;
+ NVDECOpaqueRelease *rel;
+
+ rel = av_malloc(sizeof(*rel));
+ if (!rel)
+ return AVERROR(ENOMEM);
+ rel->decoder = av_refstruct_ref(decoder);
+ rel->idx = cf->idx;
+ rel->idx_ref = av_refstruct_ref(cf->idx_ref);
+ buf0 = av_buffer_create((uint8_t *)arr, 0,
+ nvdec_opaque_release_slot, rel,
+ AV_BUFFER_FLAG_READONLY);
+ if (!buf0) {
+ av_refstruct_unref(&rel->idx_ref);
+ av_refstruct_unref(&rel->decoder);
+ av_free(rel);
+ return AVERROR(ENOMEM);
+ }
+
+ /*
+ * Mark the surface in use only now that buf0 owns rel:
+ * nvdec_opaque_release_slot (buf0's free callback) is the sole path
+ * that clears the flag, so deferring the set until buf0 exists keeps
+ * every set paired with a clear, even on a later error return.
+ */
+ if (decoder->surface_in_use)
+ atomic_store_explicit(&decoder->surface_in_use[cf->idx], 1,
+ memory_order_release);
+
+ ret = av_buffer_replace(&frame->hw_frames_ctx,
+ decoder->unsafe_output
+ ? decoder->decode_hw_frames_ref
+ : decoder->real_hw_frames_ref);
+ if (ret < 0) {
+ av_buffer_unref(&buf0);
+ return ret;
+ }
+
+ av_buffer_unref(&frame->buf[0]);
+ frame->buf[0] = buf0;
+ frame->data[0] = (uint8_t *)arr;
+
+ {
+ CUcontext dummy;
+ ret = CHECK_CU(decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx));
+ if (ret < 0) {
+ return ret;
+ }
+ for (int p = 0; p < FF_ARRAY_ELEMS(frame->linesize); p++) {
+ CUDA_ARRAY3D_DESCRIPTOR plane_desc = { 0 };
+ CUarray plane_array;
+ int elem_size;
+ CUresult cures = decoder->cudl->cuArrayGetPlane(&plane_array, arr, p);
+ if (cures == CUDA_ERROR_INVALID_VALUE)
+ break;
+ if (cures != CUDA_SUCCESS) {
+ CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy));
+ return AVERROR_EXTERNAL;
+ }
+ ret = CHECK_CU(decoder->cudl->cuArray3DGetDescriptor(&plane_desc, plane_array));
+ if (ret < 0) {
+ CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy));
+ return ret;
+ }
+ elem_size = ff_cuda_cuarray_elem_size(plane_desc.Format);
+ if (elem_size <= 0)
+ elem_size = 1;
+ frame->linesize[p] = plane_desc.Width * plane_desc.NumChannels * elem_size;
+ }
+ CHECK_CU(decoder->cudl->cuCtxPopCurrent(&dummy));
+ }
+
+ frame->format = AV_PIX_FMT_CUARRAY;
+
+ if (decoder->unsafe_output)
+ return 0;
+
+ return av_frame_make_writable(frame);
+ }
+ }
+#endif
+
vpp.progressive_frame = 1;
vpp.output_stream = decoder->stream;
@@ -663,7 +1054,14 @@ int ff_nvdec_end_frame(AVCodecContext *avctx)
if (ret < 0)
return ret;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (decoder->opaque_output && decoder->cvdl->cuvidDecodePictureAsync)
+ ret = CHECK_CU(decoder->cvdl->cuvidDecodePictureAsync(decoder->decoder, &ctx->pic_params, decoder->stream));
+ else
+ ret = CHECK_CU(decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params));
+#else
ret = CHECK_CU(decoder->cvdl->cuvidDecodePicture(decoder->decoder, &ctx->pic_params));
+#endif
if (ret < 0)
goto finish;
@@ -731,7 +1129,8 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
}
chroma_444 = supports_444 && cuvid_chroma_format == cudaVideoChromaFormat_444;
- frames_ctx->format = AV_PIX_FMT_CUDA;
+ frames_ctx->format = (avctx->hwaccel->pix_fmt == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_CUARRAY : AV_PIX_FMT_CUDA;
// NVDEC target dimensions must be even-aligned for internal surface allocation.
// For chroma-subsampled formats (420/422), the output dimensions must also be
// even. For monochrome/444, keep the original output dimensions and only
@@ -753,7 +1152,8 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
switch (sw_desc->comp[0].depth) {
case 8:
if (chroma_444) {
- frames_ctx->sw_format = AV_PIX_FMT_YUV444P;
+ frames_ctx->sw_format = (frames_ctx->format == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_NV24 : AV_PIX_FMT_YUV444P;
#ifdef NVDEC_HAVE_422_SUPPORT
} else if (cuvid_chroma_format == cudaVideoChromaFormat_422) {
frames_ctx->sw_format = AV_PIX_FMT_NV16;
@@ -765,9 +1165,11 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
case 10:
if (chroma_444) {
#if FF_API_NVDEC_OLD_PIX_FMTS
- frames_ctx->sw_format = AV_PIX_FMT_YUV444P16;
+ frames_ctx->sw_format = (frames_ctx->format == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_P416 : AV_PIX_FMT_YUV444P16;
#else
- frames_ctx->sw_format = AV_PIX_FMT_YUV444P10MSB;
+ frames_ctx->sw_format = (frames_ctx->format == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_P410 : AV_PIX_FMT_YUV444P10MSB;
#endif
#ifdef NVDEC_HAVE_422_SUPPORT
} else if (cuvid_chroma_format == cudaVideoChromaFormat_422) {
@@ -780,9 +1182,11 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
case 12:
if (chroma_444) {
#if FF_API_NVDEC_OLD_PIX_FMTS
- frames_ctx->sw_format = AV_PIX_FMT_YUV444P16;
+ frames_ctx->sw_format = (frames_ctx->format == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_P416 : AV_PIX_FMT_YUV444P16;
#else
- frames_ctx->sw_format = AV_PIX_FMT_YUV444P12MSB;
+ frames_ctx->sw_format = (frames_ctx->format == AV_PIX_FMT_CUARRAY)
+ ? AV_PIX_FMT_P412 : AV_PIX_FMT_YUV444P12MSB;
#endif
#ifdef NVDEC_HAVE_422_SUPPORT
} else if (cuvid_chroma_format == cudaVideoChromaFormat_422) {
diff --git a/libavcodec/nvdec.h b/libavcodec/nvdec.h
index 2e80c0dc1e..756192acd2 100644
--- a/libavcodec/nvdec.h
+++ b/libavcodec/nvdec.h
@@ -46,6 +46,11 @@
#define NVDEC_HAVE_422_SUPPORT
#endif
+// SDK 13.1 compile time feature checks
+#if NVDECAPI_CHECK_VERSION(13, 1)
+#define NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+#endif
+
typedef struct NVDECFrame {
unsigned int idx;
unsigned int ref_idx;
@@ -87,4 +92,10 @@ int ff_nvdec_frame_params(AVCodecContext *avctx,
int supports_444);
int ff_nvdec_get_ref_idx(AVFrame *frame);
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+void ff_nvdec_fill_cuarray_desc(CUDA_ARRAY3D_DESCRIPTOR *desc,
+ AVCodecContext *avctx,
+ cudaVideoSurfaceFormat output_format);
+#endif
+
#endif /* AVCODEC_NVDEC_H */
--
2.52.0
From 54ab6333f51b6066577f0a9829a039f02a72c2ea Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:31:56 +0100
Subject: [PATCH 4/8] avcodec/nvdec: register CUARRAY hwaccel variants for all
supported codecs
Add CUARRAY hwaccel structs (ff_<codec>_nvdec_cuarray_hwaccel) and the
corresponding AV_PIX_FMT_CUARRAY entries in each decoder's pixel format
negotiation list. This allows decoders to advertise CUARRAY as a
supported hardware output format alongside AV_PIX_FMT_CUDA.
Codecs: H.264, HEVC, AV1, MPEG-1, MPEG-2, MPEG-4, VC-1, WMV3, VP8, VP9.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
libavcodec/av1dec.c | 7 ++++++-
libavcodec/h263dec.c | 2 ++
libavcodec/h264_slice.c | 4 +++-
libavcodec/h264dec.c | 1 +
libavcodec/hevc/hevcdec.c | 9 ++++++++-
libavcodec/hwaccels.h | 10 ++++++++++
libavcodec/hwconfig.h | 2 ++
libavcodec/mpeg12dec.c | 4 ++++
libavcodec/mpeg4videodec.c | 1 +
libavcodec/nvdec_av1.c | 14 ++++++++++++++
libavcodec/nvdec_h264.c | 14 ++++++++++++++
libavcodec/nvdec_hevc.c | 14 ++++++++++++++
libavcodec/nvdec_mpeg12.c | 28 ++++++++++++++++++++++++++++
libavcodec/nvdec_mpeg4.c | 14 ++++++++++++++
libavcodec/nvdec_vc1.c | 28 ++++++++++++++++++++++++++++
libavcodec/nvdec_vp8.c | 14 ++++++++++++++
libavcodec/nvdec_vp9.c | 14 ++++++++++++++
libavcodec/vc1dec.c | 2 ++
libavcodec/vp8.c | 2 ++
libavcodec/vp9.c | 5 ++++-
20 files changed, 185 insertions(+), 4 deletions(-)
diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 424bbfc431..7649db4c5b 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -542,7 +542,7 @@ static int get_pixel_format(AVCodecContext *avctx)
#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
CONFIG_AV1_D3D12VA_HWACCEL + \
- CONFIG_AV1_NVDEC_HWACCEL + \
+ CONFIG_AV1_NVDEC_HWACCEL * 2 + \
CONFIG_AV1_VAAPI_HWACCEL + \
CONFIG_AV1_VDPAU_HWACCEL + \
CONFIG_AV1_VIDEOTOOLBOX_HWACCEL + \
@@ -566,6 +566,7 @@ static int get_pixel_format(AVCodecContext *avctx)
#endif
#if CONFIG_AV1_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_AV1_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
@@ -593,6 +594,7 @@ static int get_pixel_format(AVCodecContext *avctx)
#endif
#if CONFIG_AV1_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_AV1_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
@@ -645,11 +647,13 @@ static int get_pixel_format(AVCodecContext *avctx)
case AV_PIX_FMT_GRAY8:
#if CONFIG_AV1_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
break;
case AV_PIX_FMT_GRAY10:
#if CONFIG_AV1_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
break;
}
@@ -1563,6 +1567,7 @@ const FFCodec ff_av1_decoder = {
#endif
#if CONFIG_AV1_NVDEC_HWACCEL
HWACCEL_NVDEC(av1),
+ HWACCEL_NVDEC_CUARRAY(av1),
#endif
#if CONFIG_AV1_VAAPI_HWACCEL
HWACCEL_VAAPI(av1),
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 23fd16b726..3a90e23669 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -55,6 +55,7 @@ static const enum AVPixelFormat h263_hwaccel_pixfmt_list_420[] = {
#endif
#if CONFIG_MPEG4_NVDEC_HWACCEL
AV_PIX_FMT_CUDA,
+ AV_PIX_FMT_CUARRAY,
#endif
#if CONFIG_MPEG4_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
@@ -667,6 +668,7 @@ static const AVCodecHWConfigInternal *const h263_hw_config_list[] = {
#endif
#if CONFIG_MPEG4_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg4),
+ HWACCEL_NVDEC_CUARRAY(mpeg4),
#endif
#if CONFIG_MPEG4_VDPAU_HWACCEL
HWACCEL_VDPAU(mpeg4),
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 7e2c460293..761248f588 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -789,7 +789,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
#define HWACCEL_MAX (CONFIG_H264_DXVA2_HWACCEL + \
(CONFIG_H264_D3D11VA_HWACCEL * 2) + \
CONFIG_H264_D3D12VA_HWACCEL + \
- CONFIG_H264_NVDEC_HWACCEL + \
+ (CONFIG_H264_NVDEC_HWACCEL * 2) + \
CONFIG_H264_VAAPI_HWACCEL + \
CONFIG_H264_VIDEOTOOLBOX_HWACCEL + \
CONFIG_H264_VDPAU_HWACCEL + \
@@ -818,6 +818,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
#endif
#if CONFIG_H264_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
@@ -870,6 +871,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
#endif
#if CONFIG_H264_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
if (h->avctx->colorspace != AVCOL_SPC_RGB)
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index ca65df2b84..1bb1ffe578 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -1133,6 +1133,7 @@ const FFCodec ff_h264_decoder = {
#endif
#if CONFIG_H264_NVDEC_HWACCEL
HWACCEL_NVDEC(h264),
+ HWACCEL_NVDEC_CUARRAY(h264),
#endif
#if CONFIG_H264_VAAPI_HWACCEL
HWACCEL_VAAPI(h264),
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 304c7447ca..ab4e2be19b 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -580,7 +580,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + \
CONFIG_HEVC_D3D11VA_HWACCEL * 2 + \
CONFIG_HEVC_D3D12VA_HWACCEL + \
- CONFIG_HEVC_NVDEC_HWACCEL + \
+ CONFIG_HEVC_NVDEC_HWACCEL * 2 + \
CONFIG_HEVC_VAAPI_HWACCEL + \
CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL + \
CONFIG_HEVC_VDPAU_HWACCEL + \
@@ -613,6 +613,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
*fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
@@ -646,6 +647,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
break;
case AV_PIX_FMT_YUV444P:
@@ -657,6 +659,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_HEVC_VIDEOTOOLBOX_HWACCEL
*fmt++ = AV_PIX_FMT_VIDEOTOOLBOX;
@@ -678,6 +681,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
break;
case AV_PIX_FMT_YUV444P10:
@@ -698,6 +702,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
break;
case AV_PIX_FMT_YUV422P12:
@@ -709,6 +714,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
*fmt++ = AV_PIX_FMT_CUDA;
+ *fmt++ = AV_PIX_FMT_CUARRAY;
#endif
break;
}
@@ -4276,6 +4282,7 @@ const FFCodec ff_hevc_decoder = {
#endif
#if CONFIG_HEVC_NVDEC_HWACCEL
HWACCEL_NVDEC(hevc),
+ HWACCEL_NVDEC_CUARRAY(hevc),
#endif
#if CONFIG_HEVC_VAAPI_HWACCEL
HWACCEL_VAAPI(hevc),
diff --git a/libavcodec/hwaccels.h b/libavcodec/hwaccels.h
index 4f8da46c13..e593bf3b71 100644
--- a/libavcodec/hwaccels.h
+++ b/libavcodec/hwaccels.h
@@ -25,6 +25,7 @@ extern const struct FFHWAccel ff_av1_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_av1_d3d12va_hwaccel;
extern const struct FFHWAccel ff_av1_dxva2_hwaccel;
extern const struct FFHWAccel ff_av1_nvdec_hwaccel;
+extern const struct FFHWAccel ff_av1_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_av1_vaapi_hwaccel;
extern const struct FFHWAccel ff_av1_vdpau_hwaccel;
extern const struct FFHWAccel ff_av1_videotoolbox_hwaccel;
@@ -38,6 +39,7 @@ extern const struct FFHWAccel ff_h264_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_h264_d3d12va_hwaccel;
extern const struct FFHWAccel ff_h264_dxva2_hwaccel;
extern const struct FFHWAccel ff_h264_nvdec_hwaccel;
+extern const struct FFHWAccel ff_h264_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_h264_vaapi_hwaccel;
extern const struct FFHWAccel ff_h264_vdpau_hwaccel;
extern const struct FFHWAccel ff_h264_videotoolbox_hwaccel;
@@ -47,6 +49,7 @@ extern const struct FFHWAccel ff_hevc_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_hevc_d3d12va_hwaccel;
extern const struct FFHWAccel ff_hevc_dxva2_hwaccel;
extern const struct FFHWAccel ff_hevc_nvdec_hwaccel;
+extern const struct FFHWAccel ff_hevc_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_hevc_vaapi_hwaccel;
extern const struct FFHWAccel ff_hevc_vdpau_hwaccel;
extern const struct FFHWAccel ff_hevc_videotoolbox_hwaccel;
@@ -54,6 +57,7 @@ extern const struct FFHWAccel ff_hevc_vulkan_hwaccel;
extern const struct FFHWAccel ff_mjpeg_nvdec_hwaccel;
extern const struct FFHWAccel ff_mjpeg_vaapi_hwaccel;
extern const struct FFHWAccel ff_mpeg1_nvdec_hwaccel;
+extern const struct FFHWAccel ff_mpeg1_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_mpeg1_vdpau_hwaccel;
extern const struct FFHWAccel ff_mpeg1_videotoolbox_hwaccel;
extern const struct FFHWAccel ff_mpeg2_d3d11va_hwaccel;
@@ -61,10 +65,12 @@ extern const struct FFHWAccel ff_mpeg2_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_mpeg2_d3d12va_hwaccel;
extern const struct FFHWAccel ff_mpeg2_dxva2_hwaccel;
extern const struct FFHWAccel ff_mpeg2_nvdec_hwaccel;
+extern const struct FFHWAccel ff_mpeg2_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_mpeg2_vaapi_hwaccel;
extern const struct FFHWAccel ff_mpeg2_vdpau_hwaccel;
extern const struct FFHWAccel ff_mpeg2_videotoolbox_hwaccel;
extern const struct FFHWAccel ff_mpeg4_nvdec_hwaccel;
+extern const struct FFHWAccel ff_mpeg4_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel;
extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel;
extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel;
@@ -77,15 +83,18 @@ extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_vc1_d3d12va_hwaccel;
extern const struct FFHWAccel ff_vc1_dxva2_hwaccel;
extern const struct FFHWAccel ff_vc1_nvdec_hwaccel;
+extern const struct FFHWAccel ff_vc1_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_vc1_vaapi_hwaccel;
extern const struct FFHWAccel ff_vc1_vdpau_hwaccel;
extern const struct FFHWAccel ff_vp8_nvdec_hwaccel;
+extern const struct FFHWAccel ff_vp8_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_vp8_vaapi_hwaccel;
extern const struct FFHWAccel ff_vp9_d3d11va_hwaccel;
extern const struct FFHWAccel ff_vp9_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_vp9_d3d12va_hwaccel;
extern const struct FFHWAccel ff_vp9_dxva2_hwaccel;
extern const struct FFHWAccel ff_vp9_nvdec_hwaccel;
+extern const struct FFHWAccel ff_vp9_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_vp9_vaapi_hwaccel;
extern const struct FFHWAccel ff_vp9_vdpau_hwaccel;
extern const struct FFHWAccel ff_vp9_videotoolbox_hwaccel;
@@ -96,6 +105,7 @@ extern const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel;
extern const struct FFHWAccel ff_wmv3_d3d12va_hwaccel;
extern const struct FFHWAccel ff_wmv3_dxva2_hwaccel;
extern const struct FFHWAccel ff_wmv3_nvdec_hwaccel;
+extern const struct FFHWAccel ff_wmv3_nvdec_cuarray_hwaccel;
extern const struct FFHWAccel ff_wmv3_vaapi_hwaccel;
extern const struct FFHWAccel ff_wmv3_vdpau_hwaccel;
diff --git a/libavcodec/hwconfig.h b/libavcodec/hwconfig.h
index ee29ca631d..c7b1888017 100644
--- a/libavcodec/hwconfig.h
+++ b/libavcodec/hwconfig.h
@@ -67,6 +67,8 @@ void ff_hwaccel_uninit(AVCodecContext *avctx);
HW_CONFIG_HWACCEL(1, 1, 0, D3D11, D3D11VA, ff_ ## codec ## _d3d11va2_hwaccel)
#define HWACCEL_NVDEC(codec) \
HW_CONFIG_HWACCEL(1, 1, 0, CUDA, CUDA, ff_ ## codec ## _nvdec_hwaccel)
+#define HWACCEL_NVDEC_CUARRAY(codec) \
+ HW_CONFIG_HWACCEL(1, 1, 0, CUARRAY, CUDA, ff_ ## codec ## _nvdec_cuarray_hwaccel)
#define HWACCEL_VAAPI(codec) \
HW_CONFIG_HWACCEL(1, 1, 1, VAAPI, VAAPI, ff_ ## codec ## _vaapi_hwaccel)
#define HWACCEL_VDPAU(codec) \
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index ce3066e4a0..19f2cbb2ce 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -790,6 +790,7 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG1_NVDEC_HWACCEL
AV_PIX_FMT_CUDA,
+ AV_PIX_FMT_CUARRAY,
#endif
#if CONFIG_MPEG1_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
@@ -801,6 +802,7 @@ static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = {
static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
#if CONFIG_MPEG2_NVDEC_HWACCEL
AV_PIX_FMT_CUDA,
+ AV_PIX_FMT_CUARRAY,
#endif
#if CONFIG_MPEG2_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
@@ -2653,6 +2655,7 @@ const FFCodec ff_mpeg1video_decoder = {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MPEG1_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg1),
+ HWACCEL_NVDEC_CUARRAY(mpeg1),
#endif
#if CONFIG_MPEG1_VDPAU_HWACCEL
HWACCEL_VDPAU(mpeg1),
@@ -2724,6 +2727,7 @@ const FFCodec ff_mpeg2video_decoder = {
#endif
#if CONFIG_MPEG2_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg2),
+ HWACCEL_NVDEC_CUARRAY(mpeg2),
#endif
#if CONFIG_MPEG2_VAAPI_HWACCEL
HWACCEL_VAAPI(mpeg2),
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 3d20f7c389..e6ac96c668 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -4100,6 +4100,7 @@ const FFCodec ff_mpeg4_decoder = {
.hw_configs = (const AVCodecHWConfigInternal *const []) {
#if CONFIG_MPEG4_NVDEC_HWACCEL
HWACCEL_NVDEC(mpeg4),
+ HWACCEL_NVDEC_CUARRAY(mpeg4),
#endif
#if CONFIG_MPEG4_VAAPI_HWACCEL
HWACCEL_VAAPI(mpeg4),
diff --git a/libavcodec/nvdec_av1.c b/libavcodec/nvdec_av1.c
index d07fe6324c..87ce7aef3e 100644
--- a/libavcodec/nvdec_av1.c
+++ b/libavcodec/nvdec_av1.c
@@ -352,3 +352,17 @@ const FFHWAccel ff_av1_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_av1_nvdec_cuarray_hwaccel = {
+ .p.name = "av1_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_AV1,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_av1_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = nvdec_av1_decode_slice,
+ .frame_params = nvdec_av1_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/nvdec_h264.c b/libavcodec/nvdec_h264.c
index 54c98e611d..b92f88ce36 100644
--- a/libavcodec/nvdec_h264.c
+++ b/libavcodec/nvdec_h264.c
@@ -185,3 +185,17 @@ const FFHWAccel ff_h264_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_h264_nvdec_cuarray_hwaccel = {
+ .p.name = "h264_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_H264,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_h264_start_frame,
+ .end_frame = ff_nvdec_end_frame,
+ .decode_slice = nvdec_h264_decode_slice,
+ .frame_params = nvdec_h264_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/nvdec_hevc.c b/libavcodec/nvdec_hevc.c
index 2b9df3e702..8479a652b4 100644
--- a/libavcodec/nvdec_hevc.c
+++ b/libavcodec/nvdec_hevc.c
@@ -334,3 +334,17 @@ const FFHWAccel ff_hevc_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_hevc_nvdec_cuarray_hwaccel = {
+ .p.name = "hevc_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_HEVC,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_hevc_start_frame,
+ .end_frame = ff_nvdec_end_frame,
+ .decode_slice = nvdec_hevc_decode_slice,
+ .frame_params = nvdec_hevc_frame_params,
+ .init = nvdec_hevc_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/nvdec_mpeg12.c b/libavcodec/nvdec_mpeg12.c
index ca0a1001dc..f5fd0116c5 100644
--- a/libavcodec/nvdec_mpeg12.c
+++ b/libavcodec/nvdec_mpeg12.c
@@ -116,6 +116,20 @@ const FFHWAccel ff_mpeg2_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_mpeg2_nvdec_cuarray_hwaccel = {
+ .p.name = "mpeg2_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG2VIDEO,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_mpeg12_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = ff_nvdec_simple_decode_slice,
+ .frame_params = nvdec_mpeg12_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
#endif
#if CONFIG_MPEG1_NVDEC_HWACCEL
@@ -132,4 +146,18 @@ const FFHWAccel ff_mpeg1_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_mpeg1_nvdec_cuarray_hwaccel = {
+ .p.name = "mpeg1_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG1VIDEO,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_mpeg12_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = ff_nvdec_simple_decode_slice,
+ .frame_params = nvdec_mpeg12_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
#endif
diff --git a/libavcodec/nvdec_mpeg4.c b/libavcodec/nvdec_mpeg4.c
index 369bd5b997..aafb0bf8fb 100644
--- a/libavcodec/nvdec_mpeg4.c
+++ b/libavcodec/nvdec_mpeg4.c
@@ -125,3 +125,17 @@ const FFHWAccel ff_mpeg4_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_mpeg4_nvdec_cuarray_hwaccel = {
+ .p.name = "mpeg4_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_MPEG4,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_mpeg4_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = nvdec_mpeg4_decode_slice,
+ .frame_params = nvdec_mpeg4_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/nvdec_vc1.c b/libavcodec/nvdec_vc1.c
index d00cf5237a..ce24d8b04b 100644
--- a/libavcodec/nvdec_vc1.c
+++ b/libavcodec/nvdec_vc1.c
@@ -173,6 +173,20 @@ const FFHWAccel ff_vc1_nvdec_hwaccel = {
.priv_data_size = sizeof(NVDECContext),
};
+const FFHWAccel ff_vc1_nvdec_cuarray_hwaccel = {
+ .p.name = "vc1_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_VC1,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_vc1_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = nvdec_vc1_decode_slice,
+ .frame_params = nvdec_vc1_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
+
#if CONFIG_WMV3_NVDEC_HWACCEL
const FFHWAccel ff_wmv3_nvdec_hwaccel = {
.p.name = "wmv3_nvdec",
@@ -187,4 +201,18 @@ const FFHWAccel ff_wmv3_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_wmv3_nvdec_cuarray_hwaccel = {
+ .p.name = "wmv3_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_WMV3,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_vc1_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = ff_nvdec_simple_decode_slice,
+ .frame_params = nvdec_vc1_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
#endif
diff --git a/libavcodec/nvdec_vp8.c b/libavcodec/nvdec_vp8.c
index e273a6ec35..0f01e4c696 100644
--- a/libavcodec/nvdec_vp8.c
+++ b/libavcodec/nvdec_vp8.c
@@ -106,3 +106,17 @@ const FFHWAccel ff_vp8_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_vp8_nvdec_cuarray_hwaccel = {
+ .p.name = "vp8_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_VP8,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_vp8_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = ff_nvdec_simple_decode_slice,
+ .frame_params = nvdec_vp8_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/nvdec_vp9.c b/libavcodec/nvdec_vp9.c
index f83ff93818..70db8d6fce 100644
--- a/libavcodec/nvdec_vp9.c
+++ b/libavcodec/nvdec_vp9.c
@@ -185,3 +185,17 @@ const FFHWAccel ff_vp9_nvdec_hwaccel = {
.uninit = ff_nvdec_decode_uninit,
.priv_data_size = sizeof(NVDECContext),
};
+
+const FFHWAccel ff_vp9_nvdec_cuarray_hwaccel = {
+ .p.name = "vp9_nvdec_cuarray",
+ .p.type = AVMEDIA_TYPE_VIDEO,
+ .p.id = AV_CODEC_ID_VP9,
+ .p.pix_fmt = AV_PIX_FMT_CUARRAY,
+ .start_frame = nvdec_vp9_start_frame,
+ .end_frame = ff_nvdec_simple_end_frame,
+ .decode_slice = ff_nvdec_simple_decode_slice,
+ .frame_params = nvdec_vp9_frame_params,
+ .init = ff_nvdec_decode_init,
+ .uninit = ff_nvdec_decode_uninit,
+ .priv_data_size = sizeof(NVDECContext),
+};
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 12b1e09415..ab9288c22e 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1416,6 +1416,7 @@ const FFCodec ff_vc1_decoder = {
#endif
#if CONFIG_VC1_NVDEC_HWACCEL
HWACCEL_NVDEC(vc1),
+ HWACCEL_NVDEC_CUARRAY(vc1),
#endif
#if CONFIG_VC1_VAAPI_HWACCEL
HWACCEL_VAAPI(vc1),
@@ -1455,6 +1456,7 @@ const FFCodec ff_wmv3_decoder = {
#endif
#if CONFIG_WMV3_NVDEC_HWACCEL
HWACCEL_NVDEC(wmv3),
+ HWACCEL_NVDEC_CUARRAY(wmv3),
#endif
#if CONFIG_WMV3_VAAPI_HWACCEL
HWACCEL_VAAPI(wmv3),
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index c54e79173c..f4fa818b36 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -185,6 +185,7 @@ static enum AVPixelFormat get_pixel_format(VP8Context *s)
#endif
#if CONFIG_VP8_NVDEC_HWACCEL
AV_PIX_FMT_CUDA,
+ AV_PIX_FMT_CUARRAY,
#endif
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE,
@@ -2976,6 +2977,7 @@ const FFCodec ff_vp8_decoder = {
#endif
#if CONFIG_VP8_NVDEC_HWACCEL
HWACCEL_NVDEC(vp8),
+ HWACCEL_NVDEC_CUARRAY(vp8),
#endif
NULL
},
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 7957cbeab9..8e42df2c4c 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -167,7 +167,7 @@ static int update_size(AVCodecContext *avctx, int w, int h)
#define HWACCEL_MAX (CONFIG_VP9_DXVA2_HWACCEL + \
CONFIG_VP9_D3D11VA_HWACCEL * 2 + \
CONFIG_VP9_D3D12VA_HWACCEL + \
- CONFIG_VP9_NVDEC_HWACCEL + \
+ CONFIG_VP9_NVDEC_HWACCEL * 2 + \
CONFIG_VP9_VAAPI_HWACCEL + \
CONFIG_VP9_VDPAU_HWACCEL + \
CONFIG_VP9_VIDEOTOOLBOX_HWACCEL + \
@@ -201,6 +201,7 @@ static int update_size(AVCodecContext *avctx, int w, int h)
#endif
#if CONFIG_VP9_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_VP9_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
@@ -218,6 +219,7 @@ static int update_size(AVCodecContext *avctx, int w, int h)
case AV_PIX_FMT_YUV420P12:
#if CONFIG_VP9_NVDEC_HWACCEL
*fmtp++ = AV_PIX_FMT_CUDA;
+ *fmtp++ = AV_PIX_FMT_CUARRAY;
#endif
#if CONFIG_VP9_VAAPI_HWACCEL
*fmtp++ = AV_PIX_FMT_VAAPI;
@@ -1952,6 +1954,7 @@ const FFCodec ff_vp9_decoder = {
#endif
#if CONFIG_VP9_NVDEC_HWACCEL
HWACCEL_NVDEC(vp9),
+ HWACCEL_NVDEC_CUARRAY(vp9),
#endif
#if CONFIG_VP9_VAAPI_HWACCEL
HWACCEL_VAAPI(vp9),
--
2.52.0
From 56fa38dbeb310a1b1f8efb7d446256bcecb0f30c Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:33:08 +0100
Subject: [PATCH 5/8] avcodec/cuviddec: add CUARRAY opaque output and zero-copy
support
Implement opaque block-linear output for the CUVID decoder, mirroring
the NVDEC hwaccel path but within the standalone CUVID demuxer/decoder.
Key additions:
- output_format=cuarray option and zero_copy toggle
- CUarray surface creation and cuvidRegisterDecodeSurfaces
- Zero-copy path: frames reference decode CUarray surfaces directly
- Copy path: output surfaces allocated from the hwcontext_cuda pool
- Deferred decoder cleanup (CuvidDecoderCleanup) to handle the case
where surfaces outlive the decoder due to encoder buffering
- 444 chroma sw_pix_fmt remapping to semi-planar (NV24, P410, P412,
P416) to match the native CUarray layout
- Per-plane linesize derived from CUarray plane descriptors via
cuArrayGetPlane / cuArray3DGetDescriptor
- Crop, resize, and deinterlace forced off (with warnings) for
cuarray output, as the decode surfaces are used directly
All opaque-specific code is guarded by NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
libavcodec/cuviddec.c | 629 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 592 insertions(+), 37 deletions(-)
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 10e4cb3e21..e981f04b2a 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -21,6 +21,8 @@
#include "config_components.h"
+#include <stdatomic.h>
+
#include "compat/cuda/dynlink_loader.h"
#include "libavutil/buffer.h"
@@ -51,6 +53,16 @@
#define CUVID_HAS_AV1_SUPPORT
#endif
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+typedef struct CuvidDecoderCleanup {
+ CUvideodecoder cudecoder;
+ CUarray *cuarray_surfaces;
+ int cuarray_num_surfaces;
+ AVBufferRef *hwdevice;
+ CuvidFunctions *cvdl;
+} CuvidDecoderCleanup;
+#endif
+
typedef struct CuvidContext
{
AVClass *avclass;
@@ -92,6 +104,7 @@ typedef struct CuvidContext
int internal_error;
int decoder_flushing;
+ atomic_int abort_decode;
int *key_frame;
@@ -105,6 +118,18 @@ typedef struct CuvidContext
CudaFunctions *cudl;
CuvidFunctions *cvdl;
+
+ enum AVPixelFormat output_format;
+ int zero_copy;
+ int opaque_output;
+ CUstream cuda_stream;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ CUarray *cuarray_surfaces;
+ int cuarray_num_surfaces;
+ AVBufferRef *surface_in_use_ref;
+ atomic_int *surface_in_use;
+ CuvidDecoderCleanup *decoder_cleanup;
+#endif
} CuvidContext;
typedef struct CuvidParsedFrame
@@ -122,6 +147,104 @@ typedef struct CuvidParsedFrame
// Actual pool size will be determined by parser.
#define CUVID_DEFAULT_NUM_SURFACES (CUVID_MAX_DISPLAY_DELAY + 1)
+static int cuvid_get_requested_hw_format(AVCodecContext *avctx, CuvidContext *ctx,
+ enum AVPixelFormat *fmt)
+{
+ enum AVPixelFormat requested = ctx->output_format;
+
+ if (requested == AV_PIX_FMT_NONE)
+ requested = AV_PIX_FMT_CUDA;
+
+ if (ctx->zero_copy && requested != AV_PIX_FMT_CUARRAY) {
+ av_log(avctx, AV_LOG_WARNING,
+ "zero_copy requires cuarray output format; "
+ "overriding -output_format %s -> cuarray\n",
+ av_get_pix_fmt_name(requested) ? av_get_pix_fmt_name(requested) : "unknown");
+ requested = AV_PIX_FMT_CUARRAY;
+ }
+
+ switch (requested) {
+ case AV_PIX_FMT_CUDA:
+ break;
+ case AV_PIX_FMT_CUARRAY:
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ break;
+#else
+ av_log(avctx, AV_LOG_ERROR,
+ "CUARRAY output requires Video Codec SDK 13.1 or later\n");
+ return AVERROR(ENOSYS);
+#endif
+ default:
+ av_log(avctx, AV_LOG_ERROR,
+ "Unsupported cuvid output format: %s\n",
+ av_get_pix_fmt_name(requested) ? av_get_pix_fmt_name(requested) : "unknown");
+ return AVERROR(EINVAL);
+ }
+
+ *fmt = requested;
+ return 0;
+}
+
+static void cuvid_prepare_format_list(enum AVPixelFormat *pix_fmts,
+ enum AVPixelFormat hw_format,
+ enum AVPixelFormat sw_format)
+{
+ pix_fmts[0] = hw_format;
+ pix_fmts[1] = sw_format;
+ pix_fmts[2] = AV_PIX_FMT_NONE;
+ pix_fmts[3] = AV_PIX_FMT_NONE;
+}
+
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+typedef struct CuvidSurfaceRelease {
+ AVBufferRef *in_use_ref;
+ int idx;
+} CuvidSurfaceRelease;
+
+static void cuvid_cuarray_buf_free(void *opaque, uint8_t *data)
+{
+ CuvidSurfaceRelease *rel = opaque;
+ atomic_int *flags = (atomic_int *)rel->in_use_ref->data;
+ atomic_store_explicit(&flags[rel->idx], 0, memory_order_release);
+ av_buffer_unref(&rel->in_use_ref);
+ av_free(rel);
+}
+
+static void cuvid_decoder_cleanup_free(void *opaque, uint8_t *data)
+{
+ CuvidDecoderCleanup *cleanup = opaque;
+
+ if (cleanup && cleanup->hwdevice) {
+ AVHWDeviceContext *device_ctx = (AVHWDeviceContext *)cleanup->hwdevice->data;
+ AVCUDADeviceContext *device_hwctx = device_ctx->hwctx;
+ CudaFunctions *cudl = device_hwctx->internal->cuda_dl;
+ CUcontext dummy;
+
+ cudl->cuCtxPushCurrent(device_hwctx->cuda_ctx);
+
+ if (cleanup->cudecoder && cleanup->cvdl)
+ cleanup->cvdl->cuvidDestroyDecoder(cleanup->cudecoder);
+
+ if (cleanup->cuarray_surfaces) {
+ for (int i = 0; i < cleanup->cuarray_num_surfaces; i++)
+ cudl->cuArrayDestroy(cleanup->cuarray_surfaces[i]);
+ }
+
+ cudl->cuCtxPopCurrent(&dummy);
+ av_buffer_unref(&cleanup->hwdevice);
+ }
+
+ if (cleanup) {
+ av_freep(&cleanup->cuarray_surfaces);
+ cuvid_free_functions(&cleanup->cvdl);
+ av_free(cleanup);
+ }
+
+ av_free(data);
+}
+
+#endif
+
static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* format)
{
AVCodecContext *avctx = opaque;
@@ -132,13 +255,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
int surface_fmt;
int chroma_444;
int old_nb_surfaces, fifo_size_inc, fifo_size_mul = 1;
+ enum AVPixelFormat requested_hw_format;
int old_width = avctx->width;
int old_height = avctx->height;
- enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_CUDA,
- AV_PIX_FMT_NONE, // Will be updated below
- AV_PIX_FMT_NONE };
+ enum AVPixelFormat pix_fmts[4];
av_log(avctx, AV_LOG_TRACE, "pfnSequenceCallback, progressive_sequence=%d\n", format->progressive_sequence);
@@ -146,6 +268,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
ctx->internal_error = 0;
+ surface_fmt = cuvid_get_requested_hw_format(avctx, ctx, &requested_hw_format);
+ if (surface_fmt < 0) {
+ ctx->internal_error = surface_fmt;
+ return 0;
+ }
+
avctx->coded_width = cuinfo.ulWidth = format->coded_width;
avctx->coded_height = cuinfo.ulHeight = format->coded_height;
@@ -252,6 +380,8 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return 0;
}
+ cuvid_prepare_format_list(pix_fmts, requested_hw_format, pix_fmts[1]);
+
surface_fmt = ff_get_format(avctx, pix_fmts);
if (surface_fmt < 0) {
av_log(avctx, AV_LOG_ERROR, "ff_get_format failed: %d\n", surface_fmt);
@@ -259,13 +389,34 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return 0;
}
+ if (surface_fmt != AV_PIX_FMT_CUDA && surface_fmt != AV_PIX_FMT_CUARRAY) {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "ff_get_format returned %s, overriding to %s\n",
+ av_get_pix_fmt_name(surface_fmt),
+ av_get_pix_fmt_name(requested_hw_format));
+ surface_fmt = requested_hw_format;
+ }
+
av_log(avctx, AV_LOG_VERBOSE, "Formats: Original: %s | HW: %s | SW: %s\n",
av_get_pix_fmt_name(avctx->pix_fmt),
av_get_pix_fmt_name(surface_fmt),
av_get_pix_fmt_name(avctx->sw_pix_fmt));
+ ctx->opaque_output = (surface_fmt == AV_PIX_FMT_CUARRAY);
avctx->pix_fmt = surface_fmt;
+ if (ctx->opaque_output) {
+ switch (avctx->sw_pix_fmt) {
+ case AV_PIX_FMT_YUV444P: avctx->sw_pix_fmt = AV_PIX_FMT_NV24; break;
+#if FF_API_NVDEC_OLD_PIX_FMTS
+ case AV_PIX_FMT_YUV444P16: avctx->sw_pix_fmt = AV_PIX_FMT_P416; break;
+#endif
+ case AV_PIX_FMT_YUV444P10MSB: avctx->sw_pix_fmt = AV_PIX_FMT_P410; break;
+ case AV_PIX_FMT_YUV444P12MSB: avctx->sw_pix_fmt = AV_PIX_FMT_P412; break;
+ default: break;
+ }
+ }
+
// Update our hwframe ctx, as the get_format callback might have refreshed it!
if (avctx->hw_frames_ctx) {
av_buffer_unref(&ctx->hwframe);
@@ -299,9 +450,12 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
else
avctx->color_range = AVCOL_RANGE_MPEG;
- avctx->color_primaries = format->video_signal_description.color_primaries;
- avctx->color_trc = format->video_signal_description.transfer_characteristics;
- avctx->colorspace = format->video_signal_description.matrix_coefficients;
+ if (format->video_signal_description.color_primaries)
+ avctx->color_primaries = format->video_signal_description.color_primaries;
+ if (format->video_signal_description.transfer_characteristics)
+ avctx->color_trc = format->video_signal_description.transfer_characteristics;
+ if (format->video_signal_description.matrix_coefficients)
+ avctx->colorspace = format->video_signal_description.matrix_coefficients;
if (format->bitrate)
avctx->bit_rate = format->bitrate;
@@ -331,12 +485,13 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
if (hwframe_ctx->pool && (
hwframe_ctx->width < avctx->width ||
hwframe_ctx->height < avctx->height ||
- hwframe_ctx->format != AV_PIX_FMT_CUDA ||
+ (hwframe_ctx->format != AV_PIX_FMT_CUDA && hwframe_ctx->format != AV_PIX_FMT_CUARRAY) ||
hwframe_ctx->sw_format != avctx->sw_pix_fmt)) {
av_log(avctx, AV_LOG_ERROR, "AVHWFramesContext is already initialized with incompatible parameters\n");
av_log(avctx, AV_LOG_DEBUG, "width: %d <-> %d\n", hwframe_ctx->width, avctx->width);
av_log(avctx, AV_LOG_DEBUG, "height: %d <-> %d\n", hwframe_ctx->height, avctx->height);
- av_log(avctx, AV_LOG_DEBUG, "format: %s <-> cuda\n", av_get_pix_fmt_name(hwframe_ctx->format));
+ av_log(avctx, AV_LOG_DEBUG, "format: %s <-> %s\n", av_get_pix_fmt_name(hwframe_ctx->format),
+ av_get_pix_fmt_name(avctx->pix_fmt));
av_log(avctx, AV_LOG_DEBUG, "sw_format: %s <-> %s\n",
av_get_pix_fmt_name(hwframe_ctx->sw_format), av_get_pix_fmt_name(avctx->sw_pix_fmt));
ctx->internal_error = AVERROR(EINVAL);
@@ -365,9 +520,15 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
break;
#endif
case AV_PIX_FMT_YUV444P:
+ case AV_PIX_FMT_NV24:
cuinfo.OutputFormat = cudaVideoSurfaceFormat_YUV444;
break;
case AV_PIX_FMT_YUV444P16:
+ case AV_PIX_FMT_YUV444P10MSB:
+ case AV_PIX_FMT_YUV444P12MSB:
+ case AV_PIX_FMT_P410:
+ case AV_PIX_FMT_P412:
+ case AV_PIX_FMT_P416:
cuinfo.OutputFormat = cudaVideoSurfaceFormat_YUV444_16Bit;
break;
default:
@@ -377,6 +538,22 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
return 0;
}
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->opaque_output) {
+ switch (cuinfo.OutputFormat) {
+ case cudaVideoSurfaceFormat_NV12: cuinfo.OutputFormat = cudaVideoSurfaceFormat_NV12_Opaque; break;
+ case cudaVideoSurfaceFormat_P016: cuinfo.OutputFormat = cudaVideoSurfaceFormat_P016_Opaque; break;
+#ifdef NVDEC_HAVE_422_SUPPORT
+ case cudaVideoSurfaceFormat_NV16: cuinfo.OutputFormat = cudaVideoSurfaceFormat_NV16_Opaque; break;
+ case cudaVideoSurfaceFormat_P216: cuinfo.OutputFormat = cudaVideoSurfaceFormat_P216_Opaque; break;
+#endif
+ case cudaVideoSurfaceFormat_YUV444: cuinfo.OutputFormat = cudaVideoSurfaceFormat_YUV444_Opaque; break;
+ case cudaVideoSurfaceFormat_YUV444_16Bit: cuinfo.OutputFormat = cudaVideoSurfaceFormat_YUV444_16Bit_Opaque; break;
+ default: break;
+ }
+ }
+#endif
+
if (ctx->deint_mode_current != cudaVideoDeinterlaceMode_Weave && !ctx->drop_second_field) {
avctx->framerate = av_mul_q(avctx->framerate, (AVRational){2, 1});
fifo_size_mul = 2;
@@ -386,6 +563,11 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
ctx->nb_surfaces = FFMAX(ctx->nb_surfaces, format->min_num_decode_surfaces + 3);
if (avctx->extra_hw_frames > 0)
ctx->nb_surfaces += avctx->extra_hw_frames;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->opaque_output && ctx->zero_copy)
+ ctx->nb_surfaces = FFMIN(FFMAX(ctx->nb_surfaces, format->min_num_decode_surfaces + 16),
+ MAX_NUM_REGISTERED_DECODE_SURFACES);
+#endif
fifo_size_inc = ctx->nb_surfaces * fifo_size_mul - av_fifo_can_read(ctx->frame_queue) - av_fifo_can_write(ctx->frame_queue);
if (fifo_size_inc > 0 && av_fifo_grow2(ctx->frame_queue, fifo_size_inc) < 0) {
@@ -401,7 +583,7 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
}
cuinfo.ulNumDecodeSurfaces = ctx->nb_surfaces;
- cuinfo.ulNumOutputSurfaces = 1;
+ cuinfo.ulNumOutputSurfaces = ctx->opaque_output ? 0 : 1;
cuinfo.ulCreationFlags = cudaVideoCreate_PreferCUVID;
cuinfo.bitDepthMinus8 = format->bit_depth_luma_minus8;
cuinfo.DeinterlaceMode = ctx->deint_mode_current;
@@ -410,11 +592,124 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
if (ctx->internal_error < 0)
return 0;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->opaque_output) {
+ CUDA_ARRAY3D_DESCRIPTOR arr_desc;
+ CUVIDREGISTERDECODESURFACESINFO reg_info;
+ CUcontext dummy;
+ int i;
+
+ ff_nvdec_fill_cuarray_desc(&arr_desc, avctx, cuinfo.OutputFormat);
+
+ if (ctx->cuarray_surfaces) {
+ if (ctx->decoder_cleanup) {
+ ctx->decoder_cleanup->cuarray_surfaces = NULL;
+ ctx->decoder_cleanup->cuarray_num_surfaces = 0;
+ ctx->decoder_cleanup->cudecoder = NULL;
+ ctx->decoder_cleanup = NULL;
+ }
+ for (i = 0; i < ctx->cuarray_num_surfaces; i++)
+ ctx->cudl->cuArrayDestroy(ctx->cuarray_surfaces[i]);
+ av_freep(&ctx->cuarray_surfaces);
+ av_buffer_unref(&ctx->surface_in_use_ref);
+ ctx->surface_in_use = NULL;
+ }
+ ctx->cuarray_num_surfaces = ctx->nb_surfaces;
+ ctx->cuarray_surfaces = av_calloc(ctx->cuarray_num_surfaces, sizeof(CUarray));
+ if (!ctx->cuarray_surfaces) {
+ ctx->internal_error = AVERROR(ENOMEM);
+ return 0;
+ }
+ {
+ atomic_int *flags = av_calloc(ctx->cuarray_num_surfaces, sizeof(*flags));
+ CuvidDecoderCleanup *cleanup = NULL;
+ if (!flags) {
+ ctx->internal_error = AVERROR(ENOMEM);
+ return 0;
+ }
+ if (ctx->zero_copy) {
+ cleanup = av_mallocz(sizeof(*cleanup));
+ if (!cleanup) {
+ av_free((void *)flags);
+ ctx->internal_error = AVERROR(ENOMEM);
+ return 0;
+ }
+ ctx->decoder_cleanup = cleanup;
+ }
+ ctx->surface_in_use_ref = av_buffer_create(
+ (uint8_t *)flags, ctx->cuarray_num_surfaces * sizeof(*flags),
+ cleanup ? cuvid_decoder_cleanup_free : NULL,
+ cleanup, 0);
+ if (!ctx->surface_in_use_ref) {
+ av_free((void *)flags);
+ av_free(cleanup);
+ ctx->decoder_cleanup = NULL;
+ ctx->internal_error = AVERROR(ENOMEM);
+ return 0;
+ }
+ ctx->surface_in_use = flags;
+ }
+
+ for (i = 0; i < ctx->cuarray_num_surfaces; i++) {
+ ctx->internal_error = CHECK_CU(ctx->cudl->cuArray3DCreate(
+ &ctx->cuarray_surfaces[i], &arr_desc));
+ if (ctx->internal_error < 0) {
+ for (int j = 0; j < i; j++)
+ ctx->cudl->cuArrayDestroy(ctx->cuarray_surfaces[j]);
+ av_freep(&ctx->cuarray_surfaces);
+ av_buffer_unref(&ctx->surface_in_use_ref);
+ ctx->surface_in_use = NULL;
+ ctx->cuarray_num_surfaces = 0;
+ return 0;
+ }
+ }
+
+ {
+ AVHWDeviceContext *dev_ctx =
+ (AVHWDeviceContext *)ctx->hwdevice->data;
+ AVCUDADeviceContext *dev_hwctx = dev_ctx->hwctx;
+ ctx->internal_error = CHECK_CU(ctx->cudl->cuCtxPushCurrent(
+ dev_hwctx->cuda_ctx));
+ }
+ if (ctx->internal_error < 0)
+ return 0;
+
+ memset(®_info, 0, sizeof(reg_info));
+ reg_info.ulNumDecodeSurfaces = ctx->cuarray_num_surfaces;
+ reg_info.pDecodeSurfaces = ctx->cuarray_surfaces;
+
+ if (ctx->cvdl->cuvidRegisterDecodeSurfaces) {
+ ctx->internal_error = CHECK_CU(
+ ctx->cvdl->cuvidRegisterDecodeSurfaces(
+ ctx->cudecoder, ®_info));
+ } else {
+ av_log(avctx, AV_LOG_ERROR, "cuvidRegisterDecodeSurfaces not available in loaded driver\n");
+ ctx->internal_error = AVERROR(ENOSYS);
+ }
+ CHECK_CU(ctx->cudl->cuCtxPopCurrent(&dummy));
+ if (ctx->internal_error < 0)
+ return 0;
+
+ if (ctx->decoder_cleanup) {
+ ctx->decoder_cleanup->cudecoder = ctx->cudecoder;
+ ctx->decoder_cleanup->cuarray_surfaces = ctx->cuarray_surfaces;
+ ctx->decoder_cleanup->cuarray_num_surfaces = ctx->cuarray_num_surfaces;
+ }
+ }
+#endif
+
if (!hwframe_ctx->pool) {
- hwframe_ctx->format = AV_PIX_FMT_CUDA;
+ hwframe_ctx->format = avctx->pix_fmt;
hwframe_ctx->sw_format = avctx->sw_pix_fmt;
- hwframe_ctx->width = avctx->width;
- hwframe_ctx->height = avctx->height;
+ hwframe_ctx->width = avctx->width;
+ hwframe_ctx->height = avctx->height;
+
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (hwframe_ctx->format == AV_PIX_FMT_CUARRAY) {
+ AVCUDAFramesContext *cuda_hwctx = hwframe_ctx->hwctx;
+ ff_nvdec_fill_cuarray_desc(&cuda_hwctx->cuarray_desc, avctx, cuinfo.OutputFormat);
+ }
+#endif
if ((ctx->internal_error = av_hwframe_ctx_init(ctx->hwframe)) < 0) {
av_log(avctx, AV_LOG_ERROR, "av_hwframe_ctx_init failed\n");
@@ -437,10 +732,34 @@ static int CUDAAPI cuvid_handle_picture_decode(void *opaque, CUVIDPICPARAMS* pic
av_log(avctx, AV_LOG_TRACE, "pfnDecodePicture\n");
+ if (atomic_load_explicit(&ctx->abort_decode, memory_order_acquire))
+ return 0;
+
if(picparams->intra_pic_flag)
ctx->key_frame[picparams->CurrPicIdx] = picparams->intra_pic_flag;
- ctx->internal_error = CHECK_CU(ctx->cvdl->cuvidDecodePicture(ctx->cudecoder, picparams));
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->opaque_output) {
+ if (ctx->surface_in_use &&
+ atomic_load_explicit(&ctx->surface_in_use[picparams->CurrPicIdx],
+ memory_order_acquire)) {
+ av_log(avctx, AV_LOG_ERROR,
+ "CUARRAY surface %d still in use by the encoder. "
+ "Increase surfaces with -extra_hw_frames or reduce "
+ "encoder buffering (disable lookahead, reduce B-frames).\n",
+ picparams->CurrPicIdx);
+ ctx->internal_error = AVERROR_EXTERNAL;
+ atomic_store_explicit(&ctx->abort_decode, 1, memory_order_release);
+ return 0;
+ }
+ if (ctx->cvdl->cuvidDecodePictureAsync)
+ ctx->internal_error = CHECK_CU(ctx->cvdl->cuvidDecodePictureAsync(
+ ctx->cudecoder, picparams, ctx->cuda_stream));
+ else
+ ctx->internal_error = CHECK_CU(ctx->cvdl->cuvidDecodePicture(ctx->cudecoder, picparams));
+ } else
+#endif
+ ctx->internal_error = CHECK_CU(ctx->cvdl->cuvidDecodePicture(ctx->cudecoder, picparams));
if (ctx->internal_error < 0)
return 0;
@@ -454,6 +773,9 @@ static int CUDAAPI cuvid_handle_picture_display(void *opaque, CUVIDPARSERDISPINF
CuvidParsedFrame parsed_frame = { { 0 } };
int ret;
+ if (atomic_load_explicit(&ctx->abort_decode, memory_order_acquire))
+ return 0;
+
parsed_frame.dispinfo = *dispinfo;
ctx->internal_error = 0;
@@ -504,6 +826,9 @@ static int cuvid_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt)
av_log(avctx, AV_LOG_TRACE, "cuvid_decode_packet\n");
+ if (atomic_load_explicit(&ctx->abort_decode, memory_order_acquire))
+ return ctx->internal_error ? ctx->internal_error : AVERROR_EXTERNAL;
+
if (is_flush && avpkt && avpkt->size)
return AVERROR_EOF;
@@ -575,24 +900,26 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
av_log(avctx, AV_LOG_TRACE, "cuvid_output_frame\n");
- if (ctx->decoder_flushing) {
- ret = cuvid_decode_packet(avctx, NULL);
- if (ret < 0 && ret != AVERROR_EOF)
- return ret;
- }
+ if (!atomic_load_explicit(&ctx->abort_decode, memory_order_acquire)) {
+ if (ctx->decoder_flushing) {
+ ret = cuvid_decode_packet(avctx, NULL);
+ if (ret < 0 && ret != AVERROR_EOF)
+ return ret;
+ }
- if (!cuvid_is_buffer_full(avctx)) {
- AVPacket *const pkt = ctx->pkt;
- ret = ff_decode_get_packet(avctx, pkt);
- if (ret < 0 && ret != AVERROR_EOF)
- return ret;
- ret = cuvid_decode_packet(avctx, pkt);
- av_packet_unref(pkt);
- // cuvid_is_buffer_full() should avoid this.
- if (ret == AVERROR(EAGAIN))
- ret = AVERROR_EXTERNAL;
- if (ret < 0 && ret != AVERROR_EOF)
- return ret;
+ if (!cuvid_is_buffer_full(avctx)) {
+ AVPacket *const pkt = ctx->pkt;
+ ret = ff_decode_get_packet(avctx, pkt);
+ if (ret < 0 && ret != AVERROR_EOF)
+ return ret;
+ ret = cuvid_decode_packet(avctx, pkt);
+ av_packet_unref(pkt);
+ // cuvid_is_buffer_full() should avoid this.
+ if (ret == AVERROR(EAGAIN))
+ ret = AVERROR_EXTERNAL;
+ if (ret < 0 && ret != AVERROR_EOF)
+ return ret;
+ }
}
ret = CHECK_CU(ctx->cudl->cuCtxPushCurrent(cuda_ctx));
@@ -611,6 +938,132 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
params.second_field = parsed_frame.second_field;
params.top_field_first = parsed_frame.dispinfo.top_field_first;
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (avctx->pix_fmt == AV_PIX_FMT_CUARRAY) {
+ if (ctx->zero_copy) {
+ int idx = parsed_frame.dispinfo.picture_index;
+
+ if (idx < 0 || idx >= ctx->cuarray_num_surfaces) {
+ av_log(avctx, AV_LOG_ERROR, "CUARRAY surface index %d out of range [0, %d)\n",
+ idx, ctx->cuarray_num_surfaces);
+ ret = AVERROR_BUG;
+ goto error;
+ }
+
+ ret = ff_decode_frame_props(avctx, frame);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "ff_decode_frame_props failed\n");
+ goto error;
+ }
+
+ frame->hw_frames_ctx = av_buffer_ref(ctx->hwframe);
+ if (!frame->hw_frames_ctx) {
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+
+ {
+ CuvidSurfaceRelease *rel = av_malloc(sizeof(*rel));
+ if (!rel) {
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+ rel->in_use_ref = av_buffer_ref(ctx->surface_in_use_ref);
+ if (!rel->in_use_ref) {
+ av_free(rel);
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+ rel->idx = idx;
+ atomic_store_explicit(&ctx->surface_in_use[idx], 1,
+ memory_order_release);
+ frame->buf[0] = av_buffer_create(
+ (uint8_t *)ctx->cuarray_surfaces[idx], 0,
+ cuvid_cuarray_buf_free, rel,
+ AV_BUFFER_FLAG_READONLY);
+ if (!frame->buf[0]) {
+ atomic_store_explicit(&ctx->surface_in_use[idx], 0,
+ memory_order_release);
+ av_buffer_unref(&rel->in_use_ref);
+ av_free(rel);
+ ret = AVERROR(ENOMEM);
+ goto error;
+ }
+ }
+
+ frame->data[0] = (uint8_t *)ctx->cuarray_surfaces[idx];
+ frame->format = AV_PIX_FMT_CUARRAY;
+
+ for (int p = 0; p < FF_ARRAY_ELEMS(frame->linesize); p++) {
+ CUDA_ARRAY3D_DESCRIPTOR plane_desc = { 0 };
+ CUarray plane_array;
+ int elem_size;
+ CUresult cures = ctx->cudl->cuArrayGetPlane(
+ &plane_array, ctx->cuarray_surfaces[idx], p);
+ if (cures == CUDA_ERROR_INVALID_VALUE)
+ break;
+ if (cures != CUDA_SUCCESS) {
+ ret = CHECK_CU(cures);
+ goto error;
+ }
+
+ ret = CHECK_CU(ctx->cudl->cuArray3DGetDescriptor(
+ &plane_desc, plane_array));
+ if (ret < 0)
+ goto error;
+
+ elem_size = ff_cuda_cuarray_elem_size(plane_desc.Format);
+ if (elem_size <= 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Unknown CUarray element format %d on plane %d\n",
+ plane_desc.Format, p);
+ ret = AVERROR_BUG;
+ goto error;
+ }
+
+ frame->linesize[p] = plane_desc.Width *
+ plane_desc.NumChannels * elem_size;
+ }
+ } else {
+ int src_idx = parsed_frame.dispinfo.picture_index;
+ AVFrame tmp_frame;
+
+ if (src_idx < 0 || src_idx >= ctx->cuarray_num_surfaces) {
+ av_log(avctx, AV_LOG_ERROR, "CUARRAY source surface index %d out of range [0, %d)\n",
+ src_idx, ctx->cuarray_num_surfaces);
+ ret = AVERROR_BUG;
+ goto error;
+ }
+
+ ret = av_hwframe_get_buffer(ctx->hwframe, frame, 0);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "av_hwframe_get_buffer failed\n");
+ goto error;
+ }
+
+ ret = ff_decode_frame_props(avctx, frame);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "ff_decode_frame_props failed\n");
+ goto error;
+ }
+
+ memset(&tmp_frame, 0, sizeof(tmp_frame));
+ tmp_frame.format = AV_PIX_FMT_CUARRAY;
+ tmp_frame.data[0] = (uint8_t *)ctx->cuarray_surfaces[src_idx];
+ tmp_frame.width = frame->width;
+ tmp_frame.height = frame->height;
+ tmp_frame.hw_frames_ctx = ctx->hwframe;
+ memcpy(tmp_frame.linesize, frame->linesize, sizeof(tmp_frame.linesize));
+
+ ret = av_hwframe_transfer_data(frame, &tmp_frame, 0);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "CUARRAY transfer failed\n");
+ goto error;
+ }
+ }
+ } else
+#endif
+ {
ret = CHECK_CU(ctx->cvdl->cuvidMapVideoFrame(ctx->cudecoder, parsed_frame.dispinfo.picture_index, &mapped_frame, &pitch, ¶ms));
if (ret < 0)
goto error;
@@ -709,6 +1162,7 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
ret = AVERROR_BUG;
goto error;
}
+ }
if (ctx->key_frame[parsed_frame.dispinfo.picture_index])
frame->flags |= AV_FRAME_FLAG_KEY;
@@ -744,7 +1198,8 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
if ((frame->flags & AV_FRAME_FLAG_INTERLACED) && parsed_frame.dispinfo.top_field_first)
frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
- } else if (ctx->decoder_flushing) {
+ } else if (ctx->decoder_flushing ||
+ atomic_load_explicit(&ctx->abort_decode, memory_order_acquire)) {
ret = AVERROR_EOF;
} else {
ret = AVERROR(EAGAIN);
@@ -772,16 +1227,48 @@ static av_cold int cuvid_decode_end(AVCodecContext *avctx)
AVCUDADeviceContext *device_hwctx = device_ctx ? device_ctx->hwctx : NULL;
CUcontext dummy, cuda_ctx = device_hwctx ? device_hwctx->cuda_ctx : NULL;
+ atomic_store_explicit(&ctx->abort_decode, 1, memory_order_release);
+
av_fifo_freep2(&ctx->frame_queue);
if (cuda_ctx) {
ctx->cudl->cuCtxPushCurrent(cuda_ctx);
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->opaque_output)
+ ctx->cudl->cuCtxSynchronize();
+#endif
+
if (ctx->cuparser)
ctx->cvdl->cuvidDestroyVideoParser(ctx->cuparser);
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->decoder_cleanup) {
+ ctx->decoder_cleanup->hwdevice = av_buffer_ref(ctx->hwdevice);
+ ctx->decoder_cleanup->cvdl = ctx->cvdl;
+ ctx->cvdl = NULL;
+ ctx->cudecoder = NULL;
+ ctx->cuarray_surfaces = NULL;
+ ctx->cuarray_num_surfaces = 0;
+ av_buffer_unref(&ctx->surface_in_use_ref);
+ ctx->surface_in_use = NULL;
+ ctx->decoder_cleanup = NULL;
+ } else
+#endif
+ {
+ if (ctx->cudecoder)
+ ctx->cvdl->cuvidDestroyDecoder(ctx->cudecoder);
- if (ctx->cudecoder)
- ctx->cvdl->cuvidDestroyDecoder(ctx->cudecoder);
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ if (ctx->cuarray_surfaces) {
+ for (int i = 0; i < ctx->cuarray_num_surfaces; i++)
+ ctx->cudl->cuArrayDestroy(ctx->cuarray_surfaces[i]);
+ av_freep(&ctx->cuarray_surfaces);
+ av_buffer_unref(&ctx->surface_in_use_ref);
+ ctx->surface_in_use = NULL;
+ ctx->cuarray_num_surfaces = 0;
+ }
+#endif
+ }
ctx->cudl->cuCtxPopCurrent(&dummy);
}
@@ -911,10 +1398,9 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
uint8_t *extradata;
int extradata_size;
int ret = 0;
+ enum AVPixelFormat requested_hw_format;
- enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_CUDA,
- AV_PIX_FMT_NONE,
- AV_PIX_FMT_NONE };
+ enum AVPixelFormat pix_fmts[4];
int probed_width = avctx->coded_width ? avctx->coded_width : 1280;
int probed_height = avctx->coded_height ? avctx->coded_height : 720;
@@ -932,6 +1418,10 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
is_yuv422 = 1;
#endif
+ ret = cuvid_get_requested_hw_format(avctx, ctx, &requested_hw_format);
+ if (ret < 0)
+ return ret;
+
// Pick pixel format based on bit depth and chroma sampling.
switch (probed_bit_depth) {
case 10:
@@ -955,16 +1445,40 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
ctx->pkt = avctx->internal->in_pkt;
// Accelerated transcoding scenarios with 'ffmpeg' require that the
- // pix_fmt be set to AV_PIX_FMT_CUDA early. The sw_pix_fmt, and the
+ // requested hardware pix_fmt be set early. The sw_pix_fmt, and the
// pix_fmt for non-accelerated transcoding, do not need to be correct
// but need to be set to something.
+ cuvid_prepare_format_list(pix_fmts, requested_hw_format, pix_fmts[1]);
+
ret = ff_get_format(avctx, pix_fmts);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "ff_get_format failed: %d\n", ret);
return ret;
}
+
+ if (ret != AV_PIX_FMT_CUDA && ret != AV_PIX_FMT_CUARRAY) {
+ av_log(avctx, AV_LOG_VERBOSE,
+ "ff_get_format returned %s, overriding to %s\n",
+ av_get_pix_fmt_name(ret),
+ av_get_pix_fmt_name(requested_hw_format));
+ ret = requested_hw_format;
+ }
+
+ ctx->opaque_output = (ret == AV_PIX_FMT_CUARRAY);
avctx->pix_fmt = ret;
+ if (ctx->opaque_output) {
+ switch (avctx->sw_pix_fmt) {
+ case AV_PIX_FMT_YUV444P: avctx->sw_pix_fmt = AV_PIX_FMT_NV24; break;
+#if FF_API_NVDEC_OLD_PIX_FMTS
+ case AV_PIX_FMT_YUV444P16: avctx->sw_pix_fmt = AV_PIX_FMT_P416; break;
+#endif
+ case AV_PIX_FMT_YUV444P10MSB: avctx->sw_pix_fmt = AV_PIX_FMT_P410; break;
+ case AV_PIX_FMT_YUV444P12MSB: avctx->sw_pix_fmt = AV_PIX_FMT_P412; break;
+ default: break;
+ }
+ }
+
if (ctx->resize_expr && sscanf(ctx->resize_expr, "%dx%d",
&ctx->resize.width, &ctx->resize.height) != 2) {
av_log(avctx, AV_LOG_ERROR, "Invalid resize expressions\n");
@@ -980,6 +1494,27 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
goto error;
}
+ if (ctx->opaque_output) {
+ if (ctx->crop_expr) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Cropping is not supported with cuarray output; "
+ "crop option will be ignored\n");
+ memset(&ctx->crop, 0, sizeof(ctx->crop));
+ }
+ if (ctx->resize_expr) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Resizing is not supported with cuarray output; "
+ "resize option will be ignored\n");
+ av_freep(&ctx->resize_expr);
+ }
+ if (ctx->deint_mode != cudaVideoDeinterlaceMode_Weave) {
+ av_log(avctx, AV_LOG_WARNING,
+ "Deinterlacing is not supported with cuarray output; "
+ "deint mode will be forced to weave\n");
+ ctx->deint_mode = cudaVideoDeinterlaceMode_Weave;
+ }
+ }
+
ret = cuvid_load_functions(&ctx->cvdl, avctx);
if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Failed loading nvcuvid.\n");
@@ -1039,6 +1574,8 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx)
cuda_ctx = device_hwctx->cuda_ctx;
ctx->cudl = device_hwctx->internal->cuda_dl;
+ ctx->cuda_stream = device_hwctx->stream;
+
memset(&ctx->cuparseinfo, 0, sizeof(ctx->cuparseinfo));
memset(&seq_pkt, 0, sizeof(seq_pkt));
@@ -1245,6 +1782,12 @@ static const AVOption options[] = {
{ "drop_second_field", "Drop second field when deinterlacing", OFFSET(drop_second_field), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
{ "crop", "Crop (top)x(bottom)x(left)x(right)", OFFSET(crop_expr), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
{ "resize", "Resize (width)x(height)", OFFSET(resize_expr), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
+ { "output_format", "Hardware output format", OFFSET(output_format), AV_OPT_TYPE_INT, { .i64 = AV_PIX_FMT_CUDA }, 0, INT_MAX, VD, .unit = "output_format" },
+ { "cuda", "CUDA pitch-linear output", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PIX_FMT_CUDA }, 0, 0, VD, .unit = "output_format" },
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ { "cuarray", "CUDA block-linear opaque output", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PIX_FMT_CUARRAY }, 0, 0, VD, .unit = "output_format" },
+ { "zero_copy", "Enable zero-copy opaque decode output (forces output_format=cuarray)", OFFSET(zero_copy), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
+#endif
{ NULL }
};
@@ -1259,6 +1802,18 @@ static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = {
},
.hwaccel = NULL,
},
+#ifdef NVDEC_HAVE_OPAQUE_OUTPUT_SUPPORT
+ &(const AVCodecHWConfigInternal) {
+ .public = {
+ .pix_fmt = AV_PIX_FMT_CUARRAY,
+ .methods = AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX |
+ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX |
+ AV_CODEC_HW_CONFIG_METHOD_INTERNAL,
+ .device_type = AV_HWDEVICE_TYPE_CUDA
+ },
+ .hwaccel = NULL,
+ },
+#endif
NULL
};
--
2.52.0
From a9220eea7c002b4b63150d7dbb931d7a07b64317 Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:34:43 +0100
Subject: [PATCH 6/8] avcodec/nvenc: add CUARRAY (block-linear) input support
Allow NVENC to accept AV_PIX_FMT_CUARRAY frames by registering them
as NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY. This enables zero-copy
transcode when paired with NVDEC CUARRAY output, avoiding the
pitched-linear intermediate copy. Also accept semi-planar 444
formats (NV24, P410, P412, P416) and map them to the corresponding
NVENC buffer formats when registered as CUarray input resources.
Guarded by NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT (SDK 13.1+).
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
libavcodec/nvenc.c | 68 +++++++++++++++++++++++++++++++++++++++-------
libavcodec/nvenc.h | 1 +
2 files changed, 59 insertions(+), 10 deletions(-)
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 257b6d3892..d548631bd6 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -61,6 +61,7 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
AV_PIX_FMT_NV12,
AV_PIX_FMT_P010,
AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NV24,
AV_PIX_FMT_P016, // Truncated to 10bits
#ifdef NVENC_HAVE_422_SUPPORT
AV_PIX_FMT_NV16,
@@ -69,6 +70,9 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
#endif
AV_PIX_FMT_YUV444P10MSB,
AV_PIX_FMT_YUV444P16, // Truncated to 10bits
+ AV_PIX_FMT_P410,
+ AV_PIX_FMT_P412, // Truncated to 10bits
+ AV_PIX_FMT_P416, // Truncated to 10bits
AV_PIX_FMT_0RGB32,
AV_PIX_FMT_RGB32,
AV_PIX_FMT_0BGR32,
@@ -79,6 +83,9 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
AV_PIX_FMT_GBRP10MSB,
AV_PIX_FMT_GBRP16, // Truncated to 10bits
AV_PIX_FMT_CUDA,
+#ifdef NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT
+ AV_PIX_FMT_CUARRAY,
+#endif
#if CONFIG_D3D11VA
AV_PIX_FMT_D3D11,
#endif
@@ -87,6 +94,9 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA),
+#ifdef NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT
+ HW_CONFIG_ENCODER_FRAMES(CUARRAY, CUDA),
+#endif
HW_CONFIG_ENCODER_DEVICE(NONE, CUDA),
#if CONFIG_D3D11VA
HW_CONFIG_ENCODER_FRAMES(D3D11, D3D11VA),
@@ -101,6 +111,9 @@ const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
pix_fmt == AV_PIX_FMT_P216 || \
pix_fmt == AV_PIX_FMT_YUV444P10MSB || \
pix_fmt == AV_PIX_FMT_YUV444P16 || \
+ pix_fmt == AV_PIX_FMT_P410 || \
+ pix_fmt == AV_PIX_FMT_P412 || \
+ pix_fmt == AV_PIX_FMT_P416 || \
pix_fmt == AV_PIX_FMT_X2RGB10 || \
pix_fmt == AV_PIX_FMT_X2BGR10 || \
pix_fmt == AV_PIX_FMT_GBRP10MSB || \
@@ -114,8 +127,12 @@ const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
pix_fmt == AV_PIX_FMT_X2BGR10)
#define IS_YUV444(pix_fmt) (pix_fmt == AV_PIX_FMT_YUV444P || \
+ pix_fmt == AV_PIX_FMT_NV24 || \
pix_fmt == AV_PIX_FMT_YUV444P10MSB || \
pix_fmt == AV_PIX_FMT_YUV444P16 || \
+ pix_fmt == AV_PIX_FMT_P410 || \
+ pix_fmt == AV_PIX_FMT_P412 || \
+ pix_fmt == AV_PIX_FMT_P416 || \
pix_fmt == AV_PIX_FMT_GBRP || \
pix_fmt == AV_PIX_FMT_GBRP10MSB || \
pix_fmt == AV_PIX_FMT_GBRP16 || \
@@ -125,6 +142,10 @@ const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[] = {
pix_fmt == AV_PIX_FMT_P210 || \
pix_fmt == AV_PIX_FMT_P216)
+#define IS_HWACCEL(pix_fmt) (pix_fmt == AV_PIX_FMT_CUDA || \
+ pix_fmt == AV_PIX_FMT_CUARRAY || \
+ pix_fmt == AV_PIX_FMT_D3D11)
+
#define IS_GBRP(pix_fmt) (pix_fmt == AV_PIX_FMT_GBRP || \
pix_fmt == AV_PIX_FMT_GBRP10MSB || \
pix_fmt == AV_PIX_FMT_GBRP16)
@@ -814,7 +835,8 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
if (ctx->flags & NVENC_DEPRECATED_PRESET)
av_log(avctx, AV_LOG_WARNING, "The selected preset is deprecated. Use p1 to p7 + -tune or fast/medium/slow.\n");
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11 || avctx->hw_frames_ctx || avctx->hw_device_ctx) {
+ if (IS_HWACCEL(avctx->pix_fmt) ||
+ avctx->hw_frames_ctx || avctx->hw_device_ctx) {
AVHWFramesContext *frames_ctx;
AVHWDeviceContext *hwdev_ctx;
AVCUDADeviceContext *cuda_device_hwctx = NULL;
@@ -825,7 +847,7 @@ static av_cold int nvenc_setup_device(AVCodecContext *avctx)
if (avctx->hw_frames_ctx) {
frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
- if (frames_ctx->format == AV_PIX_FMT_CUDA)
+ if (frames_ctx->format == AV_PIX_FMT_CUDA || frames_ctx->format == AV_PIX_FMT_CUARRAY)
cuda_device_hwctx = frames_ctx->device_ctx->hwctx;
#if CONFIG_D3D11VA
else if (frames_ctx->format == AV_PIX_FMT_D3D11)
@@ -2080,7 +2102,7 @@ static av_cold int nvenc_alloc_surface(AVCodecContext *avctx, int idx)
NV_ENC_CREATE_BITSTREAM_BUFFER allocOut = { 0 };
allocOut.version = NV_ENC_CREATE_BITSTREAM_BUFFER_VER;
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11) {
+ if (IS_HWACCEL(avctx->pix_fmt)) {
ctx->surfaces[idx].in_ref = av_frame_alloc();
if (!ctx->surfaces[idx].in_ref)
return AVERROR(ENOMEM);
@@ -2112,7 +2134,7 @@ static av_cold int nvenc_alloc_surface(AVCodecContext *avctx, int idx)
nv_status = p_nvenc->nvEncCreateBitstreamBuffer(ctx->nvencoder, &allocOut);
if (nv_status != NV_ENC_SUCCESS) {
int err = nvenc_print_error(avctx, nv_status, "CreateBitstreamBuffer failed");
- if (avctx->pix_fmt != AV_PIX_FMT_CUDA && avctx->pix_fmt != AV_PIX_FMT_D3D11)
+ if (!IS_HWACCEL(avctx->pix_fmt))
p_nvenc->nvEncDestroyInputBuffer(ctx->nvencoder, ctx->surfaces[idx].input_surface);
av_frame_free(&ctx->surfaces[idx].in_ref);
return err;
@@ -2235,7 +2257,7 @@ av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
av_freep(&ctx->frame_data_array);
}
- if (ctx->surfaces && (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11)) {
+ if (ctx->surfaces && IS_HWACCEL(avctx->pix_fmt)) {
for (i = 0; i < ctx->nb_registered_frames; i++) {
if (ctx->registered_frames[i].mapped)
p_nvenc->nvEncUnmapInputResource(ctx->nvencoder, ctx->registered_frames[i].in_map.mappedResource);
@@ -2247,7 +2269,7 @@ av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
if (ctx->surfaces) {
for (i = 0; i < ctx->nb_surfaces; ++i) {
- if (avctx->pix_fmt != AV_PIX_FMT_CUDA && avctx->pix_fmt != AV_PIX_FMT_D3D11)
+ if (!IS_HWACCEL(avctx->pix_fmt))
p_nvenc->nvEncDestroyInputBuffer(ctx->nvencoder, ctx->surfaces[i].input_surface);
av_frame_free(&ctx->surfaces[i].in_ref);
p_nvenc->nvEncDestroyBitstreamBuffer(ctx->nvencoder, ctx->surfaces[i].output_surface);
@@ -2295,7 +2317,7 @@ av_cold int ff_nvenc_encode_init(AVCodecContext *avctx)
NvencContext *ctx = avctx->priv_data;
int ret;
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11) {
+ if (IS_HWACCEL(avctx->pix_fmt)) {
AVHWFramesContext *frames_ctx;
if (!avctx->hw_frames_ctx) {
av_log(avctx, AV_LOG_ERROR,
@@ -2428,7 +2450,9 @@ static int nvenc_register_frame(AVCodecContext *avctx, const AVFrame *frame)
int i, idx, ret;
for (i = 0; i < ctx->nb_registered_frames; i++) {
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA && ctx->registered_frames[i].ptr == frame->data[0])
+ if ((avctx->pix_fmt == AV_PIX_FMT_CUDA ||
+ avctx->pix_fmt == AV_PIX_FMT_CUARRAY) &&
+ ctx->registered_frames[i].ptr == frame->data[0])
return i;
else if (avctx->pix_fmt == AV_PIX_FMT_D3D11 && ctx->registered_frames[i].ptr == frame->data[0] && ctx->registered_frames[i].ptr_index == (intptr_t)frame->data[1])
return i;
@@ -2446,6 +2470,12 @@ static int nvenc_register_frame(AVCodecContext *avctx, const AVFrame *frame)
if (avctx->pix_fmt == AV_PIX_FMT_CUDA) {
reg.resourceType = NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR;
+#ifdef NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT
+ } else if (avctx->pix_fmt == AV_PIX_FMT_CUARRAY) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frames_ctx->sw_format);
+ reg.resourceType = NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY;
+ reg.pitch = frames_ctx->width * (desc && desc->comp[0].depth > 8 ? 2 : 1);
+#endif
}
else if (avctx->pix_fmt == AV_PIX_FMT_D3D11) {
reg.resourceType = NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX;
@@ -2453,6 +2483,23 @@ static int nvenc_register_frame(AVCodecContext *avctx, const AVFrame *frame)
}
reg.bufferFormat = nvenc_map_buffer_format(frames_ctx->sw_format);
+#ifdef NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT
+ if (reg.bufferFormat == NV_ENC_BUFFER_FORMAT_UNDEFINED &&
+ reg.resourceType == NV_ENC_INPUT_RESOURCE_TYPE_CUDAARRAY) {
+ switch (frames_ctx->sw_format) {
+ case AV_PIX_FMT_NV24:
+ reg.bufferFormat = NV_ENC_BUFFER_FORMAT_YUV444;
+ break;
+ case AV_PIX_FMT_P410:
+ case AV_PIX_FMT_P412:
+ case AV_PIX_FMT_P416:
+ reg.bufferFormat = NV_ENC_BUFFER_FORMAT_YUV444_10BIT;
+ break;
+ default:
+ break;
+ }
+ }
+#endif
if (reg.bufferFormat == NV_ENC_BUFFER_FORMAT_UNDEFINED) {
av_log(avctx, AV_LOG_FATAL, "Invalid input pixel format: %s\n",
av_get_pix_fmt_name(frames_ctx->sw_format));
@@ -2468,6 +2515,7 @@ static int nvenc_register_frame(AVCodecContext *avctx, const AVFrame *frame)
ctx->registered_frames[idx].ptr = frame->data[0];
ctx->registered_frames[idx].ptr_index = reg.subResourceIndex;
ctx->registered_frames[idx].regptr = reg.registeredResource;
+
return idx;
}
@@ -2481,7 +2529,7 @@ static int nvenc_upload_frame(AVCodecContext *avctx, const AVFrame *frame,
int res;
NVENCSTATUS nv_status;
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11) {
+ if (IS_HWACCEL(avctx->pix_fmt)) {
int reg_idx = nvenc_register_frame(avctx, frame);
if (reg_idx < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not register an input HW frame\n");
@@ -2799,7 +2847,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
}
- if (avctx->pix_fmt == AV_PIX_FMT_CUDA || avctx->pix_fmt == AV_PIX_FMT_D3D11) {
+ if (IS_HWACCEL(avctx->pix_fmt)) {
ctx->registered_frames[tmpoutsurf->reg_idx].mapped -= 1;
if (ctx->registered_frames[tmpoutsurf->reg_idx].mapped == 0) {
nv_status = p_nvenc->nvEncUnmapInputResource(ctx->nvencoder, ctx->registered_frames[tmpoutsurf->reg_idx].in_map.mappedResource);
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 32d4648f75..2aa0ff8c2d 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -115,6 +115,7 @@ typedef void ID3D11Device;
#if NVENCAPI_CHECK_VERSION(13, 1)
#define NVENC_NEW_COUNTING_TYPE
#define NVENC_HAVE_AV1_HGOP_SUPPORT
+#define NVENC_HAVE_CUDA_ARRAY_INPUT_SUPPORT
#endif
typedef struct NvencSurface
--
2.52.0
From 071e8e6972756ff8c77b68afa4f6e1a430c589f4 Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Sat, 14 Mar 2026 01:38:17 +0100
Subject: [PATCH 7/8] fftools/ffmpeg_dec: improve hwaccel format negotiation
for CUARRAY
Adjust get_format() to prefer the exact hwaccel_output_format requested
by the user when multiple hardware formats are available (e.g. both
AV_PIX_FMT_CUDA and AV_PIX_FMT_CUARRAY). Previously, the loop would
break on the first matching device type, ignoring the user's preferred
output format.
When the preferred format is not available, the code now falls back
gracefully and emits a warning.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
fftools/ffmpeg_dec.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c
index e424c0b17d..0611ec0849 100644
--- a/fftools/ffmpeg_dec.c
+++ b/fftools/ffmpeg_dec.c
@@ -1330,6 +1330,8 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
return AV_PIX_FMT_NONE;
}
+ dp->hwaccel_pix_fmt = AV_PIX_FMT_NONE;
+
for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(*p);
const AVCodecHWConfig *config = NULL;
@@ -1352,10 +1354,32 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
}
if (config && config->device_type == dp->hwaccel_device_type) {
dp->hwaccel_pix_fmt = *p;
- break;
+ /* Stop at the first matching hardware format unless the user
+ * explicitly requested a different *hardware* output format
+ * (e.g. CUARRAY vs CUDA, which share a device type) - in that
+ * case keep scanning for the exact match. A software
+ * hwaccel_output_format requests a download and imposes no such
+ * preference, so it must not switch us off the default (first)
+ * hardware format. */
+ if (dp->hwaccel_output_format == AV_PIX_FMT_NONE ||
+ dp->hwaccel_output_format == *p ||
+ !(av_pix_fmt_desc_get(dp->hwaccel_output_format)->flags & AV_PIX_FMT_FLAG_HWACCEL))
+ break;
}
}
+ if (dp->hwaccel_pix_fmt != AV_PIX_FMT_NONE) {
+ if (dp->hwaccel_output_format != AV_PIX_FMT_NONE &&
+ dp->hwaccel_output_format != dp->hwaccel_pix_fmt &&
+ (av_pix_fmt_desc_get(dp->hwaccel_output_format)->flags & AV_PIX_FMT_FLAG_HWACCEL))
+ av_log(dp, AV_LOG_WARNING,
+ "Requested hwaccel output format '%s' not available, "
+ "falling back to '%s'\n",
+ av_get_pix_fmt_name(dp->hwaccel_output_format),
+ av_get_pix_fmt_name(dp->hwaccel_pix_fmt));
+ return dp->hwaccel_pix_fmt;
+ }
+
return *p;
}
--
2.52.0
From 3ba0632b376f05c22881bc5ef2257a3965650020 Mon Sep 17 00:00:00 2001
From: Diego de Souza <ddesouza(a)nvidia.com>
Date: Wed, 18 Mar 2026 23:56:43 +0100
Subject: [PATCH 8/8] avfilter/hwupload_cuda: add CUARRAY output and
semi-planar 444 format support
Add an output_format option (cuda | cuarray) so the filter can produce
either pitched-linear (AV_PIX_FMT_CUDA, default) or block-linear
(AV_PIX_FMT_CUARRAY) device frames. This enables host-to-device
upload directly into CUarray surfaces for the CUARRAY transcode
pipeline.
Also extend the accepted input pixel format list with semi-planar 444
formats (NV24, P410, P416) and the planar MSB variants (YUV444P10MSB,
YUV444P12MSB). Semi-planar 444 formats are rejected with a clear
error when output_format=cuda, as they are only supported by the
CUarray allocation path.
Signed-off-by: Diego de Souza <ddesouza(a)nvidia.com>
---
libavfilter/vf_hwupload_cuda.c | 50 ++++++++++++++++++++++++++++++++--
1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/libavfilter/vf_hwupload_cuda.c b/libavfilter/vf_hwupload_cuda.c
index 8acfe5c5f9..988271c9c6 100644
--- a/libavfilter/vf_hwupload_cuda.c
+++ b/libavfilter/vf_hwupload_cuda.c
@@ -18,17 +18,25 @@
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
+#include "libavutil/hwcontext_cuda.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"
+enum {
+ CUDAUPLOAD_FMT_CUDA,
+ CUDAUPLOAD_FMT_CUARRAY,
+};
+
typedef struct CudaUploadContext {
const AVClass *class;
int device_idx;
+ int output_format;
AVBufferRef *hwdevice;
AVBufferRef *hwframe;
@@ -56,20 +64,29 @@ static int cudaupload_query_formats(const AVFilterContext *ctx,
AVFilterFormatsConfig **cfg_in,
AVFilterFormatsConfig **cfg_out)
{
+ const CudaUploadContext *s = ctx->priv;
int ret;
static const enum AVPixelFormat input_pix_fmts[] = {
AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NV16, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_P010, AV_PIX_FMT_P016, AV_PIX_FMT_P210, AV_PIX_FMT_P216, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P16,
+ AV_PIX_FMT_YUV444P10MSB, AV_PIX_FMT_YUV444P12MSB,
+ AV_PIX_FMT_NV24, AV_PIX_FMT_P410, AV_PIX_FMT_P416,
AV_PIX_FMT_0RGB32, AV_PIX_FMT_0BGR32, AV_PIX_FMT_RGB32, AV_PIX_FMT_BGR32,
#if CONFIG_VULKAN
AV_PIX_FMT_VULKAN,
#endif
AV_PIX_FMT_NONE,
};
- static const enum AVPixelFormat output_pix_fmts[] = {
+ static const enum AVPixelFormat output_cuda_fmts[] = {
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
};
+ static const enum AVPixelFormat output_cuarray_fmts[] = {
+ AV_PIX_FMT_CUARRAY, AV_PIX_FMT_NONE,
+ };
+ const enum AVPixelFormat *output_pix_fmts = s->output_format == CUDAUPLOAD_FMT_CUARRAY
+ ? output_cuarray_fmts
+ : output_cuda_fmts;
AVFilterFormats *in_fmts = ff_make_pixel_format_list(input_pix_fmts);
AVFilterFormats *out_fmts;
@@ -103,7 +120,8 @@ static int cudaupload_config_output(AVFilterLink *outlink)
return AVERROR(ENOMEM);
hwframe_ctx = (AVHWFramesContext*)s->hwframe->data;
- hwframe_ctx->format = AV_PIX_FMT_CUDA;
+ hwframe_ctx->format = s->output_format == CUDAUPLOAD_FMT_CUARRAY
+ ? AV_PIX_FMT_CUARRAY : AV_PIX_FMT_CUDA;
if (inl->hw_frames_ctx) {
AVHWFramesContext *in_hwframe_ctx = (AVHWFramesContext*)inl->hw_frames_ctx->data;
hwframe_ctx->sw_format = in_hwframe_ctx->sw_format;
@@ -113,9 +131,32 @@ static int cudaupload_config_output(AVFilterLink *outlink)
hwframe_ctx->width = inlink->w;
hwframe_ctx->height = inlink->h;
+ if (s->output_format == CUDAUPLOAD_FMT_CUDA) {
+ switch (hwframe_ctx->sw_format) {
+ case AV_PIX_FMT_NV24:
+ case AV_PIX_FMT_P410:
+ case AV_PIX_FMT_P412:
+ case AV_PIX_FMT_P416:
+ av_log(ctx, AV_LOG_ERROR,
+ "Pixel format %s is not supported with "
+ "output_format=cuda (pitch-linear). "
+ "Use output_format=cuarray instead.\n",
+ av_get_pix_fmt_name(hwframe_ctx->sw_format));
+ return AVERROR(EINVAL);
+ default:
+ break;
+ }
+ }
+
ret = av_hwframe_ctx_init(s->hwframe);
- if (ret < 0)
+ if (ret < 0) {
+ if (s->output_format == CUDAUPLOAD_FMT_CUARRAY)
+ av_log(ctx, AV_LOG_ERROR,
+ "Pixel format %s is not supported with "
+ "output_format=cuarray. Try output_format=cuda instead.\n",
+ av_get_pix_fmt_name(hwframe_ctx->sw_format));
return ret;
+ }
outl->hw_frames_ctx = av_buffer_ref(s->hwframe);
if (!outl->hw_frames_ctx)
@@ -164,6 +205,9 @@ fail:
#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
static const AVOption cudaupload_options[] = {
{ "device", "Number of the device to use", OFFSET(device_idx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
+ { "output_format", "Output frame format", OFFSET(output_format), AV_OPT_TYPE_INT, { .i64 = CUDAUPLOAD_FMT_CUDA }, 0, 1, FLAGS, .unit = "output_format" },
+ { "cuda", "Pitch-linear device memory (default)", 0, AV_OPT_TYPE_CONST, { .i64 = CUDAUPLOAD_FMT_CUDA }, .flags = FLAGS, .unit = "output_format" },
+ { "cuarray", "Block-linear CUDA array", 0, AV_OPT_TYPE_CONST, { .i64 = CUDAUPLOAD_FMT_CUARRAY }, .flags = FLAGS, .unit = "output_format" },
{ NULL },
};
--
2.52.0
1
0
[PR] swscale/uops: mark unneeded rows as zero in translate_linear_op() (PR #23563)
by Ramiro Polla 23 Jun '26
by Ramiro Polla 23 Jun '26
23 Jun '26
PR #23563 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23563
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23563.patch
From 38d40bfce58acebe676f287ad28af5b1ec449ff4 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <ramiro.polla(a)gmail.com>
Date: Tue, 23 Jun 2026 01:49:20 +0200
Subject: [PATCH] swscale/uops: mark unneeded rows as zero in
translate_linear_op()
---
libswscale/uops.c | 7 +-
libswscale/uops_macros.h | 148 +++++++++++++++++++--------------------
2 files changed, 79 insertions(+), 76 deletions(-)
diff --git a/libswscale/uops.c b/libswscale/uops.c
index 096621466c..64eb91e959 100644
--- a/libswscale/uops.c
+++ b/libswscale/uops.c
@@ -712,8 +712,11 @@ static int translate_linear_op(SwsContext *ctx, SwsUOpList *ops,
uint32_t exact = 0;
for (int i = 0; i < 4; i++) {
- if (SWS_OP_NEEDED(op, i) && (op->lin.mask & SWS_MASK_ROW(i)))
- uop.mask |= SWS_COMP(i);
+ if (!SWS_OP_NEEDED(op, i) || !(op->lin.mask & SWS_MASK_ROW(i))) {
+ uop.par.lin.zero |= SWS_MASK_ROW(i);
+ continue;
+ }
+ uop.mask |= SWS_COMP(i);
bool nonzero = (op->lin.m[i][4].num != 0);
for (int j = 0; j < 5; j++) {
const AVRational k = op->lin.m[i][j];
diff --git a/libswscale/uops_macros.h b/libswscale/uops_macros.h
index a382988361..ed8d439b17 100644
--- a/libswscale/uops_macros.h
+++ b/libswscale/uops_macros.h
@@ -1080,93 +1080,93 @@
#define SWS_FOR_F32_CLEAR(MACRO, ...)
#define SWS_FOR_STRUCT_F32_CLEAR(MACRO, ...)
#define SWS_FOR_F32_LINEAR(MACRO, ...) \
- MACRO(__VA_ARGS__, f32_linear_x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x41040, 0xbefa8) \
- MACRO(__VA_ARGS__, f32_linear_x_x000x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x41040, 0xbefae) \
- MACRO(__VA_ARGS__, f32_linear_x_xxx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x41040, 0xbefb8) \
- MACRO(__VA_ARGS__, f32_linear_y_0x000 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x2, 0x41001, 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xba108) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xba118) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbadae) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40000, 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x40421, 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x8, 0x01041, 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x01040, 0xbefae) \
- MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x01040, 0xbefb8) \
+ MACRO(__VA_ARGS__, f32_linear_x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x00000, 0xfffe8) \
+ MACRO(__VA_ARGS__, f32_linear_x_x000x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x00000, 0xfffee) \
+ MACRO(__VA_ARGS__, f32_linear_x_xxx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x1, 0x00000, 0xffff8) \
+ MACRO(__VA_ARGS__, f32_linear_y_0x000 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x2, 0x00000, 0xfffbf) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00000, 0xfa108) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00000, 0xfb10a) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00000, 0xfa118) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00000, 0xfadae) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00000, 0xfefbe) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x7, 0x00421, 0xfb10a) \
+ MACRO(__VA_ARGS__, f32_linear_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x8, 0x00000, 0xbffff) \
+ MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x00000, 0xbffee) \
+ MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0x9, 0x00000, 0xbfff8) \
MACRO(__VA_ARGS__, f32_linear_xyzw_xxx0x_xxx0x_xxx0x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0xf, 0x00000, 0xba108) \
MACRO(__VA_ARGS__, f32_linear_xyzw_x0x0x_xxx0x_xx00x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0xf, 0x00000, 0xbb10a) \
MACRO(__VA_ARGS__, f32_linear_xyzw_x0000_0x000_00x00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR , 0xf, 0x00000, 0xbefbe)
#define SWS_FOR_STRUCT_F32_LINEAR(MACRO, ...) \
- MACRO(__VA_ARGS__, f32_linear_x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefa8) \
- MACRO(__VA_ARGS__, f32_linear_x_x000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefae) \
- MACRO(__VA_ARGS__, f32_linear_x_xxx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefb8) \
- MACRO(__VA_ARGS__, f32_linear_y_0x000 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x2, .par.lin.one = 0x41001, .par.lin.zero = 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbadae) \
- MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x40421, .par.lin.zero = 0xbb10a) \
- MACRO(__VA_ARGS__, f32_linear_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x8, .par.lin.one = 0x1041, .par.lin.zero = 0xbefbe) \
- MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae) \
- MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefb8) \
+ MACRO(__VA_ARGS__, f32_linear_x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffe8) \
+ MACRO(__VA_ARGS__, f32_linear_x_x000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffee) \
+ MACRO(__VA_ARGS__, f32_linear_x_xxx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xffff8) \
+ MACRO(__VA_ARGS__, f32_linear_y_0x000 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x2, .par.lin.one = 0x0, .par.lin.zero = 0xfffbf) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_xxx0x_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa108) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x0x0x_xxx0x_xx00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfb10a) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa118) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x000x_0x00x_00x0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfadae) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfefbe) \
+ MACRO(__VA_ARGS__, f32_linear_xyz_10x0x_1xx0x_1x00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x7, .par.lin.one = 0x421, .par.lin.zero = 0xfb10a) \
+ MACRO(__VA_ARGS__, f32_linear_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x8, .par.lin.one = 0x0, .par.lin.zero = 0xbffff) \
+ MACRO(__VA_ARGS__, f32_linear_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbffee) \
+ MACRO(__VA_ARGS__, f32_linear_xw_xxx00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbfff8) \
MACRO(__VA_ARGS__, f32_linear_xyzw_xxx0x_xxx0x_xxx0x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xba108) \
MACRO(__VA_ARGS__, f32_linear_xyzw_x0x0x_xxx0x_xx00x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xbb10a) \
MACRO(__VA_ARGS__, f32_linear_xyzw_x0000_0x000_00x00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xbefbe)
#define SWS_FOR_F32_LINEAR_FMA(MACRO, ...) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefa8, 0xfffe8) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefa8, 0xfffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_x000x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefae, 0xfffee) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_X000x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefae, 0xfffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefb8, 0xffff8) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xXx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefb8, 0xffffa) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxX00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefb8, 0xffffc) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xXX00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x41040, 0xbefb8, 0xffffe) \
- MACRO(__VA_ARGS__, f32_linear_fma_y_0x000 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x2, 0x41001, 0xbefbe, 0xfffbf) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx0x_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba108, 0xfa108) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba108, 0xfbdaf) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba108, 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbb10a, 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfa118) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfbdbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xba118, 0xfbdfe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbadae, 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40000, 0xbefbe, 0xfefbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x40421, 0xbb10a, 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x8, 0x01041, 0xbefbe, 0xbffff) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefae, 0xbffee) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefae, 0xbffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_xxx00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefb8, 0xbfff8) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_xXX00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x01040, 0xbefb8, 0xbfffe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xfffe8, 0xfffe8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xfffe8, 0xfffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_x000x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xfffee, 0xfffee) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_X000x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xfffee, 0xfffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xffff8, 0xffff8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xXx00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xffff8, 0xffffa) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxX00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xffff8, 0xffffc) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xXX00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x1, 0x00000, 0xffff8, 0xffffe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_y_0x000 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x2, 0x00000, 0xfffbf, 0xfffbf) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx0x_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa108, 0xfa108) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa108, 0xfbdaf) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa108, 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfb10a, 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa118, 0xfa118) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa118, 0xfbdbe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfa118, 0xfbdfe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfadae, 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00000, 0xfefbe, 0xfefbe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x7, 0x00421, 0xfb10a, 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x8, 0x00000, 0xbffff, 0xbffff) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x00000, 0xbffee, 0xbffee) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x00000, 0xbffee, 0xbffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_xxx00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x00000, 0xbfff8, 0xbfff8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_xXX00_000x0 , SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0x9, 0x00000, 0xbfff8, 0xbfffe) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_xxx0x_xxx0x_xxx0x_000x0, SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0xf, 0x00000, 0xba108, 0xba108) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_XXX0x_XXX0x_XXX0x_000x0, SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0xf, 0x00000, 0xba108, 0xbbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_X0X0x_XXX0x_XX00x_000x0, SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0xf, 0x00000, 0xbb10a, 0xbbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_x0000_0x000_00x00_000x0, SWS_PIXEL_F32, SWS_UOP_LINEAR_FMA , 0xf, 0x00000, 0xbefbe, 0xbefbe)
#define SWS_FOR_STRUCT_F32_LINEAR_FMA(MACRO, ...) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefa8, .par.lin.exact = 0xfffe8) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefa8, .par.lin.exact = 0xfffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_x000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xfffee) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_X000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xfffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xffff8) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xXx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xffffa) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xxX00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xffffc) \
- MACRO(__VA_ARGS__, f32_linear_fma_x_xXX00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x41040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xffffe) \
- MACRO(__VA_ARGS__, f32_linear_fma_y_0x000 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x2, .par.lin.one = 0x41001, .par.lin.zero = 0xbefbe, .par.lin.exact = 0xfffbf) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx0x_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108, .par.lin.exact = 0xfa108) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108, .par.lin.exact = 0xfbdaf) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba108, .par.lin.exact = 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbb10a, .par.lin.exact = 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfa118) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfbdbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xba118, .par.lin.exact = 0xfbdfe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbadae, .par.lin.exact = 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40000, .par.lin.zero = 0xbefbe, .par.lin.exact = 0xfefbe) \
- MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x40421, .par.lin.zero = 0xbb10a, .par.lin.exact = 0xfbdef) \
- MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x8, .par.lin.one = 0x1041, .par.lin.zero = 0xbefbe, .par.lin.exact = 0xbffff) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xbffee) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefae, .par.lin.exact = 0xbffef) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_xxx00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xbfff8) \
- MACRO(__VA_ARGS__, f32_linear_fma_xw_xXX00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x1040, .par.lin.zero = 0xbefb8, .par.lin.exact = 0xbfffe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffe8, .par.lin.exact = 0xfffe8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffe8, .par.lin.exact = 0xfffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_x000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffee, .par.lin.exact = 0xfffee) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_X000x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xfffee, .par.lin.exact = 0xfffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xffff8, .par.lin.exact = 0xffff8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xXx00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xffff8, .par.lin.exact = 0xffffa) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xxX00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xffff8, .par.lin.exact = 0xffffc) \
+ MACRO(__VA_ARGS__, f32_linear_fma_x_xXX00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x1, .par.lin.one = 0x0, .par.lin.zero = 0xffff8, .par.lin.exact = 0xffffe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_y_0x000 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x2, .par.lin.one = 0x0, .par.lin.zero = 0xfffbf, .par.lin.exact = 0xfffbf) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx0x_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa108, .par.lin.exact = 0xfa108) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa108, .par.lin.exact = 0xfbdaf) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_XXX0x_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa108, .par.lin.exact = 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_X0X0x_XXX0x_XX00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfb10a, .par.lin.exact = 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xxx00_xxx0x_xxx0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa118, .par.lin.exact = 0xfa118) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XxX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa118, .par.lin.exact = 0xfbdbe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_xXX00_XXX0x_XXX0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfa118, .par.lin.exact = 0xfbdfe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_X000x_0X00x_00X0x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfadae, .par.lin.exact = 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_x0000_0x000_00x00 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x0, .par.lin.zero = 0xfefbe, .par.lin.exact = 0xfefbe) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xyz_10X0x_1XX0x_1X00x , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x7, .par.lin.one = 0x421, .par.lin.zero = 0xfb10a, .par.lin.exact = 0xfbdef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_w_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x8, .par.lin.one = 0x0, .par.lin.zero = 0xbffff, .par.lin.exact = 0xbffff) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_x000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbffee, .par.lin.exact = 0xbffee) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_X000x_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbffee, .par.lin.exact = 0xbffef) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_xxx00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbfff8, .par.lin.exact = 0xbfff8) \
+ MACRO(__VA_ARGS__, f32_linear_fma_xw_xXX00_000x0 , .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0x9, .par.lin.one = 0x0, .par.lin.zero = 0xbfff8, .par.lin.exact = 0xbfffe) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_xxx0x_xxx0x_xxx0x_000x0, .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xba108, .par.lin.exact = 0xba108) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_XXX0x_XXX0x_XXX0x_000x0, .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xba108, .par.lin.exact = 0xbbdef) \
MACRO(__VA_ARGS__, f32_linear_fma_xyzw_X0X0x_XXX0x_XX00x_000x0, .type = SWS_PIXEL_F32, .uop = SWS_UOP_LINEAR_FMA , .mask = 0xf, .par.lin.one = 0x0, .par.lin.zero = 0xbb10a, .par.lin.exact = 0xbbdef) \
--
2.52.0
1
0
PR #23562 opened by Project516
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23562
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23562.patch
# Summary of changes
Update actions/checkout@v6 to v7
https://github.com/actions/checkout/releases/tag/v7.0.0
checkout v7 adds guards against malicious pull requests, and fixes security issues
From 12ad35bd4084936d47354a04ddd9de11185bd7f0 Mon Sep 17 00:00:00 2001
From: Project516 <project516(a)project516.dev>
Date: Tue, 23 Jun 2026 14:17:42 +0000
Subject: [PATCH 1/3] Update .forgejo/workflows/autolabel.yml
update actions/checkout@v6 to v7
Signed-off-by: Project516 <project516(a)project516.dev>
---
.forgejo/workflows/autolabel.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.forgejo/workflows/autolabel.yml b/.forgejo/workflows/autolabel.yml
index 0235bdd7d4..61517342a4 100644
--- a/.forgejo/workflows/autolabel.yml
+++ b/.forgejo/workflows/autolabel.yml
@@ -15,7 +15,7 @@ jobs:
if: ${{ github.event.sender.login != 'ffmpeg-devel' }}
steps:
- name: Checkout
- uses: actions/checkout@v6
+ uses: actions/checkout@v7
- name: Label by file-changes
uses: actions/labeler@v6
if: ${{ forge.event_name == 'pull_request_target' }}
--
2.52.0
From cfaadc024ecf8c1ebbb7cdbd3685ab8626a8603e Mon Sep 17 00:00:00 2001
From: Project516 <project516(a)project516.dev>
Date: Tue, 23 Jun 2026 14:18:18 +0000
Subject: [PATCH 2/3] Update .forgejo/workflows/lint.yml
update actions/checkout@v6 to v7
Signed-off-by: Project516 <project516(a)project516.dev>
---
.forgejo/workflows/lint.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.forgejo/workflows/lint.yml b/.forgejo/workflows/lint.yml
index 32237eecc7..c4bf89a6b3 100644
--- a/.forgejo/workflows/lint.yml
+++ b/.forgejo/workflows/lint.yml
@@ -15,7 +15,7 @@ jobs:
runs-on: utilities
steps:
- name: Checkout
- uses: actions/checkout@v6
+ uses: actions/checkout@v7
- name: Install pre-commit CI
id: install
run: |
--
2.52.0
From a3069b4890e0676c2aee818378e9184a64b79fa1 Mon Sep 17 00:00:00 2001
From: Project516 <project516(a)project516.dev>
Date: Tue, 23 Jun 2026 14:18:48 +0000
Subject: [PATCH 3/3] Update .forgejo/workflows/test.yml
update actions/checkout@v6 to v7
Signed-off-by: Project516 <project516(a)project516.dev>
---
.forgejo/workflows/test.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml
index 3af1522b88..1deee7a3d2 100644
--- a/.forgejo/workflows/test.yml
+++ b/.forgejo/workflows/test.yml
@@ -28,7 +28,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
- uses: actions/checkout@v6
+ uses: actions/checkout@v7
- name: Configure
run: |
./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2 \
@@ -83,7 +83,7 @@ jobs:
container: ${{ matrix.image }}
steps:
- name: Checkout
- uses: actions/checkout@v6
+ uses: actions/checkout@v7
with:
path: ffmpeg
- name: Configure
--
2.52.0
1
0
[PATCH] avcodec/videotoolbox: don't restart session on kVTVideoDecoderBadDataErr
by Derek Cyrus-Chow 23 Jun '26
by Derek Cyrus-Chow 23 Jun '26
23 Jun '26
c6214b0d69 stopped restarting the decode session on
kVTVideoDecoderReferenceMissingErr (-17694), which otherwise loops on streams
with CRA but no IDR. The same restart loop occurs with kVTVideoDecoderBadDataErr
(-12909): VideoToolbox reports it for a picture it cannot decode, e.g. transient
corrupt or truncated input data. Restarting the session there discards its
reference frames, so the next inter-coded picture also fails -> another null
frame -> another restart, latching a permanent reconfig loop (one
videotoolbox_stop()/videotoolbox_start() per frame).
Treat -12909 like -17694: drop the picture and recover on subsequent valid
pictures. Genuine reconfiguration is unaffected -- SPS profile/level changes
still set reconfig_needed, and session faults
(kVTVideoDecoderMalfunctionErr / kVTInvalidSessionErr) still set it from the
decode-status check.
Signed-off-by: Derek Cyrus-Chow <derek.chow(a)catapult.com>
---
libavcodec/videotoolbox.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 8df8a3214c..6dfe6804f7 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -730,8 +730,17 @@ static void videotoolbox_decoder_callback(void *opaque,
}
if (!image_buffer) {
- // kVTVideoDecoderReferenceMissingErr, defined since the macOS 12 SDKs
- if (status != -17694)
+ /* Skip the session restart for recoverable per-picture errors. A
+ * restart (videotoolbox_stop()/start()) discards reference frames, so
+ * the next inter-coded picture fails too -> another null frame ->
+ * another restart, latching a reconfig loop (one stop/start per frame).
+ * -17694 kVTVideoDecoderReferenceMissingErr (named since the macOS 12
+ * SDKs): missing references, e.g. a CRA without a leading IDR.
+ * -12909 kVTVideoDecoderBadDataErr: a picture that cannot be decoded,
+ * e.g. transient corrupt or truncated input; recovers on the
+ * next valid picture, so dropping it beats tearing down the
+ * session. */
+ if (status != -17694 && status != -12909)
vtctx->reconfig_needed = true;
av_log(vtctx->logctx, status ? AV_LOG_WARNING : AV_LOG_DEBUG,
--
2.41.0
1
0
[PR] avcodec/d3d12va: fix reference-only resource pool exhaustion (PR #23560)
by Kacper Michajłow 22 Jun '26
by Kacper Michajłow 22 Jun '26
22 Jun '26
PR #23560 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23560
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23560.patch
When the driver requires REFERENCE_ONLY allocations, get_reference_only_resource()
is called for each frame's output surface but did not check whether that surface
was already mapped to a slot. As the frame pool recycles output surfaces, a
recycled surface that was still mapped got assigned a new slot every time,
leaking slots until the pool was exhausted and decoding failed with "No space
for new Reference frame!".
Reuse the slot already mapped to an output resource. Also iterate the full
max_num_ref + 1 pool that is allocated: the extra slot covers the new current
frame, which is acquired before prepare_reference_only_resources() releases the
previous frame's slots.
From b4884c71de0dcb2acf3ecee027e0c81c44dd63f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93(a)gmail.com>
Date: Mon, 22 Jun 2026 20:57:58 +0200
Subject: [PATCH] avcodec/d3d12va: fix reference-only resource pool exhaustion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When the driver requires REFERENCE_ONLY allocations, get_reference_only_resource()
is called for each frame's output surface but did not check whether that surface
was already mapped to a slot. As the frame pool recycles output surfaces, a
recycled surface that was still mapped got assigned a new slot every time,
leaking slots until the pool was exhausted and decoding failed with "No space
for new Reference frame!".
Reuse the slot already mapped to an output resource. Also iterate the full
max_num_ref + 1 pool that is allocated: the extra slot covers the new current
frame, which is acquired before prepare_reference_only_resources() releases the
previous frame's slots.
Signed-off-by: Kacper Michajłow <kasper93(a)gmail.com>
---
libavcodec/d3d12va_decode.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c
index 4e714efb1a..1b83b2d905 100644
--- a/libavcodec/d3d12va_decode.c
+++ b/libavcodec/d3d12va_decode.c
@@ -61,8 +61,20 @@ static ID3D12Resource *get_reference_only_resource(AVCodecContext *avctx, ID3D12
return NULL;
}
- // find unused resource
- for (i = 0; i < ctx->max_num_ref; i++) {
+ // Reuse the slot already mapped to this output resource. Output surfaces are
+ // recycled by the frame pool, so without this the same output_resource would
+ // be assigned a new slot every time it is reused, leaking slots until the
+ // pool is exhausted.
+ for (i = 0; i < ctx->max_num_ref + 1; i++) {
+ if (reference_only_map[i].resource != NULL &&
+ reference_only_map[i].output_resource == output_resource) {
+ reference_only_map[i].used = 1;
+ return reference_only_map[i].resource;
+ }
+ }
+
+ // Find an unused resource.
+ for (i = 0; i < ctx->max_num_ref + 1; i++) {
if (!reference_only_map[i].used && reference_only_map[i].resource != NULL) {
reference_only_map[i].used = 1;
resource = reference_only_map[i].resource;
@@ -71,13 +83,13 @@ static ID3D12Resource *get_reference_only_resource(AVCodecContext *avctx, ID3D12
}
}
- // find space to allocate
- for (i = 0; i < ctx->max_num_ref; i++) {
+ // Find space to allocate.
+ for (i = 0; i < ctx->max_num_ref + 1; i++) {
if (reference_only_map[i].resource == NULL)
break;
}
- if (i == ctx->max_num_ref) {
+ if (i == ctx->max_num_ref + 1) {
av_log(avctx, AV_LOG_ERROR, "No space for new Reference frame!\n");
return NULL;
}
@@ -105,7 +117,7 @@ static void free_reference_only_resources(AVCodecContext *avctx)
int i;
ReferenceFrame *reference_only_map = ctx->reference_only_map;
if (reference_only_map != NULL) {
- for (i = 0; i < ctx->max_num_ref; i++) {
+ for (i = 0; i < ctx->max_num_ref + 1; i++) {
if (reference_only_map[i].resource != NULL) {
D3D12_OBJECT_RELEASE(reference_only_map[i].resource);
}
@@ -123,7 +135,7 @@ static void prepare_reference_only_resources(AVCodecContext *avctx)
if (reference_only_map == NULL)
return;
memset(ctx->ref_only_resources, 0, ctx->max_num_ref * sizeof(*(ctx->ref_only_resources)));
- for (j = 0; j < ctx->max_num_ref; j++) {
+ for (j = 0; j < ctx->max_num_ref + 1; j++) {
for (i = 0; i < ctx->max_num_ref; i++) {
if (reference_only_map[j].used && reference_only_map[j].output_resource == ctx->ref_resources[i]) {
ctx->ref_only_resources[i] = reference_only_map[j].resource;
--
2.52.0
1
0