[x265] [PATCH] rc: fix error in vbv due to access of unreferenced refFrame data

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Mon Oct 20 19:26:53 CEST 2014


# HG changeset patch
# User Aarthi Thirumalai
# Date 1413825948 -19800
#      Mon Oct 20 22:55:48 2014 +0530
# Node ID 8af57a7485e79162f3f0c91f64cd3074342eb51e
# Parent  7eab67ffff81a44cc67c388dc4fcae2468979fae
rc: fix error in vbv due to access of unreferenced refFrame data

diff -r 7eab67ffff81 -r 8af57a7485e7 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Mon Oct 20 15:37:50 2014 +0530
+++ b/source/encoder/ratecontrol.cpp	Mon Oct 20 22:55:48 2014 +0530
@@ -1873,10 +1873,10 @@
             double pred_s = predictSize(rce->rowPred[0], qScale, satdCostForPendingCus);
             uint32_t refRowSatdCost = 0, refRowBits = 0, intraCost = 0;
             double refQScale = 0;
-            FrameData& refEncData = *refFrame->m_encData;
 
             if (picType != I_SLICE)
             {
+                FrameData& refEncData = *refFrame->m_encData;
                 uint32_t endCuAddr = curFrame->m_origPicYuv->m_numCuInWidth * (row + 1);
                 for (uint32_t cuAddr = curEncData.m_rowStat[row].numEncodedCUs + 1; cuAddr < endCuAddr; cuAddr++)
                 {
@@ -1891,8 +1891,9 @@
 
             if (picType == I_SLICE || qScale >= refQScale)
             {
-                if (picType == P_SLICE
-                    && refEncData.m_slice->m_sliceType == picType
+                if (picType == P_SLICE 
+                    && !refFrame 
+                    && refFrame->m_encData->m_slice->m_sliceType == picType
                     && refQScale > 0
                     && refRowSatdCost > 0)
                 {


More information about the x265-devel mailing list