Performs interpolation for motion estimation of the luma component using fractional part of motion vector.
IppStatus ippiInterpolateLuma_H264_8u_C1R(const Ipp8u* pSrc, Ipp32s srcStep, Ipp8u* pDst, Ipp32s dstStep, Ipp32s dx, Ipp32s dy, IppiSize roiSize);
IppStatus ippiInterpolateLuma_H264_16u_C1R(const IppVCInterpolate_16u* interpolateInfo);
pSrc |
Pointer to the source. |
srcStep |
Distance in items between starts of the consecutive lines in the source block. |
pDst |
Pointer to the destination. |
dstStep |
Distance in items between starts of the consecutive lines in the destination block. |
dx, dy |
Fractional parts of the motion vector in 1/4 pel units (0, 1, 2, or 3). |
roiSize |
Flag that specifies the dimensions of the region of interest (could be 16, 8 or 4 in each dimension). See structure IppiSize. |
interpolateInfo |
Pointer to the IppVCInterpolate_16u structure. |
The functions ippiInterpolateLuma_H264_8u_C1R and ippiInterpolateLuma_H264_16u_C1R are declared in the ippvc.h file. These functions perform interpolation (convolution with 6x6 kernel) for motion estimation of the luma component in accordance with 8.4.2.2.1 of [JVTG050].
The functions use only the fractional part of the motion vector. The integer part is used when finding the position (pointed to by pSrc) in the source frame.
The ippiInterpolateLuma_H264 functions do not provide any padding, therefore the whole data region indicated by the pointer should be real and increased by padding, if necessary. The functions can use up to 3 pixels up and left from the pointer and maximum 2 pixels down and right from the pointed data size.
Make sure all samples that are used for interpolation are within the boundaries of the source frame. To solve the problem, enlarge the source frame by using boundary samples or use InterpolateLumaTop_H264 or InterpolateLumaBottom_H264 functions.
Ipp32s iHVector, iVVector; IppiSize roi = {width_of_luma_block, height_of_luma_block}; Ipp32s iLumaXPos = x_position_of_current_luma_block; Ipp32s iLumaYPos = y_position_of_current_luma_block; Ipp8u* pRefYPlane = corresponding_luma_block_of_reference_luma_frame; Ipp32s iPitch = reference_luma_frame_pitch; Ipp8u* pDstY = destination_luma_block; Ipp32s iDstPitch = destination_luma_frame_pitch; // set motion vectors iHVector = horizontal_motion_vector; iVVector = vertical_motion_vector; { Ipp32s iHFraction, iVFraction; Ipp32s width, height; width = width_of_frame; height = height_of_frame; // prepare the horizontal vector, extract an interpolation factor iHFraction = iHVector & 3; iHVector >>= 2; // saturate the horizontal vector { Ipp32s iLeft = ((iHFraction) ? (1) : (0)); Ipp32s iRight; // set amount of additional pixels iRight = iLeft* 3; iLeft = iLeft* 2; if (((unsigned) (width - (iRight + iLeft) - roi.width)) < ((unsigned) (iHVector + iLumaXPos - iLeft))) { // saturate to the left bound if (- iRight - roi.width > iHVector + iLumaXPos) { iHVector = - iLumaXPos - roi.width - 3; } // saturate to the right bound else if (iLeft + width < iHVector + iLumaXPos) { iHVector = width - iLumaXPos + 2; } } } // prepare the vertical vector, extract an interpolation factor iVFraction = iVVector & 3; iVVector >>= 2; // most usual prediction // NOTE: the height is decremented to avoid factor's influence { Ipp32s iTop = ((iVFraction) ? (1) : (0)); Ipp32s iBottom; // set amount of additional pixels iBottom = iTop* 3; iTop = iTop* 2; if (((unsigned) (height - (iTop + iBottom) - roi.height)) >= ((unsigned) (iVVector + iLumaYPos - iTop))) { ippiInterpolateLuma_H264_8u_C1R(pRefYPlane + iVVector * iPitch + iHVector, iPitch, pDstY, iDstPitch, iHFraction, iVFraction, roi); } // prediction from the top of the frame else if (0 > iVVector + iLumaYPos - iTop) { // sometimes the vector points to nothing ippiInterpolateLumaTop_H264_8u_C1R(pRefYPlane + iVVector * iPitch + iHVector, iPitch, pDstY, iDstPitch, iHFraction, - iVVector - iLumaYPos, roi); } // prediction from the bottom of the frame else { // sometimes the vector points to nothing ippiInterpolateLumaBottom_H264_8u_C1R(pRefYPlane + iVVector * iPitch + iHVector, iPitch, pDstY, iDstPitch, iHFraction, iVFraction, iVVector + iLumaYPos + roi.height - height, roi); } } }
These functions are used in the H.264 decoder and encoder included into Intel IPP Samples. See introduction to H.264.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if at least one of the specified pointers is NULL. |
ippStsStepErr |
Indicates an error condition if srcStep value is less than 16. |
ippStsBadArgErr |
Indicates an error condition if dx or dy values fall outside [0,3]. |
ippStsSizeErr |
Indicates an error condition if roi.width or roi .height take values other than {16, 8, 4}. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.