Changeset 640 in SHVCSoftware
- Timestamp:
- 22 Mar 2014, 23:15:23 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r638 r640 162 162 UInt currLayerId = currSlice->getLayerId(); 163 163 UInt refLayerId = currSlice->getVPS()->getRefLayerId( currLayerId, refLayerIdc ); 164 165 if( scaleX == 65536 && scaleY == 65536 && g_bitDepthYLayer[currLayerId] == g_bitDepthYLayer[refLayerId] && g_bitDepthCLayer[currLayerId] == g_bitDepthCLayer[refLayerId] ) // ratio 1x 166 #else 164 #endif 165 166 // non-normative software optimization for certain simple resampling cases 167 167 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x 168 #endif169 168 { 170 169 piSrcY = piSrcBufY; 171 170 piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL; 171 172 #if O0194_JOINT_US_BITSHIFT 173 Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId]; 174 #endif 175 172 176 for( i = 0; i < heightBL; i++ ) 173 177 { 178 #if O0194_JOINT_US_BITSHIFT 179 for( j = 0; j < widthBL; j++ ) 180 { 181 piDstY[j] = piSrcY[j] << shift; 182 } 183 #else 174 184 memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL ); 185 #endif 175 186 piSrcY += strideBL; 176 187 piDstY += strideEL; … … 183 194 heightBL >>= 1; 184 195 185 strideBL 186 strideEL 196 strideBL = pcBasePic->getCStride(); 197 strideEL = pcUsPic->getCStride(); 187 198 188 199 piSrcU = piSrcBufU; … … 192 203 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 193 204 205 #if O0194_JOINT_US_BITSHIFT 206 shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId]; 207 #endif 208 194 209 for( i = 0; i < heightBL; i++ ) 195 210 { 211 #if O0194_JOINT_US_BITSHIFT 212 for( j = 0; j < widthBL; j++ ) 213 { 214 piDstU[j] = piSrcU[j] << shift; 215 piDstV[j] = piSrcV[j] << shift; 216 } 217 #else 196 218 memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL ); 197 219 memcpy( piDstV, piSrcV, sizeof(Pel) * widthBL ); 220 #endif 198 221 piSrcU += strideBL; 199 222 piSrcV += strideBL; … … 202 225 } 203 226 } 204 else 227 else // general resampling process 205 228 { 206 229 Int refPos16 = 0; … … 223 246 224 247 pcBasePic->setBorderExtension(false); 225 pcBasePic->extendPicBorder 248 pcBasePic->extendPicBorder(); // extend the border. 226 249 227 250 Int shiftX = 16; … … 270 293 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 271 294 272 #if 295 #if N0214_INTERMEDIATE_BUFFER_16BITS 273 296 #if O0194_JOINT_US_BITSHIFT 274 297 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 293 316 for( j = 0; j < heightBL ; j++ ) 294 317 { 295 #if 318 #if N0214_INTERMEDIATE_BUFFER_16BITS 296 319 *piDstY = sumLumaHor(piSrcY, coeff) >> shift1; 297 320 #else … … 309 332 pcTempPic->setHeight(heightEL); 310 333 311 #if 334 #if N0214_INTERMEDIATE_BUFFER_16BITS 312 335 #if O0194_JOINT_US_BITSHIFT 313 336 Int nShift = 20 - g_bitDepthYLayer[currLayerId]; … … 417 440 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 418 441 419 #if 442 #if N0214_INTERMEDIATE_BUFFER_16BITS 420 443 #if O0194_JOINT_US_BITSHIFT 421 444 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 442 465 for( j = 0; j < heightBL ; j++ ) 443 466 { 444 #if 467 #if N0214_INTERMEDIATE_BUFFER_16BITS 445 468 *piDstU = sumChromaHor(piSrcU, coeff) >> shift1; 446 469 *piDstV = sumChromaHor(piSrcV, coeff) >> shift1; … … 463 486 pcTempPic->setHeight(heightEL << 1); 464 487 465 #if 488 #if N0214_INTERMEDIATE_BUFFER_16BITS 466 489 #if O0194_JOINT_US_BITSHIFT 467 490 nShift = 20 - g_bitDepthCLayer[currLayerId];
Note: See TracChangeset for help on using the changeset viewer.