Changeset 41 in 3DVCSoftware for branches/0.3-poznan-univ/source/Lib/TLibDecoder
- Timestamp:
- 26 Mar 2012, 09:03:21 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/Lib/TLibDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
r28 r41 238 238 #endif 239 239 #if POZNAN_DBMP 240 xReadFlag( uiCode ); 241 pcSPS->setDBMP ( uiCode ); 240 xReadFlag( uiCode ); pcSPS->setDBMP ( uiCode ); 242 241 #endif 243 242 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 244 xReadFlag( uiCode ); 245 pcSPS->setUseCUSkip ( uiCode ); 243 xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode ); 246 244 #endif 247 245 xReadFlag( uiCode ); // SPS base view flag … … 279 277 #endif 280 278 #if POZNAN_NONLINEAR_DEPTH 281 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 282 uiCode = 0; 283 xReadCode(8, uiCode); 284 pcSPS->setDepthPower(dequantizeDepthPower(uiCode)); 285 #else 286 uiCode = 0; 287 xReadCode(sizeof(float)*8, uiCode); // We do not send seign 288 //uiCode &= ~0x80000000; 289 pcSPS->setDepthPower(*((float*)&uiCode)); 290 #endif 291 printf("\nfDepthPower = %f", pcSPS->getDepthPower()); 279 xReadFlag( uiCode ); 280 pcSPS->setUseNonlinearDepth( uiCode ? true : false ); 281 pcSPS->getNonlinearDepthModel().Clear(); 282 if( uiCode ) 283 { 284 uiCode = 0; //Owieczka Necessary?? 285 xReadUvlc( uiCode ); 286 int num = pcSPS->getNonlinearDepthModel().m_iNum = uiCode; 287 for (int i=1; i<=num; ++i) 288 { 289 uiCode = 0; 290 xReadUvlc( uiCode ); 291 pcSPS->getNonlinearDepthModel().m_aiPoints[i] = uiCode; 292 } 293 pcSPS->getNonlinearDepthModel().m_aiPoints[0] = 0; 294 pcSPS->getNonlinearDepthModel().m_aiPoints[num+1] = 0; 295 pcSPS->getNonlinearDepthModel().Init(); 296 } 292 297 #endif 293 298 } -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
r28 r41 90 90 m_uiMaxViewId = 0; 91 91 #if POZNAN_NONLINEAR_DEPTH 92 m_fDepthPower = 1.0; 92 m_cNonlinearDepthModel.Clear(); 93 m_bUseNonlinearDepth = false; 93 94 #endif 94 95 } … … 140 141 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 141 142 143 144 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 145 { 146 147 // real-valued look-up tables 142 148 #if POZNAN_NONLINEAR_DEPTH 143 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 144 #endif 145 146 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 147 { 148 Double dDepthValue = (Double)uiDepthValue; 149 Int64 iDepthValue = (Int64)uiDepthValue; 150 #if POZNAN_NONLINEAR_DEPTH 151 dDepthValue = cNonlinearDepthBwd(dDepthValue); 152 iDepthValue = (Int64)(dDepthValue+0.5); 153 #endif 154 #if POZNAN_LUT_INCREASED_PRECISION 155 dDepthValue /= (1<<g_uiBitIncrement); 156 #endif 157 158 // real-valued look-up tables 159 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 149 Double dShiftLuma; 150 if( m_bUseNonlinearDepth ) 151 dShiftLuma = ( m_cNonlinearDepthModel.BackwardD( (Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision ); 152 else 153 dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 154 #else 155 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 156 #endif 160 157 Double dShiftChroma = dShiftLuma / 2; 161 158 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; … … 163 160 164 161 // integer-valued look-up tables 165 Int64 iTempScale = iDepthValue * iScale; 166 #if POZNAN_LUT_INCREASED_PRECISION 167 iTempScale >>= g_uiBitIncrement; 162 #if POZNAN_NONLINEAR_DEPTH 163 Int64 iTempScale; 164 if( m_bUseNonlinearDepth ) 165 iTempScale = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale); 166 else 167 iTempScale = (Int64)uiDepthValue * iScale; 168 #else 169 Int64 iTempScale = (Int64)uiDepthValue * iScale; 168 170 #endif 169 171 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters … … 233 235 { 234 236 #if POZNAN_NONLINEAR_DEPTH 235 m_fDepthPower = pcSlice->getSPS()->getDepthPower(); 237 m_bUseNonlinearDepth = pcSlice->getSPS()->getUseNonlinearDepth(); 238 m_cNonlinearDepthModel = pcSlice->getSPS()->getNonlinearDepthModel(); 236 239 #endif 237 240 return; … … 240 243 { 241 244 #if POZNAN_NONLINEAR_DEPTH 242 pcSlice->getSPS()->setDepthPower(m_fDepthPower); // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 245 pcSlice->getSPS()->setUseNonlinearDepth(m_bUseNonlinearDepth); 246 pcSlice->getSPS()->setNonlinearDepthModel(m_cNonlinearDepthModel); // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 243 247 #endif 244 248 } … … 684 688 685 689 #if DCM_SKIP_DECODING_FRAMES 690 #if FLEX_CODING_ORDER 691 Bool TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay, Bool& bNewPictureType) 692 #else 686 693 Bool TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay) 694 #endif 687 695 #else 688 696 Void TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS ) … … 712 720 TComSPS cTempSPS; 713 721 m_cEntropyDecoder.decodeSPS( &cTempSPS ); 722 #if FLEX_CODING_ORDER 723 m_cNewSPS = cTempSPS; 724 #endif 714 725 715 726 if( (m_iViewIdx == cTempSPS.getViewId()) && ( m_bIsDepth == cTempSPS.isDepth() ) ) … … 724 735 if(!cTempSPS.isDepth() && cTempSPS.getViewId()) 725 736 { 726 Float fDepthPower = getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getDepthPower();727 cTempSPS.set DepthPower(fDepthPower);737 cTempSPS.setUseNonlinearDepth(getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getUseNonlinearDepth()); 738 cTempSPS.setNonlinearDepthModel(getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getNonlinearDepthModel()); 728 739 } 729 740 #endif … … 802 813 { 803 814 m_uiPrevPOC = m_apcSlicePilot->getPOC(); 815 #if FLEX_CODING_ORDER 816 bNewPictureType = m_cNewSPS.isDepth(); 817 #endif 804 818 return true; 805 819 } … … 887 901 // Set reference list 888 902 std::vector<TComPic*> apcSpatRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_cSPS.isDepth() ); 889 TComPic * const pcTexturePic = m_cSPS.isDepth() ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 903 TComPic * const pcTexturePic = ( m_cSPS.isDepth()) ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 904 TComPic * const pcDepthPic = (!m_cSPS.isDepth()) ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), true ) : NULL; 905 #if FLEX_CODING_ORDER 906 if (pcTexturePic != NULL) 907 { 908 assert( ! m_cSPS.isDepth() || pcTexturePic != NULL ); 909 pcSlice->setTexturePic( pcTexturePic ); 910 } 911 if (pcDepthPic != NULL) 912 { 913 assert( m_cSPS.isDepth() || pcDepthPic != NULL ); 914 pcSlice->setDepthPic( pcDepthPic ); 915 } 916 #else 890 917 assert( ! m_cSPS.isDepth() || pcTexturePic != NULL ); 891 918 pcSlice->setTexturePic( pcTexturePic ); 919 pcSlice->setDepthPic( pcDepthPic ); 892 920 pcSlice->setViewIdx( pcPic->getViewIdx() ); 921 #endif 893 922 #if SONY_COLPIC_AVAILABILITY 894 923 pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() ); … … 949 978 //* 950 979 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 980 #if FLEX_CODING_ORDER 981 Bool bHaveReconDepth = (pcSlice->getDepthPic() != NULL) && (pcSlice->getDepthPic()->getReconMark()); 982 if(!getIsDepth() && pcSlice->getSPS()->getUseTexDqpAccordingToDepth() && !bHaveReconDepth ) 983 #else 951 984 if(!getIsDepth() && pcSlice->getSPS()->getUseTexDqpAccordingToDepth()) 985 #endif 952 986 { 953 987 getDecTop()->storeDepthSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC()); -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.h
r28 r41 121 121 #endif 122 122 #if POZNAN_NONLINEAR_DEPTH 123 Float m_fDepthPower; 123 TComNonlinearDepthModel m_cNonlinearDepthModel; 124 Bool m_bUseNonlinearDepth; 124 125 #endif 125 126 … … 205 206 TComList<TComPic*> m_cListPic; // Dynamic buffer 206 207 TComSPS m_cSPS; 208 #if FLEX_CODING_ORDER 209 TComSPS m_cNewSPS; 210 #endif 207 211 TComPPS m_cPPS; 208 212 TComSlice* m_apcSlicePilot; … … 265 269 Void init( TAppDecTop* pcTAppDecTop, Bool bFirstInstance = true ); 266 270 #if DCM_SKIP_DECODING_FRAMES 271 #if FLEX_CODING_ORDER 272 Bool decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay, Bool& bNewPictureType); 273 #else 267 274 Bool decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay); 275 #endif 268 276 #else 269 277 Void decode ( Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS );
Note: See TracChangeset for help on using the changeset viewer.