Ticket #30: rm_useless_ctx_copy.patch

File rm_useless_ctx_copy.patch, 3.9 KB (added by tpoirier, 8 years ago)
  • Lib/TLibCommon/TypeDef.h

     
    4747//! \ingroup TLibCommon
    4848//! \{
    4949
     50#define RM_USELESS_CTX_COPY 1
     51
    5052///////////////////////////////////////////////////////////
    5153// KTA tools section start
    5254///////////////////////////////////////////////////////////
  • Lib/TLibEncoder/TEncCu.cpp

     
    23122312        }
    23132313      }
    23142314#endif
     2315#if !RM_USELESS_CTX_COPY
    23152316      m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWidthIdx][uiHeightIdx][CI_TEMP_BEST]);
     2317#endif
    23162318
    23172319      if (rpcBestCU->getTotalCost()!=MAX_DOUBLE)
    23182320      {
     
    24682470        }
    24692471      }
    24702472#endif
     2473#if !RM_USELESS_CTX_COPY
    24712474      m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWidthIdx][uiHeightIdx][CI_TEMP_BEST]);
     2475#endif
    24722476
    24732477      if (rpcBestCU->getTotalCost()!=MAX_DOUBLE)
    24742478      {
     
    27422746        }
    27432747      }
    27442748
     2749#if !RM_USELESS_CTX_COPY
    27452750#if JVET_C0024_QTBT
    27462751        m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWidthIdx][uiHeightIdx][CI_TEMP_BEST]);
    27472752#else
    27482753      m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    27492754#endif
     2755#endif
    27502756
    27512757      // If the configuration being tested exceeds the maximum number of bytes for a slice / slice-segment, then
    27522758      // a proper RD evaluation cannot be performed. Therefore, termination of the
     
    43754381  setCodeChromaQpAdjFlag( codeChromaQpAdjFlag );
    43764382  setdQPFlag( bCodeDQP );
    43774383
     4384#if !RM_USELESS_CTX_COPY
    43784385#if JVET_C0024_QTBT
    43794386  m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_TEMP_BEST]);
    43804387#else
    43814388  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    43824389#endif
     4390#endif
    43834391
    43844392  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
    43854393  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     
    44794487#endif
    44804488  m_pcEntropyCoder->encodeIPCMInfo ( rpcTempCU, 0, true );
    44814489
     4490#if !RM_USELESS_CTX_COPY
    44824491#if JVET_C0024_QTBT
    44834492  m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_TEMP_BEST]);
    44844493#else
    44854494  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    44864495#endif
     4496#endif
    44874497
    44884498  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
    44894499  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     
    45474557    pcCU  = NULL;
    45484558
    45494559    // store temp best CI for next CU coding
     4560#if RM_USELESS_CTX_COPY
    45504561#if JVET_C0024_QTBT
     4562    m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_NEXT_BEST]);
     4563#else
     4564    m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]);
     4565#endif
     4566#else
     4567#if JVET_C0024_QTBT
    45514568    m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_TEMP_BEST]->store(m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_NEXT_BEST]);
    45524569#else
    45534570    m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]->store(m_pppcRDSbacCoder[uiDepth][CI_NEXT_BEST]);
    45544571#endif
     4572#endif
    45554573
    45564574
    45574575#if DEBUG_STRING
  • Lib/TLibEncoder/TEncSearch.cpp

     
    81288128    pcCU->getTotalDistortion() = distortion;
    81298129    pcCU->getTotalCost()       = m_pcRdCost->calcRdCost( uiBits, distortion );
    81308130
     8131#if !RM_USELESS_CTX_COPY
    81318132#if JVET_C0024_QTBT
    81328133    m_pcRDGoOnSbacCoder->store(m_ppppcRDSbacCoder[uiWIdx][uiHIdx][CI_TEMP_BEST]);
    81338134#else
    81348135    m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_TEMP_BEST]);
    81358136#endif
     8137#endif
    81368138
    81378139#if DEBUG_STRING
    81388140    pcYuvResiBest->clear(); // Clear the residual image, if we didn't code it.