Ticket #560: transform_skip.patch
File transform_skip.patch, 3.0 KB (added by cuilinglan, 12 years ago) |
---|
-
TLibCommon/TComTrQuant.cpp
1636 1636 #else 1637 1637 UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement; 1638 1638 #endif 1639 UInt iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; 1640 Int j,k; 1641 for (j = 0; j < height; j++) 1642 { 1643 for(k = 0; k < width; k ++) 1644 { 1645 psCoeff[j*height + k] = piBlkResi[j * uiStride + k] << iTransformShift; 1639 Int shift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; 1640 UInt transformSkipShift; 1641 Int j,k; 1642 if(shift > 0) 1643 { 1644 transformSkipShift = shift; 1645 for (j = 0; j < height; j++) 1646 { 1647 for(k = 0; k < width; k ++) 1648 { 1649 psCoeff[j*height + k] = piBlkResi[j * uiStride + k] << transformSkipShift; 1650 } 1646 1651 } 1647 1652 } 1653 else 1654 { 1655 //The case when uiBitDepth >= 13 1656 transformSkipShift = - shift; 1657 for (j = 0; j < height; j++) 1658 { 1659 for(k = 0; k < width; k ++) 1660 { 1661 psCoeff[j*height + k] = piBlkResi[j * uiStride + k] >> transformSkipShift; 1662 } 1663 } 1664 } 1648 1665 } 1649 1666 1650 1667 /** Wrapper function between HM interface and core NxN transform skipping … … 1662 1679 #else 1663 1680 UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement; 1664 1681 #endif 1665 UInt iTransformShift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; 1666 UInt iAdd = (1 << (iTransformShift -1)); 1667 Int j,k; 1668 for ( j = 0; j < height; j++ ) 1669 { 1670 for(k = 0; k < width; k ++) 1671 { 1672 pResidual[j * uiStride + k] = (plCoef[j*width+k] + iAdd) >> iTransformShift; 1682 Int shift = MAX_TR_DYNAMIC_RANGE - uiBitDepth - uiLog2TrSize; 1683 UInt transformSkipShift; 1684 Int j,k; 1685 if(shift > 0) 1686 { 1687 UInt iAdd; 1688 transformSkipShift = shift; 1689 iAdd = (1 << (transformSkipShift -1)); 1690 for ( j = 0; j < height; j++ ) 1691 { 1692 for(k = 0; k < width; k ++) 1693 { 1694 pResidual[j * uiStride + k] = (plCoef[j*width+k] + iAdd) >> transformSkipShift; 1695 } 1673 1696 } 1674 1697 } 1698 else 1699 { 1700 //The case when uiBitDepth >= 13 1701 transformSkipShift = - shift; 1702 for ( j = 0; j < height; j++ ) 1703 { 1704 for(k = 0; k < width; k ++) 1705 { 1706 pResidual[j * uiStride + k] = plCoef[j*width+k] << transformSkipShift; 1707 } 1708 } 1709 } 1675 1710 } 1676 1711 #endif 1677 1712 -
TLibDecoder/TDecSbac.cpp
1122 1122 1123 1123 UInt useTansformSkip; 1124 1124 m_pcTDecBinIf->decodeBin( useTansformSkip , m_cTransformSkipSCModel.get( 0, eTType? TEXT_CHROMA: TEXT_LUMA, 0 ) ); 1125 if(eTType!= TEXT_LUMA && uiDepth == 4)1125 if(eTType!= TEXT_LUMA) 1126 1126 { 1127 uiDepth --; 1127 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - uiDepth; 1128 if(uiLog2TrafoSize == 2) 1129 { 1130 uiDepth --; 1131 } 1128 1132 } 1129 1133 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 1130 1134 DTRACE_CABAC_T("\tparseTransformSkip()");