[x265] [PATCH] cutree: bug fixes. correct the timescale used in getQScale()

Aarthi Thirumalai aarthi at multicorewareinc.com
Fri Dec 27 18:37:36 CET 2013


# HG changeset patch
# User Aarthi Thirumalai
# Date 1388165826 -19800
#      Fri Dec 27 23:07:06 2013 +0530
# Node ID 964e5bc90ad2a0f80980409046a13b4cbaf11a03
# Parent  8b5c5fe7fbc923684af45e5ff7a0ed5ed6e83db9
cutree: bug fixes. correct the timescale used in getQScale()

diff -r 8b5c5fe7fbc9 -r 964e5bc90ad2 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Fri Dec 27 15:30:41 2013 +0530
+++ b/source/encoder/ratecontrol.cpp	Fri Dec 27 23:07:06 2013 +0530
@@ -633,10 +633,11 @@
 
     if (cfg->param.rc.cuTree)
     {
-        double scale = curSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale();
-        double units = curSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick();
-        double timescale = units / scale;
-        q = pow(BASE_FRAME_DURATION / CLIP_DURATION(frameDuration * timescale), 1 - cfg->param.rc.qCompress);
+        // Scale and units are obtained from rateNum and rateDenom for videos with fixed frame rates. 
+        double scale = cfg->param.frameRate * 2;
+        double numTicks = 1;
+        double timescale = numTicks / scale;
+        q = pow(BASE_FRAME_DURATION / CLIP_DURATION(2 * timescale), 1 - cfg->param.rc.qCompress);
     }
     else
         q = pow(rce->blurredComplexity, 1 - cfg->param.rc.qCompress);
diff -r 8b5c5fe7fbc9 -r 964e5bc90ad2 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Fri Dec 27 15:30:41 2013 +0530
+++ b/source/encoder/slicetype.cpp	Fri Dec 27 23:07:06 2013 +0530
@@ -1394,7 +1394,7 @@
         memset(Frames[b]->propagateCost, 0, widthInCU * sizeof(uint16_t));
 
     uint16_t StrideInCU = (uint16_t)widthInCU;
-    for (uint16_t block_y = 0; block_y < heightInCU; block_y += 16)
+    for (uint16_t block_y = 0; block_y < heightInCU; block_y++)
     {
         int cuIndex = block_y * StrideInCU;
         /* TODO This function go into ASM */
@@ -1404,7 +1404,7 @@
 
         if (referenced)
             propagate_cost += widthInCU;
-        for (uint16_t block_x = 0; block_x < widthInCU; block_x += 16, cuIndex++)
+        for (uint16_t block_x = 0; block_x < widthInCU; block_x++, cuIndex++)
         {
             int propagate_amount = scratch[block_x];
             /* Don't propagate for an intra block. */


More information about the x265-devel mailing list