[x265] [PATCH 6 of 7] replace g_maxSlices with maxSlices of param

kavitha at multicorewareinc.com kavitha at multicorewareinc.com
Wed Jun 21 08:44:56 CEST 2017


# HG changeset patch
# User Kavitha Sampath <kavitha at multicorewareinc.com>
# Date 1497268495 -19800
#      Mon Jun 12 17:24:55 2017 +0530
# Node ID 5d640864e3aee0a5e091fa1d1df377e620f7d1ce
# Parent  4b3d1a1f4838ee86cc9528643b6abb1f31670ada
replace g_maxSlices with maxSlices of param

diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/dpb.cpp
--- a/source/encoder/dpb.cpp	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/dpb.cpp	Mon Jun 12 17:24:55 2017 +0530
@@ -204,7 +204,7 @@
     }
 
     // Disable Loopfilter in bound area, because we will do slice-parallelism in future
-    slice->m_sLFaseFlag = (g_maxSlices > 1) ? false : ((SLFASE_CONSTANT & (1 << (pocCurr % 31))) > 0);
+    slice->m_sLFaseFlag = (newFrame->m_param->maxSlices > 1) ? false : ((SLFASE_CONSTANT & (1 << (pocCurr % 31))) > 0);
 
     /* Increment reference count of all motion-referenced frames to prevent them
      * from being recycled. These counts are decremented at the end of
diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/entropy.cpp	Mon Jun 12 17:24:55 2017 +0530
@@ -700,7 +700,7 @@
     // TODO: Enable when pps_loop_filter_across_slices_enabled_flag==1
     //       We didn't support filter across slice board, so disable it now
 
-    if (g_maxSlices <= 1)
+    if (encData.m_param->maxSlices <= 1)
     {
         bool isSAOEnabled = slice.m_sps->bUseSAO ? saoParam->bSaoFlag[0] || saoParam->bSaoFlag[1] : false;
         bool isDBFEnabled = !slice.m_pps->bPicDisableDeblockingFilter;
diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/motion.cpp
--- a/source/encoder/motion.cpp	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/motion.cpp	Mon Jun 12 17:24:55 2017 +0530
@@ -739,6 +739,7 @@
                                    const MV *       mvc,
                                    int              merange,
                                    MV &             outQMv,
+                                   uint32_t         maxSlices,
                                    pixel *          srcReferencePlane)
 {
     ALIGN_VAR_16(int, costs[16]);
@@ -1439,7 +1440,7 @@
     const SubpelWorkload& wl = workload[this->subpelRefine];
 
     // check mv range for slice bound
-    if ((g_maxSlices > 1) & ((bmv.y < qmvmin.y) | (bmv.y > qmvmax.y)))
+    if ((maxSlices > 1) & ((bmv.y < qmvmin.y) | (bmv.y > qmvmax.y)))
     {
         bmv.y = x265_min(x265_max(bmv.y, qmvmin.y), qmvmax.y);
         bcost = subpelCompare(ref, bmv, satd) + mvcost(bmv);
diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/motion.h
--- a/source/encoder/motion.h	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/motion.h	Mon Jun 12 17:24:55 2017 +0530
@@ -93,7 +93,7 @@
     }
 
     void refineMV(ReferencePlanes* ref, const MV& mvmin, const MV& mvmax, const MV& qmvp, MV& outQMv);
-    int motionEstimate(ReferencePlanes* ref, const MV & mvmin, const MV & mvmax, const MV & qmvp, int numCandidates, const MV * mvc, int merange, MV & outQMv, pixel *srcReferencePlane = 0);
+    int motionEstimate(ReferencePlanes* ref, const MV & mvmin, const MV & mvmax, const MV & qmvp, int numCandidates, const MV * mvc, int merange, MV & outQMv, uint32_t maxSlices, pixel *srcReferencePlane = 0);
 
     int subpelCompare(ReferencePlanes* ref, const MV &qmv, pixelcmp_t);
 
diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/search.cpp
--- a/source/encoder/search.cpp	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/search.cpp	Mon Jun 12 17:24:55 2017 +0530
@@ -2082,7 +2082,7 @@
 
     setSearchRange(interMode.cu, mvp, m_param->searchRange, mvmin, mvmax);
 
-    int satdCost = m_me.motionEstimate(&m_slice->m_mref[list][ref], mvmin, mvmax, mvp, numMvc, mvc, m_param->searchRange, outmv, 
+    int satdCost = m_me.motionEstimate(&m_slice->m_mref[list][ref], mvmin, mvmax, mvp, numMvc, mvc, m_param->searchRange, outmv, m_param->maxSlices, 
       m_param->bSourceReferenceEstimation ? m_slice->m_refFrameList[list][ref]->m_fencPic->getLumaAddr(0) : 0);
 
     /* Get total cost of partition, but only include MV bit cost once */
@@ -2191,7 +2191,7 @@
                 if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead && mvpIdx == bestME[list].mvpIdx)
                     mvpIn = bestME[list].mv;
                     
-                int satdCost = m_me.motionEstimate(&slice->m_mref[list][ref], mvmin, mvmax, mvpIn, numMvc, mvc, m_param->searchRange, outmv,
+                int satdCost = m_me.motionEstimate(&slice->m_mref[list][ref], mvmin, mvmax, mvpIn, numMvc, mvc, m_param->searchRange, outmv, m_param->maxSlices, 
                   m_param->bSourceReferenceEstimation ? m_slice->m_refFrameList[list][ref]->m_fencPic->getLumaAddr(0) : 0);
 
                 /* Get total cost of partition, but only include MV bit cost once */
@@ -2311,7 +2311,7 @@
                             m_me.integral[planes] = interMode.fencYuv->m_integral[list][ref][planes] + puX * pu.width + puY * pu.height * m_slice->m_refFrameList[list][ref]->m_reconPic->m_stride;
                     }
                     setSearchRange(cu, mvp, m_param->searchRange, mvmin, mvmax);
-                    int satdCost = m_me.motionEstimate(&slice->m_mref[list][ref], mvmin, mvmax, mvp, numMvc, mvc, m_param->searchRange, outmv, 
+                    int satdCost = m_me.motionEstimate(&slice->m_mref[list][ref], mvmin, mvmax, mvp, numMvc, mvc, m_param->searchRange, outmv, m_param->maxSlices, 
                       m_param->bSourceReferenceEstimation ? m_slice->m_refFrameList[list][ref]->m_fencPic->getLumaAddr(0) : 0);
 
                     /* Get total cost of partition, but only include MV bit cost once */
diff -r 4b3d1a1f4838 -r 5d640864e3ae source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Tue May 30 12:24:38 2017 +0530
+++ b/source/encoder/slicetype.cpp	Mon Jun 12 17:24:55 2017 +0530
@@ -2407,7 +2407,7 @@
 
         /* ME will never return a cost larger than the cost @MVP, so we do not
          * have to check that ME cost is more than the estimated merge cost */
-        fencCost = tld.me.motionEstimate(fref, mvmin, mvmax, mvp, 0, NULL, s_merange, *fencMV);
+        fencCost = tld.me.motionEstimate(fref, mvmin, mvmax, mvp, 0, NULL, s_merange, *fencMV, m_lookahead.m_param->maxSlices);
         if (skipCost < 64 && skipCost < fencCost && bBidir)
         {
             fencCost = skipCost;


More information about the x265-devel mailing list