From patchwork Wed Apr 22 05:23:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Wang X-Patchwork-Id: 19151 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 79DBE449B6D for ; Wed, 22 Apr 2020 08:24:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 55AE868BB5F; Wed, 22 Apr 2020 08:24:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E0CD368BAFB for ; Wed, 22 Apr 2020 08:23:52 +0300 (EEST) IronPort-SDR: vRtDchpZuZXm6GtatFLGMX86Vc8fe45zHZ49H4LabNwqmTI5v/4iZk9toMBzYWsRoubBRhfYNE RjVpPiZjZV3w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 22:23:51 -0700 IronPort-SDR: AvYl0PJ9XNkX/oECb8V/jpDYOePp7urIGtgNS9FXX1xw+Yg9qJukNGRbFO8hRFK+ss/luTg2lr a0i13UaEUJVw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="300817313" Received: from t.sh.intel.com ([10.239.13.9]) by FMSMGA003.fm.intel.com with ESMTP; 21 Apr 2020 22:23:50 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Apr 2020 13:23:01 +0800 Message-Id: <1587532983-20287-1-git-send-email-fei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH v2 1/3] lavu/pix_fmt: add new pixel format x2rgb10 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Fei Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The format is packed RGB with each channel 10 bits available and include 2 bits unused. Signed-off-by: Fei Wang --- libavutil/pixdesc.c | 24 ++++++++++++++++++++++++ libavutil/pixfmt.h | 3 +++ libavutil/version.h | 2 +- tests/ref/fate/filter-pixdesc-x2rgb10le | 1 + tests/ref/fate/sws-pixdesc-query | 11 +++++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/filter-pixdesc-x2rgb10le diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 9d61c52..23ec1ab 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -252,6 +252,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { }, .flags = AV_PIX_FMT_FLAG_RGB, }, + [AV_PIX_FMT_X2RGB10LE] = { + .name = "x2rgb10le", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 4, 2, 4, 10, 3, 9, 2 }, /* R */ + { 0, 4, 1, 2, 10, 3, 9, 3 }, /* G */ + { 0, 4, 0, 0, 10, 3, 9, 4 }, /* B */ + }, + .flags = AV_PIX_FMT_FLAG_RGB, + }, + [AV_PIX_FMT_X2RGB10BE] = { + .name = "x2rgb10be", + .nb_components= 3, + .log2_chroma_w= 0, + .log2_chroma_h= 0, + .comp = { + { 0, 4, 0, 4, 10, 3, 9, 2 }, /* R */ + { 0, 4, 1, 2, 10, 3, 9, 3 }, /* G */ + { 0, 4, 2, 0, 10, 3, 9, 4 }, /* B */ + }, + .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_BE, + }, [AV_PIX_FMT_YUV422P] = { .name = "yuv422p", .nb_components = 3, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 1c625cf..71058d7 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -358,6 +358,8 @@ enum AVPixelFormat { AV_PIX_FMT_Y210BE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, big-endian AV_PIX_FMT_Y210LE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian + AV_PIX_FMT_X2RGB10LE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined + AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined 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 }; @@ -447,6 +449,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) #define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE) +#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE) /** * Chromaticity coordinates of the source primaries. diff --git a/libavutil/version.h b/libavutil/version.h index 70836a5..e4fa0a9 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 42 +#define LIBAVUTIL_VERSION_MINOR 43 #define LIBAVUTIL_VERSION_MICRO 102 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/tests/ref/fate/filter-pixdesc-x2rgb10le b/tests/ref/fate/filter-pixdesc-x2rgb10le new file mode 100644 index 0000000..94c8640 --- /dev/null +++ b/tests/ref/fate/filter-pixdesc-x2rgb10le @@ -0,0 +1 @@ +pixdesc-x2rgb10le 98d697ed4668daf535163d5e08c903bb diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index bc9a0d8..c3cccfa 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -57,6 +57,8 @@ isNBPS: nv20le p010be p010le + x2rgb10be + x2rgb10le xyz12be xyz12le y210be @@ -141,6 +143,7 @@ isBE: rgb555be rgb565be rgba64be + x2rgb10be xyz12be y210be ya16be @@ -436,6 +439,8 @@ isRGB: rgb8 rgba64be rgba64le + x2rgb10be + x2rgb10le Gray: gray @@ -582,6 +587,8 @@ AnyRGB: rgb8 rgba64be rgba64le + x2rgb10be + x2rgb10le ALPHA: ayuv64be @@ -689,6 +696,8 @@ Packed: rgba64le uyvy422 uyyvyy411 + x2rgb10be + x2rgb10le xyz12be xyz12le y210be @@ -853,6 +862,8 @@ PackedRGB: rgb8 rgba64be rgba64le + x2rgb10be + x2rgb10le PlanarRGB: gbrap From patchwork Wed Apr 22 05:23:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Wang X-Patchwork-Id: 19167 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:3c87:0:0:0:0:0 with SMTP id j129csp369950yba; Tue, 21 Apr 2020 22:24:11 -0700 (PDT) X-Google-Smtp-Source: APiQypJY1hqNl8b5Rn0niWDO3ibs9+ByzstJkoV1QldPCvfI64mq5FzdrsGvNDhCYK67xneA/0f0 X-Received: by 2002:adf:810f:: with SMTP id 15mr24180681wrm.273.1587533051373; Tue, 21 Apr 2020 22:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587533051; cv=none; d=google.com; s=arc-20160816; b=krkZMgHkLQfJwNrWvBErkA3tB6QZMV1gNqE0BDQ4UPqvun5SfgQfhiFdvtmVIAL8G7 0NV+oxrX0aOkjJkWEV8ka+02ghJXQs5bHP36ynggx2YZvaL4uMmfSirF19sLnJsiPU8a VEENL6Oit3zSxwOS21zjNrDRiHTWunlgkyDt+ugntASw9mi+K4/619kyFLUWsPidG8Bh 5QASj9Et5dzwho8zwkzT/EeMVe/IweGm09waRdMlL5vI2J1ioS/S6CIdK9vF2z42/peV ERaFNhpEJ3c9EA3Yj9L63rqm65aEhNlkdVsMgKt+62qVSq1Fx4N86UxWn0VyCC7wiae5 8l3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:ironport-sdr:ironport-sdr:delivered-to; bh=Cfkdofv+dh2nwAfxzJX+hp3JNZoCDmZDEP5KeQ6UdmE=; b=F+fcLZpTj63rM0tENZp0zJErHx7VAfLZt+erPxM5WClGBJM17pTq/B3/edePboT8F4 byttbRJlzSmsVEmd4p7fXRfu97cgCOt+8SjeM5IisH62ZuQfppj01pI+20jCVA75bVEq JZD/MCzTPbDLjDA4Az2PdqRnD/XSPXi/mXW+raqsnmxigzJWlASiHjZClvKgWHV+i+z7 jfbhBgrrfGy7ANUwPlFpy2fwkaGPSj8SzbR4OySUIaiVMUaQhKzuwwowB6Au8nF8yKdZ 45EThJlI+CEJFr8nRwjHRw/yII+29lf4GiwHkayCrIo27fspAXrCNOPr5AVE6JympY4J 3JMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j16si4342674wrm.521.2020.04.21.22.24.11; Tue, 21 Apr 2020 22:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3AFAC68BB6B; Wed, 22 Apr 2020 08:24:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D826D68BB45 for ; Wed, 22 Apr 2020 08:23:54 +0300 (EEST) IronPort-SDR: 8AY4d9wTOnvbjEYI2mZXA5rplLptAuEp/GCwsrptQZ6W+n9jE/E24n+w+PzS/KAeBjyUec/x6d /UgVxMYWZuQQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 22:23:52 -0700 IronPort-SDR: F4sceHzOznC8qz5RpgdFWtAShyCZf5tQjiUQJ4wfMrhxDo04+KdTh5yP9AaTa08Y81+1U+X/Wo ym1r/7YC2FOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="300817320" Received: from t.sh.intel.com ([10.239.13.9]) by FMSMGA003.fm.intel.com with ESMTP; 21 Apr 2020 22:23:51 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Apr 2020 13:23:02 +0800 Message-Id: <1587532983-20287-2-git-send-email-fei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587532983-20287-1-git-send-email-fei.w.wang@intel.com> References: <1587532983-20287-1-git-send-email-fei.w.wang@intel.com> Subject: [FFmpeg-devel] [PATCH v2 2/3] swscale: Add swscale input/output support for X2RGB10LE X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Fei Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: A4y59SFRG60u Content-Length: 19506 Signed-off-by: Fei Wang --- libswscale/input.c | 13 ++++++++++++- libswscale/output.c | 14 ++++++++++++++ libswscale/utils.c | 1 + libswscale/yuv2rgb.c | 22 ++++++++++++++++++++++ tests/ref/fate/filter-pixfmts-copy | 1 + tests/ref/fate/filter-pixfmts-crop | 1 + tests/ref/fate/filter-pixfmts-field | 1 + tests/ref/fate/filter-pixfmts-fieldorder | 1 + tests/ref/fate/filter-pixfmts-hflip | 1 + tests/ref/fate/filter-pixfmts-il | 1 + tests/ref/fate/filter-pixfmts-null | 1 + tests/ref/fate/filter-pixfmts-pad | 1 + tests/ref/fate/filter-pixfmts-scale | 1 + tests/ref/fate/filter-pixfmts-transpose | 1 + tests/ref/fate/filter-pixfmts-vflip | 1 + 15 files changed, 60 insertions(+), 1 deletion(-) diff --git a/libswscale/input.c b/libswscale/input.c index 099661c..05fdc2f 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -244,7 +244,8 @@ rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE) #define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \ origin == AV_PIX_FMT_BGRA || \ origin == AV_PIX_FMT_ARGB || \ - origin == AV_PIX_FMT_ABGR) \ + origin == AV_PIX_FMT_ABGR || \ + origin == AV_PIX_FMT_X2RGB10) \ ? AV_RN32A(&src[(i) * 4]) \ : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \ : AV_RL16(&src[(i) * 2]))) @@ -391,6 +392,7 @@ rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_X2RGB10LE, rgb30le, 16, 6, 0, 0, 0x3FF00000, 0xFFC00, 0x3FF, 0, 0, 4, RGB2YUV_SHIFT + 6) static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc, @@ -1260,6 +1262,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_half_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->chrToYV12 = rgb30leToUV_half_c; + break; } } else { switch (srcFormat) { @@ -1341,6 +1346,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->chrToYV12 = rgb30leToUV_c; + break; } } @@ -1610,6 +1618,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_Y210LE: c->lumToYV12 = y210le_Y_c; break; + case AV_PIX_FMT_X2RGB10LE: + c->lumToYV12 =rgb30leToY_c; + break; } if (c->needAlpha) { if (is16BPS(srcFormat) || isNBPS(srcFormat)) { diff --git a/libswscale/output.c b/libswscale/output.c index 68f43ff..f9528af 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1602,6 +1602,13 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, dest[i * 2 + 0] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1]; dest[i * 2 + 1] = r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]; + } else if (target == AV_PIX_FMT_X2RGB10) { + uint32_t *dest = (uint32_t *) _dest; + const uint32_t *r = (const uint32_t *) _r; + const uint32_t *g = (const uint32_t *) _g; + const uint32_t *b = (const uint32_t *) _b; + dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1]; + dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2]; } else /* 8/4 bits */ { uint8_t *dest = (uint8_t *) _dest; const uint8_t *r = (const uint8_t *) _r; @@ -1839,6 +1846,7 @@ YUV2RGBWRAPPER(yuv2rgb,, 12, AV_PIX_FMT_RGB444, 0) YUV2RGBWRAPPER(yuv2rgb,, 8, AV_PIX_FMT_RGB8, 0) YUV2RGBWRAPPER(yuv2rgb,, 4, AV_PIX_FMT_RGB4, 0) YUV2RGBWRAPPER(yuv2rgb,, 4b, AV_PIX_FMT_RGB4_BYTE, 0) +YUV2RGBWRAPPER(yuv2, rgb, x2rgb10, AV_PIX_FMT_X2RGB10, 0) static av_always_inline void yuv2rgb_write_full(SwsContext *c, uint8_t *dest, int i, int Y, int A, int U, int V, @@ -2892,6 +2900,12 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, *yuv2packed2 = yuv2rgb4b_2_c; *yuv2packedX = yuv2rgb4b_X_c; break; + case AV_PIX_FMT_X2RGB10LE: + case AV_PIX_FMT_X2RGB10BE: + *yuv2packed1 = yuv2x2rgb10_1_c; + *yuv2packed2 = yuv2x2rgb10_2_c; + *yuv2packedX = yuv2x2rgb10_X_c; + break; } } switch (dstFormat) { diff --git a/libswscale/utils.c b/libswscale/utils.c index bb3495b..681d395 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -267,6 +267,7 @@ static const FormatEntry format_entries[] = { [AV_PIX_FMT_NV24] = { 1, 1 }, [AV_PIX_FMT_NV42] = { 1, 1 }, [AV_PIX_FMT_Y210LE] = { 1, 0 }, + [AV_PIX_FMT_X2RGB10LE] = { 1, 1 }, }; int sws_isSupportedInput(enum AVPixelFormat pix_fmt) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 5884625..71d4b90 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -965,6 +965,28 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], fill_table(c->table_bU, 1, cbu, y_table + yoffs); fill_gv_table(c->table_gV, 1, cgv); break; + case 30: + rbase = 20; + gbase = 10; + bbase = 0; + needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat); + if (!needAlpha) + abase = 30; + ALLOC_YUV_TABLE(table_plane_size * 3 * 4); + y_table32 = c->yuvTable; + yb = -(384 << 16) - YUVRGB_TABLE_LUMA_HEADROOM*cy - oy; + for (i = 0; i < table_plane_size; i++) { + unsigned yval = av_clip_uint8((yb + 0x8000) >> 16); + y_table32[i]= (yval << rbase) + (needAlpha ? 0 : (255u << abase)); + y_table32[i + table_plane_size] = yval << gbase; + y_table32[i + 2 * table_plane_size] = yval << bbase; + yb += cy; + } + fill_table(c->table_rV, 4, crv, y_table32 + yoffs); + fill_table(c->table_gU, 4, cgu, y_table32 + yoffs + table_plane_size); + fill_table(c->table_bU, 4, cbu, y_table32 + yoffs + 2 * table_plane_size); + fill_gv_table(c->table_gV, 4, cgv); + break; case 32: case 64: base = (c->dstFormat == AV_PIX_FMT_RGB32_1 || diff --git a/tests/ref/fate/filter-pixfmts-copy b/tests/ref/fate/filter-pixfmts-copy index d19314b..c95ec33 100644 --- a/tests/ref/fate/filter-pixfmts-copy +++ b/tests/ref/fate/filter-pixfmts-copy @@ -76,6 +76,7 @@ rgba b6e1b441c365e03b5ffdf9b7b68d9a0c rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea rgba64le b91e1d77f799eb92241a2d2d28437b15 uyvy422 3bcf3c80047592f2211fae3260b1b65d +x2rgb10le b0a0c8056521beeaa3fea4985ca87176 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c ya16be 37c07787e544f900c87b853253bfc8dd diff --git a/tests/ref/fate/filter-pixfmts-crop b/tests/ref/fate/filter-pixfmts-crop index ab89d06..35bff2d 100644 --- a/tests/ref/fate/filter-pixfmts-crop +++ b/tests/ref/fate/filter-pixfmts-crop @@ -73,6 +73,7 @@ rgb8 9b364a8f112ad9459fec47a51cc03b30 rgba 9488ac85abceaf99a9309eac5a87697e rgba64be 89910046972ab3c68e2a348302cc8ca9 rgba64le fea8ebfc869b52adf353778f29eac7a7 +x2rgb10le 5c0789f76a713f343c2ed42a371d441d xyz12be cb4571f9aaa7b59f999ef327276104b7 xyz12le cd6aae8d26b18bdb4b9d068586276d91 ya16be a3d18014454942a96f15a49947c0c55d diff --git a/tests/ref/fate/filter-pixfmts-field b/tests/ref/fate/filter-pixfmts-field index 994026d..bf7347a 100644 --- a/tests/ref/fate/filter-pixfmts-field +++ b/tests/ref/fate/filter-pixfmts-field @@ -76,6 +76,7 @@ rgba ee616262ca6d67b7ecfba4b36c602ce3 rgba64be 23c8c0edaabe3eaec89ce69633fb0048 rgba64le dfdba4de4a7cac9abf08852666c341d3 uyvy422 1c49e44ab3f060e85fc4a3a9464f045e +x2rgb10le a7a5dcdfe1d4b6bd71e40b01c735f144 xyz12be d2fa69ec91d3ed862f2dac3f8e7a3437 xyz12le 02bccd5e0b6824779a1f848b0ea3e3b5 ya16be 40403b5277364777e0671da4d38e01ac diff --git a/tests/ref/fate/filter-pixfmts-fieldorder b/tests/ref/fate/filter-pixfmts-fieldorder index 3d3eef3..33cf3cf 100644 --- a/tests/ref/fate/filter-pixfmts-fieldorder +++ b/tests/ref/fate/filter-pixfmts-fieldorder @@ -67,6 +67,7 @@ rgba 1fdf872a087a32cd35b80cc7be399578 rgba64be 5598f44514d122b9a57c5c92c20bbc61 rgba64le b34e6e30621ae579519a2d91a96a0acf uyvy422 75de70e31c435dde878002d3f22b238a +x2rgb10le 636c90498c64abba1cc0624c5209a61f xyz12be 15f5cda71de5fef9cec5e75e3833b6bc xyz12le 7be6c8781f38c21a6b8f602f62ca31e6 ya16be 0f13e0f52586d172aaa07710fa3e8f31 diff --git a/tests/ref/fate/filter-pixfmts-hflip b/tests/ref/fate/filter-pixfmts-hflip index 8712074..70a69c4 100644 --- a/tests/ref/fate/filter-pixfmts-hflip +++ b/tests/ref/fate/filter-pixfmts-hflip @@ -73,6 +73,7 @@ rgb8 68a3a575badadd9e4f90226209f11699 rgba 51961c723ea6707e0a410cd3f21f15d3 rgba64be c910444019f4cfbf4d995227af55da8d rgba64le 0c810d8b3a6bca10321788e1cb145340 +x2rgb10le 9f99dce306383daf25cd1542b2517fef xyz12be 25f90259ff8a226befdaec3dfe82996e xyz12le 926c0791d59aaff61b2778e8ada3316d ya16be d5b342355bdd9e3197e01b13b7c6301e diff --git a/tests/ref/fate/filter-pixfmts-il b/tests/ref/fate/filter-pixfmts-il index 7f1c339..994a051 100644 --- a/tests/ref/fate/filter-pixfmts-il +++ b/tests/ref/fate/filter-pixfmts-il @@ -75,6 +75,7 @@ rgba 625d8f4bd39c4bdbf61eb5e4713aecc9 rgba64be db70d33aa6c06f3e0a1c77bd11284261 rgba64le a8a2daae04374a27219bc1c890204007 uyvy422 d6ee3ca43356d08c392382b24b22cda5 +x2rgb10le a01ea7dd339e028780e04971012d826d xyz12be 7c7d54c55f136cbbc50b18029f3be0b3 xyz12le 090ba6b1170baf2b1358b43b971d33b0 ya16be 7bc720918bc0132e9717acbde89874e0 diff --git a/tests/ref/fate/filter-pixfmts-null b/tests/ref/fate/filter-pixfmts-null index d19314b..c95ec33 100644 --- a/tests/ref/fate/filter-pixfmts-null +++ b/tests/ref/fate/filter-pixfmts-null @@ -76,6 +76,7 @@ rgba b6e1b441c365e03b5ffdf9b7b68d9a0c rgba64be ae2ae04b5efedca3505f47c4dd6ea6ea rgba64le b91e1d77f799eb92241a2d2d28437b15 uyvy422 3bcf3c80047592f2211fae3260b1b65d +x2rgb10le b0a0c8056521beeaa3fea4985ca87176 xyz12be a1ef56bf746d71f59669c28e48fc8450 xyz12le 831ff03c1ba4ef19374686f16a064d8c ya16be 37c07787e544f900c87b853253bfc8dd diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad index 56482cf..9a5db82 100644 --- a/tests/ref/fate/filter-pixfmts-pad +++ b/tests/ref/fate/filter-pixfmts-pad @@ -28,6 +28,7 @@ nv42 1738ad3c31c6c16e17679f5b09ce4677 rgb0 78d500c8361ab6423a4826a00268c908 rgb24 17f9e2e0c609009acaf2175c42d4a2a5 rgba b157c90191463d34fb3ce77b36c96386 +x2rgb10le c240f8a8dfa647c57c0974d061c9652a xyz12le 85abf80b77a9236a76ba0b00fcbdea2d ya16le 940fafa240b9916de5f73cb20a552f24 ya8 5fc0f471207ddf7aa01b07027d56b672 diff --git a/tests/ref/fate/filter-pixfmts-scale b/tests/ref/fate/filter-pixfmts-scale index 89d3f58..3ae17b3 100644 --- a/tests/ref/fate/filter-pixfmts-scale +++ b/tests/ref/fate/filter-pixfmts-scale @@ -76,6 +76,7 @@ rgba 85bb5d03cea1c6e8002ced3373904336 rgba64be ee73e57923af984b31cc7795d13929da rgba64le 783d2779adfafe3548bdb671ec0de69e uyvy422 aeb4ba4f9f003ae21f6d18089198244f +x2rgb10le 591fe7942544c8fc40e5d30e0e589f49 xyz12be c7ba8345998c0141ddc079cdd29b1a40 xyz12le 95f5d3a0de834cc495c9032a14987cde ya16be 20d4842899d61068f5fb6af478bf26a6 diff --git a/tests/ref/fate/filter-pixfmts-transpose b/tests/ref/fate/filter-pixfmts-transpose index e4a170f..2b8381a 100644 --- a/tests/ref/fate/filter-pixfmts-transpose +++ b/tests/ref/fate/filter-pixfmts-transpose @@ -72,6 +72,7 @@ rgb8 c90feb30c3c9391ef5f470209d7b7a15 rgba 4d76a9542143752a4ac30f82f88f68f1 rgba64be a60041217f4c0cd796d19d3940a12a41 rgba64le ad47197774858858ae7b0c177dffa459 +x2rgb10le a64d4d901b09bea9d59eda58be5e88ff xyz12be 68e5cba640f6e4ef72dff950e88b5342 xyz12le 8b6b6a6db4d7561e80db88ccaecce7a9 ya16be 3e161cb5f225922a80fefdc9cc02a4f9 diff --git a/tests/ref/fate/filter-pixfmts-vflip b/tests/ref/fate/filter-pixfmts-vflip index 2522c84..812e2d5 100644 --- a/tests/ref/fate/filter-pixfmts-vflip +++ b/tests/ref/fate/filter-pixfmts-vflip @@ -76,6 +76,7 @@ rgba c1a5908572737f2ae1e5d8218af65f4b rgba64be 17e6273323b5779b5f3f775f150c1011 rgba64le 48f45b10503b7dd140329c3dd0d54c98 uyvy422 3a237e8376264e0cfa78f8a3fdadec8a +x2rgb10le 332a6f5f5012008a562cb031836da028 xyz12be 810644e008deb231850d779aaa27cc7e xyz12le 829701db461b43533cf9241e0743bc61 ya16be 55b1dbbe4d56ed0d22461685ce85520d From patchwork Wed Apr 22 05:23:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fei Wang X-Patchwork-Id: 19152 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id E4814449D21 for ; Wed, 22 Apr 2020 08:24:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D18E968BB74; Wed, 22 Apr 2020 08:24:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C509468BAFB for ; Wed, 22 Apr 2020 08:23:58 +0300 (EEST) IronPort-SDR: Ok7s2SdXlbYJ8enjCM0xOH7G+auWGWunTEyI+wrgz5Fh9b7oh1vcCAJlofx4WotxhZbWTnQ/Vk oi3O9KumZUXQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 22:23:53 -0700 IronPort-SDR: B1yd2fnEflyou/dLbr7jPOXoFIgymvQ/x0tQ+74QLs1C92L4eIV4Om5h3+u+jFAB3vyzOBKLCA eb3tchLrAdiQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="300817333" Received: from t.sh.intel.com ([10.239.13.9]) by FMSMGA003.fm.intel.com with ESMTP; 21 Apr 2020 22:23:52 -0700 From: Fei Wang To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Apr 2020 13:23:03 +0800 Message-Id: <1587532983-20287-3-git-send-email-fei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1587532983-20287-1-git-send-email-fei.w.wang@intel.com> References: <1587532983-20287-1-git-send-email-fei.w.wang@intel.com> Subject: [FFmpeg-devel] [PATCH v2 3/3] lavu/hwcontext_vaapi: add vaapi_format_map support for x2rgb10 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Fei Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Fei Wang --- libavutil/hwcontext_vaapi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index b306965..50727fb 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -136,6 +136,9 @@ static const VAAPIFormatDescriptor vaapi_format_map[] = { #endif MAP(ARGB, RGB32, ARGB, 0), MAP(XRGB, RGB32, 0RGB, 0), +#ifdef VA_FOURCC_X2R10G10B10 + MAP(X2R10G10B10, RGB32_10, X2RGB10, 0), +#endif }; #undef MAP