Changeset 677 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibDecoder
- Timestamp:
- 15 Apr 2014, 05:23:37 (11 years ago)
- Location:
- branches/SHM-6-dev/source/Lib/TLibDecoder
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r674 r677 39 39 #include "SEIread.h" 40 40 #include "TDecSlice.h" 41 #if Q0048_CGS_3D_ASYMLUT 42 #include "../TLibCommon/TCom3DAsymLUT.h" 43 #endif 41 44 42 45 //! \ingroup TLibDecoder … … 175 178 } 176 179 177 Void TDecCavlc::parsePPS(TComPPS* pcPPS) 180 Void TDecCavlc::parsePPS(TComPPS* pcPPS 181 #if Q0048_CGS_3D_ASYMLUT 182 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 183 #endif 184 ) 178 185 { 179 186 #if ENC_DEC_TRACE … … 348 355 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 349 356 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 357 #if Q0048_CGS_3D_ASYMLUT 358 READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); 359 pcPPS->setCGSFlag( uiCode ); 360 if( pcPPS->getCGSFlag() == Q0048_CGS_3D_ASYMLUT_PPSUPDATE ) 361 { 362 xParse3DAsymLUT( pc3DAsymLUT ); 363 pcPPS->setCGSOutputBitDepthY( pc3DAsymLUT->getOutputBitDepthY() ); 364 pcPPS->setCGSOutputBitDepthC( pc3DAsymLUT->getOutputBitDepthC() ); 365 } 366 #endif 350 367 #endif 351 368 } … … 3720 3737 } 3721 3738 3739 #if Q0048_CGS_3D_ASYMLUT 3740 Void TDecCavlc::xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ) 3741 { 3742 UInt uiCurOctantDepth , uiCurPartNumLog2 , uiInputBitDepthM8 , uiOutputBitDepthM8 , uiResQaunBit; 3743 READ_CODE( 2 , uiCurOctantDepth , "cm_octant_depth" ); 3744 READ_CODE( 2 , uiCurPartNumLog2 , "cm_y_part_num_log2" ); 3745 READ_CODE( 3 , uiInputBitDepthM8 , "cm_input_bit_depth_minus8" ); 3746 Int iInputBitDepthCDelta; 3747 READ_SVLC(iInputBitDepthCDelta, "cm_input_bit_depth_chroma delta"); 3748 READ_CODE( 3 , uiOutputBitDepthM8 , "cm_output_bit_depth_minus8" ); 3749 Int iOutputBitDepthCDelta; 3750 READ_SVLC(iOutputBitDepthCDelta, "cm_output_bit_depth_chroma_delta"); 3751 READ_CODE( 2 , uiResQaunBit , "cm_res_quant_bit" ); 3752 pc3DAsymLUT->destroy(); 3753 pc3DAsymLUT->create( uiCurOctantDepth , uiInputBitDepthM8 + 8 , uiInputBitDepthM8 + 8 + iInputBitDepthCDelta, uiOutputBitDepthM8 + 8 , uiOutputBitDepthM8 + 8 + iOutputBitDepthCDelta ,uiCurPartNumLog2 ); 3754 pc3DAsymLUT->setResQuantBit( uiResQaunBit ); 3755 3756 xParse3DAsymLUTOctant( pc3DAsymLUT , 0 , 0 , 0 , 0 , 1 << pc3DAsymLUT->getCurOctantDepth() ); 3757 } 3758 3759 Void TDecCavlc::xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ) 3760 { 3761 UInt uiOctantSplit = nDepth < pc3DAsymLUT->getCurOctantDepth(); 3762 if( nDepth < pc3DAsymLUT->getCurOctantDepth() ) 3763 READ_FLAG( uiOctantSplit , "split_octant_flag" ); 3764 Int nYPartNum = 1 << pc3DAsymLUT->getCurYPartNumLog2(); 3765 if( uiOctantSplit ) 3766 { 3767 Int nHalfLength = nLength >> 1; 3768 for( Int l = 0 ; l < 2 ; l++ ) 3769 { 3770 for( Int m = 0 ; m < 2 ; m++ ) 3771 { 3772 for( Int n = 0 ; n < 2 ; n++ ) 3773 { 3774 xParse3DAsymLUTOctant( pc3DAsymLUT , nDepth + 1 , yIdx + l * nHalfLength * nYPartNum , uIdx + m * nHalfLength , vIdx + n * nHalfLength , nHalfLength ); 3775 } 3776 } 3777 } 3778 } 3779 else 3780 { 3781 for( Int l = 0 ; l < nYPartNum ; l++ ) 3782 { 3783 for( Int nVertexIdx = 0 ; nVertexIdx < 4 ; nVertexIdx++ ) 3784 { 3785 UInt uiCodeVertex = 0; 3786 Int deltaY = 0 , deltaU = 0 , deltaV = 0; 3787 READ_FLAG( uiCodeVertex , "coded_vertex_flag" ); 3788 if( uiCodeVertex ) 3789 { 3790 READ_SVLC( deltaY , "resY" ); 3791 READ_SVLC( deltaU , "resU" ); 3792 READ_SVLC( deltaV , "resV" ); 3793 } 3794 pc3DAsymLUT->setCuboidVertexResTree( yIdx + l , uIdx , vIdx , nVertexIdx , deltaY , deltaU , deltaV ); 3795 } 3796 } 3797 } 3798 } 3799 #endif 3722 3800 //! \} 3723 3801 -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r672 r677 46 46 #include "SyntaxElementParser.h" 47 47 48 #if Q0048_CGS_3D_ASYMLUT 49 class TCom3DAsymLUT; 50 #endif 48 51 //! \ingroup TLibDecoder 49 52 //! \{ … … 97 100 Void parseSPS ( TComSPS* pcSPS ); 98 101 #endif //SVC_EXTENSION 99 Void parsePPS ( TComPPS* pcPPS); 102 Void parsePPS ( TComPPS* pcPPS 103 #if Q0048_CGS_3D_ASYMLUT 104 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 105 #endif 106 ); 100 107 Void parseVUI ( TComVUI* pcVUI, TComSPS* pcSPS ); 101 108 Void parseSEI ( SEIMessages& ); … … 137 144 protected: 138 145 Bool xMoreRbspData(); 146 147 #if Q0048_CGS_3D_ASYMLUT 148 Void xParse3DAsymLUT( TCom3DAsymLUT * pc3DAsymLUT ); 149 Void xParse3DAsymLUTOctant( TCom3DAsymLUT * pc3DAsymLUT , Int nDepth , Int yIdx , Int uIdx , Int vIdx , Int nLength ); 150 #endif 139 151 }; 140 152 -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecEntropy.h
r644 r677 49 49 class TDecCavlc; 50 50 class ParameterSetManagerDecoder; 51 #if Q0048_CGS_3D_ASYMLUT 52 class TCom3DAsymLUT; 53 #endif 51 54 52 55 //! \ingroup TLibDecoder … … 71 74 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 72 75 #endif 73 virtual Void parsePPS ( TComPPS* pcPPS ) = 0; 76 virtual Void parsePPS ( TComPPS* pcPPS 77 #if Q0048_CGS_3D_ASYMLUT 78 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 79 #endif 80 ) = 0; 74 81 75 82 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) = 0; … … 138 145 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 139 146 #endif 140 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 147 Void decodePPS ( TComPPS* pcPPS 148 #if Q0048_CGS_3D_ASYMLUT 149 , TCom3DAsymLUT * pc3DAsymLUT , Int nLayerID 150 #endif 151 ) { m_pcEntropyDecoderIf->parsePPS(pcPPS 152 #if Q0048_CGS_3D_ASYMLUT 153 , pc3DAsymLUT , nLayerID 154 #endif 155 ); } 141 156 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager); } 142 157 -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecSbac.h
r644 r677 81 81 Void parseSPS ( TComSPS* /*pcSPS*/ ) {} 82 82 #endif 83 Void parsePPS ( TComPPS* /*pcPPS*/ ) {} 83 Void parsePPS ( TComPPS* /*pcPPS*/ 84 #if Q0048_CGS_3D_ASYMLUT 85 , TCom3DAsymLUT * /*pc3DAsymLUT*/ , Int /*nLayerID*/ 86 #endif 87 ) {} 84 88 85 89 Void parseSliceHeader ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {} -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp
r669 r677 93 93 m_subDpbIdx = -1; 94 94 #endif 95 #if Q0048_CGS_3D_ASYMLUT 96 m_pColorMappedPic = NULL; 97 #endif 95 98 } 96 99 … … 99 102 #if ENC_DEC_TRACE 100 103 fclose( g_hTrace ); 104 #endif 105 #if Q0048_CGS_3D_ASYMLUT 106 if(m_pColorMappedPic) 107 { 108 m_pColorMappedPic->destroy(); 109 delete m_pColorMappedPic; 110 m_pColorMappedPic = NULL; 111 } 101 112 #endif 102 113 } … … 357 368 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 358 369 359 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths ) 370 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths 371 #if Q0048_CGS_3D_ASYMLUT 372 || pcSlice->getPPS()->getCGSFlag() > 0 373 #endif 374 ) 360 375 #else 361 376 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) … … 1533 1548 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1534 1549 1550 #if Q0048_CGS_3D_ASYMLUT 1551 TComPicYuv* pBaseColRec = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 1552 if( pcSlice->getPPS()->getCGSFlag() != Q0048_CGS_3D_ASYMLUT_OFF ) 1553 { 1554 if(!m_pColorMappedPic) 1555 initAsymLut(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)); 1556 m_c3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pColorMappedPic ); 1557 pBaseColRec = m_pColorMappedPic; 1558 } 1559 #endif 1535 1560 #if SVC_UPSAMPLING 1536 1561 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) … … 1543 1568 #if O0215_PHASE_ALIGNMENT 1544 1569 #if O0194_JOINT_US_BITSHIFT 1570 #if Q0048_CGS_3D_ASYMLUT 1571 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1572 #else 1545 1573 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1574 #endif 1575 #else 1576 #if Q0048_CGS_3D_ASYMLUT 1577 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1546 1578 #else 1547 1579 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1548 1580 #endif 1581 #endif 1549 1582 #else 1550 1583 #if O0194_JOINT_US_BITSHIFT 1584 #if Q0048_CGS_3D_ASYMLUT 1585 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1586 #else 1551 1587 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1588 #endif 1589 #else 1590 #if Q0048_CGS_3D_ASYMLUT 1591 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1552 1592 #else 1553 1593 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1594 #endif 1554 1595 #endif 1555 1596 #endif … … 1763 1804 } 1764 1805 1765 Void TDecTop::xDecodePPS() 1806 Void TDecTop::xDecodePPS( 1807 #if Q0048_CGS_3D_ASYMLUT 1808 TCom3DAsymLUT * pc3DAsymLUT 1809 #endif 1810 ) 1766 1811 { 1767 1812 TComPPS* pps = new TComPPS(); … … 1771 1816 #endif 1772 1817 1773 m_cEntropyDecoder.decodePPS( pps ); 1818 m_cEntropyDecoder.decodePPS( pps 1819 #if Q0048_CGS_3D_ASYMLUT 1820 , pc3DAsymLUT , m_layerId 1821 #endif 1822 ); 1774 1823 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1775 1824 … … 1949 1998 1950 1999 case NAL_UNIT_PPS: 1951 xDecodePPS(); 2000 xDecodePPS( 2001 #if Q0048_CGS_3D_ASYMLUT 2002 &m_c3DAsymLUTPPS 2003 #endif 2004 ); 1952 2005 return false; 1953 2006 … … 2313 2366 } 2314 2367 #endif 2368 2369 #if Q0048_CGS_3D_ASYMLUT 2370 Void TDecTop::initAsymLut(TComSlice *pcSlice) 2371 { 2372 if(m_layerId>0) 2373 { 2374 if(!m_pColorMappedPic) 2375 { 2376 Int picWidth = pcSlice->getPicWidthInLumaSamples(); 2377 Int picHeight = pcSlice->getPicHeightInLumaSamples(); 2378 m_pColorMappedPic = new TComPicYuv; 2379 m_pColorMappedPic->create( picWidth, picHeight, pcSlice->getChromaFormatIdc()/*CHROMA_420*/, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 2380 } 2381 } 2382 } 2383 #endif 2315 2384 #endif //SVC_EXTENSION 2316 2385 //! \} -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.h
r669 r677 45 45 #include "TLibCommon/TComTrQuant.h" 46 46 #include "TLibCommon/SEI.h" 47 #if Q0048_CGS_3D_ASYMLUT 48 #include "TLibCommon/TCom3DAsymLUT.h" 49 #endif 47 50 48 51 #include "TDecGop.h" … … 79 82 // functional classes 80 83 TComPrediction m_cPrediction; 84 #if Q0048_CGS_3D_ASYMLUT 85 TCom3DAsymLUT m_c3DAsymLUTPPS; 86 TComPicYuv* m_pColorMappedPic; 87 #endif 81 88 TComTrQuant m_cTrQuant; 82 89 TDecGop m_cGopDecoder; … … 268 275 Void xDecodeVPS(); 269 276 Void xDecodeSPS(); 270 Void xDecodePPS(); 277 Void xDecodePPS( 278 #if Q0048_CGS_3D_ASYMLUT 279 TCom3DAsymLUT * pc3DAsymLUT 280 #endif 281 ); 271 282 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); 272 283 … … 279 290 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 280 291 #endif 292 #if Q0048_CGS_3D_ASYMLUT 293 Void initAsymLut(TComSlice *pcSlice); 294 #endif 281 295 };// END CLASS DEFINITION TDecTop 282 296
Note: See TracChangeset for help on using the changeset viewer.