Ignore:
Timestamp:
25 Mar 2014, 21:51:30 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.1-dev branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r595 r644  
    463463  Int bitDepth = (compIdx== SAO_Y) ? g_bitDepthY : g_bitDepthC;
    464464  Int shift = 2 * DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8);
     465#if SVC_EXTENSION
     466  Int offsetTh = getSaoMaxOffsetQVal()[compIdx];  //inclusive
     467#else
    465468  Int offsetTh = g_saoMaxOffsetQVal[compIdx];  //inclusive
     469#endif
    466470
    467471  ::memset(quantOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES);
     
    582586  modeParam[SAO_Y ].modeIdc = SAO_MODE_OFF;
    583587  m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
     588#if SVC_EXTENSION
     589  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true);
     590#else
    584591  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true);
     592#endif
    585593  m_pcRDGoOnSbacCoder->store(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]);
    586594
     
    590598  modeParam[compIdx].modeIdc = SAO_MODE_OFF;
    591599  m_pcRDGoOnSbacCoder->resetBits();
     600#if SVC_EXTENSION
     601  m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     602#else
    592603  m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx]);
     604#endif
    593605  modeDist[compIdx] = 0;
    594606  minCost= m_lambda[compIdx]*((Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits());
     
    613625      m_pcRDGoOnSbacCoder->load(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]);
    614626      m_pcRDGoOnSbacCoder->resetBits();
     627#if SVC_EXTENSION
     628      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     629#else
    615630      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]);
     631#endif
    616632      rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    617633      cost = (Double)dist[compIdx] + m_lambda[compIdx]*((Double)rate);
     
    638654    modeDist [component] = 0;
    639655
     656#if SVC_EXTENSION
     657    m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component], getSaoMaxOffsetQVal());
     658#else
    640659    m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component]);
     660#endif
    641661
    642662    const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
     
    672692      dist[compIdx]= getDistortion(ctu, compIdx, typeIdc, testOffset[compIdx].typeAuxInfo, invQuantOffset, blkStats[ctu][compIdx][typeIdc]);
    673693
     694#if SVC_EXTENSION
     695      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal());
     696#else
    674697      m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]);
     698#endif
    675699
    676700      const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
     
    699723  m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
    700724  m_pcRDGoOnSbacCoder->resetBits();
     725#if SVC_EXTENSION
     726  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     727#else
    701728  m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     729#endif
    702730  modeNormCost += (Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    703731
     
    742770    m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]);
    743771    m_pcRDGoOnSbacCoder->resetBits();
     772#if SVC_EXTENSION
     773    m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     774#else
    744775    m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false);
     776#endif
    745777    Int rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits();
    746778
Note: See TracChangeset for help on using the changeset viewer.