Changeset 1240 in SHVCSoftware
- Timestamp:
- 13 Jul 2015, 21:01:49 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp
r1239 r1240 1639 1639 UInt uiY = 0; 1640 1640 1641 UInt &majorAxis = (mode == RDPCM_HOR) ? uiX : uiY; 1642 UInt &minorAxis = (mode == RDPCM_HOR) ? uiY : uiX; 1643 const UInt majorAxisLimit = (mode == RDPCM_HOR) ? uiWidth : uiHeight; 1644 const UInt minorAxisLimit = (mode == RDPCM_HOR) ? uiHeight : uiWidth; 1645 const UInt referenceSampleOffset = (mode == RDPCM_HOR) ? 1 : uiWidth; 1646 1647 const Bool bUseHalfRoundingPoint = (mode != RDPCM_OFF); 1641 UInt &majorAxis = (mode == RDPCM_VER) ? uiX : uiY; 1642 UInt &minorAxis = (mode == RDPCM_VER) ? uiY : uiX; 1643 const UInt majorAxisLimit = (mode == RDPCM_VER) ? uiWidth : uiHeight; 1644 const UInt minorAxisLimit = (mode == RDPCM_VER) ? uiHeight : uiWidth; 1645 static const TCoeff pelMin=(Int) std::numeric_limits<Pel>::min(); 1646 static const TCoeff pelMax=(Int) std::numeric_limits<Pel>::max(); 1647 1648 const Bool bUseHalfRoundingPoint = (mode != RDPCM_OFF); 1648 1649 1649 1650 uiAbsSum = 0; … … 1651 1652 for ( majorAxis = 0; majorAxis < majorAxisLimit; majorAxis++ ) 1652 1653 { 1654 TCoeff accumulatorValue = 0; // 32-bit accumulator 1653 1655 for ( minorAxis = 0; minorAxis < minorAxisLimit; minorAxis++ ) 1654 1656 { … … 1656 1658 const UInt coefficientIndex = (rotateResidual ? (uiSizeMinus1-sampleIndex) : sampleIndex); 1657 1659 const Pel currentSample = pcResidual[(uiY * uiStride) + uiX]; 1658 const Pel referenceSample = ((mode != RDPCM_OFF) && (majorAxis > 0)) ? reconstructedResi[sampleIndex - referenceSampleOffset] : 0; 1659 1660 const Pel encoderSideDelta = currentSample - referenceSample; 1660 const TCoeff encoderSideDelta = TCoeff(currentSample) - accumulatorValue; 1661 1661 1662 1662 Pel reconstructedDelta; … … 1674 1674 uiAbsSum += abs(pcCoeff[coefficientIndex]); 1675 1675 1676 reconstructedResi[sampleIndex] = reconstructedDelta + referenceSample; 1676 if (mode == RDPCM_OFF) 1677 { 1678 reconstructedResi[sampleIndex] = reconstructedDelta; 1679 } 1680 else 1681 { 1682 accumulatorValue += reconstructedDelta; 1683 reconstructedResi[sampleIndex] = (Pel) Clip3<TCoeff>(pelMin, pelMax, accumulatorValue); 1684 } 1677 1685 } 1678 1686 } … … 1773 1781 } 1774 1782 1783 static const TCoeff pelMin=(TCoeff) std::numeric_limits<Pel>::min(); 1784 static const TCoeff pelMax=(TCoeff) std::numeric_limits<Pel>::max(); 1775 1785 if (rdpcmMode == RDPCM_VER) 1776 1786 { 1777 pcResidual += uiStride; //start from row 1 1778 1779 for( UInt uiY = 1; uiY < uiHeight; uiY++ ) 1780 { 1781 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1787 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1788 { 1789 Pel *pcCurResidual = pcResidual+uiX; 1790 TCoeff accumulator = *pcCurResidual; // 32-bit accumulator 1791 pcCurResidual+=uiStride; 1792 for( UInt uiY = 1; uiY < uiHeight; uiY++, pcCurResidual+=uiStride ) 1782 1793 { 1783 pcResidual[ uiX ] = pcResidual[ uiX ] + pcResidual [ (Int)uiX - (Int)uiStride ]; 1794 accumulator += *(pcCurResidual); 1795 *pcCurResidual = (Pel)Clip3<TCoeff>(pelMin, pelMax, accumulator); 1784 1796 } 1785 pcResidual += uiStride;1786 1797 } 1787 1798 } … … 1790 1801 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1791 1802 { 1792 for( UInt uiX = 1; uiX < uiWidth; uiX++ ) 1803 Pel *pcCurResidual = pcResidual+uiY*uiStride; 1804 TCoeff accumulator = *pcCurResidual; 1805 pcCurResidual++; 1806 for( UInt uiX = 1; uiX < uiWidth; uiX++, pcCurResidual++ ) 1793 1807 { 1794 pcResidual[ uiX ] = pcResidual[ uiX ] + pcResidual [ (Int)uiX-1 ]; 1808 accumulator += *(pcCurResidual); 1809 *pcCurResidual = (Pel)Clip3<TCoeff>(pelMin, pelMax, accumulator); 1795 1810 } 1796 pcResidual += uiStride;1797 1811 } 1798 1812 } … … 3146 3160 } 3147 3161 3148 Void TComTrQuant::transformSkipQuantOneSample(TComTU &rTu, const ComponentID compID, const PelresiDiff, TCoeff* pcCoeff, const UInt uiPos, const QpParam &cQP, const Bool bUseHalfRoundingPoint)3162 Void TComTrQuant::transformSkipQuantOneSample(TComTU &rTu, const ComponentID compID, const TCoeff resiDiff, TCoeff* pcCoeff, const UInt uiPos, const QpParam &cQP, const Bool bUseHalfRoundingPoint) 3149 3163 { 3150 3164 TComDataCU *pcCU = rTu.getCU(); -
branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h
r1235 r1240 195 195 Double* getSliceSumC() { return m_sliceSumC; } 196 196 #endif 197 Void transformSkipQuantOneSample(TComTU &rTu, const ComponentID compID, const PelresiDiff, TCoeff* pcCoeff, const UInt uiPos, const QpParam &cQP, const Bool bUseHalfRoundingPoint);197 Void transformSkipQuantOneSample(TComTU &rTu, const ComponentID compID, const TCoeff resiDiff, TCoeff* pcCoeff, const UInt uiPos, const QpParam &cQP, const Bool bUseHalfRoundingPoint); 198 198 Void invTrSkipDeQuantOneSample(TComTU &rTu, ComponentID compID, TCoeff pcCoeff, Pel &reconSample, const QpParam &cQP, UInt uiPos ); 199 199
Note: See TracChangeset for help on using the changeset viewer.