[x265] [PATCH] checking for all supported csp values

praveen at multicorewareinc.com praveen at multicorewareinc.com
Fri Nov 15 14:53:00 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384523566 -19800
# Node ID 6a9869846bb84b5d18932d9d258b14840d54010d
# Parent  bd9aa48dcfb7c44f0d1bb873d6965f4d3dbf7433
checking for all supported csp values

diff -r bd9aa48dcfb7 -r 6a9869846bb8 source/common/primitives.cpp
--- a/source/common/primitives.cpp	Fri Nov 15 17:49:39 2013 +0530
+++ b/source/common/primitives.cpp	Fri Nov 15 19:22:46 2013 +0530
@@ -56,6 +56,11 @@
     255,        255,      255,        LUMA_64x16, 255, 255,        255, LUMA_64x32, 255, 255, 255, LUMA_64x48, 255, 255, 255, LUMA_64x64  // 64
 };
 
+const char* colorSpaceNames[NUM_CSP] = 
+{
+    "CSP_NONE", "CSP_I420",
+};
+
 /* the "authoritative" set of encoder primitives */
 EncoderPrimitives primitives;
 
diff -r bd9aa48dcfb7 -r 6a9869846bb8 source/common/primitives.h
--- a/source/common/primitives.h	Fri Nov 15 17:49:39 2013 +0530
+++ b/source/common/primitives.h	Fri Nov 15 19:22:46 2013 +0530
@@ -144,6 +144,8 @@
   NUM_CSP
 };
 
+extern const char* colorSpaceNames[NUM_CSP];
+
 // Returns a LumaPartitions enum for the given size, always expected to return a valid enum
 inline int partitionFromSizes(int width, int height)
 {
diff -r bd9aa48dcfb7 -r 6a9869846bb8 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Fri Nov 15 17:49:39 2013 +0530
+++ b/source/test/pixelharness.cpp	Fri Nov 15 19:22:46 2013 +0530
@@ -724,12 +724,15 @@
         }
     }
 
-    if (opt.chroma_copy_pp[CSP_I420][part])
+    for(int i = 0; i < NUM_CSP; i++)
     {
-        if (!check_block_copy_pp(ref.chroma_copy_pp[CSP_I420][part], opt.chroma_copy_pp[CSP_I420][part]))
+        if (opt.chroma_copy_pp[i][part])
         {
-            printf("chroma_copy_pp[%s][%s] failed\n", "CSP_I420", chromaPartStr[part]);
-            return false;
+            if (!check_block_copy_pp(ref.chroma_copy_pp[i][part], opt.chroma_copy_pp[i][part]))
+            {
+                 printf("chroma_copy_pp[%s][%s] failed\n", colorSpaceNames[i], chromaPartStr[part]);
+                 return false;
+            }
         }
     }
 
@@ -1021,10 +1024,13 @@
         REPORT_SPEEDUP(opt.luma_copy_pp[part], ref.luma_copy_pp[part], pbuf1, 64, pbuf2, 128);
     }
 
-    if (opt.chroma_copy_pp[CSP_I420][part])
+    for (int i = 0; i < NUM_CSP; i++)
     {
-        printf("ccpy_pp[%s][%s]", "CSP_I420", chromaPartStr[part]);
-        REPORT_SPEEDUP(opt.chroma_copy_pp[CSP_I420][part], ref.chroma_copy_pp[CSP_I420][part], pbuf1, 64, pbuf2, 128);
+        if (opt.chroma_copy_pp[i][part])
+        {
+            printf("ccpy_pp[%s][%s]", colorSpaceNames[i], chromaPartStr[part]);
+            REPORT_SPEEDUP(opt.chroma_copy_pp[i][part], ref.chroma_copy_pp[i][part], pbuf1, 64, pbuf2, 128);
+        }
     }
 
     if (opt.luma_copy_sp[part])


More information about the x265-devel mailing list