[x265] [PATCH] encoder: rename cuCoder to analysis for better clarity

Steve Borho steve at borho.org
Thu Sep 25 05:32:29 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1411593702 18000
#      Wed Sep 24 16:21:42 2014 -0500
# Node ID 87ac13088486f24625d80317fd9dbb4c6b1a27a8
# Parent  e47e127da779d23314a402fa74723b0e82a2c75d
encoder: rename cuCoder to analysis for better clarity

the data type of cuCoder changed from TEncCu to Analysis weeks ago

diff -r e47e127da779 -r 87ac13088486 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Sep 24 21:51:12 2014 -0500
+++ b/source/encoder/encoder.cpp	Wed Sep 24 16:21:42 2014 -0500
@@ -109,8 +109,8 @@
     m_threadLocalData = new ThreadLocalData[numLocalData];
     for (int i = 0; i < numLocalData; i++)
     {
-        m_threadLocalData[i].cuCoder.initSearch(m_param, m_scalingList);
-        m_threadLocalData[i].cuCoder.create(g_maxCUDepth + 1, g_maxCUSize);
+        m_threadLocalData[i].analysis.initSearch(m_param, m_scalingList);
+        m_threadLocalData[i].analysis.create(g_maxCUDepth + 1, g_maxCUSize);
     }
 
     for (int i = 0; i < m_param->frameNumThreads; i++)
@@ -627,7 +627,7 @@
         {
             for (int i = 0; i < poolThreadCount; i++)
             {
-                StatisticLog& enclog = m_threadLocalData[i].cuCoder.m_sliceTypeLog[sliceType];
+                StatisticLog& enclog = m_threadLocalData[i].analysis.m_sliceTypeLog[sliceType];
                 if (depth == 0)
                     finalLog.totalCu += enclog.totalCu;
                 finalLog.cntIntra[depth] += enclog.cntIntra[depth];
diff -r e47e127da779 -r 87ac13088486 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Wed Sep 24 21:51:12 2014 -0500
+++ b/source/encoder/frameencoder.cpp	Wed Sep 24 16:21:42 2014 -0500
@@ -467,7 +467,7 @@
             }
         }
 
-        m_tld->cuCoder.loadCTUData(cu);
+        m_tld->analysis.loadCTUData(cu);
         // final coding (bitstream generation) for this CU
         m_entropyCoder.encodeCTU(cu);
 
@@ -626,12 +626,12 @@
                                                     m_rows[0].rdEntropyCoders[0][CI_CURR_BEST];
     // setup thread-local data
     TComPicYuv* fenc = m_frame->getPicYuvOrg();
-    tld.cuCoder.m_quant.m_nr = m_nr;
-    tld.cuCoder.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
-    tld.cuCoder.m_log = &tld.cuCoder.m_sliceTypeLog[m_frame->m_picSym->m_slice->m_sliceType];
-    tld.cuCoder.m_rdEntropyCoders = curRow.rdEntropyCoders;
-    tld.cuCoder.m_entropyCoder = &curRow.entropyCoder;
-    tld.cuCoder.m_quant.m_entropyCoder = &curRow.entropyCoder;
+    tld.analysis.m_quant.m_nr = m_nr;
+    tld.analysis.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
+    tld.analysis.m_log = &tld.analysis.m_sliceTypeLog[m_frame->m_picSym->m_slice->m_sliceType];
+    tld.analysis.m_rdEntropyCoders = curRow.rdEntropyCoders;
+    tld.analysis.m_entropyCoder = &curRow.entropyCoder;
+    tld.analysis.m_quant.m_entropyCoder = &curRow.entropyCoder;
     setLambda(m_frame->m_picSym->m_slice->m_sliceQp, tld);
 
     int64_t startTime = x265_mdate();
@@ -687,9 +687,9 @@
             // load current best state from go-on entropy coder
             curRow.rdEntropyCoders[0][CI_CURR_BEST].load(rowCoder);
 
-        tld.cuCoder.loadCTUData(cu);
-        tld.cuCoder.m_quant.setQPforQuant(cu);
-        tld.cuCoder.compressCU(cu); // Does all the CU analysis
+        tld.analysis.loadCTUData(cu);
+        tld.analysis.m_quant.setQPforQuant(cu);
+        tld.analysis.compressCU(cu); // Does all the CU analysis
 
         /* advance top-level row coder to include the context of this CTU.
          * if SAO is disabled, rowCoder writes the final CTU bitstream */
@@ -713,12 +713,12 @@
             {
                 /* 1 << shift == number of 8x8 blocks at current depth */
                 int shift = 2 * (g_maxCUDepth - depth);
-                curRow.rowStats.iCuCnt += tld.cuCoder.m_log->qTreeIntraCnt[depth] << shift;
-                curRow.rowStats.pCuCnt += tld.cuCoder.m_log->qTreeInterCnt[depth] << shift;
-                curRow.rowStats.skipCuCnt += tld.cuCoder.m_log->qTreeSkipCnt[depth] << shift;
+                curRow.rowStats.iCuCnt += tld.analysis.m_log->qTreeIntraCnt[depth] << shift;
+                curRow.rowStats.pCuCnt += tld.analysis.m_log->qTreeInterCnt[depth] << shift;
+                curRow.rowStats.skipCuCnt += tld.analysis.m_log->qTreeSkipCnt[depth] << shift;
 
                 // clear the row cu data from thread local object
-                tld.cuCoder.m_log->qTreeIntraCnt[depth] = tld.cuCoder.m_log->qTreeInterCnt[depth] = tld.cuCoder.m_log->qTreeSkipCnt[depth] = 0;
+                tld.analysis.m_log->qTreeIntraCnt[depth] = tld.analysis.m_log->qTreeInterCnt[depth] = tld.analysis.m_log->qTreeSkipCnt[depth] = 0;
             }
         }
 
@@ -889,16 +889,16 @@
     int qpCr = Clip3(0, QP_MAX_MAX, qp + slice->m_pps->chromaCrQpOffset);
     qp = Clip3(0, QP_MAX_MAX, qp);
 
-    tld.cuCoder.m_me.setQP(qp);
-    tld.cuCoder.m_rdCost.setLambda(x265_lambda2_tab[qp], x265_lambda_tab[qp]);
+    tld.analysis.m_me.setQP(qp);
+    tld.analysis.m_rdCost.setLambda(x265_lambda2_tab[qp], x265_lambda_tab[qp]);
 
     int chroma_offset_idx = X265_MIN(qp - qpCb + 12, MAX_CHROMA_LAMBDA_OFFSET);
-    uint16_t lambdaOffset = tld.cuCoder.m_rdCost.m_psyRd ? x265_chroma_lambda2_offset_tab[chroma_offset_idx] : 256;
-    tld.cuCoder.m_rdCost.setCbDistortionWeight(lambdaOffset);
+    uint16_t lambdaOffset = tld.analysis.m_rdCost.m_psyRd ? x265_chroma_lambda2_offset_tab[chroma_offset_idx] : 256;
+    tld.analysis.m_rdCost.setCbDistortionWeight(lambdaOffset);
 
     chroma_offset_idx = X265_MIN(qp - qpCr + 12, MAX_CHROMA_LAMBDA_OFFSET);
-    lambdaOffset = tld.cuCoder.m_rdCost.m_psyRd ? x265_chroma_lambda2_offset_tab[chroma_offset_idx] : 256;
-    tld.cuCoder.m_rdCost.setCrDistortionWeight(lambdaOffset);
+    lambdaOffset = tld.analysis.m_rdCost.m_psyRd ? x265_chroma_lambda2_offset_tab[chroma_offset_idx] : 256;
+    tld.analysis.m_rdCost.setCrDistortionWeight(lambdaOffset);
 }
 
 /* DCT-domain noise reduction / adaptive deadzone from libavcodec */
diff -r e47e127da779 -r 87ac13088486 source/encoder/frameencoder.h
--- a/source/encoder/frameencoder.h	Wed Sep 24 21:51:12 2014 -0500
+++ b/source/encoder/frameencoder.h	Wed Sep 24 16:21:42 2014 -0500
@@ -47,13 +47,13 @@
 
 struct ThreadLocalData
 {
-    Analysis cuCoder;
+    Analysis analysis;
 
     // NOTE: the maximum LCU 64x64 have 256 4x4 partitions
     bool     edgeFilter[256];
     uint8_t  blockingStrength[256];
 
-    ~ThreadLocalData() { cuCoder.destroy(); }
+    ~ThreadLocalData() { analysis.destroy(); }
 };
 
 /* manages the state of encoding one row of CTU blocks.  When


More information about the x265-devel mailing list