[x265] [PATCH 1 of 3] primitives: use NULL chroma satd func pointers for blocks not capable of satd

Steve Borho steve at borho.org
Wed Dec 10 19:26:16 CET 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1418160710 21600
#      Tue Dec 09 15:31:50 2014 -0600
# Node ID 4c97d85c8488c2b9199c457f136891005abfa232
# Parent  29489f2fc2c7edfeb56bb0f6421d19f14d25491a
primitives: use NULL chroma satd func pointers for blocks not capable of satd

If the block is not a multiple of 4x4, then chroma satd measurements are not
possible, so we will disable chroma residual measurements for these block sizes
(and thus only measure luma residual)

diff -r 29489f2fc2c7 -r 4c97d85c8488 source/common/pixel.cpp
--- a/source/common/pixel.cpp	Tue Dec 09 12:54:40 2014 -0600
+++ b/source/common/pixel.cpp	Tue Dec 09 15:31:50 2014 -0600
@@ -1085,14 +1085,14 @@
     p.satd[LUMA_64x16] = satd8<64, 16>;
     p.satd[LUMA_16x64] = satd8<16, 64>;
 
-    p.chroma[X265_CSP_I420].satd[CHROMA_2x2]   = sad<2, 2>;
+    p.chroma[X265_CSP_I420].satd[CHROMA_2x2]   = NULL;
     p.chroma[X265_CSP_I420].satd[CHROMA_4x4]   = satd_4x4;
     p.chroma[X265_CSP_I420].satd[CHROMA_8x8]   = satd8<8, 8>;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x16] = satd8<16, 16>;
     p.chroma[X265_CSP_I420].satd[CHROMA_32x32] = satd8<32, 32>;
 
-    p.chroma[X265_CSP_I420].satd[CHROMA_4x2]   = sad<4, 2>;
-    p.chroma[X265_CSP_I420].satd[CHROMA_2x4]   = sad<2, 4>;
+    p.chroma[X265_CSP_I420].satd[CHROMA_4x2]   = NULL;
+    p.chroma[X265_CSP_I420].satd[CHROMA_2x4]   = NULL;
     p.chroma[X265_CSP_I420].satd[CHROMA_8x4]   = satd_8x4;
     p.chroma[X265_CSP_I420].satd[CHROMA_4x8]   = satd4<4, 8>;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x8]  = satd8<16, 8>;
@@ -1100,10 +1100,10 @@
     p.chroma[X265_CSP_I420].satd[CHROMA_32x16] = satd8<32, 16>;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x32] = satd8<16, 32>;
 
-    p.chroma[X265_CSP_I420].satd[CHROMA_8x6]   = sad<8, 6>;
-    p.chroma[X265_CSP_I420].satd[CHROMA_6x8]   = sad<6, 8>;
-    p.chroma[X265_CSP_I420].satd[CHROMA_8x2]   = sad<8, 2>;
-    p.chroma[X265_CSP_I420].satd[CHROMA_2x8]   = sad<2, 8>;
+    p.chroma[X265_CSP_I420].satd[CHROMA_8x6]   = NULL;
+    p.chroma[X265_CSP_I420].satd[CHROMA_6x8]   = NULL;
+    p.chroma[X265_CSP_I420].satd[CHROMA_8x2]   = NULL;
+    p.chroma[X265_CSP_I420].satd[CHROMA_2x8]   = NULL;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x12] = satd4<16, 12>;
     p.chroma[X265_CSP_I420].satd[CHROMA_12x16] = satd4<12, 16>;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x4]  = satd4<16, 4>;
@@ -1113,14 +1113,14 @@
     p.chroma[X265_CSP_I420].satd[CHROMA_32x8]  = satd8<32, 8>;
     p.chroma[X265_CSP_I420].satd[CHROMA_8x32]  = satd8<8, 32>;
 
-    p.chroma[X265_CSP_I422].satd[CHROMA422_2x4]   = sad<2, 4>;
+    p.chroma[X265_CSP_I422].satd[CHROMA422_2x4]   = NULL;
     p.chroma[X265_CSP_I422].satd[CHROMA422_4x8]   = satd4<4, 8>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x16]  = satd8<8, 16>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x32] = satd8<16, 32>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_32x64] = satd8<32, 64>;
 
     p.chroma[X265_CSP_I422].satd[CHROMA422_4x4]   = satd_4x4;
-    p.chroma[X265_CSP_I422].satd[CHROMA422_2x8]   = sad<2, 8>;
+    p.chroma[X265_CSP_I422].satd[CHROMA422_2x8]   = NULL;
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x8]   = satd8<8, 8>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_4x16]  = satd4<4, 16>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x16] = satd8<16, 16>;
@@ -1129,9 +1129,9 @@
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x64] = satd8<16, 64>;
 
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x12]  = satd4<8, 12>;
-    p.chroma[X265_CSP_I422].satd[CHROMA422_6x16]  = sad<6, 16>;
+    p.chroma[X265_CSP_I422].satd[CHROMA422_6x16]  = NULL;
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x4]   = satd4<8, 4>;
-    p.chroma[X265_CSP_I422].satd[CHROMA422_2x16]  = sad<2, 16>;
+    p.chroma[X265_CSP_I422].satd[CHROMA422_2x16]  = NULL;
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x24] = satd8<16, 24>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_12x32] = satd4<12, 32>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x8]  = satd8<16, 8>;
diff -r 29489f2fc2c7 -r 4c97d85c8488 source/common/primitives.cpp
--- a/source/common/primitives.cpp	Tue Dec 09 12:54:40 2014 -0600
+++ b/source/common/primitives.cpp	Tue Dec 09 15:31:50 2014 -0600
@@ -106,8 +106,6 @@
     p.chroma[X265_CSP_I420].satd[CHROMA_16x16] = primitives.satd[LUMA_16x16];
     p.chroma[X265_CSP_I420].satd[CHROMA_32x32] = primitives.satd[LUMA_32x32];
 
-    //p.chroma[X265_CSP_I420].satd[CHROMA_4x2] = sad<4, 2>;
-    //p.chroma[X265_CSP_I420].satd[CHROMA_2x4] = sad<2, 4>;
     p.chroma[X265_CSP_I420].satd[CHROMA_8x4]   = primitives.satd[LUMA_8x4];
     p.chroma[X265_CSP_I420].satd[CHROMA_4x8]   = primitives.satd[LUMA_4x8];
     p.chroma[X265_CSP_I420].satd[CHROMA_16x8]  = primitives.satd[LUMA_16x8];
@@ -115,10 +113,6 @@
     p.chroma[X265_CSP_I420].satd[CHROMA_32x16] = primitives.satd[LUMA_32x16];
     p.chroma[X265_CSP_I420].satd[CHROMA_16x32] = primitives.satd[LUMA_16x32];
 
-    //p.chroma[X265_CSP_I420].satd[CHROMA_8x6] = sad<8, 6>;
-    //p.chroma[X265_CSP_I420].satd[CHROMA_6x8] = sad<6, 8>;
-    //p.chroma[X265_CSP_I420].satd[CHROMA_8x2] = sad<8, 2>;
-    //p.chroma[X265_CSP_I420].satd[CHROMA_2x8] = sad<2, 8>;
     p.chroma[X265_CSP_I420].satd[CHROMA_16x12] = primitives.satd[LUMA_16x12];
     p.chroma[X265_CSP_I420].satd[CHROMA_12x16] = primitives.satd[LUMA_12x16];
     p.chroma[X265_CSP_I420].satd[CHROMA_16x4]  = primitives.satd[LUMA_16x4];
@@ -134,7 +128,6 @@
     p.chroma[X265_CSP_I422].satd[CHROMA422_32x64] = primitives.satd[LUMA_32x64];
 
     p.chroma[X265_CSP_I422].satd[CHROMA422_4x4]   = primitives.satd[LUMA_4x4];
-    //p.chroma[X265_CSP_I422].satd[CHROMA422_2x8] = sad<2, 8>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x8]   = primitives.satd[LUMA_8x8];
     p.chroma[X265_CSP_I422].satd[CHROMA422_4x16]  = primitives.satd[LUMA_4x16];
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x16] = primitives.satd[LUMA_16x16];
@@ -143,9 +136,7 @@
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x64] = primitives.satd[LUMA_16x64];
 
     //p.chroma[X265_CSP_I422].satd[CHROMA422_8x12]  = satd4<8, 12>;
-    //p.chroma[X265_CSP_I422].satd[CHROMA422_6x16]  = sad<6, 16>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_8x4]   = primitives.satd[LUMA_8x4];
-    //p.chroma[X265_CSP_I422].satd[CHROMA422_2x16]  = sad<2, 16>;
     //p.chroma[X265_CSP_I422].satd[CHROMA422_16x24] = satd8<16, 24>;
     //p.chroma[X265_CSP_I422].satd[CHROMA422_12x32] = satd4<12, 32>;
     p.chroma[X265_CSP_I422].satd[CHROMA422_16x8]  = primitives.satd[LUMA_16x8];


More information about the x265-devel mailing list