[x265] [PATCH 2 of 2] Re-enabling new weightp

shazeb at multicorewareinc.com shazeb at multicorewareinc.com
Thu Jan 9 14:31:00 CET 2014


# HG changeset patch
# User Shazeb Nawaz Khan <shazeb at multicorewareinc.com>
# Date 1389274162 -19800
#      Thu Jan 09 18:59:22 2014 +0530
# Branch stable
# Node ID dc4d32171152964aa0c16df28c0dbc60fed95ee5
# Parent  dee13ce46375aded150ec7a6746643d14e7a3416
Re-enabling new weightp

diff -r dee13ce46375 -r dc4d32171152 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Thu Jan 09 17:48:13 2014 +0530
+++ b/source/encoder/frameencoder.cpp	Thu Jan 09 18:59:22 2014 +0530
@@ -31,7 +31,8 @@
 #include "frameencoder.h"
 #include "cturow.h"
 #include "common.h"
-
+#include "slicetype.h"
+#include "weightPrediction.h"
 #include <math.h>
 
 using namespace x265;
@@ -268,6 +269,7 @@
     {
         m_rows[i].m_cuCoder.m_log = &m_rows[i].m_cuCoder.m_sliceTypeLog[sliceType];
     }
+
 #endif
     if (slice->getPPS()->getDeblockingFilterControlPresentFlag())
     {
@@ -391,7 +393,7 @@
 
     m_frameFilter.m_sao.lumaLambda = lambda;
     m_frameFilter.m_sao.chromaLambda = chromaLambda;
-    
+
     switch (slice->getSliceType())
     {
     case I_SLICE:
@@ -404,8 +406,9 @@
         m_frameFilter.m_sao.depth = 2 + !slice->isReferenced();
         break;
     }
+
     /* Clip qps back to 0-51 range before encoding */
-    if(qp > MAX_QP)
+    if (qp > MAX_QP)
     {
         qp = MAX_QP;
         slice->setSliceQp(qp);
@@ -462,11 +465,8 @@
         //------------------------------------------------------------------------------
         //  Weighted Prediction implemented at Slice level. SliceMode=2 is not supported yet.
         //------------------------------------------------------------------------------
-        m_wp.xEstimateWPParamSlice(slice);
-        slice->initWpScaling();
-
-        // check WP on/off
-        m_wp.xCheckWPEnable(slice);
+        WeightPrediction wp(slice);
+        wp.weightAnalyseEnc();
     }
 
     // Generate motion references
@@ -476,7 +476,7 @@
         for (int ref = 0; ref < slice->getNumRefIdx(l); ref++)
         {
             wpScalingParam *w = NULL;
-            if ((slice->isInterP() && slice->getPPS()->getUseWP() && slice->m_weightPredTable[l][ref]->bPresentFlag))
+            if ((slice->isInterP() && slice->getPPS()->getUseWP() && slice->m_weightPredTable[l][ref][0].bPresentFlag))
             {
                 w = slice->m_weightPredTable[l][ref];
                 slice->m_numWPRefs++;
@@ -1057,7 +1057,6 @@
             if (qp > MAX_QP)
                 qp = MAX_QP;
             cu->setQP(0, (char)qp);
-
         }
         codeRow.processCU(cu, m_pic->getSlice(), bufSbac, m_cfg->param.bEnableWavefront && col == 1);
 
diff -r dee13ce46375 -r dc4d32171152 source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h	Thu Jan 09 17:48:13 2014 +0530
+++ b/source/encoder/frameencoder.h	Thu Jan 09 18:59:22 2014 +0530
@@ -48,6 +48,7 @@
 
 class ThreadPool;
 class Encoder;
+class WeightPrediction;
 
 // Manages the wave-front processing of a single encoding frame
 class FrameEncoder : public WaveFront, public Thread


More information about the x265-devel mailing list