[x265] fix weightCost() [CHANGES OUTPUT]

Satoshi Nakagawa nakagawa424 at oki.com
Tue Jan 6 03:41:22 CET 2015


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1420511389 -32400
#      Tue Jan 06 11:29:49 2015 +0900
# Node ID a260403b0d21cd2948fb2546997269c102249369
# Parent  f255e8d06423231cb8c58ab5d3b10de7fb27b424
fix weightCost() [CHANGES OUTPUT]

diff -r f255e8d06423 -r a260403b0d21 source/encoder/weightPrediction.cpp
--- a/source/encoder/weightPrediction.cpp	Fri Jan 02 18:22:38 2015 +0530
+++ b/source/encoder/weightPrediction.cpp	Tue Jan 06 11:29:49 2015 +0900
@@ -193,9 +193,9 @@
     if (bLuma)
     {
         int cu = 0;
-        for (int y = 8; y < height; y += 8, r += 8 * stride, f += 8 * stride)
+        for (int y = 0; y < height; y += 8, r += 8 * stride, f += 8 * stride)
         {
-            for (int x = 8; x < width; x += 8, cu++)
+            for (int x = 0; x < width; x += 8, cu++)
             {
                 int cmp = primitives.satd[LUMA_8x8](r + x, stride, f + x, stride);
                 cost += X265_MIN(cmp, cache.intraCost[cu]);
@@ -203,12 +203,12 @@
         }
     }
     else if (cache.csp == X265_CSP_I444)
-        for (int y = 16; y < height; y += 16, r += 16 * stride, f += 16 * stride)
-            for (int x = 16; x < width; x += 16)
+        for (int y = 0; y < height; y += 16, r += 16 * stride, f += 16 * stride)
+            for (int x = 0; x < width; x += 16)
                 cost += primitives.satd[LUMA_16x16](r + x, stride, f + x, stride);
     else
-        for (int y = 8; y < height; y += 8, r += 8 * stride, f += 8 * stride)
-            for (int x = 8; x < width; x += 8)
+        for (int y = 0; y < height; y += 8, r += 8 * stride, f += 8 * stride)
+            for (int x = 0; x < width; x += 8)
                 cost += primitives.satd[LUMA_8x8](r + x, stride, f + x, stride);
 
     return cost;
@@ -381,9 +381,9 @@
                 break;
 
             case 2:
-                fref = refFrame->m_fencPic->m_picOrg[2];
                 orig = fencPic->m_picOrg[2];
                 stride = fencPic->m_strideC;
+                fref = refFrame->m_fencPic->m_picOrg[2];
                 width =  ((fencPic->m_picWidth  >> 4) << 4) >> cache.hshift;
                 height = ((fencPic->m_picHeight >> 4) << 4) >> cache.vshift;
                 if (mvs)


More information about the x265-devel mailing list