[x265-commits] [x265] primitives: drop redundant enums and pointer aliasing

Steve Borho steve at borho.org
Wed Feb 4 04:15:40 CET 2015


details:   http://hg.videolan.org/x265/rev/e11dd720557a
branches:  
changeset: 9280:e11dd720557a
user:      Steve Borho <steve at borho.org>
date:      Tue Feb 03 21:15:08 2015 -0600
description:
primitives: drop redundant enums and pointer aliasing

Chroma 444 always uses the luma enums, and 444's chroma_ps pointers were
already being aliased to the luma primitives by the for () loop near the top
of the function.  Also removes a tab.

diffstat:

 source/common/ipfilter.cpp   |   2 +-
 source/common/primitives.cpp |  30 ------------------------------
 source/common/primitives.h   |  15 ---------------
 3 files changed, 1 insertions(+), 46 deletions(-)

diffs (77 lines):

diff -r 0bcc0313f518 -r e11dd720557a source/common/ipfilter.cpp
--- a/source/common/ipfilter.cpp	Tue Feb 03 21:04:04 2015 -0600
+++ b/source/common/ipfilter.cpp	Tue Feb 03 21:15:08 2015 -0600
@@ -416,7 +416,7 @@ namespace x265 {
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vps = interp_vert_ps_c<4, W, H>;  \
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vsp = interp_vert_sp_c<4, W, H>;  \
     p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].filter_vss = interp_vert_ss_c<4, W, H>; \
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_ ## W ## x ## H].chroma_p2s = pixelToShort_c<MAX_CU_SIZE, W, H>; 
+    p.chroma[X265_CSP_I444].pu[LUMA_ ## W ## x ## H].chroma_p2s = pixelToShort_c<MAX_CU_SIZE, W, H>; 
 
 #define LUMA(W, H) \
     p.pu[LUMA_ ## W ## x ## H].luma_hpp     = interp_horiz_pp_c<8, W, H>; \
diff -r 0bcc0313f518 -r e11dd720557a source/common/primitives.cpp
--- a/source/common/primitives.cpp	Tue Feb 03 21:04:04 2015 -0600
+++ b/source/common/primitives.cpp	Tue Feb 03 21:15:08 2015 -0600
@@ -169,36 +169,6 @@ void setupAliasPrimitives(EncoderPrimiti
     p.chroma[X265_CSP_I422].cu[BLOCK_422_2x4].sa8d = NULL;
     p.chroma[X265_CSP_I422].cu[BLOCK_422_4x8].sa8d = p.pu[LUMA_4x8].satd;
 
-    /* Chroma PU can often use filter_p2s primitives */
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_4x4].chroma_p2s   = p.pu[LUMA_4x4].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_8x8].chroma_p2s   = p.pu[LUMA_8x8].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x16].chroma_p2s = p.pu[LUMA_16x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_32x32].chroma_p2s = p.pu[LUMA_32x32].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_64x64].chroma_p2s = p.pu[LUMA_64x64].filter_p2s;
-	
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_8x4].chroma_p2s   = p.pu[LUMA_8x4].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_4x8].chroma_p2s   = p.pu[LUMA_4x8].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x8].chroma_p2s  = p.pu[LUMA_16x8].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_8x16].chroma_p2s  = p.pu[LUMA_8x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_32x16].chroma_p2s = p.pu[LUMA_32x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x32].chroma_p2s = p.pu[LUMA_16x32].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_64x32].chroma_p2s = p.pu[LUMA_64x32].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_32x64].chroma_p2s = p.pu[LUMA_32x64].filter_p2s;
-
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x12].chroma_p2s = p.pu[LUMA_16x12].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_12x16].chroma_p2s = p.pu[LUMA_12x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x4].chroma_p2s  = p.pu[LUMA_16x4].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_4x16].chroma_p2s  = p.pu[LUMA_4x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_32x24].chroma_p2s = p.pu[LUMA_32x24].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_24x32].chroma_p2s = p.pu[LUMA_24x32].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_32x8].chroma_p2s  = p.pu[LUMA_32x8].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_8x32].chroma_p2s  = p.pu[LUMA_8x32].filter_p2s;
-
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_64x48].chroma_p2s = p.pu[LUMA_64x48].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_48x64].chroma_p2s = p.pu[LUMA_48x64].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_64x16].chroma_p2s = p.pu[LUMA_64x16].filter_p2s;
-    p.chroma[X265_CSP_I444].pu[CHROMA_444_16x64].chroma_p2s = p.pu[LUMA_16x64].filter_p2s;
-
     /* alias CU copy_pp from square PU copy_pp */
     for (int i = 0; i < NUM_CU_SIZES; i++)
     {
diff -r 0bcc0313f518 -r e11dd720557a source/common/primitives.h
--- a/source/common/primitives.h	Tue Feb 03 21:04:04 2015 -0600
+++ b/source/common/primitives.h	Tue Feb 03 21:15:08 2015 -0600
@@ -110,21 +110,6 @@ enum ChromaCU422
     BLOCK_422_32x64
 };
 
-enum ChromaPU444
-{
-    // Square (the first 5 PUs match the CU sizes)
-    CHROMA_444_4x4,   CHROMA_444_8x8,   CHROMA_444_16x16, CHROMA_444_32x32, CHROMA_444_64x64,
-    // Rectangular
-    CHROMA_444_8x4,   CHROMA_444_4x8,
-    CHROMA_444_16x8,  CHROMA_444_8x16,
-    CHROMA_444_32x16, CHROMA_444_16x32,
-    CHROMA_444_64x32, CHROMA_444_32x64,
-    // Asymmetrical (0.75, 0.25)
-    CHROMA_444_16x12, CHROMA_444_12x16, CHROMA_444_16x4,  CHROMA_444_4x16,
-    CHROMA_444_32x24, CHROMA_444_24x32, CHROMA_444_32x8,  CHROMA_444_8x32,
-    CHROMA_444_64x48, CHROMA_444_48x64, CHROMA_444_64x16, CHROMA_444_16x64,
-};
-
 typedef int  (*pixelcmp_t)(const pixel* fenc, intptr_t fencstride, const pixel* fref, intptr_t frefstride); // fenc is aligned
 typedef int  (*pixelcmp_ss_t)(const int16_t* fenc, intptr_t fencstride, const int16_t* fref, intptr_t frefstride);
 typedef int  (*pixel_ssd_s_t)(const int16_t* fenc, intptr_t fencstride);


More information about the x265-commits mailing list