<div dir="ltr"><div><div>Hi,<br><br></div>This causes an error in our regression tests, within X265_FREE(m_predBuf). Please take a look at this.<br><br></div>Thanks,<br>Deepthi<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 19, 2014 at 1:08 PM, Satoshi Nakagawa <span dir="ltr"><<a href="mailto:nakagawa424@oki.com" target="_blank">nakagawa424@oki.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Satoshi Nakagawa <<a href="mailto:nakagawa424@oki.com">nakagawa424@oki.com</a>><br>
# Date 1411112115 -32400<br>
#      Fri Sep 19 16:35:15 2014 +0900<br>
# Node ID 3a2c1caf0f80e4ee2c1216636a3f9d067f719d6f<br>
# Parent  4680ab4f92b8cc809b1e8dbc927126ec70bcc5c5<br>
primitives: intra_pred[4][35] => intra_pred[35][4] (avoid *35)<br>
<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/Lib/TLibCommon/TComPattern.cpp<br>
--- a/source/Lib/TLibCommon/TComPattern.cpp     Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComPattern.cpp     Fri Sep 19 16:35:15 2014 +0900<br>
@@ -68,9 +68,9 @@<br>
<br>
     fillReferenceSamples(roiOrigin, picStride, adiTemp, intraNeighbors);<br>
<br>
-    bool bUseFilteredPredictions = (dirMode == ALL_IDX || (g_intraFilterFlags[dirMode] & tuSize));<br>
+    bool bUseFilteredPredictions = (dirMode == ALL_IDX ? (8 | 16 | 32) & tuSize : g_intraFilterFlags[dirMode] & tuSize);<br>
<br>
-    if (bUseFilteredPredictions && 8 <= tuSize && tuSize <= 32)<br>
+    if (bUseFilteredPredictions)<br>
     {<br>
         // generate filtered intra prediction samples<br>
         // left and left above border + above and above right border + top left corner = length of 3. filter buffer<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/Lib/TLibCommon/TComRom.cpp<br>
--- a/source/Lib/TLibCommon/TComRom.cpp Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComRom.cpp Fri Sep 19 16:35:15 2014 +0900<br>
@@ -497,7 +497,7 @@<br>
 };<br>
<br>
 /* g_intraFilterFlags[dir] & trSize */<br>
-const uint8_t g_intraFilterFlags[35] =<br>
+const uint8_t g_intraFilterFlags[NUM_INTRA_MODE] =<br>
 {<br>
     0x38, 0x00,<br>
     0x38, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x00, 0x20, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/Lib/TLibCommon/TComRom.h<br>
--- a/source/Lib/TLibCommon/TComRom.h   Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/Lib/TLibCommon/TComRom.h   Fri Sep 19 16:35:15 2014 +0900<br>
@@ -153,7 +153,7 @@<br>
 extern const uint8_t x265_exp2_lut[64];<br>
<br>
 // Intra tables<br>
-extern const uint8_t g_intraFilterFlags[35];<br>
+extern const uint8_t g_intraFilterFlags[NUM_INTRA_MODE];<br>
<br>
 extern const uint32_t g_depthInc[3][4];<br>
<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/common/intrapred.cpp<br>
--- a/source/common/intrapred.cpp       Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/common/intrapred.cpp       Fri Sep 19 16:35:15 2014 +0900<br>
@@ -281,22 +281,22 @@<br>
<br>
 void Setup_C_IPredPrimitives(EncoderPrimitives& p)<br>
 {<br>
-    p.intra_pred[BLOCK_4x4][0] = planar_pred_c<2>;<br>
-    p.intra_pred[BLOCK_8x8][0] = planar_pred_c<3>;<br>
-    p.intra_pred[BLOCK_16x16][0] = planar_pred_c<4>;<br>
-    p.intra_pred[BLOCK_32x32][0] = planar_pred_c<5>;<br>
+    p.intra_pred[0][BLOCK_4x4] = planar_pred_c<2>;<br>
+    p.intra_pred[0][BLOCK_8x8] = planar_pred_c<3>;<br>
+    p.intra_pred[0][BLOCK_16x16] = planar_pred_c<4>;<br>
+    p.intra_pred[0][BLOCK_32x32] = planar_pred_c<5>;<br>
<br>
     // Intra Prediction DC<br>
-    p.intra_pred[BLOCK_4x4][1] = intra_pred_dc_c<4>;<br>
-    p.intra_pred[BLOCK_8x8][1] = intra_pred_dc_c<8>;<br>
-    p.intra_pred[BLOCK_16x16][1] = intra_pred_dc_c<16>;<br>
-    p.intra_pred[BLOCK_32x32][1] = intra_pred_dc_c<32>;<br>
+    p.intra_pred[1][BLOCK_4x4] = intra_pred_dc_c<4>;<br>
+    p.intra_pred[1][BLOCK_8x8] = intra_pred_dc_c<8>;<br>
+    p.intra_pred[1][BLOCK_16x16] = intra_pred_dc_c<16>;<br>
+    p.intra_pred[1][BLOCK_32x32] = intra_pred_dc_c<32>;<br>
     for (int i = 2; i < NUM_INTRA_MODE; i++)<br>
     {<br>
-        p.intra_pred[BLOCK_4x4][i] = intra_pred_ang_c<4>;<br>
-        p.intra_pred[BLOCK_8x8][i] = intra_pred_ang_c<8>;<br>
-        p.intra_pred[BLOCK_16x16][i] = intra_pred_ang_c<16>;<br>
-        p.intra_pred[BLOCK_32x32][i] = intra_pred_ang_c<32>;<br>
+        p.intra_pred[i][BLOCK_4x4] = intra_pred_ang_c<4>;<br>
+        p.intra_pred[i][BLOCK_8x8] = intra_pred_ang_c<8>;<br>
+        p.intra_pred[i][BLOCK_16x16] = intra_pred_ang_c<16>;<br>
+        p.intra_pred[i][BLOCK_32x32] = intra_pred_ang_c<32>;<br>
     }<br>
<br>
     p.intra_pred_allangs[BLOCK_4x4] = all_angs_pred_c<2>;<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/common/primitives.h<br>
--- a/source/common/primitives.h        Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/common/primitives.h        Fri Sep 19 16:35:15 2014 +0900<br>
@@ -91,6 +91,8 @@<br>
     NUM_SQUARE_BLOCKS<br>
 };<br>
<br>
+enum { NUM_TR_SIZE = 4 };<br>
+<br>
 // NOTE: Not all DCT functions support dest stride<br>
 enum Dcts<br>
 {<br>
@@ -145,7 +147,6 @@<br>
 typedef void (*pixelavg_pp_t)(pixel *dst, intptr_t dstride, pixel *src0, intptr_t sstride0, pixel *src1, intptr_t sstride1, int weight);<br>
 typedef void (*blockfill_s_t)(int16_t *dst, intptr_t dstride, int16_t val);<br>
<br>
-typedef void (*intra_planar_t)(pixel* above, pixel* left, pixel* dst, intptr_t dstStride);<br>
 typedef void (*intra_pred_t)(pixel* dst, intptr_t dstStride, pixel *refLeft, pixel *refAbove, int dirMode, int bFilter);<br>
 typedef void (*intra_allangs_t)(pixel *dst, pixel *above0, pixel *left0, pixel *above1, pixel *left1, int bLuma);<br>
<br>
@@ -259,8 +260,8 @@<br>
     pixelavg_pp_t   pixelavg_pp[NUM_LUMA_PARTITIONS];<br>
     addAvg_t        luma_addAvg[NUM_LUMA_PARTITIONS];<br>
<br>
-    intra_pred_t    intra_pred[NUM_SQUARE_BLOCKS - 1][NUM_INTRA_MODE];<br>
-    intra_allangs_t intra_pred_allangs[NUM_SQUARE_BLOCKS - 1];<br>
+    intra_pred_t    intra_pred[NUM_INTRA_MODE][NUM_TR_SIZE];<br>
+    intra_allangs_t intra_pred_allangs[NUM_TR_SIZE];<br>
     scale_t         scale1D_128to64;<br>
     scale_t         scale2D_64to32;<br>
<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/common/x86/asm-primitives.cpp<br>
--- a/source/common/x86/asm-primitives.cpp      Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/common/x86/asm-primitives.cpp      Fri Sep 19 16:35:15 2014 +0900<br>
@@ -932,26 +932,26 @@<br>
     SETUP_CHROMA_ADDAVG_FUNC_DEF_422(32, 64, cpu);<br>
<br>
 #define SETUP_INTRA_ANG_COMMON(mode, fno, cpu) \<br>
-    p.intra_pred[BLOCK_4x4][mode] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_8x8][mode] = x265_intra_pred_ang8_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_16x16][mode] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_32x32][mode] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
+    p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
<br>
 #define SETUP_INTRA_ANG(mode, fno, cpu) \<br>
-    p.intra_pred[BLOCK_8x8][mode] = x265_intra_pred_ang8_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_16x16][mode] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_32x32][mode] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
+    p.intra_pred[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
<br>
 #define SETUP_INTRA_ANG4(mode, fno, cpu) \<br>
-    p.intra_pred[BLOCK_4x4][mode] = x265_intra_pred_ang4_ ## fno ## _ ## cpu;<br>
+    p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu;<br>
<br>
 #define SETUP_INTRA_ANG16_32(mode, fno, cpu) \<br>
-    p.intra_pred[BLOCK_16x16][mode] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_32x32][mode] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
+    p.intra_pred[mode][BLOCK_16x16] = x265_intra_pred_ang16_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_32x32] = x265_intra_pred_ang32_ ## fno ## _ ## cpu;<br>
<br>
 #define SETUP_INTRA_ANG4_8(mode, fno, cpu) \<br>
-    p.intra_pred[BLOCK_4x4][mode] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \<br>
-    p.intra_pred[BLOCK_8x8][mode] = x265_intra_pred_ang8_ ## fno ## _ ## cpu;<br>
+    p.intra_pred[mode][BLOCK_4x4] = x265_intra_pred_ang4_ ## fno ## _ ## cpu; \<br>
+    p.intra_pred[mode][BLOCK_8x8] = x265_intra_pred_ang8_ ## fno ## _ ## cpu;<br>
<br>
 #define INTRA_ANG_SSSE3(cpu) \<br>
     SETUP_INTRA_ANG_COMMON(2, 2, cpu); \<br>
@@ -1249,11 +1249,11 @@<br>
<br>
         if (mode < 18)<br>
         {<br>
-            primitives.intra_pred[sizeIdx][mode](buffer, size, left, above, mode, bLuma);<br>
+            primitives.intra_pred[mode][sizeIdx](buffer, size, left, above, mode, bLuma);<br>
             primitives.transpose[sizeIdx](out, buffer, size);<br>
         }<br>
         else<br>
-            primitives.intra_pred[sizeIdx][mode](out, size, left, above, mode, bLuma);<br>
+            primitives.intra_pred[mode][sizeIdx](out, size, left, above, mode, bLuma);<br>
     }<br>
 }<br>
 #endif<br>
@@ -1417,15 +1417,15 @@<br>
         p.cvt16to32_shr[BLOCK_8x8] = x265_cvt16to32_shr_8_sse4;<br>
         p.cvt16to32_shr[BLOCK_16x16] = x265_cvt16to32_shr_16_sse4;<br>
         p.cvt16to32_shr[BLOCK_32x32] = x265_cvt16to32_shr_32_sse4;<br>
-        p.intra_pred[BLOCK_4x4][0] = x265_intra_pred_planar4_sse4;<br>
-        p.intra_pred[BLOCK_8x8][0] = x265_intra_pred_planar8_sse4;<br>
-        p.intra_pred[BLOCK_16x16][0] = x265_intra_pred_planar16_sse4;<br>
-        p.intra_pred[BLOCK_32x32][0] = x265_intra_pred_planar32_sse4;<br>
+        p.intra_pred[0][BLOCK_4x4] = x265_intra_pred_planar4_sse4;<br>
+        p.intra_pred[0][BLOCK_8x8] = x265_intra_pred_planar8_sse4;<br>
+        p.intra_pred[0][BLOCK_16x16] = x265_intra_pred_planar16_sse4;<br>
+        p.intra_pred[0][BLOCK_32x32] = x265_intra_pred_planar32_sse4;<br>
<br>
-        p.intra_pred[BLOCK_4x4][1] = x265_intra_pred_dc4_sse4;<br>
-        p.intra_pred[BLOCK_8x8][1] = x265_intra_pred_dc8_sse4;<br>
-        p.intra_pred[BLOCK_16x16][1] = x265_intra_pred_dc16_sse4;<br>
-        p.intra_pred[BLOCK_32x32][1] = x265_intra_pred_dc32_sse4;<br>
+        p.intra_pred[1][BLOCK_4x4] = x265_intra_pred_dc4_sse4;<br>
+        p.intra_pred[1][BLOCK_8x8] = x265_intra_pred_dc8_sse4;<br>
+        p.intra_pred[1][BLOCK_16x16] = x265_intra_pred_dc16_sse4;<br>
+        p.intra_pred[1][BLOCK_32x32] = x265_intra_pred_dc32_sse4;<br>
         p.planecopy_cp = x265_upShift_8_sse4;<br>
<br>
         INTRA_ANG_SSE4_COMMON(sse4);<br>
@@ -1670,20 +1670,20 @@<br>
         p.dequant_normal = x265_dequant_normal_sse4;<br>
         p.weight_pp = x265_weight_pp_sse4;<br>
         p.weight_sp = x265_weight_sp_sse4;<br>
-        p.intra_pred[BLOCK_4x4][0] = x265_intra_pred_planar4_sse4;<br>
-        p.intra_pred[BLOCK_8x8][0] = x265_intra_pred_planar8_sse4;<br>
-        p.intra_pred[BLOCK_16x16][0] = x265_intra_pred_planar16_sse4;<br>
-        p.intra_pred[BLOCK_32x32][0] = x265_intra_pred_planar32_sse4;<br>
+        p.intra_pred[0][BLOCK_4x4] = x265_intra_pred_planar4_sse4;<br>
+        p.intra_pred[0][BLOCK_8x8] = x265_intra_pred_planar8_sse4;<br>
+        p.intra_pred[0][BLOCK_16x16] = x265_intra_pred_planar16_sse4;<br>
+        p.intra_pred[0][BLOCK_32x32] = x265_intra_pred_planar32_sse4;<br>
<br>
         p.intra_pred_allangs[BLOCK_4x4] = x265_all_angs_pred_4x4_sse4;<br>
         p.intra_pred_allangs[BLOCK_8x8] = x265_all_angs_pred_8x8_sse4;<br>
         p.intra_pred_allangs[BLOCK_16x16] = x265_all_angs_pred_16x16_sse4;<br>
         p.intra_pred_allangs[BLOCK_32x32] = x265_all_angs_pred_32x32_sse4;<br>
<br>
-        p.intra_pred[BLOCK_4x4][1] = x265_intra_pred_dc4_sse4;<br>
-        p.intra_pred[BLOCK_8x8][1] = x265_intra_pred_dc8_sse4;<br>
-        p.intra_pred[BLOCK_16x16][1] = x265_intra_pred_dc16_sse4;<br>
-        p.intra_pred[BLOCK_32x32][1] = x265_intra_pred_dc32_sse4;<br>
+        p.intra_pred[1][BLOCK_4x4] = x265_intra_pred_dc4_sse4;<br>
+        p.intra_pred[1][BLOCK_8x8] = x265_intra_pred_dc8_sse4;<br>
+        p.intra_pred[1][BLOCK_16x16] = x265_intra_pred_dc16_sse4;<br>
+        p.intra_pred[1][BLOCK_32x32] = x265_intra_pred_dc32_sse4;<br>
<br>
         INTRA_ANG_SSE4_COMMON(sse4);<br>
         INTRA_ANG_SSE4(sse4);<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/common/x86/intrapred.h<br>
--- a/source/common/x86/intrapred.h     Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/common/x86/intrapred.h     Fri Sep 19 16:35:15 2014 +0900<br>
@@ -31,10 +31,10 @@<br>
 void x265_intra_pred_dc16_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
 void x265_intra_pred_dc32_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
<br>
-void x265_intra_pred_planar4_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
-void x265_intra_pred_planar8_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
-void x265_intra_pred_planar16_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
-void x265_intra_pred_planar32_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int filter);<br>
+void x265_intra_pred_planar4_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int);<br>
+void x265_intra_pred_planar8_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int);<br>
+void x265_intra_pred_planar16_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int);<br>
+void x265_intra_pred_planar32_sse4(pixel* dst, intptr_t dstStride, pixel* above, pixel* left, int, int);<br>
<br>
 #define DECL_ANG(bsize, mode, cpu) \<br>
     void x265_intra_pred_ang ## bsize ## _ ## mode ## _ ## cpu(pixel * dst, intptr_t dstStride, pixel * refLeft, pixel * refAbove, int dirMode, int bFilter);<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/encoder/analysis.cpp<br>
--- a/source/encoder/analysis.cpp       Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/encoder/analysis.cpp       Fri Sep 19 16:35:15 2014 +0900<br>
@@ -1840,7 +1840,7 @@<br>
     uint32_t rbits = getIntraRemModeBits(cu, partOffset, depth, preds, mpms);<br>
<br>
     // DC<br>
-    primitives.intra_pred[sizeIdx][DC_IDX](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));<br>
+    primitives.intra_pred[DC_IDX][sizeIdx](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));<br>
     bsad = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;<br>
     bmode = mode = DC_IDX;<br>
     bbits = (mpms & ((uint64_t)1 << mode)) ? getIntraModeBits(cu, mode, partOffset, depth) : rbits;<br>
@@ -1849,14 +1849,14 @@<br>
     pixel *abovePlanar   = above;<br>
     pixel *leftPlanar    = left;<br>
<br>
-    if (tuSize >= 8 && tuSize <= 32)<br>
+    if (tuSize & (8 | 16 | 32))<br>
     {<br>
         abovePlanar = aboveFiltered;<br>
         leftPlanar  = leftFiltered;<br>
     }<br>
<br>
     // PLANAR<br>
-    primitives.intra_pred[sizeIdx][PLANAR_IDX](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);<br>
+    primitives.intra_pred[PLANAR_IDX][sizeIdx](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);<br>
     sad = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;<br>
     mode = PLANAR_IDX;<br>
     bits = (mpms & ((uint64_t)1 << mode)) ? getIntraModeBits(cu, mode, partOffset, depth) : rbits;<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/encoder/predict.cpp<br>
--- a/source/encoder/predict.cpp        Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/encoder/predict.cpp        Fri Sep 19 16:35:15 2014 +0900<br>
@@ -89,10 +89,10 @@<br>
         refAbv = m_refAboveFlt + tuSize - 1;<br>
     }<br>
<br>
-    bool bFilter = log2TrSize <= 4 && dirMode != PLANAR_IDX;<br>
+    bool bFilter = log2TrSize <= 4;<br>
     int sizeIdx = log2TrSize - 2;<br>
     X265_CHECK(sizeIdx >= 0 && sizeIdx < 4, "intra block size is out of range\n");<br>
-    primitives.intra_pred[sizeIdx][dirMode](dst, stride, refLft, refAbv, dirMode, bFilter);<br>
+    primitives.intra_pred[dirMode][sizeIdx](dst, stride, refLft, refAbv, dirMode, bFilter);<br>
 }<br>
<br>
 void Predict::predIntraChromaAng(pixel* src, uint32_t dirMode, pixel* dst, intptr_t stride, uint32_t log2TrSizeC, int chFmt)<br>
@@ -101,7 +101,7 @@<br>
     uint32_t tuSize2 = tuSize << 1;<br>
<br>
     // Create the prediction<br>
-    pixel refAbv[3 * MAX_CU_SIZE];<br>
+    pixel* refAbv;<br>
     pixel refLft[3 * MAX_CU_SIZE];<br>
<br>
     bool bUseFilteredPredictions = (chFmt == X265_CSP_I444 && (g_intraFilterFlags[dirMode] & tuSize));<br>
@@ -135,21 +135,21 @@<br>
<br>
         // initialization of ADI buffers<br>
         int limit = tuSize2 + 1;<br>
-        memcpy(refAbv + tuSize - 1, filterBufN + tuSize2, limit * sizeof(pixel));<br>
+        refAbv = filterBufN + tuSize2;<br>
         for (int k = 0; k < limit; k++)<br>
             refLft[k + tuSize - 1] = filterBufN[tuSize2 - k];   // Smoothened<br>
     }<br>
     else<br>
     {<br>
         int limit = (dirMode <= 25 && dirMode >= 11) ? (tuSize + 1 + 1) : (tuSize2 + 1);<br>
-        memcpy(refAbv + tuSize - 1, src, (limit) * sizeof(pixel));<br>
+        refAbv = src;<br>
         for (int k = 0; k < limit; k++)<br>
             refLft[k + tuSize - 1] = src[k * ADI_BUF_STRIDE];<br>
     }<br>
<br>
     int sizeIdx = log2TrSizeC - 2;<br>
     X265_CHECK(sizeIdx >= 0 && sizeIdx < 4, "intra block size is out of range\n");<br>
-    primitives.intra_pred[sizeIdx][dirMode](dst, stride, refLft + tuSize - 1, refAbv + tuSize - 1, dirMode, 0);<br>
+    primitives.intra_pred[dirMode][sizeIdx](dst, stride, refLft + tuSize - 1, refAbv, dirMode, 0);<br>
 }<br>
<br>
 bool Predict::checkIdenticalMotion()<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/encoder/search.cpp<br>
--- a/source/encoder/search.cpp Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/encoder/search.cpp Fri Sep 19 16:35:15 2014 +0900<br>
@@ -1285,7 +1285,7 @@<br>
         uint64_t bcost;<br>
<br>
         // DC<br>
-        primitives.intra_pred[sizeIdx][DC_IDX](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));<br>
+        primitives.intra_pred[DC_IDX][sizeIdx](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));<br>
         uint32_t bits = (mpms & ((uint64_t)1 << DC_IDX)) ? getIntraModeBits(cu, DC_IDX, partOffset, depth) : rbits;<br>
         uint32_t sad  = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;<br>
         modeCosts[DC_IDX] = bcost = m_rdCost.calcRdSADCost(sad, bits);<br>
@@ -1298,7 +1298,7 @@<br>
             abovePlanar = aboveFiltered;<br>
             leftPlanar  = leftFiltered;<br>
         }<br>
-        primitives.intra_pred[sizeIdx][PLANAR_IDX](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);<br>
+        primitives.intra_pred[PLANAR_IDX][sizeIdx](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);<br>
         bits = (mpms & ((uint64_t)1 << PLANAR_IDX)) ? getIntraModeBits(cu, PLANAR_IDX, partOffset, depth) : rbits;<br>
         sad  = sa8d(fenc, scaleStride, tmp, scaleStride) << costShift;<br>
         modeCosts[PLANAR_IDX] = m_rdCost.calcRdSADCost(sad, bits);<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/encoder/slicetype.cpp<br>
--- a/source/encoder/slicetype.cpp      Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/encoder/slicetype.cpp      Fri Sep 19 16:35:15 2014 +0900<br>
@@ -1680,13 +1680,13 @@<br>
         // generate 35 intra predictions into m_predictions<br>
         pixelcmp_t satd = primitives.satd[partitionFromLog2Size(X265_LOWRES_CU_BITS)];<br>
         int icost = m_me.COST_MAX, cost;<br>
-        primitives.intra_pred[sizeIdx][DC_IDX](m_predictions, cuSize, left0, above0, 0, (cuSize <= 16));<br>
+        primitives.intra_pred[DC_IDX][sizeIdx](m_predictions, cuSize, left0, above0, 0, (cuSize <= 16));<br>
         cost = satd(m_me.fenc, FENC_STRIDE, m_predictions, cuSize);<br>
         if (cost < icost)<br>
             icost = cost;<br>
         pixel *above = (cuSize >= 8) ? above1 : above0;<br>
         pixel *left  = (cuSize >= 8) ? left1 : left0;<br>
-        primitives.intra_pred[sizeIdx][PLANAR_IDX](m_predictions, cuSize, left, above, 0, 0);<br>
+        primitives.intra_pred[PLANAR_IDX][sizeIdx](m_predictions, cuSize, left, above, 0, 0);<br>
         cost = satd(m_me.fenc, FENC_STRIDE, m_predictions, cuSize);<br>
         if (cost < icost)<br>
             icost = cost;<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/test/intrapredharness.cpp<br>
--- a/source/test/intrapredharness.cpp  Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/test/intrapredharness.cpp  Fri Sep 19 16:35:15 2014 +0900<br>
@@ -107,7 +107,7 @@<br>
     return true;<br>
 }<br>
<br>
-bool IntraPredHarness::check_angular_primitive(const intra_pred_t ref[][NUM_INTRA_MODE], const intra_pred_t opt[][NUM_INTRA_MODE])<br>
+bool IntraPredHarness::check_angular_primitive(const intra_pred_t ref[][NUM_TR_SIZE], const intra_pred_t opt[][NUM_TR_SIZE])<br>
 {<br>
     int j = ADI_BUF_STRIDE;<br>
     intptr_t stride = FENC_STRIDE;<br>
@@ -125,15 +125,15 @@<br>
             int bFilter = (width <= 16) && (rand() % 2);<br>
             for (int pmode = 2; pmode <= 34; pmode++)<br>
             {<br>
-                if (!opt[size - 2][pmode])<br>
+                if (!opt[pmode][size - 2])<br>
                     continue;<br>
<br>
                 pixel * refAbove = pixel_buff + j;<br>
                 pixel * refLeft = refAbove + 3 * width;<br>
                 refLeft[0] = refAbove[0];<br>
<br>
-                checked(opt[size - 2][pmode], pixel_out_vec, stride, refLeft, refAbove, pmode, bFilter);<br>
-                ref[size - 2][pmode](pixel_out_c, stride, refLeft, refAbove, pmode, bFilter);<br>
+                checked(opt[pmode][size - 2], pixel_out_vec, stride, refLeft, refAbove, pmode, bFilter);<br>
+                ref[pmode][size - 2](pixel_out_c, stride, refLeft, refAbove, pmode, bFilter);<br>
<br>
                 for (int k = 0; k < width; k++)<br>
                 {<br>
@@ -206,19 +206,19 @@<br>
 {<br>
     for (int i = BLOCK_4x4; i <= BLOCK_32x32; i++)<br>
     {<br>
-        if (opt.intra_pred[i][1])<br>
+        if (opt.intra_pred[1][i])<br>
         {<br>
             const int size = (1 << (i + 2));<br>
-            if (!check_dc_primitive(ref.intra_pred[i][1], opt.intra_pred[i][1], size))<br>
+            if (!check_dc_primitive(ref.intra_pred[1][i], opt.intra_pred[1][i], size))<br>
             {<br>
                 printf("intra_dc %dx%d failed\n", size, size);<br>
                 return false;<br>
             }<br>
         }<br>
-        if (opt.intra_pred[i][0])<br>
+        if (opt.intra_pred[0][i])<br>
         {<br>
             const int size = (1 << (i + 2));<br>
-            if (!check_planar_primitive(ref.intra_pred[i][0], opt.intra_pred[i][0], size))<br>
+            if (!check_planar_primitive(ref.intra_pred[0][i], opt.intra_pred[0][i], size))<br>
             {<br>
                 printf("intra_planar %dx%d failed\n", size, size);<br>
                 return false;<br>
@@ -253,22 +253,22 @@<br>
     for (int i = BLOCK_4x4; i <= BLOCK_32x32; i++)<br>
     {<br>
         const int size = (1 << (i + 2));<br>
-        if (opt.intra_pred[i][1])<br>
+        if (opt.intra_pred[1][i])<br>
         {<br>
             printf("intra_dc_%dx%d[f=0]", size, size);<br>
-            REPORT_SPEEDUP(opt.intra_pred[i][1], ref.intra_pred[i][1],<br>
+            REPORT_SPEEDUP(opt.intra_pred[1][i], ref.intra_pred[1][i],<br>
                            pixel_out_vec, FENC_STRIDE, pixel_buff + srcStride, pixel_buff, 0, 0);<br>
             if (size <= 16)<br>
             {<br>
                 printf("intra_dc_%dx%d[f=1]", size, size);<br>
-                REPORT_SPEEDUP(opt.intra_pred[i][1], ref.intra_pred[i][1],<br>
-                               pixel_out_vec, FENC_STRIDE, pixel_buff + srcStride, pixel_buff, 0, 0);<br>
+                REPORT_SPEEDUP(opt.intra_pred[1][i], ref.intra_pred[1][i],<br>
+                               pixel_out_vec, FENC_STRIDE, pixel_buff + srcStride, pixel_buff, 0, 1);<br>
             }<br>
         }<br>
-        if (opt.intra_pred[i][0])<br>
+        if (opt.intra_pred[0][i])<br>
         {<br>
             printf("intra_planar %2dx%d", size, size);<br>
-            REPORT_SPEEDUP(opt.intra_pred[i][0], ref.intra_pred[i][0],<br>
+            REPORT_SPEEDUP(opt.intra_pred[0][i], ref.intra_pred[0][i],<br>
                            pixel_out_vec, FENC_STRIDE, pixel_buff + srcStride, pixel_buff, 0, 0);<br>
         }<br>
         if (opt.intra_pred_allangs[i])<br>
@@ -288,7 +288,7 @@<br>
         for (int p = 2; p <= 34; p += 1)<br>
         {<br>
             int pmode = p;  //(rand()%33)+2;<br>
-            if (opt.intra_pred[ii - 2][pmode])<br>
+            if (opt.intra_pred[pmode][ii - 2])<br>
             {<br>
                 width = (1 << ii);<br>
                 bool bFilter = (width <= 16);<br>
@@ -296,7 +296,7 @@<br>
                 pixel * refLeft = refAbove + 3 * width;<br>
                 refLeft[0] = refAbove[0];<br>
                 printf("intra_ang%dx%d[%2d]", width, width, pmode);<br>
-                REPORT_SPEEDUP(opt.intra_pred[ii - 2][pmode], ref.intra_pred[ii - 2][pmode],<br>
+                REPORT_SPEEDUP(opt.intra_pred[pmode][ii - 2], ref.intra_pred[pmode][ii - 2],<br>
                                pixel_out_vec, FENC_STRIDE, refAbove, refLeft, pmode, bFilter);<br>
             }<br>
         }<br>
diff -r 4680ab4f92b8 -r 3a2c1caf0f80 source/test/intrapredharness.h<br>
--- a/source/test/intrapredharness.h    Thu Sep 18 18:16:25 2014 +0530<br>
+++ b/source/test/intrapredharness.h    Fri Sep 19 16:35:15 2014 +0900<br>
@@ -43,7 +43,7 @@<br>
<br>
     bool check_dc_primitive(intra_pred_t ref, intra_pred_t opt, int width);<br>
     bool check_planar_primitive(intra_pred_t ref, intra_pred_t opt, int width);<br>
-    bool check_angular_primitive(const intra_pred_t ref[][NUM_INTRA_MODE], const intra_pred_t opt[][NUM_INTRA_MODE]);<br>
+    bool check_angular_primitive(const intra_pred_t ref[][NUM_TR_SIZE], const intra_pred_t opt[][NUM_TR_SIZE]);<br>
     bool check_allangs_primitive(const intra_allangs_t ref[], const intra_allangs_t opt[]);<br>
<br>
 public:<br>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br></div>