[FFmpeg-cvslog] swscale/output: use isDataInHighBits for 10-bit case

rcombs git at videolan.org
Wed Jan 5 03:41:15 EET 2022


ffmpeg | branch: master | rcombs <rcombs at rcombs.me> | Thu Dec 23 03:29:04 2021 -0600| [bb4f19f2a27ec2170dee852f7f307fcbc51faba9] | committer: rcombs

swscale/output: use isDataInHighBits for 10-bit case

This code will need fleshing-out (probably templating) if we ever add
e.g. a P012 format.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bb4f19f2a27ec2170dee852f7f307fcbc51faba9
---

 libswscale/output.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index e43eb7835e..7cedb145aa 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2597,9 +2597,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
     enum AVPixelFormat dstFormat = c->dstFormat;
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
 
-    if (dstFormat == AV_PIX_FMT_P010LE || dstFormat == AV_PIX_FMT_P010BE ||
-        dstFormat == AV_PIX_FMT_P210LE || dstFormat == AV_PIX_FMT_P210BE ||
-        dstFormat == AV_PIX_FMT_P410LE || dstFormat == AV_PIX_FMT_P410BE) {
+    if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) {
+        av_assert0(desc->comp[0].depth == 10);
         *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
         *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
         *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;



More information about the ffmpeg-cvslog mailing list