[x265] [PATCH] cutree: identify the correct b-ref to estimate propagatecost

gopu at multicorewareinc.com gopu at multicorewareinc.com
Thu May 15 09:02:16 CEST 2014


# HG changeset patch
# User Gopu Govindaswamy
# Date 1400137266 -19800
#      Thu May 15 12:31:06 2014 +0530
# Node ID 6ca880d7e68361e5b9e2353f05369d9e5c40a29f
# Parent  d5b42a9fe43ba877f90f73a11a071d9e449e9661
cutree: identify the correct b-ref to estimate propagatecost

diff -r d5b42a9fe43b -r 6ca880d7e683 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Wed May 14 21:01:56 2014 +0530
+++ b/source/encoder/slicetype.cpp	Thu May 15 12:31:06 2014 +0530
@@ -974,7 +974,7 @@
         bframes = lastnonb - curnonb - 1;
         if (param->bBPyramid && bframes > 1)
         {
-            int middle = (bframes + 1) / 2 + curnonb;
+            int middle = bframes / 2 + curnonb;
             est.estimateFrameCost(frames, curnonb, lastnonb, middle, 0);
             memset(frames[middle]->propagateCost, 0, cuCount * sizeof(uint16_t));
             while (i > curnonb)
@@ -1013,7 +1013,7 @@
 
     cuTreeFinish(frames[lastnonb], averageDuration, lastnonb);
     if (param->bBPyramid && bframes > 1 && !param->rc.vbvBufferSize)
-        cuTreeFinish(frames[lastnonb + (bframes + 1) / 2], averageDuration, 0);
+        cuTreeFinish(frames[lastnonb + bframes / 2], averageDuration, 0);
 }
 
 void Lookahead::estimateCUPropagate(Lowres **frames, double averageDuration, int p0, int p1, int b, int referenced)


More information about the x265-devel mailing list