📄 umc_h264_expand.cpp
字号:
//// INTEL CORPORATION PROPRIETARY INFORMATION// This software is supplied under the terms of a license agreement or// nondisclosure agreement with Intel Corporation and may not be copied// or disclosed except in accordance with the terms of that agreement.// Copyright (c) 2004 - 2005 Intel Corporation. All Rights Reserved.////--------------------------------------------------------------------------;#include "umc_h264_pub.h"//--------------------------------------------------------------------------;//// The algorithm fills in (1) the bottom (not including corners),// then (2) the sides (including the bottom corners, but not the// top corners), then (3) the top (including the top// corners) as shown below, replicating the outermost bytes// of the original frame outward://// ----------------------------// | |// | (3) |// | |// |----------------------------|// | | | |// | | | |// | | | |// | | original | |// | | frame | |// | | | |// | (2) | | (2) |// | | | |// | | | |// | |----------------| |// | | | |// | | (1) | |// | | | |// ----------------------------////--------------------------------------------------------------------------;namespace UMC{void ExpandPlane( Ipp8u *StartPtr, Ipp32u uFrameWidth, Ipp32u uFrameHeight, Ipp32u uPitch, Ipp32u uPels){ Ipp32u row, col; Ipp8u uLeftFillVal; Ipp8u uRightFillVal; Ipp32u* pSrc; Ipp32u* pDst; Ipp8u* pByteSrc; // section 1 at bottom // obtain pointer to start of bottom row of original frame pSrc = (Ipp32u*)StartPtr + ((uFrameHeight*uPitch - uPitch)>>2); pDst = pSrc + (uPitch>>2); for (row=0; row<uPels; row++, pDst += (uPitch>>2)) for (col=0; col<uFrameWidth>>2; col++) pDst[col] = pSrc[col]; // section 2 on left and right // obtain pointer to start of first row of original frame pByteSrc = StartPtr; for (row=0; row<(uFrameHeight + uPels); row++, pByteSrc += uPitch) { // get fill values from left and right columns of original frame uLeftFillVal = *pByteSrc; uRightFillVal = *(pByteSrc + uFrameWidth - 1); // fill all bytes on both edges for (col=0; col<uPels; col++) { *(pByteSrc - uPels + col) = uLeftFillVal; *(pByteSrc + uFrameWidth + col) = uRightFillVal; } } // section 3 at top // obtain pointer to top row of original frame, less expand pels pSrc = (Ipp32u*)StartPtr - (uPels>>2); pDst = pSrc - (uPitch>>2); for (row=0; row<uPels; row++, pDst -= (uPitch>>2)) for (col=0; col<(uFrameWidth+uPels+uPels)>>2; col++) pDst[col] = pSrc[col];} // end ExpandPlane} //namespace UMC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -