[x265-commits] [x265] weight: ensure chroma weights are initialized when skipped

Steve Borho steve at borho.org
Wed Mar 5 03:54:12 CET 2014


details:   http://hg.videolan.org/x265/rev/5cad3652bee8
branches:  
changeset: 6384:5cad3652bee8
user:      Steve Borho <steve at borho.org>
date:      Tue Mar 04 20:53:17 2014 -0600
description:
weight: ensure chroma weights are initialized when skipped

diffstat:

 source/encoder/weightPrediction.cpp |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 1a3d37f0a072 -r 5cad3652bee8 source/encoder/weightPrediction.cpp
--- a/source/encoder/weightPrediction.cpp	Tue Mar 04 17:45:31 2014 -0600
+++ b/source/encoder/weightPrediction.cpp	Tue Mar 04 20:53:17 2014 -0600
@@ -274,12 +274,18 @@ bool tryCommonDenom(TComSlice& slice, Ca
             log2denom[2] = log2denom[1];
 
             bool bWeightRef = false;
-            for (int yuv = 0; yuv < 3 && (!yuv || fw[0].bPresentFlag); yuv++)
+            for (int yuv = 0; yuv < 3; yuv++)
             {
                 RefData *rd = &cache.ref[list][ref][yuv];
                 ChannelData *p = &cache.paramset[yuv];
+                if (yuv && !fw[0].bPresentFlag)
+                {
+                    fw[1].inputWeight = 1 << fw[1].log2WeightDenom;
+                    fw[2].inputWeight = 1 << fw[2].log2WeightDenom;
+                    break;
+                }
+
                 x265_emms();
-
                 /* Early termination */
                 float meanDiff = rd->refMean < rd->fencMean ? rd->fencMean - rd->refMean : rd->refMean - rd->fencMean;
                 float guessVal = rd->guessScale > 1.f ? rd->guessScale - 1.f : 1.f - rd->guessScale;


More information about the x265-commits mailing list