[x265] [PATCH 4 of 5] Refactor EncoderPrimitives under test

Kevin Wu kevin at multicorewareinc.com
Fri Jan 9 07:53:51 CET 2015


# HG changeset patch
# User Kevin Wu <kevin at multicorewareinc.com>
# Date 1420674105 21600
#      Wed Jan 07 17:41:45 2015 -0600
# Node ID 15f12fbbb33c06da5071171923bf130d88d0cdbf
# Parent  2452bd8f18fdc0fccfe65905fbd4ba10ef546401
Refactor EncoderPrimitives under test.

diff -r 2452bd8f18fd -r 15f12fbbb33c source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp	Tue Jan 06 16:46:07 2015 -0600
+++ b/source/test/ipfilterharness.cpp	Wed Jan 07 17:41:45 2015 -0600
@@ -526,57 +526,57 @@
 
     for (int value = 0; value < NUM_LUMA_PARTITIONS; value++)
     {
-        if (opt.luma_hpp[value])
+        if (opt.pu[value].luma_hpp)
         {
-            if (!check_IPFilterLuma_primitive(ref.luma_hpp[value], opt.luma_hpp[value]))
+            if (!check_IPFilterLuma_primitive(ref.pu[value].luma_hpp, opt.pu[value].luma_hpp))
             {
                 printf("luma_hpp[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_hps[value])
+        if (opt.pu[value].luma_hps)
         {
-            if (!check_IPFilterLuma_hps_primitive(ref.luma_hps[value], opt.luma_hps[value]))
+            if (!check_IPFilterLuma_hps_primitive(ref.pu[value].luma_hps, opt.pu[value].luma_hps))
             {
                 printf("luma_hps[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_vpp[value])
+        if (opt.pu[value].luma_vpp)
         {
-            if (!check_IPFilterLuma_primitive(ref.luma_vpp[value], opt.luma_vpp[value]))
+            if (!check_IPFilterLuma_primitive(ref.pu[value].luma_vpp, opt.pu[value].luma_vpp))
             {
                 printf("luma_vpp[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_vps[value])
+        if (opt.pu[value].luma_vps)
         {
-            if (!check_IPFilterLuma_ps_primitive(ref.luma_vps[value], opt.luma_vps[value]))
+            if (!check_IPFilterLuma_ps_primitive(ref.pu[value].luma_vps, opt.pu[value].luma_vps))
             {
                 printf("luma_vps[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_vsp[value])
+        if (opt.pu[value].luma_vsp)
         {
-            if (!check_IPFilterLuma_sp_primitive(ref.luma_vsp[value], opt.luma_vsp[value]))
+            if (!check_IPFilterLuma_sp_primitive(ref.pu[value].luma_vsp, opt.pu[value].luma_vsp))
             {
                 printf("luma_vsp[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_vss[value])
+        if (opt.pu[value].luma_vss)
         {
-            if (!check_IPFilterLuma_ss_primitive(ref.luma_vss[value], opt.luma_vss[value]))
+            if (!check_IPFilterLuma_ss_primitive(ref.pu[value].luma_vss, opt.pu[value].luma_vss))
             {
                 printf("luma_vss[%s]", lumaPartStr[value]);
                 return false;
             }
         }
-        if (opt.luma_hvpp[value])
+        if (opt.pu[value].luma_hvpp)
         {
-            if (!check_IPFilterLumaHV_primitive(ref.luma_hvpp[value], opt.luma_hvpp[value]))
+            if (!check_IPFilterLumaHV_primitive(ref.pu[value].luma_hvpp, opt.pu[value].luma_hvpp))
             {
                 printf("luma_hvpp[%s]", lumaPartStr[value]);
                 return false;
@@ -596,49 +596,49 @@
         }
         for (int value = 0; value < NUM_CHROMA_PARTITIONS; value++)
         {
-            if (opt.chroma[csp].filter_hpp[value])
+            if (opt.chroma[csp].pu[value].filter_hpp)
             {
-                if (!check_IPFilterChroma_primitive(ref.chroma[csp].filter_hpp[value], opt.chroma[csp].filter_hpp[value]))
+                if (!check_IPFilterChroma_primitive(ref.chroma[csp].pu[value].filter_hpp, opt.chroma[csp].pu[value].filter_hpp))
                 {
                     printf("chroma_hpp[%s]", chromaPartStr[csp][value]);
                     return false;
                 }
             }
-            if (opt.chroma[csp].filter_hps[value])
+            if (opt.chroma[csp].pu[value].filter_hps)
             {
-                if (!check_IPFilterChroma_hps_primitive(ref.chroma[csp].filter_hps[value], opt.chroma[csp].filter_hps[value]))
+                if (!check_IPFilterChroma_hps_primitive(ref.chroma[csp].pu[value].filter_hps, opt.chroma[csp].pu[value].filter_hps))
                 {
                     printf("chroma_hps[%s]", chromaPartStr[csp][value]);
                     return false;
                 }
             }
-            if (opt.chroma[csp].filter_vpp[value])
+            if (opt.chroma[csp].pu[value].filter_vpp)
             {
-                if (!check_IPFilterChroma_primitive(ref.chroma[csp].filter_vpp[value], opt.chroma[csp].filter_vpp[value]))
+                if (!check_IPFilterChroma_primitive(ref.chroma[csp].pu[value].filter_vpp, opt.chroma[csp].pu[value].filter_vpp))
                 {
                     printf("chroma_vpp[%s]", chromaPartStr[csp][value]);
                     return false;
                 }
             }
-            if (opt.chroma[csp].filter_vps[value])
+            if (opt.chroma[csp].pu[value].filter_vps)
             {
-                if (!check_IPFilterChroma_ps_primitive(ref.chroma[csp].filter_vps[value], opt.chroma[csp].filter_vps[value]))
+                if (!check_IPFilterChroma_ps_primitive(ref.chroma[csp].pu[value].filter_vps, opt.chroma[csp].pu[value].filter_vps))
                 {
                     printf("chroma_vps[%s]", chromaPartStr[csp][value]);
                     return false;
                 }
             }
-            if (opt.chroma[csp].filter_vsp[value])
+            if (opt.chroma[csp].pu[value].filter_vsp)
             {
-                if (!check_IPFilterChroma_sp_primitive(ref.chroma[csp].filter_vsp[value], opt.chroma[csp].filter_vsp[value]))
+                if (!check_IPFilterChroma_sp_primitive(ref.chroma[csp].pu[value].filter_vsp, opt.chroma[csp].pu[value].filter_vsp))
                 {
                     printf("chroma_vsp[%s]", chromaPartStr[csp][value]);
                     return false;
                 }
             }
-            if (opt.chroma[csp].filter_vss[value])
+            if (opt.chroma[csp].pu[value].filter_vss)
             {
-                if (!check_IPFilterChroma_ss_primitive(ref.chroma[csp].filter_vss[value], opt.chroma[csp].filter_vss[value]))
+                if (!check_IPFilterChroma_ss_primitive(ref.chroma[csp].pu[value].filter_vss, opt.chroma[csp].pu[value].filter_vss))
                 {
                     printf("chroma_vss[%s]", chromaPartStr[csp][value]);
                     return false;
@@ -667,57 +667,57 @@
 
     for (int value = 0; value < NUM_LUMA_PARTITIONS; value++)
     {
-        if (opt.luma_hpp[value])
+        if (opt.pu[value].luma_hpp)
         {
             printf("luma_hpp[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_hpp[value], ref.luma_hpp[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_hpp, ref.pu[value].luma_hpp,
                            pixel_buff + srcStride, srcStride, IPF_vec_output_p, dstStride, 1);
         }
 
-        if (opt.luma_hps[value])
+        if (opt.pu[value].luma_hps)
         {
             printf("luma_hps[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_hps[value], ref.luma_hps[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_hps, ref.pu[value].luma_hps,
                            pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_s, dstStride, 1, 1);
         }
 
-        if (opt.luma_vpp[value])
+        if (opt.pu[value].luma_vpp)
         {
             printf("luma_vpp[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_vpp[value], ref.luma_vpp[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_vpp, ref.pu[value].luma_vpp,
                            pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_p, dstStride, 1);
         }
 
-        if (opt.luma_vps[value])
+        if (opt.pu[value].luma_vps)
         {
             printf("luma_vps[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_vps[value], ref.luma_vps[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_vps, ref.pu[value].luma_vps,
                            pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_s, dstStride, 1);
         }
 
-        if (opt.luma_vsp[value])
+        if (opt.pu[value].luma_vsp)
         {
             printf("luma_vsp[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_vsp[value], ref.luma_vsp[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_vsp, ref.pu[value].luma_vsp,
                            short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_p, dstStride, 1);
         }
 
-        if (opt.luma_vss[value])
+        if (opt.pu[value].luma_vss)
         {
             printf("luma_vss[%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_vss[value], ref.luma_vss[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_vss, ref.pu[value].luma_vss,
                            short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_s, dstStride, 1);
         }
 
-        if (opt.luma_hvpp[value])
+        if (opt.pu[value].luma_hvpp)
         {
             printf("luma_hv [%s]\t", lumaPartStr[value]);
-            REPORT_SPEEDUP(opt.luma_hvpp[value], ref.luma_hvpp[value],
+            REPORT_SPEEDUP(opt.pu[value].luma_hvpp, ref.pu[value].luma_hvpp,
                            pixel_buff + 3 * srcStride, srcStride, IPF_vec_output_p, srcStride, 1, 3);
         }
     }
@@ -733,43 +733,43 @@
         }
         for (int value = 0; value < NUM_CHROMA_PARTITIONS; value++)
         {
-            if (opt.chroma[csp].filter_hpp[value])
+            if (opt.chroma[csp].pu[value].filter_hpp)
             {
                 printf("chroma_hpp[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_hpp[value], ref.chroma[csp].filter_hpp[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_hpp, ref.chroma[csp].pu[value].filter_hpp,
                                pixel_buff + srcStride, srcStride, IPF_vec_output_p, dstStride, 1);
             }
-            if (opt.chroma[csp].filter_hps[value])
+            if (opt.chroma[csp].pu[value].filter_hps)
             {
                 printf("chroma_hps[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_hps[value], ref.chroma[csp].filter_hps[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_hps, ref.chroma[csp].pu[value].filter_hps,
                                pixel_buff + srcStride, srcStride, IPF_vec_output_s, dstStride, 1, 1);
             }
-            if (opt.chroma[csp].filter_vpp[value])
+            if (opt.chroma[csp].pu[value].filter_vpp)
             {
                 printf("chroma_vpp[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_vpp[value], ref.chroma[csp].filter_vpp[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_vpp, ref.chroma[csp].pu[value].filter_vpp,
                                pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                                IPF_vec_output_p, dstStride, 1);
             }
-            if (opt.chroma[csp].filter_vps[value])
+            if (opt.chroma[csp].pu[value].filter_vps)
             {
                 printf("chroma_vps[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_vps[value], ref.chroma[csp].filter_vps[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_vps, ref.chroma[csp].pu[value].filter_vps,
                                pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                                IPF_vec_output_s, dstStride, 1);
             }
-            if (opt.chroma[csp].filter_vsp[value])
+            if (opt.chroma[csp].pu[value].filter_vsp)
             {
                 printf("chroma_vsp[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_vsp[value], ref.chroma[csp].filter_vsp[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_vsp, ref.chroma[csp].pu[value].filter_vsp,
                                short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                                IPF_vec_output_p, dstStride, 1);
             }
-            if (opt.chroma[csp].filter_vss[value])
+            if (opt.chroma[csp].pu[value].filter_vss)
             {
                 printf("chroma_vss[%s]", chromaPartStr[csp][value]);
-                REPORT_SPEEDUP(opt.chroma[csp].filter_vss[value], ref.chroma[csp].filter_vss[value],
+                REPORT_SPEEDUP(opt.chroma[csp].pu[value].filter_vss, ref.chroma[csp].pu[value].filter_vss,
                                short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                                IPF_vec_output_s, dstStride, 1);
             }
diff -r 2452bd8f18fd -r 15f12fbbb33c source/test/mbdstharness.cpp
--- a/source/test/mbdstharness.cpp	Tue Jan 06 16:46:07 2015 -0600
+++ b/source/test/mbdstharness.cpp	Wed Jan 07 17:41:45 2015 -0600
@@ -362,11 +362,11 @@
 
 bool MBDstHarness::testCorrectness(const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
-    for (int i = 0; i < NUM_DCTS; i++)
+    for (int i = 0; i < NUM_SQUARE_BLOCKS; i++)
     {
-        if (opt.dct[i])
+        if (opt.cu[i].dct)
         {
-            if (!check_dct_primitive(ref.dct[i], opt.dct[i], dctInfo[i].width))
+            if (!check_dct_primitive(ref.cu[i].dct, opt.cu[i].dct, dctInfo[i].width))
             {
                 printf("\n%s failed\n", dctInfo[i].name);
                 return false;
@@ -374,11 +374,11 @@
         }
     }
 
-    for (int i = 0; i < NUM_IDCTS; i++)
+    for (int i = 0; i < NUM_SQUARE_BLOCKS; i++)
     {
-        if (opt.idct[i])
+        if (opt.cu[i].idct)
         {
-            if (!check_idct_primitive(ref.idct[i], opt.idct[i], idctInfo[i].width))
+            if (!check_idct_primitive(ref.cu[i].idct, opt.cu[i].idct, idctInfo[i].width))
             {
                 printf("%s failed\n", idctInfo[i].name);
                 return false;
@@ -454,21 +454,21 @@
 
 void MBDstHarness::measureSpeed(const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
-    for (int value = 0; value < NUM_DCTS; value++)
+    for (int value = 0; value < NUM_SQUARE_BLOCKS; value++)
     {
-        if (opt.dct[value])
+        if (opt.cu[value].dct)
         {
             printf("%s\t", dctInfo[value].name);
-            REPORT_SPEEDUP(opt.dct[value], ref.dct[value], mbuf1, mshortbuf2, dctInfo[value].width);
+            REPORT_SPEEDUP(opt.cu[value].dct, ref.cu[value].dct, mbuf1, mshortbuf2, dctInfo[value].width);
         }
     }
 
-    for (int value = 0; value < NUM_IDCTS; value++)
+    for (int value = 0; value < NUM_SQUARE_BLOCKS; value++)
     {
-        if (opt.idct[value])
+        if (opt.cu[value].idct)
         {
             printf("%s\t", idctInfo[value].name);
-            REPORT_SPEEDUP(opt.idct[value], ref.idct[value], mshortbuf3, mshortbuf2, idctInfo[value].width);
+            REPORT_SPEEDUP(opt.cu[value].idct, ref.cu[value].idct, mshortbuf3, mshortbuf2, idctInfo[value].width);
         }
     }
 
diff -r 2452bd8f18fd -r 15f12fbbb33c source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Tue Jan 06 16:46:07 2015 -0600
+++ b/source/test/pixelharness.cpp	Wed Jan 07 17:41:45 2015 -0600
@@ -1121,126 +1121,126 @@
 
 bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
-    if (opt.satd[part])
+    if (opt.pu[part].satd)
     {
-        if (!check_pixelcmp(ref.satd[part], opt.satd[part]))
+        if (!check_pixelcmp(ref.pu[part].satd, opt.pu[part].satd))
         {
             printf("satd[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sa8d_inter[part])
+    if (opt.pu[part].sa8d_inter)
     {
-        if (!check_pixelcmp(ref.sa8d_inter[part], opt.sa8d_inter[part]))
+        if (!check_pixelcmp(ref.pu[part].sa8d_inter, opt.pu[part].sa8d_inter))
         {
             printf("sa8d_inter[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sad[part])
+    if (opt.pu[part].sad)
     {
-        if (!check_pixelcmp(ref.sad[part], opt.sad[part]))
+        if (!check_pixelcmp(ref.pu[part].sad, opt.pu[part].sad))
         {
             printf("sad[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sse_pp[part])
+    if (opt.pu[part].sse_pp)
     {
-        if (!check_pixelcmp(ref.sse_pp[part], opt.sse_pp[part]))
+        if (!check_pixelcmp(ref.pu[part].sse_pp, opt.pu[part].sse_pp))
         {
             printf("sse_pp[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sse_sp[part])
+    if (opt.pu[part].sse_sp)
     {
-        if (!check_pixelcmp_sp(ref.sse_sp[part], opt.sse_sp[part]))
+        if (!check_pixelcmp_sp(ref.pu[part].sse_sp, opt.pu[part].sse_sp))
         {
             printf("sse_sp[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sse_ss[part])
+    if (opt.pu[part].sse_ss)
     {
-        if (!check_pixelcmp_ss(ref.sse_ss[part], opt.sse_ss[part]))
+        if (!check_pixelcmp_ss(ref.pu[part].sse_ss, opt.pu[part].sse_ss))
         {
             printf("sse_ss[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sad_x3[part])
+    if (opt.pu[part].sad_x3)
     {
-        if (!check_pixelcmp_x3(ref.sad_x3[part], opt.sad_x3[part]))
+        if (!check_pixelcmp_x3(ref.pu[part].sad_x3, opt.pu[part].sad_x3))
         {
             printf("sad_x3[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.sad_x4[part])
+    if (opt.pu[part].sad_x4)
     {
-        if (!check_pixelcmp_x4(ref.sad_x4[part], opt.sad_x4[part]))
+        if (!check_pixelcmp_x4(ref.pu[part].sad_x4, opt.pu[part].sad_x4))
         {
             printf("sad_x4[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.pixelavg_pp[part])
+    if (opt.pu[part].pixelavg_pp)
     {
-        if (!check_pixelavg_pp(ref.pixelavg_pp[part], opt.pixelavg_pp[part]))
+        if (!check_pixelavg_pp(ref.pu[part].pixelavg_pp, opt.pu[part].pixelavg_pp))
         {
             printf("pixelavg_pp[%s]: failed!\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.luma_copy_pp[part])
+    if (opt.pu[part].luma_copy_pp)
     {
-        if (!check_copy_pp(ref.luma_copy_pp[part], opt.luma_copy_pp[part]))
+        if (!check_copy_pp(ref.pu[part].luma_copy_pp, opt.pu[part].luma_copy_pp))
         {
             printf("luma_copy_pp[%s] failed\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.luma_copy_sp[part])
+    if (opt.pu[part].luma_copy_sp)
     {
-        if (!check_copy_sp(ref.luma_copy_sp[part], opt.luma_copy_sp[part]))
+        if (!check_copy_sp(ref.pu[part].luma_copy_sp, opt.pu[part].luma_copy_sp))
         {
             printf("luma_copy_sp[%s] failed\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.luma_copy_ps[part])
+    if (opt.pu[part].luma_copy_ps)
     {
-        if (!check_copy_ps(ref.luma_copy_ps[part], opt.luma_copy_ps[part]))
+        if (!check_copy_ps(ref.pu[part].luma_copy_ps, opt.pu[part].luma_copy_ps))
         {
             printf("luma_copy_ps[%s] failed\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.luma_copy_ss[part])
+    if (opt.pu[part].luma_copy_ss)
     {
-        if (!check_copy_ss(ref.luma_copy_ss[part], opt.luma_copy_ss[part]))
+        if (!check_copy_ss(ref.pu[part].luma_copy_ss, opt.pu[part].luma_copy_ss))
         {
             printf("luma_copy_ss[%s] failed\n", lumaPartStr[part]);
             return false;
         }
     }
 
-    if (opt.luma_addAvg[part])
+    if (opt.pu[part].luma_addAvg)
     {
-        if (!check_addAvg(ref.luma_addAvg[part], opt.luma_addAvg[part]))
+        if (!check_addAvg(ref.pu[part].luma_addAvg, opt.pu[part].luma_addAvg))
         {
             printf("luma_addAvg[%s] failed\n", lumaPartStr[part]);
             return false;
@@ -1249,18 +1249,18 @@
 
     if (part < NUM_SQUARE_BLOCKS)
     {
-        if (opt.luma_sub_ps[part])
+        if (opt.pu[part].luma_sub_ps)
         {
-            if (!check_pixel_sub_ps(ref.luma_sub_ps[part], opt.luma_sub_ps[part]))
+            if (!check_pixel_sub_ps(ref.pu[part].luma_sub_ps, opt.pu[part].luma_sub_ps))
             {
                 printf("luma_sub_ps[%s] failed\n", lumaPartStr[part]);
                 return false;
             }
         }
 
-        if (opt.luma_add_ps[part])
+        if (opt.pu[part].luma_add_ps)
         {
-            if (!check_pixel_add_ps(ref.luma_add_ps[part], opt.luma_add_ps[part]))
+            if (!check_pixel_add_ps(ref.pu[part].luma_add_ps, opt.pu[part].luma_add_ps))
             {
                 printf("luma_add_ps[%s] failed\n", lumaPartStr[part]);
                 return false;
@@ -1270,41 +1270,41 @@
 
     for (int i = 0; i < X265_CSP_COUNT; i++)
     {
-        if (opt.chroma[i].copy_pp[part])
+        if (opt.chroma[i].pu[part].copy_pp)
         {
-            if (!check_copy_pp(ref.chroma[i].copy_pp[part], opt.chroma[i].copy_pp[part]))
+            if (!check_copy_pp(ref.chroma[i].pu[part].copy_pp, opt.chroma[i].pu[part].copy_pp))
             {
                 printf("chroma_copy_pp[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                 return false;
             }
         }
-        if (opt.chroma[i].copy_sp[part])
+        if (opt.chroma[i].pu[part].copy_sp)
         {
-            if (!check_copy_sp(ref.chroma[i].copy_sp[part], opt.chroma[i].copy_sp[part]))
+            if (!check_copy_sp(ref.chroma[i].pu[part].copy_sp, opt.chroma[i].pu[part].copy_sp))
             {
                 printf("chroma_copy_sp[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                 return false;
             }
         }
-        if (opt.chroma[i].copy_ps[part])
+        if (opt.chroma[i].pu[part].copy_ps)
         {
-            if (!check_copy_ps(ref.chroma[i].copy_ps[part], opt.chroma[i].copy_ps[part]))
+            if (!check_copy_ps(ref.chroma[i].pu[part].copy_ps, opt.chroma[i].pu[part].copy_ps))
             {
                 printf("chroma_copy_ps[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                 return false;
             }
         }
-        if (opt.chroma[i].copy_ss[part])
+        if (opt.chroma[i].pu[part].copy_ss)
         {
-            if (!check_copy_ss(ref.chroma[i].copy_ss[part], opt.chroma[i].copy_ss[part]))
+            if (!check_copy_ss(ref.chroma[i].pu[part].copy_ss, opt.chroma[i].pu[part].copy_ss))
             {
                 printf("chroma_copy_ss[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                 return false;
             }
         }
-        if (opt.chroma[i].addAvg[part])
+        if (opt.chroma[i].pu[part].addAvg)
         {
-            if (!check_addAvg(ref.chroma[i].addAvg[part], opt.chroma[i].addAvg[part]))
+            if (!check_addAvg(ref.chroma[i].pu[part].addAvg, opt.chroma[i].pu[part].addAvg))
             {
                 printf("chroma_addAvg[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                 return false;
@@ -1312,17 +1312,17 @@
         }
         if (part < NUM_SQUARE_BLOCKS)
         {
-            if (opt.chroma[i].sub_ps[part])
+            if (opt.chroma[i].cu[part].sub_ps)
             {
-                if (!check_pixel_sub_ps(ref.chroma[i].sub_ps[part], opt.chroma[i].sub_ps[part]))
+                if (!check_pixel_sub_ps(ref.chroma[i].cu[part].sub_ps, opt.chroma[i].cu[part].sub_ps))
                 {
                     printf("chroma_sub_ps[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                     return false;
                 }
             }
-            if (opt.chroma[i].add_ps[part])
+            if (opt.chroma[i].cu[part].add_ps)
             {
-                if (!check_pixel_add_ps(ref.chroma[i].add_ps[part], opt.chroma[i].add_ps[part]))
+                if (!check_pixel_add_ps(ref.chroma[i].cu[part].add_ps, opt.chroma[i].cu[part].add_ps))
                 {
                     printf("chroma_add_ps[%s][%s] failed\n", x265_source_csp_names[i], chromaPartStr[i][part]);
                     return false;
@@ -1365,106 +1365,106 @@
 
     for (int i = 0; i < NUM_SQUARE_BLOCKS; i++)
     {
-        if (opt.calcresidual[i])
+        if (opt.cu[i].calcresidual)
         {
-            if (!check_calresidual(ref.calcresidual[i], opt.calcresidual[i]))
+            if (!check_calresidual(ref.cu[i].calcresidual, opt.cu[i].calcresidual))
             {
                 printf("calcresidual width: %d failed!\n", 4 << i);
                 return false;
             }
         }
-        if (opt.sa8d[i])
+        if (opt.cu[i].sa8d)
         {
-            if (!check_pixelcmp(ref.sa8d[i], opt.sa8d[i]))
+            if (!check_pixelcmp(ref.cu[i].sa8d, opt.cu[i].sa8d))
             {
                 printf("sa8d[%dx%d]: failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if ((i <= BLOCK_32x32) && opt.ssd_s[i])
+        if ((i <= BLOCK_32x32) && opt.cu[i].ssd_s)
         {
-            if (!check_ssd_s(ref.ssd_s[i], opt.ssd_s[i]))
+            if (!check_ssd_s(ref.cu[i].ssd_s, opt.cu[i].ssd_s))
             {
                 printf("ssd_s[%dx%d]: failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if (opt.blockfill_s[i])
+        if (opt.cu[i].blockfill_s)
         {
-            if (!check_blockfill_s(ref.blockfill_s[i], opt.blockfill_s[i]))
+            if (!check_blockfill_s(ref.cu[i].blockfill_s, opt.cu[i].blockfill_s))
             {
                 printf("blockfill_s[%dx%d]: failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
-        if (opt.transpose[i])
+        if (opt.cu[i].transpose)
         {
-            if (!check_transpose(ref.transpose[i], opt.transpose[i]))
+            if (!check_transpose(ref.cu[i].transpose, opt.cu[i].transpose))
             {
                 printf("transpose[%dx%d] failed\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if (opt.var[i])
+        if (opt.cu[i].var)
         {
-            if (!check_pixel_var(ref.var[i], opt.var[i]))
+            if (!check_pixel_var(ref.cu[i].var, opt.cu[i].var))
             {
                 printf("var[%dx%d] failed\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if ((i < BLOCK_64x64) && opt.copy_cnt[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].copy_cnt)
         {
-            if (!check_copy_cnt_t(ref.copy_cnt[i], opt.copy_cnt[i]))
+            if (!check_copy_cnt_t(ref.cu[i].copy_cnt, opt.cu[i].copy_cnt))
             {
                 printf("copy_cnt[%dx%d] failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy2Dto1D_shl[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy2Dto1D_shl)
         {
-            if (!check_cpy2Dto1D_shl_t(ref.cpy2Dto1D_shl[i], opt.cpy2Dto1D_shl[i]))
+            if (!check_cpy2Dto1D_shl_t(ref.cu[i].cpy2Dto1D_shl, opt.cu[i].cpy2Dto1D_shl))
             {
                 printf("cpy2Dto1D_shl failed!\n");
                 return false;
             }
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy2Dto1D_shr[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy2Dto1D_shr)
         {
-            if (!check_cpy2Dto1D_shr_t(ref.cpy2Dto1D_shr[i], opt.cpy2Dto1D_shr[i]))
+            if (!check_cpy2Dto1D_shr_t(ref.cu[i].cpy2Dto1D_shr, opt.cu[i].cpy2Dto1D_shr))
             {
                 printf("cpy2Dto1D_shr failed!\n");
                 return false;
             }
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy1Dto2D_shl[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy1Dto2D_shl)
         {
-            if (!check_cpy1Dto2D_shl_t(ref.cpy1Dto2D_shl[i], opt.cpy1Dto2D_shl[i]))
+            if (!check_cpy1Dto2D_shl_t(ref.cu[i].cpy1Dto2D_shl, opt.cu[i].cpy1Dto2D_shl))
             {
                 printf("cpy1Dto2D_shl[%dx%d] failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy1Dto2D_shr[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy1Dto2D_shr)
         {
-            if (!check_cpy1Dto2D_shr_t(ref.cpy1Dto2D_shr[i], opt.cpy1Dto2D_shr[i]))
+            if (!check_cpy1Dto2D_shr_t(ref.cu[i].cpy1Dto2D_shr, opt.cu[i].cpy1Dto2D_shr))
             {
                 printf("cpy1Dto2D_shr[%dx%d] failed!\n", 4 << i, 4 << i);
                 return false;
             }
         }
 
-        if (opt.psy_cost_pp[i])
+        if (opt.cu[i].psy_cost_pp)
         {
-            if (!check_psyCost_pp(ref.psy_cost_pp[i], opt.psy_cost_pp[i]))
+            if (!check_psyCost_pp(ref.cu[i].psy_cost_pp, opt.cu[i].psy_cost_pp))
             {
                 printf("\npsy_cost_pp[%dx%d] failed!\n", 4 << i, 4 << i);
                 return false;
@@ -1617,139 +1617,139 @@
     char header[128];
 #define HEADER(str, ...) sprintf(header, str, __VA_ARGS__); printf("%22s", header);
 
-    if (opt.satd[part])
+    if (opt.pu[part].satd)
     {
         HEADER("satd[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.satd[part], ref.satd[part], pbuf1, STRIDE, fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].satd, ref.pu[part].satd, pbuf1, STRIDE, fref, STRIDE);
     }
 
-    if (opt.pixelavg_pp[part])
+    if (opt.pu[part].pixelavg_pp)
     {
         HEADER("avg_pp[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.pixelavg_pp[part], ref.pixelavg_pp[part], pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 32);
+        REPORT_SPEEDUP(opt.pu[part].pixelavg_pp, ref.pu[part].pixelavg_pp, pbuf1, STRIDE, pbuf2, STRIDE, pbuf3, STRIDE, 32);
     }
 
-    if (opt.sa8d_inter[part])
+    if (opt.pu[part].sa8d_inter)
     {
         HEADER("sa8d[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sa8d_inter[part], ref.sa8d_inter[part], pbuf1, STRIDE, fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].sa8d_inter, ref.pu[part].sa8d_inter, pbuf1, STRIDE, fref, STRIDE);
     }
 
-    if (opt.sad[part])
+    if (opt.pu[part].sad)
     {
         HEADER("sad[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sad[part], ref.sad[part], pbuf1, STRIDE, fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].sad, ref.pu[part].sad, pbuf1, STRIDE, fref, STRIDE);
     }
 
-    if (opt.sad_x3[part])
+    if (opt.pu[part].sad_x3)
     {
         HEADER("sad_x3[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sad_x3[part], ref.sad_x3[part], pbuf1, fref, fref + 1, fref - 1, FENC_STRIDE + 5, &cres[0]);
+        REPORT_SPEEDUP(opt.pu[part].sad_x3, ref.pu[part].sad_x3, pbuf1, fref, fref + 1, fref - 1, FENC_STRIDE + 5, &cres[0]);
     }
 
-    if (opt.sad_x4[part])
+    if (opt.pu[part].sad_x4)
     {
         HEADER("sad_x4[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sad_x4[part], ref.sad_x4[part], pbuf1, fref, fref + 1, fref - 1, fref - INCR, FENC_STRIDE + 5, &cres[0]);
+        REPORT_SPEEDUP(opt.pu[part].sad_x4, ref.pu[part].sad_x4, pbuf1, fref, fref + 1, fref - 1, fref - INCR, FENC_STRIDE + 5, &cres[0]);
     }
 
-    if (opt.sse_pp[part])
+    if (opt.pu[part].sse_pp)
     {
         HEADER("sse_pp[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sse_pp[part], ref.sse_pp[part], pbuf1, STRIDE, fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].sse_pp, ref.pu[part].sse_pp, pbuf1, STRIDE, fref, STRIDE);
     }
 
-    if (opt.sse_sp[part])
+    if (opt.pu[part].sse_sp)
     {
         HEADER("sse_sp[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sse_sp[part], ref.sse_sp[part], (int16_t*)pbuf1, STRIDE, fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].sse_sp, ref.pu[part].sse_sp, (int16_t*)pbuf1, STRIDE, fref, STRIDE);
     }
 
-    if (opt.sse_ss[part])
+    if (opt.pu[part].sse_ss)
     {
         HEADER("sse_ss[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.sse_ss[part], ref.sse_ss[part], (int16_t*)pbuf1, STRIDE, (int16_t*)fref, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].sse_ss, ref.pu[part].sse_ss, (int16_t*)pbuf1, STRIDE, (int16_t*)fref, STRIDE);
     }
 
-    if (opt.luma_copy_pp[part])
+    if (opt.pu[part].luma_copy_pp)
     {
         HEADER("luma_copy_pp[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.luma_copy_pp[part], ref.luma_copy_pp[part], pbuf1, 64, pbuf2, 128);
+        REPORT_SPEEDUP(opt.pu[part].luma_copy_pp, ref.pu[part].luma_copy_pp, pbuf1, 64, pbuf2, 128);
     }
 
-    if (opt.luma_copy_sp[part])
+    if (opt.pu[part].luma_copy_sp)
     {
         HEADER("luma_copy_sp[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.luma_copy_sp[part], ref.luma_copy_sp[part], pbuf1, 64, sbuf3, 128);
+        REPORT_SPEEDUP(opt.pu[part].luma_copy_sp, ref.pu[part].luma_copy_sp, pbuf1, 64, sbuf3, 128);
     }
 
-    if (opt.luma_copy_ps[part])
+    if (opt.pu[part].luma_copy_ps)
     {
         HEADER("luma_copy_ps[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.luma_copy_ps[part], ref.luma_copy_ps[part], sbuf1, 64, pbuf1, 128);
+        REPORT_SPEEDUP(opt.pu[part].luma_copy_ps, ref.pu[part].luma_copy_ps, sbuf1, 64, pbuf1, 128);
     }
-    if (opt.luma_copy_ss[part])
+    if (opt.pu[part].luma_copy_ss)
     {
         HEADER("luma_copy_ss[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.luma_copy_ss[part], ref.luma_copy_ss[part], sbuf1, 64, sbuf2, 128);
+        REPORT_SPEEDUP(opt.pu[part].luma_copy_ss, ref.pu[part].luma_copy_ss, sbuf1, 64, sbuf2, 128);
     }
-    if (opt.luma_addAvg[part])
+    if (opt.pu[part].luma_addAvg)
     {
         HEADER("luma_addAvg[%s]", lumaPartStr[part]);
-        REPORT_SPEEDUP(opt.luma_addAvg[part], ref.luma_addAvg[part], sbuf1, sbuf2, pbuf1, STRIDE, STRIDE, STRIDE);
+        REPORT_SPEEDUP(opt.pu[part].luma_addAvg, ref.pu[part].luma_addAvg, sbuf1, sbuf2, pbuf1, STRIDE, STRIDE, STRIDE);
     }
     if (part < NUM_SQUARE_BLOCKS)
     {
-        if (opt.luma_sub_ps[part])
+        if (opt.pu[part].luma_sub_ps)
         {
             HEADER("luma_sub_ps[%s]", lumaPartStr[part]);
-            REPORT_SPEEDUP(opt.luma_sub_ps[part], ref.luma_sub_ps[part], (int16_t*)pbuf1, FENC_STRIDE, pbuf2, pbuf1, STRIDE, STRIDE);
+            REPORT_SPEEDUP(opt.pu[part].luma_sub_ps, ref.pu[part].luma_sub_ps, (int16_t*)pbuf1, FENC_STRIDE, pbuf2, pbuf1, STRIDE, STRIDE);
         }
-        if (opt.luma_add_ps[part])
+        if (opt.pu[part].luma_add_ps)
         {
             HEADER("luma_add_ps[%s]", lumaPartStr[part]);
-            REPORT_SPEEDUP(opt.luma_add_ps[part], ref.luma_add_ps[part], pbuf1, FENC_STRIDE, pbuf2, sbuf1, STRIDE, STRIDE);
+            REPORT_SPEEDUP(opt.pu[part].luma_add_ps, ref.pu[part].luma_add_ps, pbuf1, FENC_STRIDE, pbuf2, sbuf1, STRIDE, STRIDE);
         }
     }
 
     for (int i = 0; i < X265_CSP_COUNT; i++)
     {
-        if (opt.chroma[i].copy_pp[part])
+        if (opt.chroma[i].pu[part].copy_pp)
         {
             HEADER("[%s] copy_pp[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-            REPORT_SPEEDUP(opt.chroma[i].copy_pp[part], ref.chroma[i].copy_pp[part], pbuf1, 64, pbuf2, 128);
+            REPORT_SPEEDUP(opt.chroma[i].pu[part].copy_pp, ref.chroma[i].pu[part].copy_pp, pbuf1, 64, pbuf2, 128);
         }
-        if (opt.chroma[i].copy_sp[part])
+        if (opt.chroma[i].pu[part].copy_sp)
         {
             HEADER("[%s] copy_sp[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-            REPORT_SPEEDUP(opt.chroma[i].copy_sp[part], ref.chroma[i].copy_sp[part], pbuf1, 64, sbuf3, 128);
+            REPORT_SPEEDUP(opt.chroma[i].pu[part].copy_sp, ref.chroma[i].pu[part].copy_sp, pbuf1, 64, sbuf3, 128);
         }
-        if (opt.chroma[i].copy_ps[part])
+        if (opt.chroma[i].pu[part].copy_ps)
         {
             HEADER("[%s] copy_ps[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-            REPORT_SPEEDUP(opt.chroma[i].copy_ps[part], ref.chroma[i].copy_ps[part], sbuf1, 64, pbuf1, 128);
+            REPORT_SPEEDUP(opt.chroma[i].pu[part].copy_ps, ref.chroma[i].pu[part].copy_ps, sbuf1, 64, pbuf1, 128);
         }
-        if (opt.chroma[i].copy_ss[part])
+        if (opt.chroma[i].pu[part].copy_ss)
         {
             HEADER("[%s] copy_ss[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-            REPORT_SPEEDUP(opt.chroma[i].copy_ss[part], ref.chroma[i].copy_ss[part], sbuf1, 64, sbuf2, 128);
+            REPORT_SPEEDUP(opt.chroma[i].pu[part].copy_ss, ref.chroma[i].pu[part].copy_ss, sbuf1, 64, sbuf2, 128);
         }
-        if (opt.chroma[i].addAvg[part])
+        if (opt.chroma[i].pu[part].addAvg)
         {
             HEADER("[%s]  addAvg[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-            REPORT_SPEEDUP(opt.chroma[i].addAvg[part], ref.chroma[i].addAvg[part], sbuf1, sbuf2, pbuf1, STRIDE, STRIDE, STRIDE);
+            REPORT_SPEEDUP(opt.chroma[i].pu[part].addAvg, ref.chroma[i].pu[part].addAvg, sbuf1, sbuf2, pbuf1, STRIDE, STRIDE, STRIDE);
         }
         if (part < NUM_SQUARE_BLOCKS)
         {
-            if (opt.chroma[i].sub_ps[part])
+            if (opt.chroma[i].cu[part].sub_ps)
             {
                 HEADER("[%s]  sub_ps[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-                REPORT_SPEEDUP(opt.chroma[i].sub_ps[part], ref.chroma[i].sub_ps[part], (int16_t*)pbuf1, FENC_STRIDE, pbuf2, pbuf1, STRIDE, STRIDE);
+                REPORT_SPEEDUP(opt.chroma[i].cu[part].sub_ps, ref.chroma[i].cu[part].sub_ps, (int16_t*)pbuf1, FENC_STRIDE, pbuf2, pbuf1, STRIDE, STRIDE);
             }
-            if (opt.chroma[i].add_ps[part])
+            if (opt.chroma[i].cu[part].add_ps)
             {
                 HEADER("[%s]  add_ps[%s]", x265_source_csp_names[i], chromaPartStr[i][part]);
-                REPORT_SPEEDUP(opt.chroma[i].add_ps[part], ref.chroma[i].add_ps[part], pbuf1, FENC_STRIDE, pbuf2, sbuf1, STRIDE, STRIDE);
+                REPORT_SPEEDUP(opt.chroma[i].cu[part].add_ps, ref.chroma[i].cu[part].add_ps, pbuf1, FENC_STRIDE, pbuf2, sbuf1, STRIDE, STRIDE);
             }
         }
     }
@@ -1793,74 +1793,74 @@
 
     for (int i = 0; i < NUM_SQUARE_BLOCKS; i++)
     {
-        if ((i <= BLOCK_32x32) && opt.ssd_s[i])
+        if ((i <= BLOCK_32x32) && opt.cu[i].ssd_s)
         {
             HEADER("ssd_s[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.ssd_s[i], ref.ssd_s[i], sbuf1, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].ssd_s, ref.cu[i].ssd_s, sbuf1, STRIDE);
         }
-        if (opt.sa8d[i])
+        if (opt.cu[i].sa8d)
         {
             HEADER("sa8d[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.sa8d[i], ref.sa8d[i], pbuf1, STRIDE, pbuf2, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].sa8d, ref.cu[i].sa8d, pbuf1, STRIDE, pbuf2, STRIDE);
         }
-        if (opt.calcresidual[i])
+        if (opt.cu[i].calcresidual)
         {
             HEADER("residual[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.calcresidual[i], ref.calcresidual[i], pbuf1, pbuf2, sbuf1, 64);
+            REPORT_SPEEDUP(opt.cu[i].calcresidual, ref.cu[i].calcresidual, pbuf1, pbuf2, sbuf1, 64);
         }
 
-        if (opt.blockfill_s[i])
+        if (opt.cu[i].blockfill_s)
         {
             HEADER("blkfill[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.blockfill_s[i], ref.blockfill_s[i], sbuf1, 64, SHORT_MAX);
+            REPORT_SPEEDUP(opt.cu[i].blockfill_s, ref.cu[i].blockfill_s, sbuf1, 64, SHORT_MAX);
         }
 
-        if (opt.transpose[i])
+        if (opt.cu[i].transpose)
         {
             HEADER("transpose[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.transpose[i], ref.transpose[i], pbuf1, pbuf2, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].transpose, ref.cu[i].transpose, pbuf1, pbuf2, STRIDE);
         }
 
-        if (opt.var[i])
+        if (opt.cu[i].var)
         {
             HEADER("var[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.var[i], ref.var[i], pbuf1, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].var, ref.cu[i].var, pbuf1, STRIDE);
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy2Dto1D_shl[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy2Dto1D_shl)
         {
             HEADER("cpy2Dto1D_shl[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.cpy2Dto1D_shl[i], ref.cpy2Dto1D_shl[i], sbuf1, sbuf2, STRIDE, MAX_TR_DYNAMIC_RANGE - X265_DEPTH - (i + 2));
+            REPORT_SPEEDUP(opt.cu[i].cpy2Dto1D_shl, ref.cu[i].cpy2Dto1D_shl, sbuf1, sbuf2, STRIDE, MAX_TR_DYNAMIC_RANGE - X265_DEPTH - (i + 2));
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy2Dto1D_shr[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy2Dto1D_shr)
         {
             HEADER("cpy2Dto1D_shr[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.cpy2Dto1D_shr[i], ref.cpy2Dto1D_shr[i], sbuf1, sbuf2, STRIDE, 3);
+            REPORT_SPEEDUP(opt.cu[i].cpy2Dto1D_shr, ref.cu[i].cpy2Dto1D_shr, sbuf1, sbuf2, STRIDE, 3);
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy1Dto2D_shl[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy1Dto2D_shl)
         {
             HEADER("cpy1Dto2D_shl[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.cpy1Dto2D_shl[i], ref.cpy1Dto2D_shl[i], sbuf1, sbuf2, STRIDE, 64);
+            REPORT_SPEEDUP(opt.cu[i].cpy1Dto2D_shl, ref.cu[i].cpy1Dto2D_shl, sbuf1, sbuf2, STRIDE, 64);
         }
 
-        if ((i < BLOCK_64x64) && opt.cpy1Dto2D_shr[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].cpy1Dto2D_shr)
         {
             HEADER("cpy1Dto2D_shr[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.cpy1Dto2D_shr[i], ref.cpy1Dto2D_shr[i], sbuf1, sbuf2, STRIDE, 64);
+            REPORT_SPEEDUP(opt.cu[i].cpy1Dto2D_shr, ref.cu[i].cpy1Dto2D_shr, sbuf1, sbuf2, STRIDE, 64);
         }
 
-        if ((i < BLOCK_64x64) && opt.copy_cnt[i])
+        if ((i < BLOCK_64x64) && opt.cu[i].copy_cnt)
         {
             HEADER("copy_cnt[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.copy_cnt[i], ref.copy_cnt[i], sbuf1, sbuf2, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].copy_cnt, ref.cu[i].copy_cnt, sbuf1, sbuf2, STRIDE);
         }
 
-        if (opt.psy_cost_pp[i])
+        if (opt.cu[i].psy_cost_pp)
         {
             HEADER("psy_cost_pp[%dx%d]", 4 << i, 4 << i);
-            REPORT_SPEEDUP(opt.psy_cost_pp[i], ref.psy_cost_pp[i], pbuf1, STRIDE, pbuf2, STRIDE);
+            REPORT_SPEEDUP(opt.cu[i].psy_cost_pp, ref.cu[i].psy_cost_pp, pbuf1, STRIDE, pbuf2, STRIDE);
         }
     }
 



More information about the x265-devel mailing list