This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 080b13c5da82ab469949ec7bbef25ec11e3fb007 Author: Wu Jianhua <[email protected]> AuthorDate: Fri May 2 20:25:13 2025 +0800 Commit: jianhuaw <[email protected]> CommitDate: Sun Nov 29 10:42:10 2026 +0000 avcodec/vvc/ps: support 14 bits pixel formats Signed-off-by: Wu Jianhua <[email protected]> --- libavcodec/vvc/ps.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c index 8d6bb74533..389b01d4e0 100644 --- a/libavcodec/vvc/ps.c +++ b/libavcodec/vvc/ps.c @@ -33,6 +33,13 @@ #include "ps.h" #include "dec.h" +static enum AVPixelFormat chroma_idc_formats[][4] = { + { AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P }, + { AV_PIX_FMT_GRAY10, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10 }, + { AV_PIX_FMT_GRAY12, AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12 }, + { AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14 }, +}; + static int sps_map_pixel_format(VVCSPS *sps, void *log_ctx) { const H266RawSPS *r = sps->r; @@ -40,26 +47,18 @@ static int sps_map_pixel_format(VVCSPS *sps, void *log_ctx) switch (sps->bit_depth) { case 8: - if (r->sps_chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY8; - if (r->sps_chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P; - if (r->sps_chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P; - if (r->sps_chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P; - break; case 10: - if (r->sps_chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY10; - if (r->sps_chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P10; - if (r->sps_chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P10; - if (r->sps_chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P10; - break; case 12: - if (r->sps_chroma_format_idc == 0) sps->pix_fmt = AV_PIX_FMT_GRAY12; - if (r->sps_chroma_format_idc == 1) sps->pix_fmt = AV_PIX_FMT_YUV420P12; - if (r->sps_chroma_format_idc == 2) sps->pix_fmt = AV_PIX_FMT_YUV422P12; - if (r->sps_chroma_format_idc == 3) sps->pix_fmt = AV_PIX_FMT_YUV444P12; + case 14: + { + enum AVPixelFormat *formats = chroma_idc_formats[sps->r->sps_bitdepth_minus8 >> 1]; + sps->pix_fmt = formats[sps->r->sps_chroma_format_idc]; break; + } + default: av_log(log_ctx, AV_LOG_ERROR, - "The following bit-depths are currently specified: 8, 10, 12 bits, " + "The following bit-depths are currently specified: 8, 10, 12, 14 bits, " "chroma_format_idc is %d, depth is %d\n", r->sps_chroma_format_idc, sps->bit_depth); return AVERROR_INVALIDDATA; -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
