Merge pull request #689 from huili2/add_file_CopyMB_EC
divide copy_mb functions into new file for decoder use from encoder and ...
This commit is contained in:
commit
e8d8bdc48e
@ -685,6 +685,10 @@
|
||||
RelativePath="..\..\..\decoder\core\inc\bit_stream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\copy_mb.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\cpu.h"
|
||||
>
|
||||
@ -733,6 +737,10 @@
|
||||
RelativePath="..\..\..\decoder\core\inc\error_code.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\inc\error_concealment.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\inc\expand_pic.h"
|
||||
>
|
||||
@ -854,6 +862,10 @@
|
||||
RelativePath="..\..\..\decoder\core\src\bit_stream.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\src\copy_mb.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\src\cpu.cpp"
|
||||
>
|
||||
@ -890,6 +902,10 @@
|
||||
RelativePath="..\..\..\decoder\core\src\decoder_data_tables.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\src\error_concealment.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\decoder\core\src\expand_pic.cpp"
|
||||
>
|
||||
|
@ -395,6 +395,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\src\copy_mb.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\src\cpu.cpp"
|
||||
>
|
||||
@ -1448,6 +1452,10 @@
|
||||
RelativePath="..\..\..\encoder\core\inc\bit_stream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\copy_mb.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\common\inc\cpu.h"
|
||||
>
|
||||
|
72
codec/common/inc/copy_mb.h
Normal file
72
codec/common/inc/copy_mb.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*!
|
||||
* \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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef WELS_COPY_MB_H_
|
||||
#define WELS_COPY_MB_H_
|
||||
|
||||
#include "typedefs.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Copy functions
|
||||
****************************************************************************/
|
||||
void WelsCopy4x4 (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
|
||||
void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
|
||||
void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif//__cplusplus
|
||||
|
||||
#if defined (X86_ASM)
|
||||
|
||||
void WelsCopy8x8_mmx (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x16_mmx (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy16x8NotAligned_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
void WelsCopy16x16_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
void WelsCopy16x16NotAligned_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
#endif//X86_ASM
|
||||
|
||||
#if defined (HAVE_NEON)
|
||||
void WelsCopy8x8_neon (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy16x16_neon (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy16x16NotAligned_neon (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy16x8NotAligned_neon (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x16_neon (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif//__cplusplus
|
||||
|
||||
#endif //SAMPLE_H_
|
103
codec/common/src/copy_mb.cpp
Normal file
103
codec/common/src/copy_mb.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* \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 copy_mb.cpp
|
||||
*
|
||||
* \brief copy MB YUV data
|
||||
*
|
||||
* \date 2014.04.14 Created
|
||||
*
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
#include "copy_mb.h"
|
||||
#include "macros.h"
|
||||
#include "ls_defines.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Copy functions
|
||||
****************************************************************************/
|
||||
void WelsCopy4x4 (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
const int32_t kiSrcStride2 = iStrideS << 1;
|
||||
const int32_t kiSrcStride3 = iStrideS + kiSrcStride2;
|
||||
const int32_t kiDstStride2 = iStrideD << 1;
|
||||
const int32_t kiDstStride3 = iStrideD + kiDstStride2;
|
||||
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + kiDstStride2, LD32 (pSrc + kiSrcStride2));
|
||||
ST32 (pDst + kiDstStride3, LD32 (pSrc + kiSrcStride3));
|
||||
}
|
||||
void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
|
||||
pDst += iStrideD << 1;
|
||||
pSrc += iStrideS << 1;
|
||||
}
|
||||
}
|
||||
void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
|
||||
pDst += iStrideD << 1;
|
||||
pSrc += iStrideS << 1;
|
||||
}
|
||||
}
|
||||
void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 8; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + 8 , LD32 (pSrc + 8));
|
||||
ST32 (pDst + 12 , LD32 (pSrc + 12));
|
||||
pDst += iStrideD ;
|
||||
pSrc += iStrideS;
|
||||
}
|
||||
}
|
||||
void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + 8 , LD32 (pSrc + 8));
|
||||
ST32 (pDst + 12 , LD32 (pSrc + 12));
|
||||
pDst += iStrideD ;
|
||||
pSrc += iStrideS;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
COMMON_SRCDIR=codec/common
|
||||
COMMON_CPP_SRCS=\
|
||||
$(COMMON_SRCDIR)/src/copy_mb.cpp\
|
||||
$(COMMON_SRCDIR)/src/cpu.cpp\
|
||||
$(COMMON_SRCDIR)/src/crt_util_safe_x.cpp\
|
||||
$(COMMON_SRCDIR)/src/deblocking_common.cpp\
|
||||
|
@ -98,6 +98,12 @@ typedef struct TagMcFunc {
|
||||
PWelsMcFunc pMcChromaFunc;
|
||||
} SMcFunc;
|
||||
|
||||
typedef void (*PCopyFunc) (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
typedef struct TagCopyFunc {
|
||||
PCopyFunc pCopyLumaFunc;
|
||||
PCopyFunc pCopyChromaFunc;
|
||||
} SCopyFunc;
|
||||
|
||||
//deblock module defination
|
||||
struct TagDeblockingFunc;
|
||||
|
||||
@ -278,6 +284,9 @@ typedef struct TagWelsDecoderContext {
|
||||
PGetIntraPredFunc pGetIChromaPredFunc[7]; // h264_predict_8x8_t
|
||||
PIdctResAddPredFunc pIdctResAddPredFunc;
|
||||
SMcFunc sMcFunc;
|
||||
|
||||
//For error concealment
|
||||
SCopyFunc sCopyFunc;
|
||||
/* For Deblocking */
|
||||
SDeblockingFunc sDeblockingFunc;
|
||||
SExpandPicFunc sExpandPicFunc;
|
||||
|
62
codec/decoder/core/inc/error_concealment.h
Normal file
62
codec/decoder/core/inc/error_concealment.h
Normal file
@ -0,0 +1,62 @@
|
||||
/*!
|
||||
* \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 error_concealment.h
|
||||
*
|
||||
* \brief Interfaces introduced for error concealment
|
||||
*
|
||||
* \date 04/14/2014 Created
|
||||
*
|
||||
*************************************************************************************
|
||||
*/
|
||||
#ifndef WELS_ERROR_CONCEALMENT_H__
|
||||
#define WELS_ERROR_CONCEALMENT_H__
|
||||
#include "typedefs.h"
|
||||
#include "decoder_context.h"
|
||||
|
||||
namespace WelsDec {
|
||||
//Initialize error concealment
|
||||
void InitErrorCon (PWelsDecoderContext pCtx);
|
||||
//Do error concealment using frame copy method
|
||||
void DoErrorConFrameCopy (PWelsDecoderContext pCtx);
|
||||
//Do error concealment using slice copy method
|
||||
void DoErrorConSliceCopy (PWelsDecoderContext pCtx);
|
||||
//Mark erroneous frame as Ref Pic into DPB
|
||||
int32_t MarkECFrameAsRef (PWelsDecoderContext pCtx);
|
||||
//Judge if EC is needed to current frame
|
||||
bool NeedErrorCon (PWelsDecoderContext pCtx);
|
||||
// ImplementErrorConceal
|
||||
// Do actual error concealment
|
||||
int32_t ImplementErrorCon (PWelsDecoderContext pCtx);
|
||||
|
||||
} // namespace WelsDec
|
||||
|
||||
#endif//WELS_ERROR_CONCEALMENT_H__
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include "deblocking.h"
|
||||
#include "expand_pic.h"
|
||||
#include "decode_slice.h"
|
||||
#include "error_concealment.h"
|
||||
#include "mem_align.h"
|
||||
#include "ls_defines.h"
|
||||
|
||||
@ -476,6 +477,8 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
||||
return pCtx->iErrorCode;
|
||||
}
|
||||
}
|
||||
//Do error concealment here
|
||||
ImplementErrorCon (pCtx);
|
||||
}
|
||||
|
||||
if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) &&
|
||||
@ -530,10 +533,10 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
||||
ResetParameterSetsState (pCtx);
|
||||
return pCtx->iErrorCode;
|
||||
}
|
||||
//Do error concealment here
|
||||
ImplementErrorCon (pCtx);
|
||||
}
|
||||
|
||||
//TODO error concealment here
|
||||
|
||||
if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType))
|
||||
&& pNalPayload) {
|
||||
if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) {
|
||||
@ -571,7 +574,8 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
||||
ResetParameterSetsState (pCtx);
|
||||
return pCtx->iErrorCode;
|
||||
}
|
||||
|
||||
//Do error concealment here
|
||||
ImplementErrorCon (pCtx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "decoder.h"
|
||||
#include "decode_mb_aux.h"
|
||||
#include "mem_align.h"
|
||||
#include "error_concealment.h"
|
||||
|
||||
namespace WelsDec {
|
||||
|
||||
@ -1549,6 +1550,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI
|
||||
WelsLog (pCtx, WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr);
|
||||
return iErr;
|
||||
}
|
||||
InitErrorCon (pCtx); //Do EC initialization here, for sequence start
|
||||
}
|
||||
|
||||
|
||||
|
98
codec/decoder/core/src/error_concealment.cpp
Normal file
98
codec/decoder/core/src/error_concealment.cpp
Normal file
@ -0,0 +1,98 @@
|
||||
/*!
|
||||
* \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.
|
||||
*
|
||||
* error_concealment.cpp: Wels decoder error concealment implementation
|
||||
*/
|
||||
|
||||
#include "error_code.h"
|
||||
#include "expand_pic.h"
|
||||
#include "manage_dec_ref.h"
|
||||
#include "copy_mb.h"
|
||||
#include "error_concealment.h"
|
||||
#include "cpu_core.h"
|
||||
|
||||
namespace WelsDec {
|
||||
//Init
|
||||
void InitErrorCon (PWelsDecoderContext pCtx) {
|
||||
if (pCtx->iErrorConMethod == ERROR_CON_SLICE_COPY) {
|
||||
pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_c;
|
||||
pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_c;
|
||||
|
||||
#if defined(X86_ASM)
|
||||
if (pCtx->uiCpuFlag & WELS_CPU_MMXEXT) {
|
||||
pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_mmx; //aligned
|
||||
}
|
||||
|
||||
if (pCtx->uiCpuFlag & WELS_CPU_SSE2) {
|
||||
pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_sse2; //this is aligned copy;
|
||||
}
|
||||
#endif //X86_ASM
|
||||
|
||||
#if defined(HAVE_NEON)
|
||||
if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
|
||||
pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_neon; //aligned
|
||||
}
|
||||
#endif //HAVE_NEON
|
||||
} //TODO add more methods here
|
||||
return;
|
||||
}
|
||||
|
||||
//Do error concealment using frame copy method
|
||||
void DoErrorConFrameCopy (PWelsDecoderContext pCtx) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
||||
//Do error concealment using slice copy method
|
||||
void DoErrorConSliceCopy (PWelsDecoderContext pCtx) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
//Mark erroneous frame as Ref Pic into DPB
|
||||
int32_t MarkECFrameAsRef (PWelsDecoderContext pCtx) {
|
||||
//TODO
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
bool NeedErrorCon (PWelsDecoderContext pCtx) {
|
||||
bool bNeedEC = false;
|
||||
//TODO
|
||||
return bNeedEC;
|
||||
}
|
||||
|
||||
// ImplementErrorConceal
|
||||
// Do actual error concealment
|
||||
int32_t ImplementErrorCon (PWelsDecoderContext pCtx) {
|
||||
int32_t iRet = ERR_NONE;
|
||||
//TODO
|
||||
return iRet;
|
||||
}
|
||||
|
||||
} // namespace WelsDec
|
@ -8,6 +8,7 @@ DECODER_CPP_SRCS=\
|
||||
$(DECODER_SRCDIR)/core/src/decoder.cpp\
|
||||
$(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\
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include "typedefs.h"
|
||||
#include "wels_func_ptr_def.h"
|
||||
#include "copy_mb.h"
|
||||
|
||||
namespace WelsSVCEnc {
|
||||
void WelsInitEncodingFuncs (SWelsFuncPtrList* pFuncList, uint32_t uiCpuFlag);
|
||||
@ -68,15 +69,6 @@ void WelsDctT4_c (int16_t* pDct, uint8_t* pPixel1, int32_t iStride1, uint8_t* pP
|
||||
// dct_data is no-use here, just for the same interface with dct_save functions
|
||||
void WelsDctFourT4_c (int16_t* pDct, uint8_t* pPixel1, int32_t iStride1, uint8_t* pPixel2, int32_t iStride2);
|
||||
|
||||
/****************************************************************************
|
||||
* Copy functions
|
||||
****************************************************************************/
|
||||
void WelsCopy4x4 (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
|
||||
void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS); //
|
||||
void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif//__cplusplus
|
||||
@ -111,24 +103,9 @@ void WelsQuant4x4Dc_sse2 (int16_t* pDct, int16_t iFF, int16_t iMF);
|
||||
void WelsQuantFour4x4_sse2 (int16_t* pDct, const int16_t* pFF, const int16_t* pMF);
|
||||
void WelsQuantFour4x4Max_sse2 (int16_t* pDct, const int16_t* pFF, const int16_t* pMF, int16_t* pMax);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Copy functions for rec
|
||||
****************************************************************************/
|
||||
void WelsCopy8x8_mmx (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy8x16_mmx (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS);
|
||||
void WelsCopy16x8NotAligned_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
void WelsCopy16x16_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
void WelsCopy16x16NotAligned_sse2 (uint8_t* Dst, int32_t iStrideD, uint8_t* Src, int32_t iStrideS);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NEON
|
||||
void WelsCopy8x8_neon( uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS );
|
||||
void WelsCopy16x16_neon( uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS );
|
||||
void WelsCopy16x16NotAligned_neon( uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS );
|
||||
void WelsCopy16x8NotAligned_neon( uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS );
|
||||
void WelsCopy8x16_neon( uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS );
|
||||
|
||||
void WelsHadamardT4Dc_neon(int16_t* pLumaDc, int16_t* pDct);
|
||||
int32_t WelsHadamardQuant2x2_neon(int16_t* pRes, const int16_t kiFF, int16_t iMF, int16_t* pDct, int16_t* pBlock);
|
||||
int32_t WelsHadamardQuant2x2Skip_neon(int16_t* pRes, int16_t iFF, int16_t iMF);
|
||||
|
@ -434,65 +434,6 @@ int32_t WelsCalculateSingleCtr4x4_c (int16_t* pDct) {
|
||||
return iSingleCtr;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Copy functions
|
||||
****************************************************************************/
|
||||
void WelsCopy4x4 (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
const int32_t kiSrcStride2 = iStrideS << 1;
|
||||
const int32_t kiSrcStride3 = iStrideS + kiSrcStride2;
|
||||
const int32_t kiDstStride2 = iStrideD << 1;
|
||||
const int32_t kiDstStride3 = iStrideD + kiDstStride2;
|
||||
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + kiDstStride2, LD32 (pSrc + kiSrcStride2));
|
||||
ST32 (pDst + kiDstStride3, LD32 (pSrc + kiSrcStride3));
|
||||
}
|
||||
void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
|
||||
pDst += iStrideD << 1;
|
||||
pSrc += iStrideS << 1;
|
||||
}
|
||||
}
|
||||
void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 8; ++i) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + iStrideD, LD32 (pSrc + iStrideS));
|
||||
ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
|
||||
pDst += iStrideD << 1;
|
||||
pSrc += iStrideS << 1;
|
||||
}
|
||||
}
|
||||
void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 8; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + 8 , LD32 (pSrc + 8));
|
||||
ST32 (pDst + 12 , LD32 (pSrc + 12));
|
||||
pDst += iStrideD ;
|
||||
pSrc += iStrideS;
|
||||
}
|
||||
}
|
||||
void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
|
||||
int32_t i;
|
||||
for (i = 0; i < 16; i++) {
|
||||
ST32 (pDst, LD32 (pSrc));
|
||||
ST32 (pDst + 4 , LD32 (pSrc + 4));
|
||||
ST32 (pDst + 8 , LD32 (pSrc + 8));
|
||||
ST32 (pDst + 12 , LD32 (pSrc + 12));
|
||||
pDst += iStrideD ;
|
||||
pSrc += iStrideS;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t WelsGetNoneZeroCount_c (int16_t* pLevel) {
|
||||
int32_t iCnt = 0;
|
||||
int32_t iIdx = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user