changeset 4038:f467c4792a28

lookahead: fix cost estimation, use previous result when calculation is skipped
author Deepthi Devaki <deepthidevaki@multicorewareinc.com>
date Wed, 18 Sep 2013 18:19:22 +0530
parents d05f4310a976
children 6b1982cfc05d
files source/encoder/slicetype.cpp
diffstat 1 files changed, 4 insertions(+-), 1 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/slicetype.cpp	Tue Sep 17 00:13:08 2013 +0530
+++ b/source/encoder/slicetype.cpp	Wed Sep 18 18:19:22 2013 +0530
@@ -363,8 +363,11 @@ void Lookahead::estimateCUCost(int cux, 
     for (int i = 0; i < 1 + bBidir; i++)
     {
         if (!bDoSearch[i])
+        {
+            /* Use previously calculated cost */
+            COPY2_IF_LT(bcost, *fenc_costs[i], listused, i + 1);
             continue;
-
+        }
         int numc = 0;
         MV mvc[4], mvp;
         MV *fenc_mv = fenc_mvs[i];