Changeset 601 in SHVCSoftware for branches/SHM-5.0-dev/source/Lib/TLibEncoder
- Timestamp:
- 6 Feb 2014, 06:02:59 (11 years ago)
- Location:
- branches/SHM-5.0-dev/source/Lib/TLibEncoder
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h
r593 r601 100 100 101 101 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 102 #if SVC_EXTENSION 103 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 104 #else 102 105 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 106 #endif 103 107 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 104 108 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncEntropy.h
r593 r601 105 105 virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 106 106 virtual Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ) = 0; 107 #if SVC_EXTENSION 108 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 109 #else 107 110 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 111 #endif 108 112 virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; 109 113 … … 184 188 185 189 Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); 190 #if SVC_EXTENSION 191 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 192 #else 186 193 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 194 #endif 187 195 static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); 188 196 -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r593 r601 463 463 Int bitDepth = (compIdx== SAO_Y) ? g_bitDepthY : g_bitDepthC; 464 464 Int shift = 2 * DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 465 #if SVC_EXTENSION 466 Int offsetTh = getSaoMaxOffsetQVal()[compIdx]; //inclusive 467 #else 465 468 Int offsetTh = g_saoMaxOffsetQVal[compIdx]; //inclusive 469 #endif 466 470 467 471 ::memset(quantOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES); … … 582 586 modeParam[SAO_Y ].modeIdc = SAO_MODE_OFF; 583 587 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 584 591 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true); 592 #endif 585 593 m_pcRDGoOnSbacCoder->store(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 586 594 … … 590 598 modeParam[compIdx].modeIdc = SAO_MODE_OFF; 591 599 m_pcRDGoOnSbacCoder->resetBits(); 600 #if SVC_EXTENSION 601 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 602 #else 592 603 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx]); 604 #endif 593 605 modeDist[compIdx] = 0; 594 606 minCost= m_lambda[compIdx]*((Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits()); … … 613 625 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 614 626 m_pcRDGoOnSbacCoder->resetBits(); 627 #if SVC_EXTENSION 628 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 629 #else 615 630 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 631 #endif 616 632 rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 617 633 cost = (Double)dist[compIdx] + m_lambda[compIdx]*((Double)rate); … … 638 654 modeDist [component] = 0; 639 655 656 #if SVC_EXTENSION 657 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component], getSaoMaxOffsetQVal()); 658 #else 640 659 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component]); 660 #endif 641 661 642 662 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 672 692 dist[compIdx]= getDistortion(ctu, compIdx, typeIdc, testOffset[compIdx].typeAuxInfo, invQuantOffset, blkStats[ctu][compIdx][typeIdc]); 673 693 694 #if SVC_EXTENSION 695 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 696 #else 674 697 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 698 #endif 675 699 676 700 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 699 723 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 700 724 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 701 728 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 729 #endif 702 730 modeNormCost += (Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 703 731 … … 742 770 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 743 771 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 744 775 m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 776 #endif 745 777 Int rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 746 778 -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncSbac.cpp
r593 r601 1592 1592 } 1593 1593 1594 #if SVC_EXTENSION 1595 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal) 1596 #else 1594 1597 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled) 1598 #endif 1595 1599 { 1596 1600 UInt uiSymbol; … … 1639 1643 for(Int i=0; i< 4; i++) 1640 1644 { 1645 #if SVC_EXTENSION 1646 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1647 #else 1641 1648 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1649 #endif 1642 1650 } 1643 1651 … … 1669 1677 1670 1678 Void TEncSbac::codeSAOBlkParam(SAOBlkParam& saoBlkParam 1679 #if SVC_EXTENSION 1680 , UInt* saoMaxOffsetQVal 1681 #endif 1671 1682 , Bool* sliceEnabled 1672 1683 , Bool leftMergeAvail … … 1700 1711 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 1701 1712 { 1713 #if SVC_EXTENSION 1714 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx], saoMaxOffsetQVal); 1715 #else 1702 1716 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx]); 1717 #endif 1703 1718 } 1704 1719 } -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncSbac.h
r593 r601 104 104 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;}; 105 105 106 #if SVC_EXTENSION 107 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal); 108 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam 109 , UInt* saoMaxOffsetQVal 110 , Bool* sliceEnabled 111 , Bool leftMergeAvail 112 , Bool aboveMergeAvail 113 , Bool onlyEstMergeInfo = false 114 ); 115 #else 106 116 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled); 107 117 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam … … 111 121 , Bool onlyEstMergeInfo = false 112 122 ); 123 #endif 113 124 114 125 private: -
branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r593 r601 1356 1356 } 1357 1357 1358 #if SVC_EXTENSION 1359 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail); 1360 #else 1358 1361 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam,sliceEnabled, leftMergeAvail, aboveMergeAvail); 1362 #endif 1359 1363 } 1360 1364 }
Note: See TracChangeset for help on using the changeset viewer.