clean up expand picture.
This commit is contained in:
parent
78eed44d15
commit
14e5d740cd
@ -730,11 +730,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\inc\expand_pic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\expand_picture_common.h"
|
||||
RelativePath="..\..\..\common\inc\expand_pic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -895,7 +891,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\src\expand_pic.cpp"
|
||||
RelativePath="..\..\..\common\src\expand_pic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -388,7 +388,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\encoder\core\src\expand_pic.cpp"
|
||||
RelativePath="..\..\..\common\src\expand_pic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -545,11 +545,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\encoder\core\inc\expand_pic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\expand_picture_common.h"
|
||||
RelativePath="..\..\..\common\inc\expand_pic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -37,8 +37,8 @@
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef EXPAND_PICTURE_COMMON_H
|
||||
#define EXPAND_PICTURE_COMMON_H
|
||||
#ifndef EXPAND_PICTURE_H
|
||||
#define EXPAND_PICTURE_H
|
||||
|
||||
#include "typedefs.h"
|
||||
|
||||
@ -46,6 +46,8 @@
|
||||
extern "C" {
|
||||
#endif//__cplusplus
|
||||
|
||||
#define PADDING_LENGTH 32 // reference extension
|
||||
|
||||
#if defined(X86_ASM)
|
||||
void ExpandPictureLuma_sse2 (uint8_t* pDst,
|
||||
const int32_t kiStride,
|
||||
@ -70,6 +72,20 @@ void ExpandPictureLuma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, cons
|
||||
void ExpandPictureChroma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
|
||||
const int32_t kiPicH);
|
||||
#endif
|
||||
|
||||
typedef void (*PExpandPictureFunc) (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
|
||||
|
||||
typedef struct TagExpandPicFunc {
|
||||
PExpandPictureFunc pfExpandLumaPicture;
|
||||
PExpandPictureFunc pfExpandChromaPicture[2];
|
||||
} SExpandPicFunc;
|
||||
|
||||
|
||||
void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3],
|
||||
PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]);
|
||||
|
||||
void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCPUFlags);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif//__cplusplus
|
@ -32,9 +32,7 @@
|
||||
#include <string.h>
|
||||
#include "expand_pic.h"
|
||||
#include "cpu_core.h"
|
||||
#include "wels_func_ptr_def.h"
|
||||
|
||||
namespace WelsSVCEnc {
|
||||
// rewrite it (split into luma & chroma) that is helpful for mmx/sse2 optimization perform, 9/27/2009
|
||||
static inline void ExpandPictureLuma_c (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
|
||||
const int32_t kiPicH) {
|
||||
@ -116,60 +114,61 @@ static inline void ExpandPictureChroma_c (uint8_t* pDst, const int32_t kiStride,
|
||||
} while (i < kiPicH);
|
||||
}
|
||||
|
||||
void InitExpandPictureFunc (void* pL, const uint32_t kuiCPUFlag) {
|
||||
SWelsFuncPtrList* pFuncList = (SWelsFuncPtrList*)pL;
|
||||
pFuncList->pfExpandLumaPicture = ExpandPictureLuma_c;
|
||||
pFuncList->pfExpandChromaPicture[0] = ExpandPictureChroma_c;
|
||||
pFuncList->pfExpandChromaPicture[1] = ExpandPictureChroma_c;
|
||||
void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCPUFlag) {
|
||||
pExpandPicFunc->pfExpandLumaPicture = ExpandPictureLuma_c;
|
||||
pExpandPicFunc->pfExpandChromaPicture[0] = ExpandPictureChroma_c;
|
||||
pExpandPicFunc->pfExpandChromaPicture[1] = ExpandPictureChroma_c;
|
||||
|
||||
#if defined(X86_ASM)
|
||||
if ((kuiCPUFlag & WELS_CPU_SSE2) == WELS_CPU_SSE2) {
|
||||
pFuncList->pfExpandLumaPicture = ExpandPictureLuma_sse2;
|
||||
pFuncList->pfExpandChromaPicture[0] = ExpandPictureChromaUnalign_sse2;
|
||||
pFuncList->pfExpandChromaPicture[1] = ExpandPictureChromaAlign_sse2;
|
||||
pExpandPicFunc->pfExpandLumaPicture = ExpandPictureLuma_sse2;
|
||||
pExpandPicFunc->pfExpandChromaPicture[0] = ExpandPictureChromaUnalign_sse2;
|
||||
pExpandPicFunc->pfExpandChromaPicture[1] = ExpandPictureChromaAlign_sse2;
|
||||
}
|
||||
#endif//X86_ASM
|
||||
#if defined(HAVE_NEON)
|
||||
if (kuiCPUFlag & WELS_CPU_NEON) {
|
||||
pFuncList->pfExpandLumaPicture = ExpandPictureLuma_neon;
|
||||
pFuncList->pfExpandChromaPicture[0] = ExpandPictureChroma_neon;
|
||||
pFuncList->pfExpandChromaPicture[1] = ExpandPictureChroma_neon;
|
||||
pExpandPicFunc->pfExpandLumaPicture = ExpandPictureLuma_neon;
|
||||
pExpandPicFunc->pfExpandChromaPicture[0] = ExpandPictureChroma_neon;
|
||||
pExpandPicFunc->pfExpandChromaPicture[1] = ExpandPictureChroma_neon;
|
||||
}
|
||||
#endif//HAVE_NEON
|
||||
#if defined(HAVE_NEON_AARCH64)
|
||||
if (kuiCPUFlag & WELS_CPU_NEON) {
|
||||
pFuncList->pfExpandLumaPicture = ExpandPictureLuma_AArch64_neon;
|
||||
pFuncList->pfExpandChromaPicture[0] = ExpandPictureChroma_AArch64_neon;
|
||||
pFuncList->pfExpandChromaPicture[1] = ExpandPictureChroma_AArch64_neon;
|
||||
pExpandPicFunc->pfExpandLumaPicture = ExpandPictureLuma_AArch64_neon;
|
||||
pExpandPicFunc->pfExpandChromaPicture[0] = ExpandPictureChroma_AArch64_neon;
|
||||
pExpandPicFunc->pfExpandChromaPicture[1] = ExpandPictureChroma_AArch64_neon;
|
||||
}
|
||||
#endif//HAVE_NEON_AARCH64
|
||||
}
|
||||
|
||||
|
||||
void ExpandReferencingPicture (SPicture* pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) {
|
||||
//void ExpandReferencingPicture (SPicture* pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) {
|
||||
void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3],
|
||||
PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]) {
|
||||
/*local variable*/
|
||||
uint8_t* pPicY = pPic->pData[0];
|
||||
uint8_t* pPicCb = pPic->pData[1];
|
||||
uint8_t* pPicCr = pPic->pData[2];
|
||||
const int32_t kiWidthY = pPic->iWidthInPixel;
|
||||
const int32_t kiHeightY = pPic->iHeightInPixel;
|
||||
uint8_t* pPicY = pData[0];
|
||||
uint8_t* pPicCb = pData[1];
|
||||
uint8_t* pPicCr = pData[2];
|
||||
const int32_t kiWidthY = iWidth;
|
||||
const int32_t kiHeightY = iHeight;
|
||||
const int32_t kiWidthUV = kiWidthY >> 1;
|
||||
const int32_t kiHeightUV = kiHeightY >> 1;
|
||||
|
||||
|
||||
|
||||
pExpLuma (pPicY, pPic->iLineSize[0], kiWidthY, kiHeightY);
|
||||
pExpLuma (pPicY, iStride[0], kiWidthY, kiHeightY);
|
||||
if (kiWidthUV >= 16) {
|
||||
// fix coding picture size as 16x16
|
||||
const bool kbChrAligned = /*(iWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0); // chroma planes: (16+iWidthUV) & 15
|
||||
pExpChrom[kbChrAligned] (pPicCb, pPic->iLineSize[1], kiWidthUV, kiHeightUV);
|
||||
pExpChrom[kbChrAligned] (pPicCr, pPic->iLineSize[2], kiWidthUV, kiHeightUV);
|
||||
pExpChrom[kbChrAligned] (pPicCb, iStride[1], kiWidthUV, kiHeightUV);
|
||||
pExpChrom[kbChrAligned] (pPicCr, iStride[2], kiWidthUV, kiHeightUV);
|
||||
} else {
|
||||
// fix coding picture size as 16x16
|
||||
ExpandPictureChroma_c (pPicCb, pPic->iLineSize[1], kiWidthUV, kiHeightUV);
|
||||
ExpandPictureChroma_c (pPicCr, pPic->iLineSize[2], kiWidthUV, kiHeightUV);
|
||||
ExpandPictureChroma_c (pPicCb, iStride[1], kiWidthUV, kiHeightUV);
|
||||
ExpandPictureChroma_c (pPicCr, iStride[2], kiWidthUV, kiHeightUV);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ COMMON_CPP_SRCS=\
|
||||
$(COMMON_SRCDIR)/src/cpu.cpp\
|
||||
$(COMMON_SRCDIR)/src/crt_util_safe_x.cpp\
|
||||
$(COMMON_SRCDIR)/src/deblocking_common.cpp\
|
||||
$(COMMON_SRCDIR)/src/expand_pic.cpp\
|
||||
$(COMMON_SRCDIR)/src/logging.cpp\
|
||||
$(COMMON_SRCDIR)/src/sad_common.cpp\
|
||||
$(COMMON_SRCDIR)/src/WelsThreadLib.cpp\
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "as264_common.h" // for LONG_TERM_REF macro,can be delete if not need this macro
|
||||
#include "crt_util_safe_x.h"
|
||||
#include "mb_cache.h"
|
||||
#include "expand_pic.h"
|
||||
|
||||
namespace WelsDec {
|
||||
|
||||
@ -151,11 +152,6 @@ typedef int32_t (*PWelsParseIntra4x4ModeFunc) (PNeighAvail pNeighAvail, int8_t*
|
||||
PDqLayer pCurDqLayer);
|
||||
typedef int32_t (*PWelsParseIntra16x16ModeFunc) (PNeighAvail pNeighAvail, PBitStringAux pBs, PDqLayer pCurDqLayer);
|
||||
|
||||
typedef struct TagExpandPicFunc {
|
||||
PExpandPictureFunc pExpandLumaPicture;
|
||||
PExpandPictureFunc pExpandChromaPicture[2];
|
||||
} SExpandPicFunc;
|
||||
|
||||
enum {
|
||||
OVERWRITE_NONE = 0,
|
||||
OVERWRITE_PPS = 1,
|
||||
|
@ -1,57 +0,0 @@
|
||||
/*!
|
||||
* \copy
|
||||
* Copyright (c) 2009-2013, Cisco Systems
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* \file expand_pic.h
|
||||
*
|
||||
* \brief Interface for expanding reconstructed picture to be used for reference
|
||||
*
|
||||
* \date 06/08/2009 Created
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef WELS_EXPAND_PIC_H__
|
||||
#define WELS_EXPAND_PIC_H__
|
||||
|
||||
#include "decoder_context.h"
|
||||
#include "picture.h"
|
||||
|
||||
#include "expand_picture_common.h"
|
||||
|
||||
namespace WelsDec {
|
||||
|
||||
void ExpandReferencingPicture (PPicture pPic, PExpandPictureFunc pExpandPictureLuma,
|
||||
PExpandPictureFunc pExpandPictureChroma[2]);
|
||||
|
||||
void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCpuFlags);
|
||||
|
||||
} // namespace WelsDec
|
||||
|
||||
#endif//WELS_EXPAND_PIC_H__
|
@ -81,7 +81,6 @@
|
||||
|
||||
#define ALIGN_RBSP_LEN_FIX 4
|
||||
|
||||
#define PADDING_LENGTH 32 // reference extension
|
||||
|
||||
#define BASE_QUALITY_ID 0
|
||||
//#define BASE_DEPENDENCY_ID 0
|
||||
|
@ -1919,8 +1919,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
ExpandReferencingPicture (pCtx->pDec, pCtx->sExpandPicFunc.pExpandLumaPicture,
|
||||
pCtx->sExpandPicFunc.pExpandChromaPicture);
|
||||
ExpandReferencingPicture (pCtx->pDec->pData, pCtx->pDec->iWidthInPixel, pCtx->pDec->iHeightInPixel,
|
||||
pCtx->pDec->iLinesize,
|
||||
pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
|
||||
pCtx->pDec = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -149,8 +149,9 @@ int32_t MarkECFrameAsRef (PWelsDecoderContext pCtx) {
|
||||
pCtx->pDec = NULL;
|
||||
return iRet;
|
||||
}
|
||||
ExpandReferencingPicture (pCtx->pDec, pCtx->sExpandPicFunc.pExpandLumaPicture,
|
||||
pCtx->sExpandPicFunc.pExpandChromaPicture);
|
||||
ExpandReferencingPicture (pCtx->pDec->pData, pCtx->pDec->iWidthInPixel, pCtx->pDec->iHeightInPixel,
|
||||
pCtx->pDec->iLinesize,
|
||||
pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
|
||||
pCtx->pDec = NULL;
|
||||
|
||||
return ERR_NONE;
|
||||
|
@ -1,171 +0,0 @@
|
||||
/*!
|
||||
* \copy
|
||||
* Copyright (c) 2013, Cisco Systems
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "expand_pic.h"
|
||||
#include "cpu_core.h"
|
||||
|
||||
namespace WelsDec {
|
||||
|
||||
// rewrite it (split into luma & chroma) that is helpful for mmx/sse2 optimization perform, 9/27/2009
|
||||
static inline void ExpandPictureLuma_c (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicWidth,
|
||||
const int32_t kiPicHeight) {
|
||||
uint8_t* pTmp = pDst;
|
||||
uint8_t* pDstLastLine = pTmp + (kiPicHeight - 1) * kiStride;
|
||||
const int32_t kiPaddingLen = PADDING_LENGTH;
|
||||
const uint8_t kuiTopLeft = pTmp[0];
|
||||
const uint8_t kuiTopRight = pTmp[kiPicWidth - 1];
|
||||
const uint8_t kuiBottomLeft = pDstLastLine[0];
|
||||
const uint8_t kuiBottomRight = pDstLastLine[kiPicWidth - 1];
|
||||
int32_t i = 0;
|
||||
|
||||
do {
|
||||
const int32_t kiStrides = (1 + i) * kiStride;
|
||||
uint8_t* pTop = pTmp - kiStrides;
|
||||
uint8_t* pBottom = pDstLastLine + kiStrides;
|
||||
|
||||
// pad pTop and pBottom
|
||||
memcpy (pTop, pTmp, kiPicWidth);
|
||||
memcpy (pBottom, pDstLastLine, kiPicWidth);
|
||||
|
||||
// pad corners
|
||||
memset (pTop - kiPaddingLen, kuiTopLeft, kiPaddingLen); //pTop left
|
||||
memset (pTop + kiPicWidth, kuiTopRight, kiPaddingLen); //pTop right
|
||||
memset (pBottom - kiPaddingLen, kuiBottomLeft, kiPaddingLen); //pBottom left
|
||||
memset (pBottom + kiPicWidth, kuiBottomRight, kiPaddingLen); //pBottom right
|
||||
|
||||
++ i;
|
||||
} while (i < kiPaddingLen);
|
||||
|
||||
// pad left and right
|
||||
i = 0;
|
||||
do {
|
||||
memset (pTmp - kiPaddingLen, pTmp[0], kiPaddingLen);
|
||||
memset (pTmp + kiPicWidth, pTmp[kiPicWidth - 1], kiPaddingLen);
|
||||
|
||||
pTmp += kiStride;
|
||||
++ i;
|
||||
} while (i < kiPicHeight);
|
||||
}
|
||||
|
||||
static inline void ExpandPictureChroma_c (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicWidth,
|
||||
const int32_t kiPicHeight) {
|
||||
uint8_t* pTmp = pDst;
|
||||
uint8_t* pDstLastLine = pTmp + (kiPicHeight - 1) * kiStride;
|
||||
const int32_t kiPaddingLen = (PADDING_LENGTH >> 1);
|
||||
const uint8_t kuiTopLeft = pTmp[0];
|
||||
const uint8_t kuiTopRight = pTmp[kiPicWidth - 1];
|
||||
const uint8_t kuiBottomLeft = pDstLastLine[0];
|
||||
const uint8_t kuiBottomRight = pDstLastLine[kiPicWidth - 1];
|
||||
int32_t i = 0;
|
||||
|
||||
do {
|
||||
const int32_t kiStrides = (1 + i) * kiStride;
|
||||
uint8_t* pTop = pTmp - kiStrides;
|
||||
uint8_t* pBottom = pDstLastLine + kiStrides;
|
||||
|
||||
// pad pTop and pBottom
|
||||
memcpy (pTop, pTmp, kiPicWidth);
|
||||
memcpy (pBottom, pDstLastLine, kiPicWidth);
|
||||
|
||||
// pad corners
|
||||
memset (pTop - kiPaddingLen, kuiTopLeft, kiPaddingLen); //pTop left
|
||||
memset (pTop + kiPicWidth, kuiTopRight, kiPaddingLen); //pTop right
|
||||
memset (pBottom - kiPaddingLen, kuiBottomLeft, kiPaddingLen); //pBottom left
|
||||
memset (pBottom + kiPicWidth, kuiBottomRight, kiPaddingLen); //pBottom right
|
||||
|
||||
++ i;
|
||||
} while (i < kiPaddingLen);
|
||||
|
||||
// pad left and right
|
||||
i = 0;
|
||||
do {
|
||||
memset (pTmp - kiPaddingLen, pTmp[0], kiPaddingLen);
|
||||
memset (pTmp + kiPicWidth, pTmp[kiPicWidth - 1], kiPaddingLen);
|
||||
|
||||
pTmp += kiStride;
|
||||
++ i;
|
||||
} while (i < kiPicHeight);
|
||||
}
|
||||
|
||||
void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCpuFlags) {
|
||||
pExpandPicFunc->pExpandLumaPicture = ExpandPictureLuma_c;
|
||||
pExpandPicFunc->pExpandChromaPicture[0] = ExpandPictureChroma_c;
|
||||
pExpandPicFunc->pExpandChromaPicture[1] = ExpandPictureChroma_c;
|
||||
|
||||
#if defined(X86_ASM)
|
||||
if ((kuiCpuFlags & WELS_CPU_SSE2) == WELS_CPU_SSE2) {
|
||||
pExpandPicFunc->pExpandLumaPicture = ExpandPictureLuma_sse2;
|
||||
pExpandPicFunc->pExpandChromaPicture[0] = ExpandPictureChromaUnalign_sse2;
|
||||
pExpandPicFunc->pExpandChromaPicture[1] = ExpandPictureChromaAlign_sse2;
|
||||
}
|
||||
#endif//X86_ASM
|
||||
#if defined(HAVE_NEON)
|
||||
if ((kuiCpuFlags & WELS_CPU_NEON) == WELS_CPU_NEON) {
|
||||
pExpandPicFunc->pExpandLumaPicture = ExpandPictureLuma_neon;
|
||||
pExpandPicFunc->pExpandChromaPicture[0] = ExpandPictureChroma_neon;
|
||||
pExpandPicFunc->pExpandChromaPicture[1] = ExpandPictureChroma_neon;
|
||||
}
|
||||
#endif//HAVE_NEON
|
||||
#if defined(HAVE_NEON_AARCH64)
|
||||
if ((kuiCpuFlags & WELS_CPU_NEON) == WELS_CPU_NEON) {
|
||||
pExpandPicFunc->pExpandLumaPicture = ExpandPictureLuma_AArch64_neon;
|
||||
pExpandPicFunc->pExpandChromaPicture[0] = ExpandPictureChroma_AArch64_neon;
|
||||
pExpandPicFunc->pExpandChromaPicture[1] = ExpandPictureChroma_AArch64_neon;
|
||||
}
|
||||
#endif//HAVE_NEON_AARCH64
|
||||
}
|
||||
|
||||
void ExpandReferencingPicture (PPicture pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChroma[2]) {
|
||||
/*local variable*/
|
||||
uint8_t* pPicY = pPic->pData[0];
|
||||
uint8_t* pPicCb = pPic->pData[1];
|
||||
uint8_t* pPicCr = pPic->pData[2];
|
||||
const int32_t kiWidthY = pPic->iWidthInPixel;
|
||||
const int32_t kiHeightY = pPic->iHeightInPixel;
|
||||
const int32_t kiWidthUV = kiWidthY >> 1;
|
||||
const int32_t kiHeightUV = kiHeightY >> 1;
|
||||
|
||||
pExpLuma (pPicY, pPic->iLinesize[0], kiWidthY, kiHeightY);
|
||||
if (kiWidthUV >= 16) {
|
||||
// fix coding picture size as 16x16 issues 7/27/2010
|
||||
const bool kbChrAligned = /*(kiWidthUV >= 16) && */ ((kiWidthUV & 0x0F) == 0); // chroma planes: (16+kiWidthUV) & 15
|
||||
pExpChroma[kbChrAligned] (pPicCb, pPic->iLinesize[1], kiWidthUV, kiHeightUV);
|
||||
pExpChroma[kbChrAligned] (pPicCr, pPic->iLinesize[2], kiWidthUV, kiHeightUV);
|
||||
} else {
|
||||
// fix coding picture size as 16x16 issues 7/27/2010
|
||||
ExpandPictureChroma_c (pPicCb, pPic->iLinesize[1], kiWidthUV, kiHeightUV);
|
||||
ExpandPictureChroma_c (pPicCr, pPic->iLinesize[2], kiWidthUV, kiHeightUV);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace WelsDec
|
@ -9,7 +9,6 @@ DECODER_CPP_SRCS=\
|
||||
$(DECODER_SRCDIR)/core/src/decoder_core.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/decoder_data_tables.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/error_concealment.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/expand_pic.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/fmo.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/get_intra_predictor.cpp\
|
||||
$(DECODER_SRCDIR)/core/src/manage_dec_ref.cpp\
|
||||
|
@ -1,55 +0,0 @@
|
||||
/*!
|
||||
* \copy
|
||||
* Copyright (c) 2009-2013, Cisco Systems
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* \file expand_pic.h
|
||||
*
|
||||
* \brief Interface for expanding reconstructed picture to be used for reference
|
||||
*
|
||||
* \date 06/08/2009
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef EXPAND_PIC_H
|
||||
#define EXPAND_PIC_H
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "picture.h"
|
||||
|
||||
#include "expand_picture_common.h"
|
||||
|
||||
namespace WelsSVCEnc {
|
||||
typedef void (*PExpandPictureFunc) (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
|
||||
|
||||
void ExpandReferencingPicture (SPicture* pPic, PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]);
|
||||
|
||||
void InitExpandPictureFunc (void* pL, const uint32_t kuiCPUFlags);
|
||||
}
|
||||
#endif
|
@ -103,7 +103,7 @@
|
||||
|
||||
#define ALIGN_RBSP_LEN_FIX 4
|
||||
|
||||
#define PADDING_LENGTH 32 // reference extension
|
||||
|
||||
#define INTPEL_NEEDED_MARGIN (3) // for safe sub-pel MC
|
||||
|
||||
#define I420_PLANES 3
|
||||
|
@ -192,10 +192,7 @@ typedef void (*PMarkPicFunc) (void* pCtx);
|
||||
typedef bool (*PUpdateRefListFunc) (void* pCtx);
|
||||
|
||||
struct TagWelsFuncPointerList {
|
||||
PExpandPictureFunc pfExpandLumaPicture;
|
||||
PExpandPictureFunc
|
||||
pfExpandChromaPicture[2];// 0: for chroma unalignment && width_uv >= 16; 1: for chroma alignment && width_uv >= 16;
|
||||
|
||||
SExpandPicFunc sExpandPicFunc;
|
||||
PFillInterNeighborCacheFunc pfFillInterNeighborCache;
|
||||
|
||||
PGetVarianceFromIntraVaaFunc pfGetVarianceFromIntraVaa;
|
||||
|
@ -178,7 +178,7 @@ int32_t InitFunctionPointers (SWelsFuncPtrList* pFuncList, SWelsSvcCodingParam*
|
||||
}
|
||||
#endif
|
||||
|
||||
InitExpandPictureFunc (pFuncList, uiCpuFlag);
|
||||
InitExpandPictureFunc (& (pFuncList->sExpandPicFunc), uiCpuFlag);
|
||||
|
||||
/* Intra_Prediction_fn*/
|
||||
WelsInitFillingPredFuncs (uiCpuFlag);
|
||||
|
@ -378,7 +378,9 @@ bool WelsUpdateRefList (void* pEncCtx) {
|
||||
if ((pParamD->iHighestTemporalId == 0) || (kuiTid < pParamD->iHighestTemporalId))
|
||||
#endif// !ENABLE_FRAME_DUMP
|
||||
// Expanding picture for future reference
|
||||
ExpandReferencingPicture (pCtx->pDecPic, pCtx->pFuncList->pfExpandLumaPicture, pCtx->pFuncList->pfExpandChromaPicture);
|
||||
ExpandReferencingPicture (pCtx->pDecPic->pData, pCtx->pDecPic->iWidthInPixel, pCtx->pDecPic->iHeightInPixel,
|
||||
pCtx->pDecPic->iLineSize,
|
||||
pCtx->pFuncList->sExpandPicFunc.pfExpandLumaPicture, pCtx->pFuncList->sExpandPicFunc.pfExpandChromaPicture);
|
||||
|
||||
// move picture in list
|
||||
pCtx->pDecPic->uiTemporalId = kuiTid;
|
||||
@ -720,7 +722,9 @@ bool WelsUpdateRefListScreen (void* pEncCtx) {
|
||||
if ((pParamD->iHighestTemporalId == 0) || (kuiTid < pParamD->iHighestTemporalId))
|
||||
#endif// !ENABLE_FRAME_DUMP
|
||||
// Expanding picture for future reference
|
||||
ExpandReferencingPicture (pCtx->pDecPic, pCtx->pFuncList->pfExpandLumaPicture, pCtx->pFuncList->pfExpandChromaPicture);
|
||||
ExpandReferencingPicture (pCtx->pDecPic->pData, pCtx->pDecPic->iWidthInPixel, pCtx->pDecPic->iHeightInPixel,
|
||||
pCtx->pDecPic->iLineSize,
|
||||
pCtx->pFuncList->sExpandPicFunc.pfExpandLumaPicture, pCtx->pFuncList->sExpandPicFunc.pfExpandChromaPicture);
|
||||
|
||||
// move picture in list
|
||||
pCtx->pDecPic->uiTemporalId = pCtx->uiTemporalId;
|
||||
|
@ -7,7 +7,6 @@ ENCODER_CPP_SRCS=\
|
||||
$(ENCODER_SRCDIR)/core/src/encoder.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/encoder_data_tables.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/encoder_ext.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/expand_pic.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/get_intra_predictor.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/mc.cpp\
|
||||
$(ENCODER_SRCDIR)/core/src/md.cpp\
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "codec_def.h"
|
||||
#include "expand_pic.h"
|
||||
#include "mem_align.h"
|
||||
#include "decoder_context.h"
|
||||
using namespace WelsDec;
|
||||
#define EXPAND_PIC_TEST_NUM 10
|
||||
namespace WelsDec {
|
||||
@ -120,7 +121,7 @@ TEST (ExpandPicture, ExpandPictureLuma) {
|
||||
}
|
||||
}
|
||||
H264ExpandPictureLumaAnchor_c (pAnchorDst, iStride, iPicWidth, iPicHeight);
|
||||
sExpandPicFunc.pExpandLumaPicture (pTestDst, iStride, iPicWidth, iPicHeight);
|
||||
sExpandPicFunc.pfExpandLumaPicture (pTestDst, iStride, iPicWidth, iPicHeight);
|
||||
EXPECT_EQ (CompareBuff (pAnchorDstBuff, pTestDstBuff, iStride, iPicWidth + H264_PADDING_LENGTH_LUMA * 2,
|
||||
iPicHeight + H264_PADDING_LENGTH_LUMA * 2), true);
|
||||
|
||||
@ -155,7 +156,7 @@ TEST (ExpandPicture, ExpandPictureChroma) {
|
||||
}
|
||||
}
|
||||
H264ExpandPictureChromaAnchor_c (pAnchorDst, iStride, iPicWidth, iPicHeight);
|
||||
sExpandPicFunc.pExpandChromaPicture[0] (pTestDst, iStride, iPicWidth, iPicHeight);
|
||||
sExpandPicFunc.pfExpandChromaPicture[0] (pTestDst, iStride, iPicWidth, iPicHeight);
|
||||
EXPECT_EQ (CompareBuff (pAnchorDstBuff, pTestDstBuff, iStride, iPicWidth + H264_PADDING_LENGTH_CHROMA * 2,
|
||||
iPicHeight + H264_PADDING_LENGTH_CHROMA * 2), true);
|
||||
|
||||
@ -199,7 +200,8 @@ TEST (ExpandPicture, ExpandPicForMotion) {
|
||||
H264ExpandPictureLumaAnchor_c (pPicAnchor->pData[0], iStride, iPicWidth, iPicHeight);
|
||||
H264ExpandPictureChromaAnchor_c (pPicAnchor->pData[1], iStrideC, iPicWidth / 2, iPicHeight / 2);
|
||||
H264ExpandPictureChromaAnchor_c (pPicAnchor->pData[2], iStrideC, iPicWidth / 2, iPicHeight / 2);
|
||||
ExpandReferencingPicture (sCtx.pDec, sExpandPicFunc.pExpandLumaPicture, sExpandPicFunc.pExpandChromaPicture);
|
||||
ExpandReferencingPicture (sCtx.pDec->pData, sCtx.pDec->iWidthInPixel, sCtx.pDec->iHeightInPixel, sCtx.pDec->iLinesize,
|
||||
sExpandPicFunc.pfExpandLumaPicture, sExpandPicFunc.pfExpandChromaPicture);
|
||||
|
||||
EXPECT_EQ (CompareBuff (pPicAnchor->pBuffer[0], pPicTest->pBuffer[0], iStride, iPicWidth + PADDING_LENGTH * 2,
|
||||
iPicHeight + PADDING_LENGTH * 2), true);
|
||||
|
@ -6,59 +6,59 @@
|
||||
|
||||
using namespace WelsSVCEnc;
|
||||
|
||||
TEST(ExpandPicTest, TestExpandPictureLuma_c) {
|
||||
TEST (ExpandPicTest, TestExpandPictureLuma_c) {
|
||||
SWelsFuncPtrList sFuncList;
|
||||
InitExpandPictureFunc( &sFuncList, 0 );
|
||||
InitExpandPictureFunc (& (sFuncList.sExpandPicFunc), 0);
|
||||
|
||||
int32_t iPicW = rand()%256 + 1;
|
||||
int32_t iPicH = rand()%256 + 1;
|
||||
int32_t iStride = iPicW + rand()%16 + 1 + PADDING_LENGTH * 2;
|
||||
int32_t iPicW = rand() % 256 + 1;
|
||||
int32_t iPicH = rand() % 256 + 1;
|
||||
int32_t iStride = iPicW + rand() % 16 + 1 + PADDING_LENGTH * 2;
|
||||
|
||||
const int32_t kiPaddingLen = PADDING_LENGTH;
|
||||
const int32_t kiMemSize = (iStride+kiPaddingLen*2) * (iPicH+kiPaddingLen*2);
|
||||
const int32_t kiMemSize = (iStride + kiPaddingLen * 2) * (iPicH + kiPaddingLen * 2);
|
||||
|
||||
uint8_t *pRef = new uint8_t[kiMemSize];
|
||||
uint8_t* pRef = new uint8_t[kiMemSize];
|
||||
|
||||
for(int i=0; i<kiMemSize; i++)
|
||||
pRef[i] = rand()%256 + 1;
|
||||
for (int i = 0; i < kiMemSize; i++)
|
||||
pRef[i] = rand() % 256 + 1;
|
||||
|
||||
uint8_t *pDst = pRef + kiPaddingLen * iStride + kiPaddingLen;
|
||||
uint8_t* pDst = pRef + kiPaddingLen * iStride + kiPaddingLen;
|
||||
|
||||
sFuncList.pfExpandLumaPicture(pDst, iStride, iPicW, iPicH);
|
||||
sFuncList.sExpandPicFunc.pfExpandLumaPicture (pDst, iStride, iPicW, iPicH);
|
||||
|
||||
int k = 0;
|
||||
//top and top corner
|
||||
for (int i=0; i<kiPaddingLen; i++) {
|
||||
for (int j=0; j<iPicW+2*kiPaddingLen; j++) {
|
||||
for (int i = 0; i < kiPaddingLen; i++) {
|
||||
for (int j = 0; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
if (j < kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[0]);
|
||||
} else if (j >= iPicW+kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[iPicW-1]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[0]);
|
||||
} else if (j >= iPicW + kiPaddingLen) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[iPicW - 1]);
|
||||
} else
|
||||
EXPECT_EQ(pRef[k+j],pDst[j-kiPaddingLen]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[j - kiPaddingLen]);
|
||||
}
|
||||
k += iStride;
|
||||
}
|
||||
|
||||
k = (iPicH + kiPaddingLen - 1) * iStride;
|
||||
//bottom and bottom corner
|
||||
for (int i=iPicH+kiPaddingLen; i<iPicH+2*kiPaddingLen; i++) {
|
||||
for (int j=0; j<iPicW+2*kiPaddingLen; j++) {
|
||||
for (int i = iPicH + kiPaddingLen; i < iPicH + 2 * kiPaddingLen; i++) {
|
||||
for (int j = 0; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
if (j < kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride]);
|
||||
} else if (j >= iPicW+kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride+iPicW-1]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride]);
|
||||
} else if (j >= iPicW + kiPaddingLen) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride + iPicW - 1]);
|
||||
} else
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride+j-kiPaddingLen]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride + j - kiPaddingLen]);
|
||||
}
|
||||
k += iStride;
|
||||
}
|
||||
|
||||
k = kiPaddingLen * iStride;
|
||||
int l = 0;
|
||||
for (int i=0; i<iPicH-1; i++) { //left
|
||||
for (int j=0; j<kiPaddingLen; j++) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[l]);
|
||||
for (int i = 0; i < iPicH - 1; i++) { //left
|
||||
for (int j = 0; j < kiPaddingLen; j++) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[l]);
|
||||
}
|
||||
k += iStride;
|
||||
l += iStride;
|
||||
@ -66,9 +66,9 @@ TEST(ExpandPicTest, TestExpandPictureLuma_c) {
|
||||
|
||||
k = kiPaddingLen * iStride;
|
||||
l = 0;
|
||||
for (int i=0; i<iPicH-1; i++) { //right
|
||||
for (int j=iPicW+kiPaddingLen; j<iPicW+2*kiPaddingLen; j++) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[l+iPicW-1]);
|
||||
for (int i = 0; i < iPicH - 1; i++) { //right
|
||||
for (int j = iPicW + kiPaddingLen; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[l + iPicW - 1]);
|
||||
}
|
||||
k += iStride;
|
||||
l += iStride;
|
||||
@ -77,60 +77,60 @@ TEST(ExpandPicTest, TestExpandPictureLuma_c) {
|
||||
delete []pRef;
|
||||
}
|
||||
|
||||
TEST(ExpandPicTest, TestExpandPictureChroma_c) {
|
||||
TEST (ExpandPicTest, TestExpandPictureChroma_c) {
|
||||
SWelsFuncPtrList sFuncList;
|
||||
InitExpandPictureFunc( &sFuncList, 0 );
|
||||
InitExpandPictureFunc (& (sFuncList.sExpandPicFunc), 0);
|
||||
|
||||
int32_t iPicW = rand()%256 + 1;
|
||||
int32_t iPicH = rand()%256 + 1;
|
||||
int32_t iPicW = rand() % 256 + 1;
|
||||
int32_t iPicH = rand() % 256 + 1;
|
||||
|
||||
const int32_t kiPaddingLen = (PADDING_LENGTH>>1);
|
||||
int32_t iStride = iPicW + rand()%16 + 1 + kiPaddingLen*2;
|
||||
const int32_t kiPaddingLen = (PADDING_LENGTH >> 1);
|
||||
int32_t iStride = iPicW + rand() % 16 + 1 + kiPaddingLen * 2;
|
||||
|
||||
const int32_t kiMemSize = (iStride+kiPaddingLen*2) * (iPicH+kiPaddingLen*2);
|
||||
const int32_t kiMemSize = (iStride + kiPaddingLen * 2) * (iPicH + kiPaddingLen * 2);
|
||||
|
||||
uint8_t *pRef = new uint8_t[kiMemSize];
|
||||
uint8_t* pRef = new uint8_t[kiMemSize];
|
||||
|
||||
for (int i=0; i<kiMemSize; i++)
|
||||
pRef[i] = rand()%256 + 1;
|
||||
for (int i = 0; i < kiMemSize; i++)
|
||||
pRef[i] = rand() % 256 + 1;
|
||||
|
||||
uint8_t *pDst = pRef + kiPaddingLen * iStride + kiPaddingLen;
|
||||
uint8_t* pDst = pRef + kiPaddingLen * iStride + kiPaddingLen;
|
||||
|
||||
sFuncList.pfExpandChromaPicture[0](pDst,iStride, iPicW, iPicH);
|
||||
sFuncList.sExpandPicFunc.pfExpandChromaPicture[0] (pDst, iStride, iPicW, iPicH);
|
||||
|
||||
int k = 0;
|
||||
//top and top corner
|
||||
for (int i=0; i<kiPaddingLen; i++) {
|
||||
for (int j=0; j<iPicW+2*kiPaddingLen; j++) {
|
||||
for (int i = 0; i < kiPaddingLen; i++) {
|
||||
for (int j = 0; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
if (j < kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[0]);
|
||||
} else if (j >= iPicW+kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[iPicW-1]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[0]);
|
||||
} else if (j >= iPicW + kiPaddingLen) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[iPicW - 1]);
|
||||
} else
|
||||
EXPECT_EQ(pRef[k+j],pDst[j-kiPaddingLen]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[j - kiPaddingLen]);
|
||||
}
|
||||
k += iStride;
|
||||
}
|
||||
|
||||
k = (iPicH + kiPaddingLen - 1) * iStride;
|
||||
//bottom and bottom corner
|
||||
for (int i=iPicH+kiPaddingLen; i<iPicH+2*kiPaddingLen; i++) {
|
||||
for (int j=0; j<iPicW+2*kiPaddingLen; j++) {
|
||||
for (int i = iPicH + kiPaddingLen; i < iPicH + 2 * kiPaddingLen; i++) {
|
||||
for (int j = 0; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
if (j < kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride]);
|
||||
} else if (j >= iPicW+kiPaddingLen) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride + iPicW - 1]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride]);
|
||||
} else if (j >= iPicW + kiPaddingLen) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride + iPicW - 1]);
|
||||
} else
|
||||
EXPECT_EQ(pRef[k+j],pDst[(iPicH-1) * iStride + j - kiPaddingLen]);
|
||||
EXPECT_EQ (pRef[k + j], pDst[ (iPicH - 1) * iStride + j - kiPaddingLen]);
|
||||
}
|
||||
k += iStride;
|
||||
}
|
||||
|
||||
k = kiPaddingLen * iStride;
|
||||
int l=0;
|
||||
for (int i=0; i<iPicH-1; i++) { //left
|
||||
for (int j=0; j<kiPaddingLen; j++) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[l]);
|
||||
int l = 0;
|
||||
for (int i = 0; i < iPicH - 1; i++) { //left
|
||||
for (int j = 0; j < kiPaddingLen; j++) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[l]);
|
||||
}
|
||||
k += iStride;
|
||||
l += iStride;
|
||||
@ -138,9 +138,9 @@ TEST(ExpandPicTest, TestExpandPictureChroma_c) {
|
||||
|
||||
k = kiPaddingLen * iStride;
|
||||
l = 0;
|
||||
for (int i=0; i<iPicH-1; i++) { //right
|
||||
for (int j=iPicW+kiPaddingLen; j<iPicW+2*kiPaddingLen; j++) {
|
||||
EXPECT_EQ(pRef[k+j],pDst[l+iPicW-1]);
|
||||
for (int i = 0; i < iPicH - 1; i++) { //right
|
||||
for (int j = iPicW + kiPaddingLen; j < iPicW + 2 * kiPaddingLen; j++) {
|
||||
EXPECT_EQ (pRef[k + j], pDst[l + iPicW - 1]);
|
||||
}
|
||||
k += iStride;
|
||||
l += iStride;
|
||||
|
Loading…
x
Reference in New Issue
Block a user