Ticket #595: 14-bit_offset_issue_WP_IF.patch
File 14-bit_offset_issue_WP_IF.patch, 2.5 KB (added by pandrivon, 11 years ago) |
---|
-
source/Lib/TLibCommon/TComInterpolationFilter.cpp
124 124 else 125 125 { 126 126 Int shift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 127 Short offset = IF_INTERNAL_OFFS + (1 << (shift - 1)); 127 Short offset = IF_INTERNAL_OFFS; 128 offset += shift?(1 << (shift - 1)):0; 128 129 Short maxVal = g_uiIBDI_MAX; 129 130 Short minVal = 0; 130 131 for (row = 0; row < height; row++) -
source/Lib/TLibCommon/TComWeightPrediction.cpp
79 79 Int offset = wp0[0].offset; 80 80 Int shiftNum = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 81 81 Int shift = wp0[0].shift + shiftNum; 82 Int round = (1<<(shift-1)) * bRound;82 Int round = shift?(1<<(shift-1)) * bRound:0; 83 83 Int w1 = wp1[0].w; 84 84 85 85 UInt iSrc0Stride = pcYuvSrc0->getStride(); … … 105 105 w0 = wp0[1].w; 106 106 offset = wp0[1].offset; 107 107 shift = wp0[1].shift + shiftNum; 108 round = (1<<(shift-1));108 round = shift?(1<<(shift-1)):0; 109 109 w1 = wp1[1].w; 110 110 111 111 iSrc0Stride = pcYuvSrc0->getCStride(); … … 132 132 w0 = wp0[2].w; 133 133 offset = wp0[2].offset; 134 134 shift = wp0[2].shift + shiftNum; 135 round = (1<<(shift-1));135 round = shift?(1<<(shift-1)):0; 136 136 w1 = wp1[2].w; 137 137 138 138 for ( y = iHeight-1; y >= 0; y-- ) … … 175 175 Int offset = wp0[0].offset; 176 176 Int shiftNum = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 177 177 Int shift = wp0[0].shift + shiftNum; 178 Int round = (1<<(shift-1));178 Int round = shift?(1<<(shift-1)):0; 179 179 UInt iSrc0Stride = pcYuvSrc0->getStride(); 180 180 UInt iDstStride = rpcYuvDst->getStride(); 181 181 … … 197 197 w0 = wp0[1].w; 198 198 offset = wp0[1].offset; 199 199 shift = wp0[1].shift + shiftNum; 200 round = (1<<(shift-1));200 round = shift?(1<<(shift-1)):0; 201 201 202 202 iSrc0Stride = pcYuvSrc0->getCStride(); 203 203 iDstStride = rpcYuvDst->getCStride(); … … 221 221 w0 = wp0[2].w; 222 222 offset = wp0[2].offset; 223 223 shift = wp0[2].shift + shiftNum; 224 round = (1<<(shift-1));224 round = shift?(1<<(shift-1)):0; 225 225 226 226 for ( y = iHeight-1; y >= 0; y-- ) 227 227 {