Changeset 1287 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 17 Jul 2015, 05:43:37 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 30 edited
-
CommonDef.h (modified) (1 diff)
-
TComChromaFormat.h (modified) (1 diff)
-
TComInterpolationFilter.cpp (modified) (4 diffs)
-
TComInterpolationFilter.h (modified) (1 diff)
-
TComLoopFilter.cpp (modified) (13 diffs)
-
TComLoopFilter.h (modified) (1 diff)
-
TComPattern.cpp (modified) (5 diffs)
-
TComPattern.h (modified) (4 diffs)
-
TComPicYuv.cpp (modified) (4 diffs)
-
TComPicYuv.h (modified) (3 diffs)
-
TComPicYuvMD5.cpp (modified) (6 diffs)
-
TComPrediction.cpp (modified) (7 diffs)
-
TComPrediction.h (modified) (2 diffs)
-
TComRdCost.cpp (modified) (4 diffs)
-
TComRdCost.h (modified) (1 diff)
-
TComRom.cpp (modified) (2 diffs)
-
TComRom.h (modified) (1 diff)
-
TComSampleAdaptiveOffset.cpp (modified) (7 diffs)
-
TComSampleAdaptiveOffset.h (modified) (3 diffs)
-
TComSlice.cpp (modified) (10 diffs)
-
TComSlice.h (modified) (10 diffs)
-
TComTrQuant.cpp (modified) (24 diffs)
-
TComTrQuant.h (modified) (4 diffs)
-
TComUpsampleFilter.cpp (modified) (10 diffs)
-
TComUpsampleFilter.h (modified) (1 diff)
-
TComWeightPrediction.cpp (modified) (9 diffs)
-
TComWeightPrediction.h (modified) (2 diffs)
-
TComYuv.cpp (modified) (4 diffs)
-
TComYuv.h (modified) (2 diffs)
-
TypeDef.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h
r1283 r1287 144 144 // ==================================================================================================================== 145 145 146 extern Int g_bitDepth[MAX_NUM_CHANNEL_TYPE];147 148 #if SVC_EXTENSION149 extern Int g_bitDepthLayer[MAX_NUM_CHANNEL_TYPE][MAX_LAYERS];150 extern void* g_refWeightACDCParam; //type:wpACDCParam151 #endif152 153 146 template <typename T> inline T Clip3 (const T minVal, const T maxVal, const T a) { return std::min<T> (std::max<T> (minVal, a) , maxVal); } ///< general min/max clip 154 147 template <typename T> inline T ClipBD(const T x, const Int bitDepth) { return Clip3(T(0), T((1 << bitDepth)-1), x); } 155 template <typename T> inline T Clip (const T x, const ChannelType type) { return ClipBD(x, g_bitDepth[type]); }156 148 157 149 template <typename T> inline Void Check3( T minVal, T maxVal, T a) -
branches/SHM-dev/source/Lib/TLibCommon/TComChromaFormat.h
r1285 r1287 163 163 //------------------------------------------------ 164 164 165 static inline Int getTransformShift(const ChannelType type, const UInt uiLog2TrSize, const Int maxLog2TrDynamicRange) 166 { 167 #if O0043_BEST_EFFORT_DECODING 168 return maxLog2TrDynamicRange - g_bitDepthInStream[type] - uiLog2TrSize; 169 #else 170 return maxLog2TrDynamicRange - g_bitDepth[type] - uiLog2TrSize; 171 #endif 165 static inline Int getTransformShift(const Int channelBitDepth, const UInt uiLog2TrSize, const Int maxLog2TrDynamicRange) 166 { 167 return maxLog2TrDynamicRange - channelBitDepth - uiLog2TrSize; 172 168 } 173 169 -
branches/SHM-dev/source/Lib/TLibCommon/TComInterpolationFilter.cpp
r1260 r1287 338 338 * \param fmt Chroma format 339 339 */ 340 Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt )340 Void TComInterpolationFilter::filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth ) 341 341 { 342 342 if ( frac == 0 ) 343 343 { 344 filterCopy( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, true, isLast );344 filterCopy(bitDepth, src, srcStride, dst, dstStride, width, height, true, isLast ); 345 345 } 346 346 else if (isLuma(compID)) 347 347 { 348 348 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 349 filterHor<NTAPS_LUMA>( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]);349 filterHor<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac]); 350 350 } 351 351 else … … 353 353 const UInt csx = getComponentScaleX(compID, fmt); 354 354 assert(frac >=0 && csx<2 && (frac<<(1-csx)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 355 filterHor<NTAPS_CHROMA>( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]);355 filterHor<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac<<(1-csx)]); 356 356 } 357 357 } … … 373 373 * \param fmt Chroma format 374 374 */ 375 Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt )375 Void TComInterpolationFilter::filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth ) 376 376 { 377 377 if ( frac == 0 ) 378 378 { 379 filterCopy( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, isFirst, isLast );379 filterCopy(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast ); 380 380 } 381 381 else if (isLuma(compID)) 382 382 { 383 383 assert(frac >= 0 && frac < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 384 filterVer<NTAPS_LUMA>( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]);384 filterVer<NTAPS_LUMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac]); 385 385 } 386 386 else … … 388 388 const UInt csy = getComponentScaleY(compID, fmt); 389 389 assert(frac >=0 && csy<2 && (frac<<(1-csy)) < CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS); 390 filterVer<NTAPS_CHROMA>( g_bitDepth[toChannelType(compID)], src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]);390 filterVer<NTAPS_CHROMA>(bitDepth, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac<<(1-csy)]); 391 391 } 392 392 } -
branches/SHM-dev/source/Lib/TLibCommon/TComInterpolationFilter.h
r1259 r1287 73 73 ~TComInterpolationFilter() {} 74 74 75 Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt );76 Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt );75 Void filterHor(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isLast, const ChromaFormat fmt, const Int bitDepth ); 76 Void filterVer(const ComponentID compID, Pel *src, Int srcStride, Pel *dst, Int dstStride, Int width, Int height, Int frac, Bool isFirst, Bool isLast, const ChromaFormat fmt, const Int bitDepth ); 77 77 }; 78 78 -
branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.cpp
r1260 r1287 564 564 Pel* piSrc = pcPicYuvRec->getAddr(COMPONENT_Y, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 565 565 Pel* piTmpSrc = piSrc; 566 #if SVC_EXTENSION 567 const Int bitDepthLuma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_LUMA); 568 #else 569 const Int bitDepthLuma = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA); 570 #endif 566 571 567 572 const Bool lfCrossSliceBoundaryFlag=pcCU->getSlice()->getLFCrossSliceBoundaryFlag(); … … 600 605 } 601 606 607 const Int iBitdepthScale = 1 << (bitDepthLuma-8); 608 602 609 for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ ) 603 610 { … … 620 627 iQP_P = pcCUP->getQP(uiPartPIdx); 621 628 iQP = (iQP_P + iQP_Q + 1) >> 1; 622 Int iBitdepthScale = 1 << (g_bitDepth[CHANNEL_TYPE_LUMA]-8);623 629 624 630 Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, Int(iQP + DEFAULT_INTRA_TC_OFFSET*(uiBs-1) + (tcOffsetDiv2 << 1))); … … 666 672 for ( Int i = 0; i < DEBLOCK_SMALLEST_BLOCK/2; i++) 667 673 { 668 xPelFilterLuma( piTmpSrc+iSrcStep*(iIdx*uiPelsInPart+iBlkIdx*4+i), iOffset, iTc, sw, bPartPNoFilter, bPartQNoFilter, iThrCut, bFilterP, bFilterQ );674 xPelFilterLuma( piTmpSrc+iSrcStep*(iIdx*uiPelsInPart+iBlkIdx*4+i), iOffset, iTc, sw, bPartPNoFilter, bPartQNoFilter, iThrCut, bFilterP, bFilterQ, bitDepthLuma); 669 675 } 670 676 } … … 681 687 Pel* piSrcCb = pcPicYuvRec->getAddr( COMPONENT_Cb, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 682 688 Pel* piSrcCr = pcPicYuvRec->getAddr( COMPONENT_Cr, pcCU->getCtuRsAddr(), uiAbsZorderIdx ); 689 #if SVC_EXTENSION 690 const Int bitDepthChroma = pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA); 691 #else 692 const Int bitDepthChroma = pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA); 693 #endif 683 694 Int iQP = 0; 684 695 Int iQP_P = 0; … … 740 751 uiLoopLength=uiPelsInPartChromaH; 741 752 } 753 754 #if SVC_EXTENSION 755 const Int iBitdepthScale = 1 << (pcCU->getSlice()->getBitDepth(CHANNEL_TYPE_CHROMA)-8); 756 #else 757 const Int iBitdepthScale = 1 << (pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA)-8); 758 #endif 742 759 743 760 for ( UInt iIdx = 0; iIdx < uiNumParts; iIdx++ ) … … 798 815 } 799 816 800 Int iBitdepthScale = 1 << (g_bitDepth[CHANNEL_TYPE_CHROMA]-8);801 802 817 Int iIndexTC = Clip3(0, MAX_QP+DEFAULT_INTRA_TC_OFFSET, iQP + DEFAULT_INTRA_TC_OFFSET*(ucBs - 1) + (tcOffsetDiv2 << 1)); 803 818 Int iTc = sm_tcTable[iIndexTC]*iBitdepthScale; … … 805 820 for ( UInt uiStep = 0; uiStep < uiLoopLength; uiStep++ ) 806 821 { 807 xPelFilterChroma( piTmpSrcChroma + iSrcStep*(uiStep+iIdx*uiLoopLength), iOffset, iTc , bPartPNoFilter, bPartQNoFilter );822 xPelFilterChroma( piTmpSrcChroma + iSrcStep*(uiStep+iIdx*uiLoopLength), iOffset, iTc , bPartPNoFilter, bPartQNoFilter, bitDepthChroma); 808 823 } 809 824 } … … 825 840 \param bFilterSecondQ decision weak filter/no filter for partQ 826 841 */ 827 __inline Void TComLoopFilter::xPelFilterLuma( Pel* piSrc, Int iOffset, Int tc, Bool sw, Bool bPartPNoFilter, Bool bPartQNoFilter, Int iThrCut, Bool bFilterSecondP, Bool bFilterSecondQ )842 __inline Void TComLoopFilter::xPelFilterLuma( Pel* piSrc, Int iOffset, Int tc, Bool sw, Bool bPartPNoFilter, Bool bPartQNoFilter, Int iThrCut, Bool bFilterSecondP, Bool bFilterSecondQ, const Int bitDepthLuma) 828 843 { 829 844 Int delta; … … 855 870 { 856 871 delta = Clip3(-tc, tc, delta); 857 piSrc[-iOffset] = Clip ((m3+delta), CHANNEL_TYPE_LUMA);858 piSrc[0] = Clip ((m4-delta), CHANNEL_TYPE_LUMA);872 piSrc[-iOffset] = ClipBD((m3+delta), bitDepthLuma); 873 piSrc[0] = ClipBD((m4-delta), bitDepthLuma); 859 874 860 875 Int tc2 = tc>>1; … … 862 877 { 863 878 Int delta1 = Clip3(-tc2, tc2, (( ((m1+m3+1)>>1)- m2+delta)>>1)); 864 piSrc[-iOffset*2] = Clip ((m2+delta1), CHANNEL_TYPE_LUMA);879 piSrc[-iOffset*2] = ClipBD((m2+delta1), bitDepthLuma); 865 880 } 866 881 if(bFilterSecondQ) 867 882 { 868 883 Int delta2 = Clip3(-tc2, tc2, (( ((m6+m4+1)>>1)- m5-delta)>>1)); 869 piSrc[ iOffset] = Clip ((m5+delta2), CHANNEL_TYPE_LUMA);884 piSrc[ iOffset] = ClipBD((m5+delta2), bitDepthLuma); 870 885 } 871 886 } … … 895 910 \param bPartQNoFilter indicator to disable filtering on partQ 896 911 */ 897 __inline Void TComLoopFilter::xPelFilterChroma( Pel* piSrc, Int iOffset, Int tc, Bool bPartPNoFilter, Bool bPartQNoFilter )912 __inline Void TComLoopFilter::xPelFilterChroma( Pel* piSrc, Int iOffset, Int tc, Bool bPartPNoFilter, Bool bPartQNoFilter, const Int bitDepthChroma) 898 913 { 899 914 Int delta; … … 905 920 906 921 delta = Clip3(-tc,tc, (((( m4 - m3 ) << 2 ) + m2 - m5 + 4 ) >> 3) ); 907 piSrc[-iOffset] = Clip ((m3+delta), CHANNEL_TYPE_CHROMA);908 piSrc[0] = Clip ((m4-delta), CHANNEL_TYPE_CHROMA);922 piSrc[-iOffset] = ClipBD((m3+delta), bitDepthChroma); 923 piSrc[0] = ClipBD((m4-delta), bitDepthChroma); 909 924 910 925 if(bPartPNoFilter) -
branches/SHM-dev/source/Lib/TLibCommon/TComLoopFilter.h
r1259 r1287 108 108 Void xEdgeFilterChroma ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, DeblockEdgeDir edgeDir, Int iEdge ); 109 109 110 __inline Void xPelFilterLuma( Pel* piSrc, Int iOffset, Int tc, Bool sw, Bool bPartPNoFilter, Bool bPartQNoFilter, Int iThrCut, Bool bFilterSecondP, Bool bFilterSecondQ );111 __inline Void xPelFilterChroma( Pel* piSrc, Int iOffset, Int tc, Bool bPartPNoFilter, Bool bPartQNoFilter );110 __inline Void xPelFilterLuma( Pel* piSrc, Int iOffset, Int tc, Bool sw, Bool bPartPNoFilter, Bool bPartQNoFilter, Int iThrCut, Bool bFilterSecondP, Bool bFilterSecondQ, const Int bitDepthLuma); 111 __inline Void xPelFilterChroma( Pel* piSrc, Int iOffset, Int tc, Bool bPartPNoFilter, Bool bPartQNoFilter, const Int bitDepthChroma); 112 112 113 113 -
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.cpp
r1260 r1287 79 79 Int iRoiWidth, 80 80 Int iRoiHeight, 81 Int iStride 81 Int iStride, 82 Int bitDepth 82 83 ) 83 84 { 84 85 m_piROIOrigin = piTexture; 85 m_iROIWidth = iRoiWidth; 86 m_iROIHeight = iRoiHeight; 87 m_iPatternStride = iStride; 86 m_iROIWidth = iRoiWidth; 87 m_iROIHeight = iRoiHeight; 88 m_iPatternStride = iStride; 89 m_bitDepth = bitDepth; 88 90 } 89 91 … … 95 97 Int iRoiWidth, 96 98 Int iRoiHeight, 97 Int iStride) 98 { 99 m_cPatternY. setPatternParamPel( piY, iRoiWidth, iRoiHeight, iStride); 99 Int iStride, 100 Int bitDepthLuma) 101 { 102 m_cPatternY. setPatternParamPel( piY, iRoiWidth, iRoiHeight, iStride, bitDepthLuma); 100 103 } 101 104 … … 120 123 const Int iAboveUnits = iTUWidthInUnits << 1; 121 124 const Int iLeftUnits = iTUHeightInUnits << 1; 125 #if SVC_EXTENSION 126 const Int bitDepthForChannel = pcCU->getSlice()->getBitDepth(chType); 127 #else 128 const Int bitDepthForChannel = pcCU->getSlice()->getSPS()->getBitDepth(chType); 129 #endif 122 130 123 131 assert(iTUHeightInUnits > 0 && iTUWidthInUnits > 0); … … 156 164 Pel *piRoiOrigin = pcCU->getPic()->getPicYuvRec()->getAddr(compID, pcCU->getCtuRsAddr(), pcCU->getZorderIdxInCtu()+uiZorderIdxInPart); 157 165 #if O0043_BEST_EFFORT_DECODING 158 fillReferenceSamples (g_bitDepthInStream[chType], g_bitDepthInStream[chType] - g_bitDepth[chType], pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 159 #else 160 fillReferenceSamples (g_bitDepth[chType], pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 166 const Int bitDepthForChannelInStream = pcCU->getSlice()->getSPS()->getStreamBitDepth(chType); 167 fillReferenceSamples (bitDepthForChannelInStream, bitDepthForChannelInStream - bitDepthForChannel, pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 168 #else 169 fillReferenceSamples (bitDepthForChannel, pcCU, piRoiOrigin, piAdiTemp, bNeighborFlags, iNumIntraNeighbor, iUnitWidth, iUnitHeight, iAboveUnits, iLeftUnits, 161 170 #endif 162 171 uiTuWidth, uiTuHeight, uiROIWidth, uiROIHeight, iPicStride, toChannelType(compID), chFmt); … … 202 211 { 203 212 #if O0043_BEST_EFFORT_DECODING 204 const Int threshold = 1 << ( g_bitDepthInStream[chType]- 5);205 #else 206 const Int threshold = 1 << ( g_bitDepth[chType]- 5);213 const Int threshold = 1 << (bitDepthForChannelInStream - 5); 214 #else 215 const Int threshold = 1 << (bitDepthForChannel - 5); 207 216 #endif 208 217 const Bool bilinearLeft = abs((bottomLeft + topLeft ) - (2 * piAdiTemp[stride * uiTuHeight])) < threshold; //difference between the -
branches/SHM-dev/source/Lib/TLibCommon/TComPattern.h
r1262 r1287 62 62 Int m_iROIHeight; 63 63 Int m_iPatternStride; 64 Int m_bitDepth; 64 65 65 66 /// return starting position of ROI (ROI = &pattern[AboveOffset][LeftOffset]) … … 70 71 71 72 /// set parameters from Pel buffer for accessing neighbouring pixels 72 Void setPatternParamPel (Pel* piTexture, 73 Int iRoiWidth, 74 Int iRoiHeight, 75 Int iStride 76 ); 73 Void setPatternParamPel( Pel* piTexture, Int iRoiWidth, Int iRoiHeight, Int iStride, Int bitDepth ); 77 74 }; 78 75 … … 92 89 Int getROIYHeight() { return m_cPatternY.m_iROIHeight; } 93 90 Int getPatternLStride() { return m_cPatternY.m_iPatternStride; } 91 Int getBitDepthY() { return m_cPatternY.m_bitDepth; } 94 92 95 93 // ------------------------------------------------------------------------------------------------------------------- … … 98 96 99 97 /// set parameters from Pel buffers for accessing neighbouring pixels 100 Void initPattern (Pel* piY, 101 Int iRoiWidth, 102 Int iRoiHeight, 103 Int iStride ); 104 105 106 107 98 Void initPattern( Pel* piY, Int iRoiWidth, Int iRoiHeight, Int iStride, Int bitDepthLuma ); 108 99 }; 109 100 -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r1259 r1287 256 256 257 257 // NOTE: This function is never called, but may be useful for developers. 258 Void TComPicYuv::dump (const Char* pFileName, Bool bAdd) const258 Void TComPicYuv::dump (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd) const 259 259 { 260 260 FILE* pFile; … … 272 272 { 273 273 const ComponentID ch = ComponentID(chan); 274 const Int shift = g_bitDepth[toChannelType(ch)] - 8;274 const Int shift = bitDepths.recon[toChannelType(ch)] - 8; 275 275 const Int offset = (shift>0)?(1<<(shift-1)):0; 276 276 const Pel *pi = getAddr(ch); … … 307 307 if( bitDepth == 8 ) 308 308 { 309 dump( pFileName, b Add );309 dump( pFileName, bitDepth, bAdd ); 310 310 return; 311 311 } … … 338 338 339 339 #if AUXILIARY_PICTURES 340 Void TComPicYuv::convertToMonochrome( )341 { 342 Pel grayVal = (1 << ( g_bitDepth[CHANNEL_TYPE_CHROMA]- 1));340 Void TComPicYuv::convertToMonochrome(Int bitDepthChroma) 341 { 342 Pel grayVal = (1 << (bitDepthChroma - 1)); 343 343 344 344 for( UInt comp = 1; comp < getNumberValidComponents(); comp++ ) -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h
r1273 r1287 160 160 161 161 // Dump picture 162 Void dump (const Char* pFileName, Bool bAdd = false) const ;162 Void dump (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd = false) const ; 163 163 164 164 // Set border extension flag … … 172 172 Bool isReconstructed() { return m_isReconstructed; } 173 173 #if AUXILIARY_PICTURES 174 Void convertToMonochrome( );174 Void convertToMonochrome(Int bitDepthChroma); 175 175 #endif 176 176 #endif … … 182 182 183 183 // These functions now return the length of the digest strings. 184 UInt calcChecksum(const TComPicYuv& pic, TComPictureHash &digest );185 UInt calcCRC (const TComPicYuv& pic, TComPictureHash &digest );186 UInt calcMD5 (const TComPicYuv& pic, TComPictureHash &digest );184 UInt calcChecksum(const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths); 185 UInt calcCRC (const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths); 186 UInt calcMD5 (const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths); 187 187 std::string hashToString(const TComPictureHash &digest, Int numChar); 188 188 //! \} -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp
r1273 r1287 127 127 } 128 128 129 UInt calcCRC(const TComPicYuv& pic, TComPictureHash &digest )129 UInt calcCRC(const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths) 130 130 { 131 131 UInt digestLen=0; … … 134 134 { 135 135 const ComponentID compID=ComponentID(chan); 136 digestLen=compCRC( g_bitDepth[toChannelType(compID)], pic.getAddr(compID), pic.getWidth(compID), pic.getHeight(compID), pic.getStride(compID), digest);136 digestLen=compCRC(bitDepths.recon[toChannelType(compID)], pic.getAddr(compID), pic.getWidth(compID), pic.getHeight(compID), pic.getStride(compID), digest); 137 137 } 138 138 return digestLen; 139 139 } 140 140 141 UInt compChecksum(Int bitdepth, const Pel* plane, UInt width, UInt height, UInt stride, TComPictureHash &digest )141 UInt compChecksum(Int bitdepth, const Pel* plane, UInt width, UInt height, UInt stride, TComPictureHash &digest, const BitDepths &/*bitDepths*/) 142 142 { 143 143 UInt checksum = 0; … … 165 165 } 166 166 167 UInt calcChecksum(const TComPicYuv& pic, TComPictureHash &digest )167 UInt calcChecksum(const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths) 168 168 { 169 169 UInt digestLen=0; … … 172 172 { 173 173 const ComponentID compID=ComponentID(chan); 174 digestLen=compChecksum( g_bitDepth[toChannelType(compID)], pic.getAddr(compID), pic.getWidth(compID), pic.getHeight(compID), pic.getStride(compID), digest);174 digestLen=compChecksum(bitDepths.recon[toChannelType(compID)], pic.getAddr(compID), pic.getWidth(compID), pic.getHeight(compID), pic.getStride(compID), digest, bitDepths); 175 175 } 176 176 return digestLen; … … 183 183 * uses little-endian two byte words; 8bit data uses single byte words. 184 184 */ 185 UInt calcMD5(const TComPicYuv& pic, TComPictureHash &digest )185 UInt calcMD5(const TComPicYuv& pic, TComPictureHash &digest, const BitDepths &bitDepths) 186 186 { 187 187 /* choose an md5_plane packing function based on the system bitdepth */ … … 195 195 { 196 196 const ComponentID compID=ComponentID(chan); 197 md5_plane_func = g_bitDepth[toChannelType(compID)] <= 8 ? (MD5PlaneFunc)md5_plane<1> : (MD5PlaneFunc)md5_plane<2>;197 md5_plane_func = bitDepths.recon[toChannelType(compID)] <= 8 ? (MD5PlaneFunc)md5_plane<1> : (MD5PlaneFunc)md5_plane<2>; 198 198 UChar tmp_digest[MD5_DIGEST_STRING_LENGTH]; 199 199 md5_plane_func(md5[compID], pic.getAddr(compID), pic.getWidth(compID), pic.getHeight(compID), pic.getStride(compID)); -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1262 r1287 480 480 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); 481 481 const Bool enableEdgeFilters = !(pcCU->isRDPCMEnabled(uiAbsPartIdx) && pcCU->getCUTransquantBypass(uiAbsPartIdx)); 482 483 482 #if O0043_BEST_EFFORT_DECODING 484 xPredIntraAng( g_bitDepthInStream[channelType], ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, format, uiDirMode, bAbove, bLeft, enableEdgeFilters);483 const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getSPS()->getStreamBitDepth(channelType); 485 484 #else 486 xPredIntraAng( g_bitDepth[channelType], ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, format, uiDirMode, bAbove, bLeft, enableEdgeFilters ); 485 #if SVC_EXTENSION 486 const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getBitDepth(channelType); 487 #else 488 const Int channelsBitDepthForPrediction = rTu.getCU()->getSlice()->getSPS()->getBitDepth(channelType); 487 489 #endif 490 #endif 491 xPredIntraAng( channelsBitDepthForPrediction, ptrSrc+sw+1, sw, pDst, uiStride, iWidth, iHeight, channelType, format, uiDirMode, bAbove, bLeft, enableEdgeFilters ); 488 492 489 493 if(( uiDirMode == DC_IDX ) && bAbove && bLeft ) … … 614 618 #endif 615 619 616 for (UInt ch=COMPONENT_Y; ch<pcYuvPred->getNumberValidComponents(); ch++) 617 { 618 xPredInterBlk (ComponentID(ch), pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi ); 620 for (UInt comp=COMPONENT_Y; comp<pcYuvPred->getNumberValidComponents(); comp++) 621 { 622 const ComponentID compID=ComponentID(comp); 623 #if SVC_EXTENSION 624 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getBitDepth(toChannelType(compID)) ); 625 #else 626 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) ); 627 #endif 619 628 } 620 629 } … … 666 675 else 667 676 { 668 xWeightedAverage( &m_acYuvPred[REF_PIC_LIST_0], &m_acYuvPred[REF_PIC_LIST_1], iRefIdx[REF_PIC_LIST_0], iRefIdx[REF_PIC_LIST_1], uiPartAddr, iWidth, iHeight, pcYuvPred ); 677 #if SVC_EXTENSION 678 xWeightedAverage( &m_acYuvPred[REF_PIC_LIST_0], &m_acYuvPred[REF_PIC_LIST_1], iRefIdx[REF_PIC_LIST_0], iRefIdx[REF_PIC_LIST_1], uiPartAddr, iWidth, iHeight, pcYuvPred, pcCU->getSlice()->getBitDepths() ); 679 #else 680 xWeightedAverage( &m_acYuvPred[REF_PIC_LIST_0], &m_acYuvPred[REF_PIC_LIST_1], iRefIdx[REF_PIC_LIST_0], iRefIdx[REF_PIC_LIST_1], uiPartAddr, iWidth, iHeight, pcYuvPred, pcCU->getSlice()->getSPS()->getBitDepths() ); 681 #endif 669 682 } 670 683 } … … 685 698 686 699 687 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi )700 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth ) 688 701 { 689 702 Int refStride = refPic->getStride(compID); … … 707 720 if ( yFrac == 0 ) 708 721 { 709 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt );722 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth); 710 723 } 711 724 else if ( xFrac == 0 ) 712 725 { 713 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt );726 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth); 714 727 } 715 728 else … … 720 733 const Int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA; 721 734 722 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt );723 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt );724 } 725 } 726 727 Void TComPrediction::xWeightedAverage( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* pcYuvDst )735 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt, bitDepth); 736 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth); 737 } 738 } 739 740 Void TComPrediction::xWeightedAverage( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* pcYuvDst, const BitDepths &clipBitDepths ) 728 741 { 729 742 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 730 743 { 731 pcYuvDst->addAvg( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight );744 pcYuvDst->addAvg( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight, clipBitDepths ); 732 745 } 733 746 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) … … 870 883 871 884 #if SVC_EXTENSION 872 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )873 { 874 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic );885 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Int refBitDepthLuma, const Int refBitDepthChroma ) 886 { 887 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, refBitDepthLuma, refBitDepthChroma ); 875 888 } 876 889 #endif //SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h
r1262 r1287 94 94 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv* pcYuvPred, Bool bi=false ); 95 95 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv* pcYuvPred ); 96 Void xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi );97 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv* pcYuvDst );96 Void xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth ); 97 Void xWeightedAverage ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv* pcYuvDst, const BitDepths &clipBitDepths ); 98 98 99 99 Void xGetLLSPrediction ( const Pel* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0, const ChromaFormat chFmt DEBUG_STRING_FN_DECLARE(sDebug) ); … … 145 145 146 146 #if SVC_EXTENSION 147 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic);148 #endif //SVC_EXTENSION147 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Int refBitDepthLuma, const Int refBitDepthChroma ); 148 #endif 149 149 }; 150 150 -
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.cpp
r1259 r1287 192 192 } 193 193 194 Void TComRdCost::setLambda( Double dLambda )194 Void TComRdCost::setLambda( Double dLambda, const BitDepths &bitDepths ) 195 195 { 196 196 m_dLambda = dLambda; … … 202 202 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12) / 3.0)); 203 203 #else 204 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * ( g_bitDepth[CHANNEL_TYPE_LUMA] - 8)) / 3.0));204 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * (bitDepths.recon[CHANNEL_TYPE_LUMA] - 8)) / 3.0)); 205 205 #endif 206 206 m_dLambdaMotionSAD[1] = 65536.0 * sqrt(dLambda); … … 212 212 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12) / 3.0)); 213 213 #else 214 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * ( g_bitDepth[CHANNEL_TYPE_LUMA] - 8)) / 3.0));214 dLambda = 0.57 * pow(2.0, ((LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME - 12 - 6 * (bitDepths.recon[CHANNEL_TYPE_LUMA] - 8)) / 3.0)); 215 215 #endif 216 216 m_uiLambdaMotionSAD[1] = (UInt)floor(65536.0 * sqrt(dLambda)); … … 340 340 Void TComRdCost::setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME ) 341 341 { 342 #if SVC_EXTENSION343 // Set bit depth for weighted cost calculation344 rcDistParam.bitDepth = g_bitDepth[CHANNEL_TYPE_LUMA];345 #endif346 342 // set Original & Curr Pointer / Stride 347 343 rcDistParam.pOrg = pcPatternKey->getROIY(); -
branches/SHM-dev/source/Lib/TLibCommon/TComRdCost.h
r1259 r1287 138 138 139 139 Void setDistortionWeight ( const ComponentID compID, const Double distortionWeight ) { m_distortionWeight[compID] = distortionWeight; } 140 Void setLambda ( Double dLambda );140 Void setLambda ( Double dLambda, const BitDepths &bitDepths ); 141 141 Void setFrameLambda ( Double dLambda ) { m_dFrameLambda = dLambda; } 142 142 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1285 r1287 541 541 542 542 // ==================================================================================================================== 543 // Bit-depth544 // ====================================================================================================================545 546 Int g_bitDepth [MAX_NUM_CHANNEL_TYPE] = {8, 8};547 #if O0043_BEST_EFFORT_DECODING548 Int g_bitDepthInStream [MAX_NUM_CHANNEL_TYPE] = {8, 8}; // In the encoder, this is the same as g_bitDepth. In the decoder, this can vary from g_bitDepth if the decoder is forced to use 'best-effort decoding' at a particular bit-depth.549 #endif550 551 // ====================================================================================================================552 543 // Misc. 553 544 // ==================================================================================================================== … … 681 672 UInt g_predefSetIntraModes[NUM_INTRA_MODE-1] = {26,10,18,34,2,22,14,30,6,24,12,28,8,20,16,32,4,17,19,15,21,13,23,11,25,9,27,7,29,5,31,3,33,0,2}; 682 673 #endif 683 Int g_bitDepthLayer[MAX_NUM_CHANNEL_TYPE][MAX_LAYERS];684 void * g_refWeightACDCParam; // type=wpACDCParam685 674 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 686 675 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1285 r1287 153 153 154 154 // ==================================================================================================================== 155 // Bit-depth156 // ====================================================================================================================157 158 extern Int g_bitDepth [MAX_NUM_CHANNEL_TYPE];159 #if O0043_BEST_EFFORT_DECODING160 extern Int g_bitDepthInStream [MAX_NUM_CHANNEL_TYPE]; // In the encoder, this is the same as g_bitDepth. In the decoder, this can vary from g_bitDepth if the decoder is forced to use 'best-effort decoding' at a particular bit-depth.161 #endif162 163 // ====================================================================================================================164 155 // Mode-Dependent DST Matrices 165 156 // ==================================================================================================================== -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r1260 r1287 44 44 //! \ingroup TLibCommon 45 45 //! \{ 46 #if !SVC_EXTENSION47 UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT];48 #endif49 46 50 47 SAOOffset::SAOOffset() … … 154 151 for(Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++) 155 152 { 156 Int bitDepthSample = g_bitDepth[toChannelType(ComponentID(compIdx))];157 153 m_offsetStepLog2 [compIdx] = isLuma(ComponentID(compIdx))? lumaBitShift : chromaBitShift; 158 #if SVC_EXTENSION159 m_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive160 #else161 g_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive162 #endif163 154 } 164 155 } … … 320 311 321 312 322 Void TComSampleAdaptiveOffset::offsetBlock( ComponentID compIdx, Int typeIdx, Int* offset313 Void TComSampleAdaptiveOffset::offsetBlock(const Int channelBitDepth, Int typeIdx, Int* offset 323 314 , Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height 324 315 , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail) … … 343 334 } 344 335 345 const Int maxSampleValueIncl = (1<< g_bitDepth[toChannelType(compIdx)])-1;336 const Int maxSampleValueIncl = (1<< channelBitDepth )-1; 346 337 347 338 Int x,y, startX, startY, endX, endY, edgeType; … … 540 531 case SAO_TYPE_BO: 541 532 { 542 const Int shiftBits = g_bitDepth[toChannelType(compIdx)]- NUM_SAO_BO_CLASSES_LOG2;533 const Int shiftBits = channelBitDepth - NUM_SAO_BO_CLASSES_LOG2; 543 534 for (y=0; y< height; y++) 544 535 { … … 608 599 Pel* resBlk = resYuv->getAddr(component) + blkYPos*resStride + blkXPos; 609 600 610 offsetBlock( component, ctbOffset.typeIdc, ctbOffset.offset 601 #if SVC_EXTENSION 602 offsetBlock( pPic->getSlice(0)->getBitDepth(toChannelType(component)), ctbOffset.typeIdc, ctbOffset.offset 603 #else 604 offsetBlock( pPic->getPicSym()->getSPS().getBitDepth(toChannelType(component)), ctbOffset.typeIdc, ctbOffset.offset 605 #endif 611 606 , srcBlk, resBlk, srcStride, resStride, blkWidth, blkHeight 612 607 , isLeftAvail, isRightAvail … … 743 738 else 744 739 { 745 uiPcmLeftShiftBit = g_bitDepth[toChannelType(compID)] - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID)); 740 #if SVC_EXTENSION 741 uiPcmLeftShiftBit = pcCU->getSlice()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID)); 742 #else 743 uiPcmLeftShiftBit = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) - pcCU->getSlice()->getSPS()->getPCMBitDepth(toChannelType(compID)); 744 #endif 746 745 } 747 746 -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r1260 r1287 55 55 // Class definition 56 56 // ==================================================================================================================== 57 #if !SVC_EXTENSION58 extern UInt g_saoMaxOffsetQVal[MAX_NUM_COMPONENT];59 #endif60 57 61 58 template <typename T> Int sgn(T val) … … 74 71 Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams); 75 72 Void PCMLFDisableProcess (TComPic* pcPic); 76 #if SVC_EXTENSION 77 UInt* getSaoMaxOffsetQVal() { return m_saoMaxOffsetQVal; } 78 #endif 73 static Int getMaxOffsetQVal(const Int channelBitDepth) { return (1<<(std::min<Int>(channelBitDepth,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; } //Table 9-32, inclusive 74 79 75 protected: 80 Void offsetBlock( ComponentID compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height76 Void offsetBlock(const Int channelBitDepth, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height 81 77 , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail); 82 78 Void invertQuantOffsets(ComponentID compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets); … … 105 101 private: 106 102 Bool m_picSAOEnabled[MAX_NUM_COMPONENT]; 107 108 #if SVC_EXTENSION109 UInt m_saoMaxOffsetQVal[MAX_NUM_COMPONENT];110 #endif111 103 }; 112 104 -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1273 r1287 512 512 ); 513 513 514 Bool sameBitDepths = ( g _bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId]);514 Bool sameBitDepths = ( getBitDepth(CHANNEL_TYPE_LUMA) == ilpPic[refLayerIdc]->getSlice(0)->getBitDepth(CHANNEL_TYPE_LUMA) ) && ( getBitDepth(CHANNEL_TYPE_CHROMA) == ilpPic[refLayerIdc]->getSlice(0)->getBitDepth(CHANNEL_TYPE_CHROMA) ); 515 515 516 516 // motion resampling constraint … … 1821 1821 } 1822 1822 1823 //! get AC and DC values for weighted pred1824 Void TComSlice::getWpAcDcParam(WPACDCParam *&wp)1825 {1826 wp = m_weightACDCParam;1827 }1828 1829 1823 //! init AC and DC values for weighted pred 1830 1824 Void TComSlice::initWpAcDcParam() … … 1882 1876 } 1883 1877 1884 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (g_bitDepth[toChannelType(ComponentID(yuv))]-8)); 1878 #if SVC_EXTENSION 1879 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (getBitDepth(toChannelType(ComponentID(yuv)))-8)); 1880 #else 1881 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (sps->getBitDepth(toChannelType(ComponentID(yuv)))-8)); 1882 #endif 1885 1883 1886 1884 pwp->w = pwp->iWeight; … … 2098 2096 for(Int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++) 2099 2097 { 2100 m_uiBitDepth [ch] = 8; 2101 m_uiPCMBitDepth[ch] = 8; 2098 m_bitDepths.recon[ch] = 8; 2099 #if O0043_BEST_EFFORT_DECODING 2100 m_bitDepths.stream[ch] = 8; 2101 #endif 2102 m_pcmBitDepths[ch] = 8; 2102 2103 m_qpBDOffset [ch] = 0; 2103 2104 } … … 3560 3561 } 3561 3562 3562 UInt TComSlice::getBitDepthY() 3563 BitDepths& TComSlice::getBitDepths() 3564 { 3565 static BitDepths bitDepths; 3566 3567 bitDepths.recon[CHANNEL_TYPE_LUMA] = getBitDepth(CHANNEL_TYPE_LUMA); 3568 bitDepths.recon[CHANNEL_TYPE_CHROMA] = getBitDepth(CHANNEL_TYPE_CHROMA); 3569 3570 return bitDepths; 3571 } 3572 3573 UInt TComSlice::getBitDepth(ChannelType type) const 3563 3574 { 3564 3575 UInt retVal, layerId = getLayerId(); … … 3568 3579 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3569 3580 { 3570 retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVps Luma();3581 retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVps(type); 3571 3582 } 3572 3583 else 3573 3584 { 3574 retVal = m_pcSPS->getBitDepth( CHANNEL_TYPE_LUMA);3585 retVal = m_pcSPS->getBitDepth(type); 3575 3586 } 3576 3587 } 3577 3588 else 3578 3589 { 3579 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVps Luma();3590 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVps(type); 3580 3591 } 3581 3592 … … 3583 3594 } 3584 3595 3585 UInt TComVPS::getBitDepth Y(const TComSPS* sps, const UInt layerId ) const3596 UInt TComVPS::getBitDepth( ChannelType type, const TComSPS* sps, const UInt layerId ) const 3586 3597 { 3587 3598 UInt retVal; … … 3591 3602 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3592 3603 { 3593 retVal = m_vpsRepFormat[layerId].getBitDepthVps Luma();3604 retVal = m_vpsRepFormat[layerId].getBitDepthVps(type); 3594 3605 } 3595 3606 else 3596 3607 { 3597 retVal = sps->getBitDepth( CHANNEL_TYPE_LUMA);3608 retVal = sps->getBitDepth(type); 3598 3609 } 3599 3610 } 3600 3611 else 3601 3612 { 3602 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVps Luma();3613 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVps(type); 3603 3614 } 3604 3615 … … 3606 3617 } 3607 3618 3608 UInt TComSlice::getBitDepthC() 3609 { 3610 UInt retVal, layerId = getLayerId(); 3611 3612 if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 ) 3613 { 3614 if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() ) 3615 { 3616 retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVpsChroma(); 3617 } 3618 else 3619 { 3620 retVal = m_pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA); 3621 } 3622 } 3623 else 3624 { 3625 retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma(); 3626 } 3627 3628 return retVal; 3629 } 3630 3631 UInt TComVPS::getBitDepthC( const TComSPS* sps, const UInt layerId ) const 3632 { 3633 UInt retVal; 3634 3635 if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 ) 3636 { 3637 if( layerId == 0 && m_nonHEVCBaseLayerFlag ) 3638 { 3639 retVal = m_vpsRepFormat[layerId].getBitDepthVpsChroma(); 3640 } 3641 else 3642 { 3643 retVal = sps->getBitDepth(CHANNEL_TYPE_CHROMA); 3644 } 3645 } 3646 else 3647 { 3648 retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVpsChroma(); 3649 } 3650 3651 return retVal; 3652 } 3653 3654 Int TComSlice::getQpBDOffsetY() 3655 { 3656 return (getBitDepthY() - 8) * 6; 3657 } 3658 3659 Int TComSlice::getQpBDOffsetC() 3660 { 3661 return (getBitDepthC() - 8) * 6; 3619 const BitDepths& TComVPS::getBitDepths( const TComSPS* sps, const UInt layerId ) const 3620 { 3621 static const BitDepths bitDepths( getBitDepth(CHANNEL_TYPE_LUMA, sps, layerId), getBitDepth(CHANNEL_TYPE_CHROMA, sps, layerId) ); 3622 return bitDepths; 3662 3623 } 3663 3624 … … 3783 3744 pcIlpPic[refLayerIdc]->getSlice(0)->setPPS( m_pcPic->getSlice(0)->getPPS() ); 3784 3745 3746 // assign SPS to ILRP to be used for obtaining bit depth 3747 pcIlpPic[refLayerIdc]->getSlice(0)->setSPS( m_pcPic->getSlice(0)->getSPS() ); 3748 3785 3749 // assing VPS to ILRP to be used for deriving layerIdx 3786 3750 pcIlpPic[refLayerIdc]->getSlice(0)->setVPS( m_pcPic->getSlice(0)->getVPS() ); -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1285 r1287 563 563 Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } 564 564 565 Int getBitDepthVps(ChannelType type) { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma; }565 Int getBitDepthVps(ChannelType type) const { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma; } 566 566 567 567 Window& getConformanceWindowVps() { return m_conformanceWindowVps; } … … 1129 1129 UInt getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const; 1130 1130 UInt getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const; 1131 UInt getBitDepth Y(const TComSPS* sps, const UInt layerId ) const;1132 UInt getBitDepthC( const TComSPS* sps, const UInt layerId ) const;1131 UInt getBitDepth( ChannelType type, const TComSPS* sps, const UInt layerId ) const; 1132 const BitDepths& getBitDepths( const TComSPS* sps, const UInt layerId ) const; 1133 1133 const Window& getConformanceWindow( const TComSPS* sps, const UInt layerId ) const; 1134 1134 #endif //SVC_EXTENSION … … 1304 1304 }; 1305 1305 1306 1306 1307 /// SPS class 1307 1308 class TComSPS … … 1342 1343 1343 1344 // Parameter 1344 Int m_uiBitDepth[MAX_NUM_CHANNEL_TYPE];1345 BitDepths m_bitDepths; 1345 1346 Int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE]; 1346 1347 Bool m_useExtendedPrecision; … … 1351 1352 Bool m_alignCABACBeforeBypass; 1352 1353 Bool m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES]; 1353 UInt m_uiPCMBitDepth[MAX_NUM_CHANNEL_TYPE];1354 Int m_pcmBitDepths[MAX_NUM_CHANNEL_TYPE]; 1354 1355 Bool m_bPCMFilterDisableFlag; 1355 1356 Bool m_disableIntraReferenceSmoothing; … … 1478 1479 1479 1480 // Bit-depth 1480 Int getBitDepth(ChannelType type) const { return m_uiBitDepth[type]; } 1481 Void setBitDepth(ChannelType type, Int u ) { m_uiBitDepth[type] = u; } 1482 Int getMaxLog2TrDynamicRange(ChannelType channelType) const { return getUseExtendedPrecision() ? std::max<Int>(15, Int(m_uiBitDepth[channelType] + 6)) : 15; } 1483 1484 Int getDifferentialLumaChromaBitDepth() const { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); } 1481 Int getBitDepth(ChannelType type) const { return m_bitDepths.recon[type]; } 1482 Void setBitDepth(ChannelType type, Int u ) { m_bitDepths.recon[type] = u; } 1483 #if O0043_BEST_EFFORT_DECODING 1484 Int getStreamBitDepth(ChannelType type) const { return m_bitDepths.stream[type]; } 1485 Void setStreamBitDepth(ChannelType type, Int u ) { m_bitDepths.stream[type] = u; } 1486 #endif 1487 const BitDepths& getBitDepths() const { return m_bitDepths; } 1488 Int getMaxLog2TrDynamicRange(ChannelType channelType) const { return getUseExtendedPrecision() ? std::max<Int>(15, Int(m_bitDepths.recon[channelType] + 6)) : 15; } 1489 1490 Int getDifferentialLumaChromaBitDepth() const { return Int(m_bitDepths.recon[CHANNEL_TYPE_LUMA]) - Int(m_bitDepths.recon[CHANNEL_TYPE_CHROMA]); } 1485 1491 Int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; } 1486 1492 Void setQpBDOffset(ChannelType type, Int i) { m_qpBDOffset[type] = i; } … … 1513 1519 Bool getTemporalIdNestingFlag() const { return m_bTemporalIdNestingFlag; } 1514 1520 Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } 1515 UInt getPCMBitDepth(ChannelType type) const { return m_ uiPCMBitDepth[type];}1516 Void setPCMBitDepth(ChannelType type, UInt u) { m_ uiPCMBitDepth[type] = u;}1521 UInt getPCMBitDepth(ChannelType type) const { return m_pcmBitDepths[type]; } 1522 Void setPCMBitDepth(ChannelType type, UInt u) { m_pcmBitDepths[type] = u; } 1517 1523 Void setPCMFilterDisableFlag( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } 1518 1524 Bool getPCMFilterDisableFlag() const { return m_bPCMFilterDisableFlag; } … … 2260 2266 } 2261 2267 2262 Void getWpAcDcParam( WPACDCParam *&wp ); 2268 WPACDCParam* getWpAcDcParam() { return &m_weightACDCParam[0]; } 2269 2263 2270 Void initWpAcDcParam(); 2264 2271 … … 2293 2300 2294 2301 Void setLayerId(UInt layerId) { m_layerId = layerId; } 2295 UInt getLayerId() { return m_layerId; }2302 UInt getLayerId() const { return m_layerId; } 2296 2303 UInt getLayerIdx() { return m_pcVPS->getLayerIdxInVps(m_layerId); } 2297 2304 … … 2347 2354 UInt getPicHeightInLumaSamples(); 2348 2355 ChromaFormat getChromaFormatIdc(); 2349 UInt getBitDepthY(); 2350 UInt getBitDepthC(); 2351 Int getQpBDOffsetY(); 2352 Int getQpBDOffsetC(); 2356 UInt getBitDepth(ChannelType type) const; 2357 BitDepths& getBitDepths(); 2358 Int getQpBDOffset(ChannelType type) const { return (getBitDepth(type) - 8) * 6; } 2353 2359 2354 2360 const Window& getConformanceWindow() const; -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1285 r1287 119 119 toChannelType(compID), 120 120 #if SVC_EXTENSION 121 isLuma(compID) ? slice->getQpBDOffsetY() : slice->getQpBDOffsetC(),121 cu.getSlice()->getQpBDOffset(toChannelType(compID)), 122 122 #else 123 123 cu.getSlice()->getSPS()->getQpBDOffset(toChannelType(compID)), … … 1147 1147 TComDataCU* pcCU = rTu.getCU(); 1148 1148 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); 1149 #if SVC_EXTENSION 1150 const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID)); 1151 #else 1152 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 1153 #endif 1149 1154 1150 1155 TCoeff* piCoef = pSrc; … … 1192 1197 1193 1198 // Represents scaling through forward transform 1194 Int iTransformShift = getTransformShift( toChannelType(compID), uiLog2TrSize, maxLog2TrDynamicRange);1199 Int iTransformShift = getTransformShift(channelBitDepth, uiLog2TrSize, maxLog2TrDynamicRange); 1195 1200 if (useTransformSkip && pcCU->getSlice()->getSPS()->getUseExtendedPrecision()) 1196 1201 { … … 1271 1276 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0)); 1272 1277 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); 1278 #if O0043_BEST_EFFORT_DECODING 1279 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID)); 1280 #else 1281 #if SVC_EXTENSION 1282 const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID)); 1283 #else 1284 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 1285 #endif 1286 #endif 1273 1287 1274 1288 assert (scalingListType < SCALING_LIST_NUM); … … 1277 1291 // Represents scaling through forward transform 1278 1292 const Bool bClipTransformShiftTo0 = (pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0) && pcCU->getSlice()->getSPS()->getUseExtendedPrecision(); 1279 const Int originalTransformShift = getTransformShift( toChannelType(compID), uiLog2TrSize, maxLog2TrDynamicRange);1293 const Int originalTransformShift = getTransformShift(channelBitDepth, uiLog2TrSize, maxLog2TrDynamicRange); 1280 1294 const Int iTransformShift = bClipTransformShiftTo0 ? std::max<Int>(0, originalTransformShift) : originalTransformShift; 1281 1295 … … 1443 1457 else 1444 1458 { 1445 xT( compID, rTu.useDST(compID), pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) ); 1459 #if SVC_EXTENSION 1460 const Int channelBitDepth=pcCU->getSlice()->getBitDepth(toChannelType(compID)); 1461 #else 1462 const Int channelBitDepth=pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 1463 #endif 1464 xT( channelBitDepth, rTu.useDST(compID), pcResidual, uiStride, m_plTempCoeff, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) ); 1446 1465 } 1447 1466 … … 1573 1592 else 1574 1593 { 1575 xIT( compID, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) ); 1594 #if O0043_BEST_EFFORT_DECODING 1595 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID)); 1596 #else 1597 #if SVC_EXTENSION 1598 const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID)); 1599 #else 1600 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 1601 #endif 1602 #endif 1603 xIT( channelBitDepth, rTu.useDST(compID), m_plTempCoeff, pcResidual, uiStride, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)) ); 1576 1604 1577 1605 #if defined DEBUG_STRING … … 1865 1893 * \param iHeight transform height 1866 1894 */ 1867 Void TComTrQuant::xT( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange )1895 Void TComTrQuant::xT( const Int channelBitDepth, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ) 1868 1896 { 1869 1897 #if MATRIX_MULT 1870 1898 if( iWidth == iHeight) 1871 1899 { 1872 xTr( g_bitDepth[toChannelType(compID)], piBlkResi, psCoeff, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange);1900 xTr(channelBitDepth, piBlkResi, psCoeff, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange); 1873 1901 return; 1874 1902 } … … 1886 1914 } 1887 1915 1888 xTrMxN( g_bitDepth[toChannelType(compID)], block, coeff, iWidth, iHeight, useDST, maxLog2TrDynamicRange );1916 xTrMxN( channelBitDepth, block, coeff, iWidth, iHeight, useDST, maxLog2TrDynamicRange ); 1889 1917 1890 1918 memcpy(psCoeff, coeff, (iWidth * iHeight * sizeof(TCoeff))); … … 1900 1928 * \param iHeight transform height 1901 1929 */ 1902 Void TComTrQuant::xIT( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange )1930 Void TComTrQuant::xIT( const Int channelBitDepth, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ) 1903 1931 { 1904 1932 #if MATRIX_MULT 1905 1933 if( iWidth == iHeight ) 1906 1934 { 1907 #if O0043_BEST_EFFORT_DECODING 1908 xITr(g_bitDepthInStream[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange); 1909 #else 1910 xITr(g_bitDepth[toChannelType(compID)], plCoef, pResidual, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange); 1911 #endif 1935 xITr(channelBitDepth, plCoef, pResidual, uiStride, (UInt)iWidth, useDST, maxLog2TrDynamicRange); 1912 1936 return; 1913 1937 } … … 1919 1943 memcpy(coeff, plCoef, (iWidth * iHeight * sizeof(TCoeff))); 1920 1944 1921 #if O0043_BEST_EFFORT_DECODING 1922 xITrMxN( g_bitDepthInStream[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, maxLog2TrDynamicRange ); 1923 #else 1924 xITrMxN( g_bitDepth[toChannelType(compID)], coeff, block, iWidth, iHeight, useDST, maxLog2TrDynamicRange ); 1925 #endif 1945 xITrMxN( channelBitDepth, coeff, block, iWidth, iHeight, useDST, maxLog2TrDynamicRange ); 1926 1946 1927 1947 for (Int y = 0; y < iHeight; y++) … … 1947 1967 const Int height = rect.height; 1948 1968 const Int maxLog2TrDynamicRange = rTu.getCU()->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(component)); 1949 1950 Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange); 1969 #if SVC_EXTENSION 1970 const Int channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(toChannelType(component)); 1971 #else 1972 const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(toChannelType(component)); 1973 #endif 1974 1975 Int iTransformShift = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange); 1951 1976 if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision()) 1952 1977 { … … 1995 2020 const Int height = rect.height; 1996 2021 const Int maxLog2TrDynamicRange = rTu.getCU()->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(component)); 1997 1998 Int iTransformShift = getTransformShift(toChannelType(component), rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange); 2022 #if O0043_BEST_EFFORT_DECODING 2023 const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getStreamBitDepth(toChannelType(component)); 2024 #else 2025 #if SVC_EXTENSION 2026 const Int channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(toChannelType(component)); 2027 #else 2028 const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(toChannelType(component)); 2029 #endif 2030 #endif 2031 2032 Int iTransformShift = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(component), maxLog2TrDynamicRange); 1999 2033 if (rTu.getCU()->getSlice()->getSPS()->getUseExtendedPrecision()) 2000 2034 { … … 2063 2097 const Bool extendedPrecision = pcCU->getSlice()->getSPS()->getUseExtendedPrecision(); 2064 2098 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)); 2099 #if SVC_EXTENSION 2100 const Int channelBitDepth = rTu.getCU()->getSlice()->getBitDepth(channelType); 2101 #else 2102 const Int channelBitDepth = rTu.getCU()->getSlice()->getSPS()->getBitDepth(channelType); 2103 #endif 2065 2104 2066 2105 /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be … … 2071 2110 2072 2111 // Represents scaling through forward transform 2073 Int iTransformShift = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange);2112 Int iTransformShift = getTransformShift(channelBitDepth, uiLog2TrSize, maxLog2TrDynamicRange); 2074 2113 if ((pcCU->getTransformSkip(uiAbsPartIdx, compID) != 0) && pcCU->getSlice()->getSPS()->getUseExtendedPrecision()) 2075 2114 { … … 2457 2496 const Double inverseQuantScale = Double(g_invQuantScales[cQP.rem]); 2458 2497 Int64 rdFactor = (Int64)(inverseQuantScale * inverseQuantScale * (1 << (2 * cQP.per)) 2459 / m_dLambda / 16 / (1 << (2 * DISTORTION_PRECISION_ADJUSTMENT( g_bitDepth[channelType]- 8)))2498 / m_dLambda / 16 / (1 << (2 * DISTORTION_PRECISION_ADJUSTMENT(channelBitDepth - 8))) 2460 2499 + 0.5); 2461 2500 … … 2986 3025 * \param format chroma format 2987 3026 */ 2988 Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] )3027 Void TComTrQuant::setScalingList(TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) 2989 3028 { 2990 3029 const Int minimumQp = 0; … … 2999 3038 xSetScalingListEnc(scalingList,list,size,qp,format); 3000 3039 xSetScalingListDec(*scalingList,list,size,qp,format); 3001 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange );3040 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange, bitDepths); 3002 3041 } 3003 3042 } … … 3029 3068 * \param qp Quantization parameter 3030 3069 */ 3031 Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] )3070 Void TComTrQuant::setErrScaleCoeff(UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) 3032 3071 { 3033 3072 const UInt uiLog2TrSize = g_aucConvertToBit[ g_scalingListSizeX[size] ] + 2; 3034 3073 const ChannelType channelType = ((list == 0) || (list == MAX_NUM_COMPONENT)) ? CHANNEL_TYPE_LUMA : CHANNEL_TYPE_CHROMA; 3035 3074 3036 const Int iTransformShift = getTransformShift(channelType, uiLog2TrSize, maxLog2TrDynamicRange[channelType]); // Represents scaling through forward transform 3075 const Int channelBitDepth = bitDepths.recon[channelType]; 3076 const Int iTransformShift = getTransformShift(channelBitDepth, uiLog2TrSize, maxLog2TrDynamicRange[channelType]); // Represents scaling through forward transform 3037 3077 3038 3078 UInt i,uiMaxNumCoeff = g_scalingListSize[size]; … … 3047 3087 for(i=0;i<uiMaxNumCoeff;i++) 3048 3088 { 3049 pdErrScale[i] = dErrScale / piQuantcoeff[i] / piQuantcoeff[i] / (1 << DISTORTION_PRECISION_ADJUSTMENT(2 * ( g_bitDepth[channelType] - 8)));3050 } 3051 3052 getErrScaleCoeffNoScalingList(list, size, qp) = dErrScale / g_quantScales[qp] / g_quantScales[qp] / (1 << DISTORTION_PRECISION_ADJUSTMENT(2 * ( g_bitDepth[channelType] - 8)));3089 pdErrScale[i] = dErrScale / piQuantcoeff[i] / piQuantcoeff[i] / (1 << DISTORTION_PRECISION_ADJUSTMENT(2 * (bitDepths.recon[channelType] - 8))); 3090 } 3091 3092 getErrScaleCoeffNoScalingList(list, size, qp) = dErrScale / g_quantScales[qp] / g_quantScales[qp] / (1 << DISTORTION_PRECISION_ADJUSTMENT(2 * (bitDepths.recon[channelType] - 8))); 3053 3093 } 3054 3094 … … 3108 3148 /** set flat matrix value to quantized coefficient 3109 3149 */ 3110 Void TComTrQuant::setFlatScalingList(const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] )3150 Void TComTrQuant::setFlatScalingList(const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths) 3111 3151 { 3112 3152 const Int minimumQp = 0; … … 3120 3160 { 3121 3161 xsetFlatScalingList(list,size,qp,format); 3122 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange );3162 setErrScaleCoeff(list,size,qp,maxLog2TrDynamicRange, bitDepths); 3123 3163 } 3124 3164 } … … 3256 3296 const UInt uiHeight = rect.height; 3257 3297 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)); 3258 const Int iTransformShift = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange); 3298 #if SVC_EXTENSION 3299 const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID)); 3300 #else 3301 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 3302 #endif 3303 const Int iTransformShift = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange); 3259 3304 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); 3260 3305 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true); … … 3315 3360 const Int QP_rem = cQP.rem; 3316 3361 const Int maxLog2TrDynamicRange = pcCU->getSlice()->getSPS()->getMaxLog2TrDynamicRange(toChannelType(compID)); 3317 const Int iTransformShift = getTransformShift(toChannelType(compID), rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange); 3362 #if O0043_BEST_EFFORT_DECODING 3363 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getStreamBitDepth(toChannelType(compID)); 3364 #else 3365 #if SVC_EXTENSION 3366 const Int channelBitDepth = pcCU->getSlice()->getBitDepth(toChannelType(compID)); 3367 #else 3368 const Int channelBitDepth = pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)); 3369 #endif 3370 #endif 3371 const Int iTransformShift = getTransformShift(channelBitDepth, rTu.GetEquivalentLog2TrSize(compID), maxLog2TrDynamicRange); 3318 3372 const Int scalingListType = getScalingListType(pcCU->getPredictionMode(uiAbsPartIdx), compID); 3319 3373 const Bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true); -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h
r1285 r1287 172 172 Void initScalingList (); 173 173 Void destroyScalingList (); 174 Void setErrScaleCoeff ( UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] );174 Void setErrScaleCoeff ( UInt list, UInt size, Int qp, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths ); 175 175 Double* getErrScaleCoeff ( UInt list, UInt size, Int qp ) { return m_errScale [size][list][qp]; }; //!< get Error Scale Coefficent 176 176 Double& getErrScaleCoeffNoScalingList ( UInt list, UInt size, Int qp ) { return m_errScaleNoScalingList[size][list][qp]; }; //!< get Error Scale Coefficent … … 179 179 Void setUseScalingList ( Bool bUseScalingList){ m_scalingListEnabledFlag = bUseScalingList; }; 180 180 Bool getUseScalingList (const UInt width, const UInt height, const Bool isTransformSkip){ return m_scalingListEnabledFlag && (!isTransformSkip || ((width == 4) && (height == 4))); }; 181 Void setFlatScalingList (const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] );181 Void setFlatScalingList (const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths); 182 182 Void xsetFlatScalingList ( UInt list, UInt size, Int qp, const ChromaFormat format); 183 183 Void xSetScalingListEnc ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format); 184 184 Void xSetScalingListDec ( const TComScalingList &scalingList, UInt list, UInt size, Int qp, const ChromaFormat format); 185 Void setScalingList ( TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE] );185 Void setScalingList ( TComScalingList *scalingList, const ChromaFormat format, const Int maxLog2TrDynamicRange[MAX_NUM_CHANNEL_TYPE], const BitDepths &bitDepths); 186 186 Void setScalingListDec ( const TComScalingList &scalingList, const ChromaFormat format); 187 187 Void processScalingListEnc( Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc); … … 230 230 private: 231 231 // forward Transform 232 Void xT ( const ComponentID compID, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange );232 Void xT ( const Int channelBitDepth, Bool useDST, Pel* piBlkResi, UInt uiStride, TCoeff* psCoeff, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ); 233 233 234 234 // skipping Transform … … 304 304 305 305 // inverse transform 306 Void xIT ( const ComponentID compID, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange );306 Void xIT ( const Int channelBitDepth, Bool useDST, TCoeff* plCoef, Pel* pResidual, UInt uiStride, Int iWidth, Int iHeight, const Int maxLog2TrDynamicRange ); 307 307 308 308 // inverse skipping transform -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r1235 r1287 51 51 } 52 52 53 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )53 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Int refBitDepthLuma, const Int refBitDepthChroma ) 54 54 { 55 55 assert ( NTAPS_US_LUMA == 8 ); … … 63 63 const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 64 64 const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId); 65 66 Int bitDepthLuma = currSlice->getBitDepth(CHANNEL_TYPE_LUMA); 67 Int bitDepthChroma = currSlice->getBitDepth(CHANNEL_TYPE_CHROMA); 65 68 66 69 //========== Y component upsampling =========== … … 115 118 piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL; 116 119 117 Int shift = g_bitDepthLayer[CHANNEL_TYPE_LUMA][currLayerId] - g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId];120 Int shift = bitDepthLuma - refBitDepthLuma; 118 121 119 122 #if CGS_3D_ASYMLUT 120 123 if( currSlice->getPPS()->getCGSFlag() ) 121 124 { 122 shift = g_bitDepthLayer[CHANNEL_TYPE_LUMA][currLayerId]- currSlice->getPPS()->getCGSOutputBitDepthY();125 shift = bitDepthLuma - currSlice->getPPS()->getCGSOutputBitDepthY(); 123 126 } 124 127 assert( shift >= 0 ); … … 151 154 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 152 155 153 shift = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][currLayerId] - g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId];156 shift = bitDepthChroma - refBitDepthChroma; 154 157 155 158 #if CGS_3D_ASYMLUT 156 159 if( currSlice->getPPS()->getCGSFlag() ) 157 160 { 158 shift = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][currLayerId]- currSlice->getPPS()->getCGSOutputBitDepthC();161 shift = currSlice->getBitDepth(CHANNEL_TYPE_CHROMA) - currSlice->getPPS()->getCGSOutputBitDepthC(); 159 162 } 160 163 #endif … … 218 221 219 222 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 220 Int shift1 = g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId]- 8;223 Int shift1 = refBitDepthLuma - 8; 221 224 222 225 #if CGS_3D_ASYMLUT … … 254 257 pcTempPic->setHeight(heightEL); 255 258 256 Int nShift = 20 - g_bitDepthLayer[CHANNEL_TYPE_LUMA][currLayerId];259 Int nShift = 20 - bitDepthLuma; 257 260 Int iOffset = 1 << (nShift - 1); 258 261 … … 273 276 for( i = pcTempPic->getWidth(COMPONENT_Y); i > 0; i-- ) 274 277 { 275 *piDstY = Clip ( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_LUMA);278 *piDstY = ClipBD( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift), bitDepthLuma ); 276 279 piSrcY++; 277 280 piDstY++; … … 318 321 319 322 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth 320 shift1 = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId]- 8;323 shift1 = refBitDepthChroma - 8; 321 324 322 325 #if CGS_3D_ASYMLUT … … 360 363 pcTempPic->setHeight(heightEL << 1); 361 364 362 nShift = 20 - g_bitDepthLayer[CHANNEL_TYPE_CHROMA][currLayerId];365 nShift = 20 - bitDepthChroma; 363 366 364 367 iOffset = 1 << (nShift - 1); … … 384 387 for( i = pcTempPic->getWidth(COMPONENT_Y) >> 1; i > 0; i-- ) 385 388 { 386 *piDstU = Clip ( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA);387 *piDstV = Clip ( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA);389 *piDstU = ClipBD( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), bitDepthChroma ); 390 *piDstV = ClipBD( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift), bitDepthChroma ); 388 391 piSrcU++; 389 392 piSrcV++; -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
r1090 r1287 42 42 TComUpsampleFilter(void); 43 43 ~TComUpsampleFilter(void); 44 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );44 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Int refBitDepthLuma, const Int refBitDepthChroma ); 45 45 46 46 }; -
branches/SHM-dev/source/Lib/TLibCommon/TComWeightPrediction.cpp
r1262 r1287 67 67 Void TComWeightPrediction::addWeightBi( const TComYuv *pcYuvSrc0, 68 68 const TComYuv *pcYuvSrc1, 69 const BitDepths &bitDepths, 69 70 const UInt iPartUnitIdx, 70 71 const UInt uiWidth, … … 73 74 const WPScalingParam *const wp1, 74 75 TComYuv *const rpcYuvDst, 75 const Bool bRoundLuma )76 const Bool bRoundLuma) 76 77 { 77 78 … … 91 92 const Int w0 = wp0[compID].w; 92 93 const Int offset = wp0[compID].offset; 93 const Int clipBD = g_bitDepth[toChannelType(compID)];94 const Int clipBD = bitDepths.recon[toChannelType(compID)]; 94 95 const Int shiftNum = std::max<Int>(2, (IF_INTERNAL_PREC - clipBD)); 95 96 const Int shift = wp0[compID].shift + shiftNum; … … 131 132 //! weighted averaging for uni-pred 132 133 Void TComWeightPrediction::addWeightUni( const TComYuv *const pcYuvSrc0, 134 const BitDepths &bitDepths, 133 135 const UInt iPartUnitIdx, 134 136 const UInt uiWidth, … … 149 151 const Int w0 = wp0[compID].w; 150 152 const Int offset = wp0[compID].offset; 151 const Int clipBD = g_bitDepth[toChannelType(compID)];153 const Int clipBD = bitDepths.recon[toChannelType(compID)]; 152 154 const Int shiftNum = std::max<Int>(2, (IF_INTERNAL_PREC - clipBD)); 153 155 const Int shift = wp0[compID].shift + shiftNum; … … 230 232 for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ ) 231 233 { 232 const Int bitDepth = g_bitDepth[toChannelType(ComponentID(yuv))]; 234 #if SVC_EXTENSION 235 const Int bitDepth = pcSlice->getBitDepth(toChannelType(ComponentID(yuv))); 236 #else 237 const Int bitDepth = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv))); 238 #endif 233 239 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8)); 234 240 … … 251 257 for ( Int yuv=0 ; yuv<numValidComponent ; yuv++ ) 252 258 { 253 const Int bitDepth = g_bitDepth[toChannelType(ComponentID(yuv))]; 259 #if SVC_EXTENSION 260 const Int bitDepth = pcSlice->getBitDepth(toChannelType(ComponentID(yuv))); 261 #else 262 const Int bitDepth = pcSlice->getSPS()->getBitDepth(toChannelType(ComponentID(yuv))); 263 #endif 254 264 const Int offsetScalingFactor = bUseHighPrecisionPredictionWeighting ? 1 : (1 << (bitDepth-8)); 255 265 … … 283 293 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 284 294 { 285 addWeightBi(pcYuvSrc0, pcYuvSrc1, uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 295 #if SVC_EXTENSION 296 addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 297 #else 298 addWeightBi(pcYuvSrc0, pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, pwp1, rpcYuvDst ); 299 #endif 286 300 } 287 301 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 288 302 { 289 addWeightUni( pcYuvSrc0, uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 303 #if SVC_EXTENSION 304 addWeightUni( pcYuvSrc0, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 305 #else 306 addWeightUni( pcYuvSrc0, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp0, rpcYuvDst ); 307 #endif 290 308 } 291 309 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 292 310 { 293 addWeightUni( pcYuvSrc1, uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 311 #if SVC_EXTENSION 312 addWeightUni( pcYuvSrc1, pcCU->getSlice()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 313 #else 314 addWeightUni( pcYuvSrc1, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartIdx, iWidth, iHeight, pwp1, rpcYuvDst ); 315 #endif 294 316 } 295 317 else … … 327 349 getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp); 328 350 } 329 addWeightUni( pcYuvSrc, uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 330 } 351 #if SVC_EXTENSION 352 addWeightUni( pcYuvSrc, pcCU->getSlice()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 353 #else 354 addWeightUni( pcYuvSrc, pcCU->getSlice()->getSPS()->getBitDepths(), uiPartAddr, iWidth, iHeight, pwp, pcYuvPred ); 355 #endif 356 } -
branches/SHM-dev/source/Lib/TLibCommon/TComWeightPrediction.h
r1262 r1287 63 63 Void addWeightBi( const TComYuv *pcYuvSrc0, 64 64 const TComYuv *pcYuvSrc1, 65 const BitDepths &bitDepths, 65 66 const UInt iPartUnitIdx, 66 67 const UInt uiWidth, … … 72 73 73 74 Void addWeightUni( const TComYuv *const pcYuvSrc0, 75 const BitDepths &bitDepths, 74 76 const UInt iPartUnitIdx, 75 77 const UInt uiWidth, -
branches/SHM-dev/source/Lib/TLibCommon/TComYuv.cpp
r1259 r1287 278 278 279 279 280 Void TComYuv::addClip( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize )280 Void TComYuv::addClip( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize, const BitDepths &clipBitDepths ) 281 281 { 282 282 for(Int chan=0; chan<getNumberValidComponents(); chan++) … … 293 293 const UInt iSrc1Stride = pcYuvSrc1->getStride(ch); 294 294 const UInt iDstStride = getStride(ch); 295 const Int clipbd = g_bitDepth[toChannelType(ch)];295 const Int clipbd = clipBitDepths.recon[toChannelType(ch)]; 296 296 #if O0043_BEST_EFFORT_DECODING 297 const Int bitDepthDelta = g_bitDepthInStream[toChannelType(ch)] - g_bitDepth[toChannelType(ch)];297 const Int bitDepthDelta = clipBitDepths.stream[toChannelType(ch)] - clipbd; 298 298 #endif 299 299 … … 350 350 351 351 352 Void TComYuv::addAvg( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt iPartUnitIdx, const UInt uiWidth, const UInt uiHeight )352 Void TComYuv::addAvg( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt iPartUnitIdx, const UInt uiWidth, const UInt uiHeight, const BitDepths &clipBitDepths ) 353 353 { 354 354 for(Int chan=0; chan<getNumberValidComponents(); chan++) … … 362 362 const UInt iSrc1Stride = pcYuvSrc1->getStride(ch); 363 363 const UInt iDstStride = getStride(ch); 364 const Int clipbd = g_bitDepth[toChannelType(ch)];364 const Int clipbd = clipBitDepths.recon[toChannelType(ch)]; 365 365 const Int shiftNum = std::max<Int>(2, (IF_INTERNAL_PREC - clipbd)) + 1; 366 366 const Int offset = ( 1 << ( shiftNum - 1 ) ) + 2 * IF_INTERNAL_OFFS; -
branches/SHM-dev/source/Lib/TLibCommon/TComYuv.h
r1262 r1287 131 131 132 132 // Clip(pcYuvSrc0 + pcYuvSrc1) -> m_apiBuf 133 Void addClip ( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize );133 Void addClip ( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt uiTrUnitIdx, const UInt uiPartSize, const BitDepths &clipBitDepths ); 134 134 135 135 // pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf … … 137 137 138 138 // (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition 139 Void addAvg ( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt iPartUnitIdx, const UInt iWidth, const UInt iHeight );139 Void addAvg ( const TComYuv* pcYuvSrc0, const TComYuv* pcYuvSrc1, const UInt iPartUnitIdx, const UInt iWidth, const UInt iHeight, const BitDepths &clipBitDepths ); 140 140 141 141 Void removeHighFreq ( const TComYuv* pcYuvSrc, const UInt uiPartIdx, const UInt uiWidth, const UInt uiHeight ); -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1273 r1287 842 842 843 843 844 struct BitDepths 845 { 846 #if O0043_BEST_EFFORT_DECODING 847 Int recon[MAX_NUM_CHANNEL_TYPE]; ///< the bit depth used for reconstructing the video 848 Int stream[MAX_NUM_CHANNEL_TYPE];///< the bit depth used indicated in the SPS 849 #else 850 Int recon[MAX_NUM_CHANNEL_TYPE]; ///< the bit depth as indicated in the SPS 851 #endif 852 853 #if SVC_EXTENSION 854 BitDepths() 855 { 856 } 857 BitDepths(Int bitDepthY, Int bitDepthC) 858 { 859 recon[CHANNEL_TYPE_LUMA] = bitDepthY; 860 recon[CHANNEL_TYPE_CHROMA] = bitDepthC; 861 } 862 #endif 863 }; 864 844 865 /// parameters for deblocking filter 845 866 typedef struct _LFCUParam
Note: See TracChangeset for help on using the changeset viewer.