MCPcopy Create free account
hub / github.com/cisco/openh264 / WelsInitScaledPic

Function WelsInitScaledPic

codec/encoder/core/src/wels_preprocess.cpp:514–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514int32_t WelsInitScaledPic (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPicture, CMemoryAlign* pMemoryAlign) {
515 bool bInputPicNeedScaling = JudgeNeedOfScaling (pParam, pScaledPicture);
516 if (bInputPicNeedScaling) {
517 pScaledPicture->pScaledInputPicture = AllocPicture (pMemoryAlign, pParam->SUsedPicRect.iWidth,
518 pParam->SUsedPicRect.iHeight, false, 0);
519 if (pScaledPicture->pScaledInputPicture == NULL)
520 return -1;
521
522 // Avoid valgrind false positives.
523 //
524 // X86 SIMD downsampling routines may, for convenience, read slightly beyond
525 // the input data and into the alignment padding area beyond each line. This
526 // causes valgrind to warn about uninitialized values even if these values
527 // only affect lanes of a SIMD vector that are effectively never used.
528 //
529 // Avoid these false positives by zero-initializing the padding area beyond
530 // each line of the source buffer used for downsampling.
531 SPicture* pPic = pScaledPicture->pScaledInputPicture;
532 ClearEndOfLinePadding (pPic->pData[0], pPic->iLineSize[0], pPic->iWidthInPixel, pPic->iHeightInPixel);
533 ClearEndOfLinePadding (pPic->pData[1], pPic->iLineSize[1], pPic->iWidthInPixel >> 1, pPic->iHeightInPixel >> 1);
534 ClearEndOfLinePadding (pPic->pData[2], pPic->iLineSize[2], pPic->iWidthInPixel >> 1, pPic->iHeightInPixel >> 1);
535 }
536 return 0;
537}
538
539void FreeScaledPic (Scaled_Picture* pScaledPicture, CMemoryAlign* pMemoryAlign) {
540 if (pScaledPicture->pScaledInputPicture) {

Callers 1

WelsPreprocessResetMethod · 0.85

Calls 3

JudgeNeedOfScalingFunction · 0.85
ClearEndOfLinePaddingFunction · 0.85
AllocPictureFunction · 0.70

Tested by

no test coverage detected