[x265] [PATCH] no-rdo: Include intra mode for B frames

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Mon Nov 4 12:35:40 CET 2013


# HG changeset patch
# User Sumalatha Polureddy
# Date 1383564929 -19800
# Node ID 3c283ec979001c29e8ed1c7aa158a7b45439a0ef
# Parent  37903c6fd1f90ec6bd166a116254d7cf29d4c90c
no-rdo: Include intra mode for B frames

Included the intra mode calculation for B frames

diff -r 37903c6fd1f9 -r 3c283ec97900 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Mon Nov 04 12:09:06 2013 +0530
+++ b/source/encoder/compress.cpp	Mon Nov 04 17:05:29 2013 +0530
@@ -494,28 +494,25 @@
                 m_bestMergeRecoYuv[depth] = tempYuv;
             }
 
-            /* Check for Intra in inter frames only if its a P-slice*/
-            if (outBestCU->getSlice()->getSliceType() == P_SLICE)
+            /* Check for Intra in inter frames only if its a P-slice/B-slice*/
+            /*compute intra cost */
+            if (outBestCU->getCbf(0, TEXT_LUMA) != 0 ||
+                outBestCU->getCbf(0, TEXT_CHROMA_U) != 0 ||
+                outBestCU->getCbf(0, TEXT_CHROMA_V) != 0)
             {
-                /*compute intra cost */
-                if (outBestCU->getCbf(0, TEXT_LUMA) != 0 ||
-                    outBestCU->getCbf(0, TEXT_CHROMA_U) != 0 ||
-                    outBestCU->getCbf(0, TEXT_CHROMA_V) != 0)
+                xComputeCostIntraInInter(m_intraInInterCU[depth], SIZE_2Nx2N);
+                xEncodeIntraInInter(m_intraInInterCU[depth], m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth],  m_tmpRecoYuv[depth]);
+
+                if (m_intraInInterCU[depth]->m_totalCost < outBestCU->m_totalCost)
                 {
-                    xComputeCostIntraInInter(m_intraInInterCU[depth], SIZE_2Nx2N);
-                    xEncodeIntraInInter(m_intraInInterCU[depth], m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth],  m_tmpRecoYuv[depth]);
+                    outBestCU = m_intraInInterCU[depth];
+                    tempYuv = m_modePredYuv[5][depth];
+                    m_modePredYuv[5][depth] = m_bestPredYuv[depth];
+                    m_bestPredYuv[depth] = tempYuv;
 
-                    if (m_intraInInterCU[depth]->m_totalCost < outBestCU->m_totalCost)
-                    {
-                        outBestCU = m_intraInInterCU[depth];
-                        tempYuv = m_modePredYuv[5][depth];
-                        m_modePredYuv[5][depth] = m_bestPredYuv[depth];
-                        m_bestPredYuv[depth] = tempYuv;
-
-                        TComYuv* tmpPic = m_bestRecoYuv[depth];
-                        m_bestRecoYuv[depth] = m_tmpRecoYuv[depth];
-                        m_tmpRecoYuv[depth] = tmpPic;
-                    }
+                    TComYuv* tmpPic = m_bestRecoYuv[depth];
+                    m_bestRecoYuv[depth] = m_tmpRecoYuv[depth];
+                    m_tmpRecoYuv[depth] = tmpPic;
                 }
             }
         }


More information about the x265-devel mailing list