Browse Source

swscale: add P210/P410/P216/P416 output

rcombs 3 years ago
parent
commit
88d804b7ff

+ 6 - 2
libswscale/output.c

@@ -2563,14 +2563,18 @@ 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) {
+    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) {
         *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c;
         *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c;
         *yuv2nv12cX = yuv2p010cX_c;
     } else if (is16BPS(dstFormat)) {
         *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c  : yuv2planeX_16LE_c;
         *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c  : yuv2plane1_16LE_c;
-        if (dstFormat == AV_PIX_FMT_P016LE || dstFormat == AV_PIX_FMT_P016BE) {
+        if (dstFormat == AV_PIX_FMT_P016LE || dstFormat == AV_PIX_FMT_P016BE ||
+            dstFormat == AV_PIX_FMT_P216LE || dstFormat == AV_PIX_FMT_P216BE ||
+            dstFormat == AV_PIX_FMT_P416LE || dstFormat == AV_PIX_FMT_P416BE) {
           *yuv2nv12cX = yuv2p016cX_c;
         }
     } else if (isNBPS(dstFormat)) {

+ 8 - 8
libswscale/utils.c

@@ -268,14 +268,14 @@ static const FormatEntry format_entries[] = {
     [AV_PIX_FMT_Y210LE]      = { 1, 0 },
     [AV_PIX_FMT_X2RGB10LE]   = { 1, 1 },
     [AV_PIX_FMT_X2BGR10LE]   = { 1, 1 },
-    [AV_PIX_FMT_P210BE]      = { 1, 0 },
-    [AV_PIX_FMT_P210LE]      = { 1, 0 },
-    [AV_PIX_FMT_P410BE]      = { 1, 0 },
-    [AV_PIX_FMT_P410LE]      = { 1, 0 },
-    [AV_PIX_FMT_P216BE]      = { 1, 0 },
-    [AV_PIX_FMT_P216LE]      = { 1, 0 },
-    [AV_PIX_FMT_P416BE]      = { 1, 0 },
-    [AV_PIX_FMT_P416LE]      = { 1, 0 },
+    [AV_PIX_FMT_P210BE]      = { 1, 1 },
+    [AV_PIX_FMT_P210LE]      = { 1, 1 },
+    [AV_PIX_FMT_P410BE]      = { 1, 1 },
+    [AV_PIX_FMT_P410LE]      = { 1, 1 },
+    [AV_PIX_FMT_P216BE]      = { 1, 1 },
+    [AV_PIX_FMT_P216LE]      = { 1, 1 },
+    [AV_PIX_FMT_P416BE]      = { 1, 1 },
+    [AV_PIX_FMT_P416LE]      = { 1, 1 },
 };
 
 void ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int filterSize, int16_t *filter, int dstW){

+ 1 - 1
libswscale/version.h

@@ -28,7 +28,7 @@
 
 #define LIBSWSCALE_VERSION_MAJOR   6
 #define LIBSWSCALE_VERSION_MINOR   1
-#define LIBSWSCALE_VERSION_MICRO 101
+#define LIBSWSCALE_VERSION_MICRO 102
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \

+ 1 - 0
tests/ref/fate/filter-pixdesc-p210be

@@ -0,0 +1 @@
+pixdesc-p210be      9f3465e388d91beeb5cb7fe0011c5a67

+ 1 - 0
tests/ref/fate/filter-pixdesc-p210le

@@ -0,0 +1 @@
+pixdesc-p210le      9994fb3da38c83d3b5fd4994993ad0ae

+ 1 - 0
tests/ref/fate/filter-pixdesc-p216be

@@ -0,0 +1 @@
+pixdesc-p216be      db5cabe6e5f1814a6d20e8398aec4785

+ 1 - 0
tests/ref/fate/filter-pixdesc-p216le

@@ -0,0 +1 @@
+pixdesc-p216le      79d711ee3dac99e37c013d2073d90a2c

+ 1 - 0
tests/ref/fate/filter-pixdesc-p410be

@@ -0,0 +1 @@
+pixdesc-p410be      85671676fa52d0350c918f45417f3c64

+ 1 - 0
tests/ref/fate/filter-pixdesc-p410le

@@ -0,0 +1 @@
+pixdesc-p410le      0b90a10af76240042876793a1dafa862

+ 1 - 0
tests/ref/fate/filter-pixdesc-p416be

@@ -0,0 +1 @@
+pixdesc-p416be      a7d8a859ce47c3860e0fee31539a84b0

Some files were not shown because too many files changed in this diff