aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-23 03:29:04 -0600
committerrcombs <rcombs@rcombs.me>2022-01-04 19:39:22 -0600
commitbb4f19f2a27ec2170dee852f7f307fcbc51faba9 (patch)
treeb39cfce431eb625b8985a97ae9790562c9d0cee3
parentcf9e8cb52f413ec9cf82b8934db1d5f9c7fbb975 (diff)
downloadffmpeg-bb4f19f2a27ec2170dee852f7f307fcbc51faba9.tar.gz
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.
-rw-r--r--libswscale/output.c5
1 files 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;