[x265] [PATCH 3 of 3] Integrating new weight analysis in encoder

shazeb at multicorewareinc.com shazeb at multicorewareinc.com
Mon Dec 30 13:25:52 CET 2013


# HG changeset patch
# User Shazeb Nawaz Khan <shazeb at multicorewareinc.com>
# Date 1388406269 -19800
#      Mon Dec 30 17:54:29 2013 +0530
# Node ID 2fad5dbf6d370f3818844c1e4c630a0a25d56b48
# Parent  a172c7333c31488425ba2209fdf5cc6bd11b078e
Integrating new weight analysis in encoder

diff -r a172c7333c31 -r 2fad5dbf6d37 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Mon Dec 30 17:53:03 2013 +0530
+++ b/source/encoder/frameencoder.cpp	Mon Dec 30 17:54:29 2013 +0530
@@ -31,6 +31,8 @@
 #include "frameencoder.h"
 #include "cturow.h"
 #include "common.h"
+#include "slicetype.h"
+#include "weightPrediction.h"
 
 #include <math.h>
 
@@ -268,6 +270,7 @@
     {
         m_rows[i].m_cuCoder.m_log = &m_rows[i].m_cuCoder.m_sliceTypeLog[sliceType];
     }
+
 #endif
     if (slice->getPPS()->getDeblockingFilterControlPresentFlag())
     {
@@ -389,7 +392,7 @@
 
     m_frameFilter.m_sao.lumaLambda = lambda;
     m_frameFilter.m_sao.chromaLambda = chromaLambda;
-    
+
     switch (slice->getSliceType())
     {
     case I_SLICE:
@@ -402,8 +405,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);
@@ -460,11 +464,9 @@
         //------------------------------------------------------------------------------
         //  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
@@ -474,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++;
@@ -1055,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 a172c7333c31 -r 2fad5dbf6d37 source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h	Mon Dec 30 17:53:03 2013 +0530
+++ b/source/encoder/frameencoder.h	Mon Dec 30 17:54:29 2013 +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