Convert tabs to spaces in multiline comments
This commit is contained in:
parent
853423b5ad
commit
b05468b5c1
@ -50,7 +50,7 @@ extern "C" {
|
||||
|
||||
#if defined(X86_ASM)
|
||||
/*
|
||||
* cpuid support verify routine
|
||||
* cpuid support verify routine
|
||||
* return 0 if cpuid is not supported by cpu
|
||||
*/
|
||||
int32_t WelsCPUIdVerify();
|
||||
@ -63,7 +63,7 @@ int32_t WelsCPUSupportFMA (uint32_t eax, uint32_t ecx);
|
||||
void WelsEmms();
|
||||
|
||||
/*
|
||||
* clear FPU registers states for potential float based calculation if support
|
||||
* clear FPU registers states for potential float based calculation if support
|
||||
*/
|
||||
void WelsCPURestore (const uint32_t kuiCPU);
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#define WELS_CPU_CORE_FEATURE_DETECTION_H__
|
||||
|
||||
/*
|
||||
* WELS CPU feature flags
|
||||
* WELS CPU feature flags
|
||||
*/
|
||||
#define WELS_CPU_MMX 0x00000001 /* mmx */
|
||||
#define WELS_CPU_MMXEXT 0x00000002 /* mmx-ext*/
|
||||
@ -80,7 +80,7 @@
|
||||
#define WELS_CPU_NEON 0x000004 /* NEON */
|
||||
|
||||
/*
|
||||
* Interfaces for CPU core feature detection as below
|
||||
* Interfaces for CPU core feature detection as below
|
||||
*/
|
||||
|
||||
#endif//WELS_CPU_CORE_FEATURE_DETECTION_H__
|
||||
|
@ -56,13 +56,13 @@ namespace WelsCommon {
|
||||
|
||||
|
||||
/*!
|
||||
* \brief initialize bitstream writing
|
||||
* \brief initialize bitstream writing
|
||||
*
|
||||
* \param pBs Bit string auxiliary pointer
|
||||
* \param pBuf bit-stream pBuffer
|
||||
* \param iSize iSize in bits for decoder; iSize in bytes for encoder
|
||||
* \param pBs Bit string auxiliary pointer
|
||||
* \param pBuf bit-stream pBuffer
|
||||
* \param iSize iSize in bits for decoder; iSize in bytes for encoder
|
||||
*
|
||||
* \return iSize of pBuffer pData in byte; failed in -1 return
|
||||
* \return iSize of pBuffer pData in byte; failed in -1 return
|
||||
*/
|
||||
static inline int32_t InitBits (SBitStringAux* pBs, const uint8_t* kpBuf, const int32_t kiSize) {
|
||||
uint8_t* ptr = (uint8_t*)kpBuf;
|
||||
@ -92,7 +92,7 @@ static inline int32_t BsWriteBits (PBitStringAux pBitString, int32_t iLen, const
|
||||
}
|
||||
|
||||
/*
|
||||
* Write 1 bit
|
||||
* Write 1 bit
|
||||
*/
|
||||
static inline int32_t BsWriteOneBit (PBitStringAux pBitString, const uint32_t kuiValue) {
|
||||
BsWriteBits (pBitString, 1, kuiValue);
|
||||
@ -108,7 +108,7 @@ static inline int32_t BsFlush (PBitStringAux pBitString) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Write unsigned exp golomb codes
|
||||
* Write unsigned exp golomb codes
|
||||
*/
|
||||
|
||||
static inline int32_t BsWriteUE (PBitStringAux pBitString, const uint32_t kuiValue) {
|
||||
@ -135,7 +135,7 @@ static inline int32_t BsWriteUE (PBitStringAux pBitString, const uint32_t kuiVal
|
||||
}
|
||||
|
||||
/*
|
||||
* Write signed exp golomb codes
|
||||
* Write signed exp golomb codes
|
||||
*/
|
||||
static inline int32_t BsWriteSE (PBitStringAux pBitString, const int32_t kiValue) {
|
||||
uint32_t iTmpValue;
|
||||
@ -153,7 +153,7 @@ static inline int32_t BsWriteSE (PBitStringAux pBitString, const int32_t kiValue
|
||||
|
||||
|
||||
/*
|
||||
* Write RBSP trailing bits
|
||||
* Write RBSP trailing bits
|
||||
*/
|
||||
static inline int32_t BsRbspTrailingBits (PBitStringAux pBitString) {
|
||||
BsWriteOneBit (pBitString, 1);
|
||||
|
@ -207,8 +207,8 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
|
||||
|
||||
/*
|
||||
* Description: to check variable validation and return the specified result
|
||||
* iResult: value to be checked
|
||||
* iExpected: the expected value
|
||||
* iResult: value to be checked
|
||||
* iExpected: the expected value
|
||||
*/
|
||||
#ifndef WELS_VERIFY_RETURN_IFNEQ
|
||||
#define WELS_VERIFY_RETURN_IFNEQ(iResult, iExpected) \
|
||||
@ -219,8 +219,8 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
|
||||
|
||||
/*
|
||||
* Description: to check variable validation and return the specified result
|
||||
* iResult: value to be return
|
||||
* bCaseIf: negative condition to be verified
|
||||
* iResult: value to be return
|
||||
* bCaseIf: negative condition to be verified
|
||||
*/
|
||||
#ifndef WELS_VERIFY_RETURN_IF
|
||||
#define WELS_VERIFY_RETURN_IF(iResult, bCaseIf) \
|
||||
@ -230,11 +230,11 @@ template<typename T> T WelsClip3(T iX, T iY, T iZ) {
|
||||
#endif//#if WELS_VERIFY_RETURN_IF
|
||||
|
||||
/*
|
||||
* Description: to check variable validation and return the specified result
|
||||
* with correspoinding process advance.
|
||||
* result: value to be return
|
||||
* case_if: negative condition to be verified
|
||||
* proc: process need perform
|
||||
* Description: to check variable validation and return the specified result
|
||||
* with correspoinding process advance.
|
||||
* result: value to be return
|
||||
* case_if: negative condition to be verified
|
||||
* proc: process need perform
|
||||
*/
|
||||
#ifndef WELS_VERIFY_RETURN_PROC_IF
|
||||
#define WELS_VERIFY_RETURN_PROC_IF(iResult, bCaseIf, fProc) \
|
||||
|
@ -55,9 +55,9 @@ extern "C" {
|
||||
#endif//__cplusplus
|
||||
|
||||
/*!
|
||||
* \brief time cost measure utilization
|
||||
* \param void
|
||||
* \return time elapsed since run (unit: microsecond)
|
||||
* \brief time cost measure utilization
|
||||
* \param void
|
||||
* \return time elapsed since run (unit: microsecond)
|
||||
*/
|
||||
|
||||
static inline int64_t WelsTime (void) {
|
||||
|
@ -46,7 +46,7 @@
|
||||
#define MAX_WIDTH (4096)
|
||||
#define MAX_HEIGHT (2304)//MAX_FS_LEVEL51 (36864); MAX_FS_LEVEL51*256/4096 = 2304
|
||||
/*
|
||||
* Function pointer declaration for various tool sets
|
||||
* Function pointer declaration for various tool sets
|
||||
*/
|
||||
// wels log output
|
||||
typedef void (*PWelsLogCallbackFunc) (void* pCtx, const int32_t iLevel, const char* kpFmt, va_list argv);
|
||||
@ -67,22 +67,22 @@ extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PSNR calculation routines
|
||||
* PSNR calculation routines
|
||||
*/
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief PSNR calculation utilization in Wels
|
||||
* \brief PSNR calculation utilization in Wels
|
||||
*
|
||||
* \param kpTarPic target picture to be calculated in Picture pData format
|
||||
* \param kiTarStride stride of target picture pData pBuffer
|
||||
* \param kpRefPic base referencing picture samples
|
||||
* \param kiRefStride stride of reference picture pData pBuffer
|
||||
* \param kiWidth picture iWidth in pixel
|
||||
* \param kiHeight picture iHeight in pixel
|
||||
* \param kpTarPic target picture to be calculated in Picture pData format
|
||||
* \param kiTarStride stride of target picture pData pBuffer
|
||||
* \param kpRefPic base referencing picture samples
|
||||
* \param kiRefStride stride of reference picture pData pBuffer
|
||||
* \param kiWidth picture iWidth in pixel
|
||||
* \param kiHeight picture iHeight in pixel
|
||||
*
|
||||
* \return actual PSNR result;
|
||||
* \return actual PSNR result;
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
float WelsCalcPsnr (const void* kpTarPic,
|
||||
|
@ -78,7 +78,7 @@ extern const int8_t g_kiCabacGlobalContextIdx[WELS_CONTEXT_COUNT][4][2];
|
||||
extern const uint8_t g_kuiStateTransTable[64][2];
|
||||
extern const uint32_t g_kuiGolombUELength[256];
|
||||
/*
|
||||
* NAL Unit Type (5 Bits)
|
||||
* NAL Unit Type (5 Bits)
|
||||
*/
|
||||
enum EWelsNalUnitType {
|
||||
NAL_UNIT_UNSPEC_0 = 0,
|
||||
@ -116,7 +116,7 @@ enum EWelsNalUnitType {
|
||||
};
|
||||
|
||||
/*
|
||||
* NAL Reference IDC (2 Bits)
|
||||
* NAL Reference IDC (2 Bits)
|
||||
*/
|
||||
|
||||
enum EWelsNalRefIdc {
|
||||
@ -137,7 +137,7 @@ enum EVclType {
|
||||
};
|
||||
|
||||
/*
|
||||
* vcl type map for given NAL unit type and corresponding H264 type (0: AVC; 1: SVC).
|
||||
* vcl type map for given NAL unit type and corresponding H264 type (0: AVC; 1: SVC).
|
||||
*/
|
||||
extern const EVclType g_keTypeMap[32][2];
|
||||
|
||||
@ -202,7 +202,7 @@ enum EChromaComp {
|
||||
|
||||
|
||||
/*
|
||||
* Memory Management Control Operation (MMCO) code
|
||||
* Memory Management Control Operation (MMCO) code
|
||||
*/
|
||||
enum EMmcoCode {
|
||||
MMCO_END = 0,
|
||||
@ -215,7 +215,7 @@ enum EMmcoCode {
|
||||
};
|
||||
|
||||
/*
|
||||
* Bit-stream auxiliary reading / writing
|
||||
* Bit-stream auxiliary reading / writing
|
||||
*/
|
||||
typedef struct TagBitStringAux {
|
||||
uint8_t* pStartBuf; // buffer to start position
|
||||
|
@ -146,7 +146,7 @@ const uint8_t g_kuiChromaQpTable[52] = {
|
||||
};
|
||||
|
||||
/*
|
||||
* vcl type map for given NAL unit type and corresponding H264 type (0: AVC; 1: SVC).
|
||||
* vcl type map for given NAL unit type and corresponding H264 type (0: AVC; 1: SVC).
|
||||
*/
|
||||
const EVclType g_keTypeMap[32][2] = {
|
||||
{ NON_VCL, NON_VCL }, // 0: NAL_UNIT_UNSPEC_0
|
||||
|
@ -80,22 +80,22 @@ void WelsLog (SLogContext* logCtx, int32_t iLevel, const char* kpFmt, ...) {
|
||||
#endif//CALC_PSNR
|
||||
|
||||
/*
|
||||
* PSNR calculation routines
|
||||
* PSNR calculation routines
|
||||
*/
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief PSNR calculation utilization in Wels
|
||||
* \brief PSNR calculation utilization in Wels
|
||||
*
|
||||
* \param pTarPic target picture to be calculated in Picture pData format
|
||||
* \param iTarStride stride of target picture pData pBuffer
|
||||
* \param pRefPic base referencing picture samples
|
||||
* \param iRefStride stride of reference picture pData pBuffer
|
||||
* \param iWidth picture iWidth in pixel
|
||||
* \param iHeight picture iHeight in pixel
|
||||
* \param pTarPic target picture to be calculated in Picture pData format
|
||||
* \param iTarStride stride of target picture pData pBuffer
|
||||
* \param pRefPic base referencing picture samples
|
||||
* \param iRefStride stride of reference picture pData pBuffer
|
||||
* \param iWidth picture iWidth in pixel
|
||||
* \param iHeight picture iHeight in pixel
|
||||
*
|
||||
* \return actual PSNR result;
|
||||
* \return actual PSNR result;
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
float WelsCalcPsnr (const void* kpTarPic,
|
||||
|
@ -93,7 +93,7 @@ using namespace std;
|
||||
using namespace WelsEnc;
|
||||
|
||||
/*
|
||||
* Layer Context
|
||||
* Layer Context
|
||||
*/
|
||||
typedef struct LayerpEncCtx_s {
|
||||
int32_t iDLayerQp;
|
||||
|
@ -50,37 +50,37 @@ namespace WelsDec {
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Start Code Prefix (0x 00 00 00 01) detection
|
||||
* \brief Start Code Prefix (0x 00 00 00 01) detection
|
||||
*
|
||||
* \param pBuf bitstream payload buffer
|
||||
* \param pOffset offset between NAL rbsp and original bitsteam that
|
||||
* start code prefix is seperated from.
|
||||
* \param iBufSize count size of buffer
|
||||
* \param pBuf bitstream payload buffer
|
||||
* \param pOffset offset between NAL rbsp and original bitsteam that
|
||||
* start code prefix is seperated from.
|
||||
* \param iBufSize count size of buffer
|
||||
*
|
||||
* \return RBSP buffer of start code prefix exclusive
|
||||
* \return RBSP buffer of start code prefix exclusive
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t iBufSize);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse network abstraction layer unit,
|
||||
* escape emulation_prevention_three_byte within it
|
||||
former name is parse_nal
|
||||
* \brief to parse network abstraction layer unit,
|
||||
* escape emulation_prevention_three_byte within it
|
||||
former name is parse_nal
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pNalUnitHeader parsed result of NAL Unit Header to output
|
||||
* \param pCtx decoder context
|
||||
* \param pNalUnitHeader parsed result of NAL Unit Header to output
|
||||
* \param pSrcRbsp bitstream buffer to input
|
||||
* \param iSrcRbspLen length size of bitstream buffer payload
|
||||
* \param pSrcNal
|
||||
* \param iSrcNalLen
|
||||
* \param pConsumedBytes consumed bytes during parsing
|
||||
* \param pSrcNal
|
||||
* \param iSrcNalLen
|
||||
* \param pConsumedBytes consumed bytes during parsing
|
||||
*
|
||||
* \return decoded bytes payload, might be (pSrcRbsp+1) if no escapes
|
||||
* \return decoded bytes payload, might be (pSrcRbsp+1) if no escapes
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp,
|
||||
@ -100,33 +100,33 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse Sequence Parameter Set (SPS)
|
||||
* \brief to parse Sequence Parameter Set (SPS)
|
||||
*
|
||||
* \param pCtx Decoder context
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pPicWidth picture width current Sps represented
|
||||
* \param pPicHeight picture height current Sps represented
|
||||
* \param pCtx Decoder context
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pPicWidth picture width current Sps represented
|
||||
* \param pPicHeight picture height current Sps represented
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is SPS.
|
||||
* \note Call it in case eNalUnitType is SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicWidth, int32_t* pPicHeight, uint8_t* pSrcNal, const int32_t kSrcNalLen);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse Picture Parameter Set (PPS)
|
||||
* \brief to parse Picture Parameter Set (PPS)
|
||||
*
|
||||
* \param pCtx Decoder context
|
||||
* \param pPpsList pps list
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pCtx Decoder context
|
||||
* \param pPpsList pps list
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is PPS.
|
||||
* \note Call it in case eNalUnitType is PPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal, const int32_t kSrcNalLen);
|
||||
@ -148,26 +148,26 @@ int32_t SetScalingListValue (uint8_t *pScalingList,int iScalingListNum,bool* bUs
|
||||
int32_t ParseScalingList(PSps pSps,PBitStringAux pBs,bool bPPS,bool *bScalingListPresentFlag,uint8_t(*iScalingList4x4)[16],uint8_t(*iScalingList8x8)[64]);
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse SEI message payload
|
||||
* \brief to parse SEI message payload
|
||||
*
|
||||
* \param pSei sei message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pSei sei message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is NAL_UNIT_SEI.
|
||||
* \note Call it in case eNalUnitType is NAL_UNIT_SEI.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ParseSei (void* pSei, PBitStringAux pBsAux); // reserved Sei_Msg type
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief reset fmo list due to got Sps now
|
||||
* \brief reset fmo list due to got Sps now
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pCtx decoder context
|
||||
*
|
||||
* \return count number of fmo context units are reset
|
||||
* \return count number of fmo context units are reset
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ResetFmoList (PWelsDecoderContext pCtx);
|
||||
|
@ -43,13 +43,13 @@ using namespace WelsCommon;
|
||||
namespace WelsDec {
|
||||
|
||||
/*!
|
||||
* \brief input bits for decoder or initialize bitstream writing in encoder
|
||||
* \brief input bits for decoder or initialize bitstream writing in encoder
|
||||
*
|
||||
* \param pBitString Bit string auxiliary pointer
|
||||
* \param kpBuf bit-stream buffer
|
||||
* \param kiSize size in bits for decoder; size in bytes for encoder
|
||||
* \param pBitString Bit string auxiliary pointer
|
||||
* \param kpBuf bit-stream buffer
|
||||
* \param kiSize size in bits for decoder; size in bytes for encoder
|
||||
*
|
||||
* \return size of buffer data in byte; failed in -1 return
|
||||
* \return size of buffer data in byte; failed in -1 return
|
||||
*/
|
||||
int32_t DecInitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize);
|
||||
|
||||
|
@ -46,35 +46,35 @@
|
||||
namespace WelsDec {
|
||||
|
||||
/*!
|
||||
* \brief deblocking module initialize
|
||||
* \brief deblocking module initialize
|
||||
*
|
||||
* \param pf
|
||||
* \param pf
|
||||
* cpu
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
|
||||
void DeblockingInit (PDeblockingFunc pDeblockingFunc, int32_t iCpu);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief deblocking filtering target slice
|
||||
* \brief deblocking filtering target slice
|
||||
*
|
||||
* \param dec Wels decoder context
|
||||
* \param dec Wels decoder context
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFunc pDeblockMb);
|
||||
|
||||
/*!
|
||||
* \brief pixel deblocking filtering
|
||||
* \brief pixel deblocking filtering
|
||||
*
|
||||
* \param filter deblocking filter
|
||||
* \param pix pixel value
|
||||
* \param stride frame stride
|
||||
* \param bs boundary strength
|
||||
* \param filter deblocking filter
|
||||
* \param pix pixel value
|
||||
* \param stride frame stride
|
||||
* \param bs boundary strength
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
|
||||
uint32_t DeblockingBsMarginalMBAvcbase (PDqLayer pCurDqLayer, int32_t iEdge, int32_t iNeighMb, int32_t iMbXy);
|
||||
|
@ -84,7 +84,7 @@ static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t*
|
||||
}
|
||||
|
||||
/*
|
||||
* Exponential Golomb codes decoding routines
|
||||
* Exponential Golomb codes decoding routines
|
||||
*/
|
||||
|
||||
// for data sharing cross modules and try to reduce size of binary generated, 12/10/2009
|
||||
@ -122,7 +122,7 @@ static inline uint32_t GetPrefixBits (uint32_t uiValue) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Read one bit from bit stream followed
|
||||
* Read one bit from bit stream followed
|
||||
*/
|
||||
static inline uint32_t BsGetOneBit (PBitStringAux pBs, uint32_t* pCode) {
|
||||
return (BsGetBits (pBs, 1, pCode));
|
||||
@ -185,7 +185,7 @@ static inline uint32_t BsGetUe (PBitStringAux pBs, uint32_t* pCode) {
|
||||
|
||||
|
||||
/*
|
||||
* Read signed exp golomb codes
|
||||
* Read signed exp golomb codes
|
||||
*/
|
||||
static inline int32_t BsGetSe (PBitStringAux pBs, int32_t* pCode) {
|
||||
uint32_t uiCodeNum;
|
||||
@ -216,7 +216,7 @@ static inline int32_t BsGetTe0 (PBitStringAux pBs, int32_t iRange, uint32_t* pCo
|
||||
}
|
||||
|
||||
/*
|
||||
* Get number of trailing bits
|
||||
* Get number of trailing bits
|
||||
*/
|
||||
static inline int32_t BsGetTrailingBits (uint8_t* pBuf) {
|
||||
// TODO
|
||||
|
@ -50,53 +50,53 @@ extern "C" {
|
||||
#endif//__cplusplus
|
||||
|
||||
/*!
|
||||
* \brief configure decoder parameters
|
||||
* \brief configure decoder parameters
|
||||
*/
|
||||
int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Initialize Wels decoder parameters and memory
|
||||
* \brief Initialize Wels decoder parameters and memory
|
||||
*
|
||||
* \param pCtx input context to be initialized at first stage
|
||||
* \param pCtx input context to be initialized at first stage
|
||||
* \param pTraceHandle handle for trace
|
||||
* \param pLo log info pointer
|
||||
*
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, const bool bParseOnly, SLogContext* pLogCtx);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Uninitialize Wels decoder parameters and memory
|
||||
* \brief Uninitialize Wels decoder parameters and memory
|
||||
*
|
||||
* \param pCtx input context to be uninitialized at release stage
|
||||
* \param pCtx input context to be uninitialized at release stage
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
void WelsEndDecoder (PWelsDecoderContext pCtx);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief First entrance to decoding core interface.
|
||||
* \brief First entrance to decoding core interface.
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pBufBs bit streaming buffer
|
||||
* \param kBsLen size in bytes length of bit streaming buffer input
|
||||
* \param ppDst picture payload data to be output
|
||||
* \param pDstBufInfo buf information of ouput data
|
||||
* \param pCtx decoder context
|
||||
* \param pBufBs bit streaming buffer
|
||||
* \param kBsLen size in bytes length of bit streaming buffer input
|
||||
* \param ppDst picture payload data to be output
|
||||
* \param pDstBufInfo buf information of ouput data
|
||||
*
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
@ -104,13 +104,13 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
||||
uint8_t** ppDst, SBufferInfo* pDstBufInfo, SParserBsInfo* pDstBsInfo);
|
||||
|
||||
/*
|
||||
* request memory blocks for decoder avc part
|
||||
* request memory blocks for decoder avc part
|
||||
*/
|
||||
int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight);
|
||||
|
||||
|
||||
/*
|
||||
* free memory blocks in avc
|
||||
* free memory blocks in avc
|
||||
*/
|
||||
void WelsFreeMem (PWelsDecoderContext pCtx);
|
||||
|
||||
@ -120,13 +120,13 @@ void WelsFreeMem (PWelsDecoderContext pCtx);
|
||||
int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat);
|
||||
|
||||
/*!
|
||||
* \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on)
|
||||
* over decoder internal
|
||||
* \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on)
|
||||
* over decoder internal
|
||||
* ( MB coordinate and parts of data within decoder context structure )
|
||||
* \param pCtx Wels decoder context
|
||||
* \param iMbWidth MB width
|
||||
* \pram iMbHeight MB height
|
||||
* \return 0 - successful; none 0 - something wrong
|
||||
* \param pCtx Wels decoder context
|
||||
* \param iMbWidth MB width
|
||||
* \pram iMbHeight MB height
|
||||
* \return 0 - successful; none 0 - something wrong
|
||||
*/
|
||||
int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight);
|
||||
|
||||
|
@ -127,7 +127,7 @@ typedef struct TagPpsBsInfo {
|
||||
//#endif//__cplusplus
|
||||
|
||||
/*
|
||||
* Need move below structures to function pointer to seperate module/file later
|
||||
* Need move below structures to function pointer to seperate module/file later
|
||||
*/
|
||||
|
||||
//typedef int32_t (*rec_mb) (Mb *cur_mb, PWelsDecoderContext pCtx);
|
||||
@ -226,7 +226,7 @@ enum {
|
||||
};
|
||||
|
||||
/*
|
||||
* SWelsDecoderContext: to maintail all modules data over decoder@framework
|
||||
* SWelsDecoderContext: to maintail all modules data over decoder@framework
|
||||
*/
|
||||
|
||||
typedef struct TagWelsDecoderContext {
|
||||
|
@ -52,7 +52,7 @@ namespace WelsDec {
|
||||
* InitBsBuffer
|
||||
* Memory allocation for Bitstream Buffer
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
*/
|
||||
int32_t InitBsBuffer (PWelsDecoderContext pCtx);
|
||||
|
||||
@ -61,7 +61,7 @@ int32_t InitBsBuffer (PWelsDecoderContext pCtx);
|
||||
* Expand current BS buffer and copy its content
|
||||
* new buffer size will consider input size as a reference
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
*/
|
||||
int32_t ExpandBsBuffer (PWelsDecoderContext pCtx, const int32_t kiSrcLen);
|
||||
|
||||
@ -77,7 +77,7 @@ int32_t CheckBsBuffer (PWelsDecoderContext pCtx, const int32_t kiSrcLen);
|
||||
* Especially for:
|
||||
* rbsp_au_buffer, cur_dq_layer_ptr and ref_dq_layer_ptr in MB info cache.
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
*/
|
||||
int32_t WelsInitMemory (PWelsDecoderContext pCtx);
|
||||
|
||||
@ -89,33 +89,33 @@ int32_t WelsInitMemory (PWelsDecoderContext pCtx);
|
||||
void WelsFreeMemory (PWelsDecoderContext pCtx);
|
||||
|
||||
/*!
|
||||
* \brief request memory when maximal picture width and height are available
|
||||
* \brief request memory when maximal picture width and height are available
|
||||
*/
|
||||
int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWidth, const int32_t kiMaxHeight);
|
||||
|
||||
/*!
|
||||
* \brief free dq layer context memory related
|
||||
* \brief free dq layer context memory related
|
||||
*/
|
||||
void UninitialDqLayersContext (PWelsDecoderContext pCtx);
|
||||
|
||||
/*
|
||||
* DecodeNalHeaderExt
|
||||
* Trigger condition: NAL_UNIT_TYPE = NAL_UNIT_PREFIX or NAL_UNIT_CODED_SLICE_EXT
|
||||
* Parameter:
|
||||
* pNal: target NALUnit ptr
|
||||
* pSrc: NAL Unit bitstream
|
||||
* DecodeNalHeaderExt
|
||||
* Trigger condition: NAL_UNIT_TYPE = NAL_UNIT_PREFIX or NAL_UNIT_CODED_SLICE_EXT
|
||||
* Parameter:
|
||||
* pNal: target NALUnit ptr
|
||||
* pSrc: NAL Unit bitstream
|
||||
*/
|
||||
void DecodeNalHeaderExt (PNalUnit pNal, uint8_t* pSrc);
|
||||
|
||||
/*
|
||||
* ParseSliceHeaderSyntaxs
|
||||
* Parse slice header of bitstream
|
||||
* ParseSliceHeaderSyntaxs
|
||||
* Parse slice header of bitstream
|
||||
*/
|
||||
int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, const bool kbExtensionFlag);
|
||||
/*
|
||||
* Copy relative syntax elements of NALUnitHeaderExt, sRefPicBaseMarking and bStoreRefBasePicFlag in prefix nal unit.
|
||||
* pSrc: mark as decoded prefix NAL
|
||||
* pDst: succeeded VCL NAL based AVC (I/P Slice)
|
||||
* Copy relative syntax elements of NALUnitHeaderExt, sRefPicBaseMarking and bStoreRefBasePicFlag in prefix nal unit.
|
||||
* pSrc: mark as decoded prefix NAL
|
||||
* pDst: succeeded VCL NAL based AVC (I/P Slice)
|
||||
*/
|
||||
bool PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kpDst, PNalUnit const kpSrc);
|
||||
|
||||
@ -125,12 +125,12 @@ bool PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kpDst,
|
||||
* construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to
|
||||
* joint a collective access unit.
|
||||
* parameter\
|
||||
* buf: bitstream data buffer
|
||||
* bit_len: size in bit length of data
|
||||
* buf_len: size in byte length of data
|
||||
* coded_au: mark an Access Unit decoding finished
|
||||
* buf: bitstream data buffer
|
||||
* bit_len: size in bit length of data
|
||||
* buf_len: size in byte length of data
|
||||
* coded_au: mark an Access Unit decoding finished
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h
|
||||
*/
|
||||
int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo);
|
||||
|
||||
@ -146,7 +146,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
|
||||
*/
|
||||
bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** pDst, SBufferInfo* pDstInfo);
|
||||
/*
|
||||
* Prepare current dq layer context initialization.
|
||||
* Prepare current dq layer context initialization.
|
||||
*/
|
||||
void WelsDqLayerDecodeStart (PWelsDecoderContext pCtx, PNalUnit pCurNal, PSps pSps, PPps pPps);
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace WelsDec {
|
||||
#endif//MB_XY_T
|
||||
|
||||
/*!
|
||||
* \brief Wels Flexible Macroblock Ordering (FMO)
|
||||
* \brief Wels Flexible Macroblock Ordering (FMO)
|
||||
*/
|
||||
typedef struct TagFmo {
|
||||
uint8_t* pMbAllocMap;
|
||||
@ -64,47 +64,47 @@ uint8_t uiReserved[3]; // reserved padding bytes
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Initialize Wels Flexible Macroblock Ordering (FMO)
|
||||
* \brief Initialize Wels Flexible Macroblock Ordering (FMO)
|
||||
*
|
||||
* \param pFmo Wels fmo to be initialized
|
||||
* \param pPps PPps
|
||||
* \param kiMbWidth mb width
|
||||
* \param kiMbHeight mb height
|
||||
* \param pFmo Wels fmo to be initialized
|
||||
* \param pPps PPps
|
||||
* \param kiMbWidth mb width
|
||||
* \param kiMbHeight mb height
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
*/
|
||||
int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t kiMbHeight);
|
||||
|
||||
/*!
|
||||
* \brief Uninitialize Wels Flexible Macroblock Ordering (FMO) list
|
||||
* \brief Uninitialize Wels Flexible Macroblock Ordering (FMO) list
|
||||
*
|
||||
* \param pFmo Wels base fmo ptr to be uninitialized
|
||||
* \param kiCnt count number of PPS per list
|
||||
* \param kiAvail count available number of PPS in list
|
||||
* \param pFmo Wels base fmo ptr to be uninitialized
|
||||
* \param kiCnt count number of PPS per list
|
||||
* \param kiAvail count available number of PPS in list
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail);
|
||||
|
||||
/*!
|
||||
* \brief update/insert FMO parameter unit
|
||||
* \brief update/insert FMO parameter unit
|
||||
*
|
||||
* \param pFmo FMO context
|
||||
* \param pSps PSps
|
||||
* \param pPps PPps
|
||||
* \param pActiveFmoNum int32_t* [in/out]
|
||||
* \param pFmo FMO context
|
||||
* \param pSps PSps
|
||||
* \param pPps PPps
|
||||
* \param pActiveFmoNum int32_t* [in/out]
|
||||
*
|
||||
* \return true - update/insert successfully; false - failed;
|
||||
* \return true - update/insert successfully; false - failed;
|
||||
*/
|
||||
bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum);
|
||||
|
||||
/*!
|
||||
* \brief Get successive mb to be processed with given current mb_xy
|
||||
* \brief Get successive mb to be processed with given current mb_xy
|
||||
*
|
||||
* \param pFmo Wels fmo context
|
||||
* \param iMbXy current mb_xy
|
||||
* \param pFmo Wels fmo context
|
||||
* \param iMbXy current mb_xy
|
||||
*
|
||||
* \return iNextMb - successful; -1 - failed;
|
||||
* \return iNextMb - successful; -1 - failed;
|
||||
*/
|
||||
MB_XY_T FmoNextMb (PFmo pFmo, const MB_XY_T kiMbXy);
|
||||
|
||||
|
@ -42,15 +42,15 @@ namespace WelsDec {
|
||||
#define REF_NOT_IN_LIST -1 //intra
|
||||
|
||||
/*
|
||||
* MB Cache information, such one cache should be defined within a slice
|
||||
* MB Cache information, such one cache should be defined within a slice
|
||||
*/
|
||||
/*
|
||||
* Cache for Luma Cache for Chroma(Cb, Cr)
|
||||
* Cache for Luma Cache for Chroma(Cb, Cr)
|
||||
*
|
||||
* TL T T T T TL T T
|
||||
* L - - - - L - -
|
||||
* L - - - - L - - TR
|
||||
* L - - - -
|
||||
* TL T T T T TL T T
|
||||
* L - - - - L - -
|
||||
* L - - - - L - - TR
|
||||
* L - - - -
|
||||
* L - - - - TR
|
||||
*
|
||||
*/
|
||||
|
@ -52,9 +52,9 @@ int32_t MemInitNalList (PAccessUnit* ppAu, const uint32_t kuiSize);
|
||||
int32_t MemFreeNalList (PAccessUnit* ppAu);
|
||||
|
||||
/*
|
||||
* MemGetNextNal
|
||||
* Get next NAL Unit for using.
|
||||
* Need expand NAL Unit list if exceeding count number of available NAL Units withing an Access Unit
|
||||
* MemGetNextNal
|
||||
* Get next NAL Unit for using.
|
||||
* Need expand NAL Unit list if exceeding count number of available NAL Units withing an Access Unit
|
||||
*/
|
||||
PNalUnit MemGetNextNal (PAccessUnit* ppAu);
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
namespace WelsDec {
|
||||
|
||||
/*!
|
||||
* \brief update mv and ref_index cache for current MB, only for P_16x16 (SKIP inclusive)
|
||||
* \brief update mv and ref_index cache for current MB, only for P_16x16 (SKIP inclusive)
|
||||
* \param
|
||||
* \param
|
||||
*/
|
||||
@ -63,7 +63,7 @@ void UpdateP16x8MotionInfo (PDqLayer pCurDqLayer, int16_t iMotionVector[LIST_A][
|
||||
|
||||
|
||||
/*!
|
||||
* \brief update mv and ref_index cache for current MB, only for P_8x16
|
||||
* \brief update mv and ref_index cache for current MB, only for P_8x16
|
||||
* \param
|
||||
* \param
|
||||
*/
|
||||
@ -74,14 +74,14 @@ void UpdateP8x16MotionInfo (PDqLayer pCurDqLayer, int16_t iMotionVector[LIST_A][
|
||||
/*!
|
||||
* \brief get the motion predictor for skip mode
|
||||
* \param
|
||||
* \param output iMvp[]
|
||||
* \param output iMvp[]
|
||||
*/
|
||||
void PredPSkipMvFromNeighbor (PDqLayer pCurLayer, int16_t iMvp[2]);
|
||||
|
||||
/*!
|
||||
* \brief get the motion predictor for 4*4 or 8*8 or 16*16 block
|
||||
* \param
|
||||
* \param output iMvp[]
|
||||
* \param output iMvp[]
|
||||
*/
|
||||
void PredMv (int16_t iMotionVector[LIST_A][30][MV_A], int8_t iRefIndex[LIST_A][30],
|
||||
int32_t iPartIdx, int32_t iPartWidth, int8_t iRef, int16_t iMVP[2]);
|
||||
@ -89,7 +89,7 @@ void PredMv (int16_t iMotionVector[LIST_A][30][MV_A], int8_t iRefIndex[LIST_A][3
|
||||
/*!
|
||||
* \brief get the motion predictor for inter16x8 MB
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredInter16x8Mv (int16_t iMotionVector[LIST_A][30][MV_A], int8_t iRefIndex[LIST_A][30],
|
||||
int32_t iPartIdx, int8_t iRef, int16_t iMVP[2]);
|
||||
@ -97,7 +97,7 @@ void PredInter16x8Mv (int16_t iMotionVector[LIST_A][30][MV_A], int8_t iRefIndex[
|
||||
/*!
|
||||
* \brief get the motion predictor for inter8x16 MB
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredInter8x16Mv (int16_t iMotionVector[LIST_A][30][MV_A], int8_t iRefIndex[LIST_A][30],
|
||||
int32_t iPartIdx, int8_t iRef, int16_t iMVP[2]);
|
||||
|
@ -49,7 +49,7 @@ int32_t iCurrentIdx;
|
||||
} SPicBuff, *PPicBuff;
|
||||
|
||||
/*
|
||||
* Interfaces
|
||||
* Interfaces
|
||||
*/
|
||||
|
||||
PPicture PrefetchPic (PPicBuff pPicBuff); // To get current node applicable
|
||||
|
@ -39,8 +39,8 @@
|
||||
namespace WelsDec {
|
||||
|
||||
/*
|
||||
* Reconstructed Picture definition
|
||||
* It is used to express reference picture, also consequent reconstruction picture for output
|
||||
* Reconstructed Picture definition
|
||||
* It is used to express reference picture, also consequent reconstruction picture for output
|
||||
*/
|
||||
typedef struct TagPicture {
|
||||
/************************************payload data*********************************/
|
||||
|
@ -43,7 +43,7 @@
|
||||
namespace WelsDec {
|
||||
|
||||
/*
|
||||
* Reference picture list reordering syntax, refer to page 64 in JVT X201wcm
|
||||
* Reference picture list reordering syntax, refer to page 64 in JVT X201wcm
|
||||
*/
|
||||
typedef struct TagRefPicListReorderSyntax {
|
||||
struct {
|
||||
@ -55,7 +55,7 @@ bool bRefPicListReorderingFlag[LIST_A];
|
||||
} SRefPicListReorderSyn, *PRefPicListReorderSyn;
|
||||
|
||||
/*
|
||||
* Prediction weight table syntax, refer to page 65 in JVT X201wcm
|
||||
* Prediction weight table syntax, refer to page 65 in JVT X201wcm
|
||||
*/
|
||||
typedef struct TagPredWeightTabSyntax {
|
||||
uint32_t uiLumaLog2WeightDenom;
|
||||
|
@ -49,16 +49,16 @@
|
||||
namespace WelsDec {
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Start Code Prefix (0x 00 00 00 01) detection
|
||||
* \brief Start Code Prefix (0x 00 00 00 01) detection
|
||||
*
|
||||
* \param pBuf bitstream payload buffer
|
||||
* \param pOffset offset between NAL rbsp and original bitsteam that
|
||||
* start code prefix is seperated from.
|
||||
* \param iBufSize count size of buffer
|
||||
* \param pBuf bitstream payload buffer
|
||||
* \param pOffset offset between NAL rbsp and original bitsteam that
|
||||
* start code prefix is seperated from.
|
||||
* \param iBufSize count size of buffer
|
||||
*
|
||||
* \return RBSP buffer of start code prefix exclusive
|
||||
* \return RBSP buffer of start code prefix exclusive
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t iBufSize) {
|
||||
@ -88,19 +88,19 @@ uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse nal unit
|
||||
* \brief to parse nal unit
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pNalUnitHeader parsed result of NAL Unit Header to output
|
||||
* \param pCtx decoder context
|
||||
* \param pNalUnitHeader parsed result of NAL Unit Header to output
|
||||
* \param pSrcRbsp bitstream buffer to input
|
||||
* \param iSrcRbspLen length size of bitstream buffer payload
|
||||
* \param pSrcNal
|
||||
* \param iSrcNalLen
|
||||
* \param pConsumedBytes consumed bytes during parsing
|
||||
* \param pSrcNal
|
||||
* \param iSrcNalLen
|
||||
* \param pConsumedBytes consumed bytes during parsing
|
||||
*
|
||||
* \return decoded bytes payload, might be (pSrcRbsp+1) if no escapes
|
||||
* \return decoded bytes payload, might be (pSrcRbsp+1) if no escapes
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeader, uint8_t* pSrcRbsp,
|
||||
@ -563,14 +563,14 @@ bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse NON VCL NAL Units
|
||||
* \brief to parse NON VCL NAL Units
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param rbsp rbsp buffer of NAL Unit
|
||||
* \param src_len length of rbsp buffer
|
||||
* \param pCtx decoder context
|
||||
* \param rbsp rbsp buffer of NAL Unit
|
||||
* \param src_len length of rbsp buffer
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
*************************************************************************************
|
||||
*/
|
||||
@ -887,17 +887,17 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) {
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse Sequence Parameter Set (SPS)
|
||||
* \brief to parse Sequence Parameter Set (SPS)
|
||||
*
|
||||
* \param pCtx Decoder context
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pPicWidth picture width current Sps represented
|
||||
* \param pPicHeight picture height current Sps represented
|
||||
* \param pCtx Decoder context
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pPicWidth picture width current Sps represented
|
||||
* \param pPicHeight picture height current Sps represented
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is SPS.
|
||||
* \note Call it in case eNalUnitType is SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
@ -1263,16 +1263,16 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse Picture Parameter Set (PPS)
|
||||
* \brief to parse Picture Parameter Set (PPS)
|
||||
*
|
||||
* \param pCtx Decoder context
|
||||
* \param pPpsList pps list
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pCtx Decoder context
|
||||
* \param pPpsList pps list
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is PPS.
|
||||
* \note Call it in case eNalUnitType is PPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, uint8_t* pSrcNal,
|
||||
@ -1440,15 +1440,15 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux,
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to parse SEI message payload
|
||||
* \brief to parse SEI message payload
|
||||
*
|
||||
* \param pSei sei message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pSei sei message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case eNalUnitType is NAL_UNIT_SEI.
|
||||
* \note Call it in case eNalUnitType is NAL_UNIT_SEI.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ParseSei (void* pSei, PBitStringAux pBsAux) { // reserved Sei_Msg type
|
||||
@ -1458,15 +1458,15 @@ int32_t ParseSei (void* pSei, PBitStringAux pBsAux) { // reserved Sei_Msg type
|
||||
}
|
||||
/*
|
||||
*************************************************************************************
|
||||
* \brief to parse scalinglist message payload
|
||||
* \brief to parse scalinglist message payload
|
||||
*
|
||||
* \param pps sps scaling list matrix message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
* \param pps sps scaling list matrix message to be parsed output
|
||||
* \param pBsAux bitstream reader auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case scaling list matrix present at sps or pps level
|
||||
* \note Call it in case scaling list matrix present at sps or pps level
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t SetScalingListValue (uint8_t* pScalingList, int iScalingListNum, bool* bUseDefaultScalingMatrixFlag,
|
||||
@ -1561,11 +1561,11 @@ int32_t ParseScalingList (PSps pSps, PBitStringAux pBs, bool bPPS, bool* pScalin
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief reset fmo list due to got Sps now
|
||||
* \brief reset fmo list due to got Sps now
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pCtx decoder context
|
||||
*
|
||||
* \return count number of fmo context units are reset
|
||||
* \return count number of fmo context units are reset
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t ResetFmoList (PWelsDecoderContext pCtx) {
|
||||
|
@ -59,13 +59,13 @@ int32_t InitReadBits (PBitStringAux pBitString, intX_t iEndOffset) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief input bits for decoder or initialize bitstream writing in encoder
|
||||
* \brief input bits for decoder or initialize bitstream writing in encoder
|
||||
*
|
||||
* \param pBitString Bit string auxiliary pointer
|
||||
* \param kpBuf bit-stream buffer
|
||||
* \param kiSize size in bits for decoder; size in bytes for encoder
|
||||
* \param pBitString Bit string auxiliary pointer
|
||||
* \param kpBuf bit-stream buffer
|
||||
* \param kiSize size in bits for decoder; size in bytes for encoder
|
||||
*
|
||||
* \return 0: success, other: fail
|
||||
* \return 0: success, other: fail
|
||||
*/
|
||||
int32_t DecInitBits (PBitStringAux pBitString, const uint8_t* kpBuf, const int32_t kiSize) {
|
||||
const int32_t kiSizeBuf = (kiSize + 7) >> 3;
|
||||
|
@ -862,11 +862,11 @@ void WelsDeblockingMb (PDqLayer pCurDqLayer, PDeblockingFilter pFilter, int32_t
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief AVC slice deblocking filtering target layer
|
||||
* \brief AVC slice deblocking filtering target layer
|
||||
*
|
||||
* \param dec Wels avc decoder context
|
||||
* \param dec Wels avc decoder context
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFunc pDeblockMb) {
|
||||
PDqLayer pCurDqLayer = pCtx->pCurDqLayer;
|
||||
@ -931,12 +931,12 @@ void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFun
|
||||
}
|
||||
}
|
||||
/*!
|
||||
* \brief deblocking module initialize
|
||||
* \brief deblocking module initialize
|
||||
*
|
||||
* \param pf
|
||||
* \param pf
|
||||
* cpu
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
|
||||
void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) {
|
||||
|
@ -323,12 +323,12 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
|
||||
}
|
||||
|
||||
/*
|
||||
* destory_mb_blocks
|
||||
* destory_mb_blocks
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* get size of reference picture list in target layer incoming, = (iNumRefFrames
|
||||
* get size of reference picture list in target layer incoming, = (iNumRefFrames
|
||||
*/
|
||||
static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) {
|
||||
int32_t iNumRefFrames = 0;
|
||||
@ -350,7 +350,7 @@ static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
|
||||
/*
|
||||
* request memory blocks for decoder avc part
|
||||
* request memory blocks for decoder avc part
|
||||
*/
|
||||
int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight) {
|
||||
const int32_t kiPicWidth = kiMbWidth << 4;
|
||||
@ -431,7 +431,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const
|
||||
}
|
||||
|
||||
/*
|
||||
* free memory blocks in avc
|
||||
* free memory blocks in avc
|
||||
*/
|
||||
void WelsFreeMem (PWelsDecoderContext pCtx) {
|
||||
int32_t iListIdx = 0;
|
||||
@ -460,7 +460,7 @@ void WelsFreeMem (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Open decoder
|
||||
* \brief Open decoder
|
||||
*/
|
||||
int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
||||
// function pointers
|
||||
@ -492,7 +492,7 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Close decoder
|
||||
* \brief Close decoder
|
||||
*/
|
||||
void WelsCloseDecoder (PWelsDecoderContext pCtx) {
|
||||
WelsFreeMem (pCtx);
|
||||
@ -511,7 +511,7 @@ void WelsCloseDecoder (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief configure decoder parameters
|
||||
* \brief configure decoder parameters
|
||||
*/
|
||||
int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam) {
|
||||
if (NULL == pCtx || NULL == kpParam)
|
||||
@ -549,14 +549,14 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Initialize Wels decoder parameters and memory
|
||||
* \brief Initialize Wels decoder parameters and memory
|
||||
*
|
||||
* \param pCtx input context to be initialized at first stage
|
||||
* \param pCtx input context to be initialized at first stage
|
||||
*
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsInitDecoder (PWelsDecoderContext pCtx, const bool bParseOnly, SLogContext* pLogCtx) {
|
||||
@ -574,13 +574,13 @@ int32_t WelsInitDecoder (PWelsDecoderContext pCtx, const bool bParseOnly, SLogCo
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief Uninitialize Wels decoder parameters and memory
|
||||
* \brief Uninitialize Wels decoder parameters and memory
|
||||
*
|
||||
* \param pCtx input context to be uninitialized at release stage
|
||||
* \param pCtx input context to be uninitialized at release stage
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
void WelsEndDecoder (PWelsDecoderContext pCtx) {
|
||||
@ -598,18 +598,18 @@ void GetVclNalTemporalId (PWelsDecoderContext pCtx) {
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief First entrance to decoding core interface.
|
||||
* \brief First entrance to decoding core interface.
|
||||
*
|
||||
* \param pCtx decoder context
|
||||
* \param pBufBs bit streaming buffer
|
||||
* \param kBsLen size in bytes length of bit streaming buffer input
|
||||
* \param ppDst picture payload data to be output
|
||||
* \param pDstBufInfo buf information of ouput data
|
||||
* \param pCtx decoder context
|
||||
* \param pBufBs bit streaming buffer
|
||||
* \param kBsLen size in bytes length of bit streaming buffer input
|
||||
* \param ppDst picture payload data to be output
|
||||
* \param pDstBufInfo buf information of ouput data
|
||||
*
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
* \return 0 - successed
|
||||
* \return 1 - failed
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const int32_t kiBsLen,
|
||||
@ -807,13 +807,13 @@ int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on)
|
||||
* over decoder internal
|
||||
* \brief make sure synchonozization picture resolution (get from slice header) among different parts (i.e, memory related and so on)
|
||||
* over decoder internal
|
||||
* ( MB coordinate and parts of data within decoder context structure )
|
||||
* \param pCtx Wels decoder context
|
||||
* \param iMbWidth MB width
|
||||
* \pram iMbHeight MB height
|
||||
* \return 0 - successful; none 0 - something wrong
|
||||
* \param pCtx Wels decoder context
|
||||
* \param iMbWidth MB width
|
||||
* \pram iMbHeight MB height
|
||||
* \return 0 - successful; none 0 - something wrong
|
||||
*/
|
||||
int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight) {
|
||||
int32_t iErr = ERR_NONE;
|
||||
|
@ -315,7 +315,7 @@ int32_t ParsePredWeightedTable (PBitStringAux pBs, PSliceHeader pSh) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Predeclared function routines ..
|
||||
* Predeclared function routines ..
|
||||
*/
|
||||
int32_t ParseRefPicListReordering (PBitStringAux pBs, PSliceHeader pSh) {
|
||||
int32_t iList = 0;
|
||||
@ -538,7 +538,7 @@ int32_t CheckBsBuffer (PWelsDecoderContext pCtx, const int32_t kiSrcLen) {
|
||||
* Especially for:
|
||||
* rbsp_au_buffer, cur_dq_layer_ptr and ref_dq_layer_ptr in MB info cache.
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h.
|
||||
*/
|
||||
int32_t WelsInitMemory (PWelsDecoderContext pCtx) {
|
||||
if (pCtx == NULL) {
|
||||
@ -600,11 +600,11 @@ void WelsFreeMemory (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
* DecodeNalHeaderExt
|
||||
* Trigger condition: NAL_UNIT_TYPE = NAL_UNIT_PREFIX or NAL_UNIT_CODED_SLICE_EXT
|
||||
* Parameter:
|
||||
* pNal: target NALUnit ptr
|
||||
* pSrc: NAL Unit bitstream
|
||||
* DecodeNalHeaderExt
|
||||
* Trigger condition: NAL_UNIT_TYPE = NAL_UNIT_PREFIX or NAL_UNIT_CODED_SLICE_EXT
|
||||
* Parameter:
|
||||
* pNal: target NALUnit ptr
|
||||
* pSrc: NAL Unit bitstream
|
||||
*/
|
||||
void DecodeNalHeaderExt (PNalUnit pNal, uint8_t* pSrc) {
|
||||
PNalUnitHeaderExt pHeaderExt = &pNal->sNalHeaderExt;
|
||||
@ -636,8 +636,8 @@ void DecodeNalHeaderExt (PNalUnit pNal, uint8_t* pSrc) {
|
||||
#define MAX_NUM_REF_IDX_L0_ACTIVE_MINUS1 15
|
||||
#define SLICE_HEADER_CABAC_INIT_IDC_MAX 2
|
||||
/*
|
||||
* decode_slice_header_avc
|
||||
* Parse slice header of bitstream in avc for storing data structure
|
||||
* decode_slice_header_avc
|
||||
* Parse slice header of bitstream in avc for storing data structure
|
||||
*/
|
||||
int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, const bool kbExtensionFlag) {
|
||||
PNalUnit const kpCurNal = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1];
|
||||
@ -1108,9 +1108,9 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy relative syntax elements of NALUnitHeaderExt, sRefPicBaseMarking and bStoreRefBasePicFlag in prefix nal unit.
|
||||
* pSrc: mark as decoded prefix NAL
|
||||
* ppDst: succeeded VCL NAL based AVC (I/P Slice)
|
||||
* Copy relative syntax elements of NALUnitHeaderExt, sRefPicBaseMarking and bStoreRefBasePicFlag in prefix nal unit.
|
||||
* pSrc: mark as decoded prefix NAL
|
||||
* ppDst: succeeded VCL NAL based AVC (I/P Slice)
|
||||
*/
|
||||
bool PrefetchNalHeaderExtSyntax (PWelsDecoderContext pCtx, PNalUnit const kppDst, PNalUnit const kpSrc) {
|
||||
PNalUnitHeaderExt pNalHdrExtD = NULL, pNalHdrExtS = NULL;
|
||||
@ -1507,9 +1507,9 @@ void ResetCurrentAccessUnit (PWelsDecoderContext pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Force reset current Acess Unit Nal list in case error parsing/decoding in current AU
|
||||
* \brief Force reset current Acess Unit Nal list in case error parsing/decoding in current AU
|
||||
* \author
|
||||
* \history 11/16/2009
|
||||
* \history 11/16/2009
|
||||
*/
|
||||
void ForceResetCurrentAccessUnit (PAccessUnit pAu) {
|
||||
uint32_t uiSucAuIdx = pAu->uiEndPos + 1;
|
||||
@ -1929,12 +1929,12 @@ void DecodeFinishUpdate (PWelsDecoderContext pCtx) {
|
||||
* construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to
|
||||
* joint a collective access unit.
|
||||
* parameter\
|
||||
* buf: bitstream data buffer
|
||||
* bit_len: size in bit length of data
|
||||
* buf_len: size in byte length of data
|
||||
* coded_au: mark an Access Unit decoding finished
|
||||
* buf: bitstream data buffer
|
||||
* bit_len: size in bit length of data
|
||||
* buf_len: size in byte length of data
|
||||
* coded_au: mark an Access Unit decoding finished
|
||||
* return:
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h
|
||||
* 0 - success; otherwise returned error_no defined in error_no.h
|
||||
*/
|
||||
int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) {
|
||||
int32_t iErr;
|
||||
@ -2152,7 +2152,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
|
||||
memset (&pLayerInfo, 0, sizeof (SLayerInfo));
|
||||
|
||||
/*
|
||||
* Loop decoding for slices (even FMO and/ multiple slices) within a dq layer
|
||||
* Loop decoding for slices (even FMO and/ multiple slices) within a dq layer
|
||||
*/
|
||||
while (iIdx <= iEndIdx) {
|
||||
bool bReconstructSlice;
|
||||
|
@ -44,12 +44,12 @@
|
||||
namespace WelsDec {
|
||||
|
||||
/*!
|
||||
* \brief Generate MB allocated map for interleaved slice group (TYPE 0)
|
||||
* \brief Generate MB allocated map for interleaved slice group (TYPE 0)
|
||||
*
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed
|
||||
* \return 0 - successful; none 0 - failed
|
||||
*/
|
||||
static inline int32_t FmoGenerateMbAllocMapType0 (PFmo pFmo, PPps pPps) {
|
||||
uint32_t uiNumSliceGroups = 0;
|
||||
@ -79,13 +79,13 @@ static inline int32_t FmoGenerateMbAllocMapType0 (PFmo pFmo, PPps pPps) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Generate MB allocated map for dispersed slice group (TYPE 1)
|
||||
* \brief Generate MB allocated map for dispersed slice group (TYPE 1)
|
||||
*
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
* \param iMbWidth MB width
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
* \param iMbWidth MB width
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed
|
||||
* \return 0 - successful; none 0 - failed
|
||||
*/
|
||||
static inline int32_t FmoGenerateMbAllocMapType1 (PFmo pFmo, PPps pPps, const int32_t kiMbWidth) {
|
||||
uint32_t uiNumSliceGroups = 0;
|
||||
@ -106,14 +106,14 @@ static inline int32_t FmoGenerateMbAllocMapType1 (PFmo pFmo, PPps pPps, const in
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Generate MB allocated map for various type of slice group cases (TYPE 0, .., 6)
|
||||
* \brief Generate MB allocated map for various type of slice group cases (TYPE 0, .., 6)
|
||||
*
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
* \param kiMbWidth MB width
|
||||
* \param kiMbHeight MB height
|
||||
* \param pFmo fmo context
|
||||
* \param pPps pps context
|
||||
* \param kiMbWidth MB width
|
||||
* \param kiMbHeight MB height
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed
|
||||
* \return 0 - successful; none 0 - failed
|
||||
*/
|
||||
static inline int32_t FmoGenerateSliceGroup (PFmo pFmo, const PPps kpPps, const int32_t kiMbWidth,
|
||||
const int32_t kiMbHeight) {
|
||||
@ -177,14 +177,14 @@ static inline int32_t FmoGenerateSliceGroup (PFmo pFmo, const PPps kpPps, const
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Initialize Wels Flexible Macroblock Ordering (FMO)
|
||||
* \brief Initialize Wels Flexible Macroblock Ordering (FMO)
|
||||
*
|
||||
* \param pFmo Wels fmo to be initialized
|
||||
* \param pPps pps argument
|
||||
* \param kiMbWidth mb width
|
||||
* \param kiMbHeight mb height
|
||||
* \param pFmo Wels fmo to be initialized
|
||||
* \param pPps pps argument
|
||||
* \param kiMbWidth mb width
|
||||
* \param kiMbHeight mb height
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
*/
|
||||
int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t kiMbHeight) {
|
||||
return FmoGenerateSliceGroup (pFmo, pPps, kiMbWidth, kiMbHeight);
|
||||
@ -192,13 +192,13 @@ int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t ki
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Uninitialize Wels Flexible Macroblock Ordering (FMO) list
|
||||
* \brief Uninitialize Wels Flexible Macroblock Ordering (FMO) list
|
||||
*
|
||||
* \param pFmo Wels base fmo ptr to be uninitialized
|
||||
* \param kiCnt count number of PPS per list
|
||||
* \param kiAvail count available number of PPS in list
|
||||
* \param pFmo Wels base fmo ptr to be uninitialized
|
||||
* \param kiCnt count number of PPS per list
|
||||
* \param kiAvail count available number of PPS in list
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*/
|
||||
void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail) {
|
||||
PFmo pIter = pFmo;
|
||||
@ -229,14 +229,14 @@ void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief detect parameter sets are changed or not
|
||||
* \brief detect parameter sets are changed or not
|
||||
*
|
||||
* \param pFmo fmo context
|
||||
* \param kiCountNumMb (iMbWidth * iMbHeight) in Sps
|
||||
* \param iSliceGroupType slice group type if fmo is exactly enabled
|
||||
* \param iSliceGroupCount slice group count if fmo is exactly enabled
|
||||
* \param pFmo fmo context
|
||||
* \param kiCountNumMb (iMbWidth * iMbHeight) in Sps
|
||||
* \param iSliceGroupType slice group type if fmo is exactly enabled
|
||||
* \param iSliceGroupCount slice group count if fmo is exactly enabled
|
||||
*
|
||||
* \return true - changed or not initialized yet; false - not change at all
|
||||
* \return true - changed or not initialized yet; false - not change at all
|
||||
*/
|
||||
bool FmoParamSetsChanged (PFmo pFmo, const int32_t kiCountNumMb, const int32_t kiSliceGroupType,
|
||||
const int32_t kiSliceGroupCount) {
|
||||
@ -249,14 +249,14 @@ bool FmoParamSetsChanged (PFmo pFmo, const int32_t kiCountNumMb, const int32_t k
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief update/insert FMO parameter unit
|
||||
* \brief update/insert FMO parameter unit
|
||||
*
|
||||
* \param _fmo FMO context
|
||||
* \param _sps PSps
|
||||
* \param _pps PPps
|
||||
* \param pActiveFmoNum int32_t* [in/out]
|
||||
* \param _fmo FMO context
|
||||
* \param _sps PSps
|
||||
* \param _pps PPps
|
||||
* \param pActiveFmoNum int32_t* [in/out]
|
||||
*
|
||||
* \return true - update/insert successfully; false - failed;
|
||||
* \return true - update/insert successfully; false - failed;
|
||||
*/
|
||||
bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum) {
|
||||
const uint32_t kuiMbWidth = pSps->iMbWidth;
|
||||
@ -281,12 +281,12 @@ bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Convert kMbXy to slice group idc correspondingly
|
||||
* \brief Convert kMbXy to slice group idc correspondingly
|
||||
*
|
||||
* \param pFmo Wels fmo context
|
||||
* \param kMbXy kMbXy to be converted
|
||||
* \param pFmo Wels fmo context
|
||||
* \param kMbXy kMbXy to be converted
|
||||
*
|
||||
* \return slice group idc - successful; -1 - failed;
|
||||
* \return slice group idc - successful; -1 - failed;
|
||||
*/
|
||||
int32_t FmoMbToSliceGroup (PFmo pFmo, const MB_XY_T kiMbXy) {
|
||||
const int32_t kiMbNum = pFmo->iCountMbNum;
|
||||
@ -299,12 +299,12 @@ int32_t FmoMbToSliceGroup (PFmo pFmo, const MB_XY_T kiMbXy) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get successive mb to be processed with given current kMbXy
|
||||
* \brief Get successive mb to be processed with given current kMbXy
|
||||
*
|
||||
* \param pFmo Wels fmo context
|
||||
* \param kMbXy current kMbXy
|
||||
* \param pFmo Wels fmo context
|
||||
* \param kMbXy current kMbXy
|
||||
*
|
||||
* \return iNextMb - successful; -1 - failed;
|
||||
* \return iNextMb - successful; -1 - failed;
|
||||
*/
|
||||
MB_XY_T FmoNextMb (PFmo pFmo, const MB_XY_T kiMbXy) {
|
||||
const int32_t kiTotalMb = pFmo->iCountMbNum;
|
||||
|
@ -122,9 +122,9 @@ int32_t ExpandNalUnitList (PAccessUnit* ppAu, const int32_t kiOrgSize, const int
|
||||
}
|
||||
|
||||
/*
|
||||
* MemGetNextNal
|
||||
* Get next NAL Unit for using.
|
||||
* Need expand NAL Unit list if exceeding count number of available NAL Units withing an Access Unit
|
||||
* MemGetNextNal
|
||||
* Get next NAL Unit for using.
|
||||
* Need expand NAL Unit list if exceeding count number of available NAL Units withing an Access Unit
|
||||
*/
|
||||
PNalUnit MemGetNextNal (PAccessUnit* ppAu) {
|
||||
PAccessUnit pAu = *ppAu;
|
||||
|
@ -48,12 +48,12 @@ void FreePicture (PPicture pPic);
|
||||
|
||||
|
||||
///////////////////////////////////Recycled queue management for pictures///////////////////////////////////
|
||||
/* ______________________________________
|
||||
/* ______________________________________
|
||||
-->| P0 | P1 | P2 | P3 | P4 | .. | Pn-1 |-->
|
||||
--------------------------------------
|
||||
--------------------------------------
|
||||
*
|
||||
* How does it work?
|
||||
* node <- next; ++ next;
|
||||
* How does it work?
|
||||
* node <- next; ++ next;
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -63,16 +63,16 @@ virtual long EXTAPI Initialize (const SDecodingParam* pParam);
|
||||
virtual long EXTAPI Uninitialize();
|
||||
|
||||
/***************************************************************************
|
||||
* Description:
|
||||
* Decompress one frame, and output I420 or RGB24(in the future) decoded stream and its length.
|
||||
* Input parameters:
|
||||
* Parameter TYPE Description
|
||||
* pSrc unsigned char* the h264 stream to decode
|
||||
* Description:
|
||||
* Decompress one frame, and output I420 or RGB24(in the future) decoded stream and its length.
|
||||
* Input parameters:
|
||||
* Parameter TYPE Description
|
||||
* pSrc unsigned char* the h264 stream to decode
|
||||
* srcLength int the length of h264 steam
|
||||
* pDst unsigned char* buffer pointer of decoded data
|
||||
* pDst unsigned char* buffer pointer of decoded data
|
||||
* pDstInfo SBufferInfo& information provided to API including width, height, SW/HW option, etc
|
||||
*
|
||||
* return: if decode frame success return 0, otherwise corresponding error returned.
|
||||
* return: if decode frame success return 0, otherwise corresponding error returned.
|
||||
***************************************************************************/
|
||||
virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* kpSrc,
|
||||
const int kiSrcLen,
|
||||
|
@ -78,13 +78,13 @@ namespace WelsDec {
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************
|
||||
* Description:
|
||||
* class CWelsDecoder constructor function, do initialization and
|
||||
* Description:
|
||||
* class CWelsDecoder constructor function, do initialization and
|
||||
* alloc memory required
|
||||
*
|
||||
* Input parameters: none
|
||||
* Input parameters: none
|
||||
*
|
||||
* return: none
|
||||
* return: none
|
||||
***************************************************************************/
|
||||
CWelsDecoder::CWelsDecoder (void)
|
||||
: m_pDecContext (NULL),
|
||||
@ -155,12 +155,12 @@ CWelsDecoder::CWelsDecoder (void)
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* Description:
|
||||
* class CWelsDecoder destructor function, destroy allocced memory
|
||||
* Description:
|
||||
* class CWelsDecoder destructor function, destroy allocced memory
|
||||
*
|
||||
* Input parameters: none
|
||||
* Input parameters: none
|
||||
*
|
||||
* return: none
|
||||
* return: none
|
||||
***************************************************************************/
|
||||
CWelsDecoder::~CWelsDecoder() {
|
||||
if (m_pWelsTrace != NULL) {
|
||||
@ -327,7 +327,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Get Option
|
||||
* Get Option
|
||||
*/
|
||||
long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) {
|
||||
int iVal = 0;
|
||||
@ -669,8 +669,8 @@ int WelsGetDecoderCapability (SDecoderCapability* pDecCapability) {
|
||||
/* WINAPI is indeed in prefix due to sync to application layer callings!! */
|
||||
|
||||
/*
|
||||
* WelsCreateDecoder
|
||||
* @return: success in return 0, otherwise failed.
|
||||
* WelsCreateDecoder
|
||||
* @return: success in return 0, otherwise failed.
|
||||
*/
|
||||
long WelsCreateDecoder (ISVCDecoder** ppDecoder) {
|
||||
|
||||
@ -688,7 +688,7 @@ long WelsCreateDecoder (ISVCDecoder** ppDecoder) {
|
||||
}
|
||||
|
||||
/*
|
||||
* WelsDestroyDecoder
|
||||
* WelsDestroyDecoder
|
||||
*/
|
||||
void WelsDestroyDecoder (ISVCDecoder* pDecoder) {
|
||||
if (NULL != pDecoder) {
|
||||
|
@ -48,15 +48,15 @@
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to write Sequence Parameter Set (SPS)
|
||||
* \brief to write Sequence Parameter Set (SPS)
|
||||
*
|
||||
* \param pSps SWelsSPS to be wrote
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
* \param pSps SWelsSPS to be wrote
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is SPS.
|
||||
* \note Call it in case EWelsNalUnitType is SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
@ -65,15 +65,15 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t*
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to write SubSet Sequence Parameter Set
|
||||
* \brief to write SubSet Sequence Parameter Set
|
||||
*
|
||||
* \param sub_sps subset pSps parsed
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
* \param sub_sps subset pSps parsed
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is SubSet SPS.
|
||||
* \note Call it in case EWelsNalUnitType is SubSet SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta);
|
||||
@ -81,27 +81,27 @@ int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStr
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to write Picture Parameter Set (PPS)
|
||||
* \brief to write Picture Parameter Set (PPS)
|
||||
*
|
||||
* \param pPps pPps
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
* \param pPps pPps
|
||||
* \param bs_aux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is PPS.
|
||||
* \note Call it in case EWelsNalUnitType is PPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsWritePpsSyntax (SWelsPPS* pPps, SBitStringAux* pBitStringAux, SParaSetOffset* sPSOVector);
|
||||
|
||||
/*!
|
||||
* \brief initialize pSps based on configurable parameters in svc
|
||||
* \param pSps SWelsSPS*
|
||||
* \param pLayerParam SSpatialLayerConfig dependency layer parameter
|
||||
* \param pLayerParamInternal SSpatialLayerInternal*, internal dependency layer parameter
|
||||
* \param iSpsId SPS Id
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
* \brief initialize pSps based on configurable parameters in svc
|
||||
* \param pSps SWelsSPS*
|
||||
* \param pLayerParam SSpatialLayerConfig dependency layer parameter
|
||||
* \param pLayerParamInternal SSpatialLayerInternal*, internal dependency layer parameter
|
||||
* \param iSpsId SPS Id
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
*/
|
||||
int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialLayerInternal* pLayerParamInternal,
|
||||
const uint32_t kuiIntraPeriod, const int32_t kiNumRefFrame,
|
||||
@ -109,13 +109,13 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL
|
||||
const int32_t kiDlayerCount,bool bSVCBaselayer);
|
||||
|
||||
/*!
|
||||
* \brief initialize subset pSps based on configurable parameters in svc
|
||||
* \param pSubsetSps SSubsetSps*
|
||||
* \param pLayerParam SSpatialLayerConfig dependency layer parameter
|
||||
* \param pLayerParamInternal SSpatialLayerInternal*, internal dependency layer parameter
|
||||
* \param kiSpsId SPS Id
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
* \brief initialize subset pSps based on configurable parameters in svc
|
||||
* \param pSubsetSps SSubsetSps*
|
||||
* \param pLayerParam SSpatialLayerConfig dependency layer parameter
|
||||
* \param pLayerParamInternal SSpatialLayerInternal*, internal dependency layer parameter
|
||||
* \param kiSpsId SPS Id
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
*/
|
||||
int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerParam,
|
||||
SSpatialLayerInternal* pLayerParamInternal,
|
||||
@ -124,15 +124,15 @@ int32_t WelsInitSubsetSps (SSubsetSps* pSubsetSps, SSpatialLayerConfig* pLayerPa
|
||||
const int32_t kiDlayerCount);
|
||||
|
||||
/*!
|
||||
* \brief initialize pPps based on configurable parameters and pSps(subset pSps) in svc
|
||||
* \param pPps SWelsPPS*
|
||||
* \param pSps SWelsSPS*
|
||||
* \param pSubsetSps SSubsetSps*
|
||||
* \param kbDeblockingFilterPresentFlag bool
|
||||
* \param kiPpsId PPS Id
|
||||
* \param kbUsingSubsetSps bool
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
* \brief initialize pPps based on configurable parameters and pSps(subset pSps) in svc
|
||||
* \param pPps SWelsPPS*
|
||||
* \param pSps SWelsSPS*
|
||||
* \param pSubsetSps SSubsetSps*
|
||||
* \param kbDeblockingFilterPresentFlag bool
|
||||
* \param kiPpsId PPS Id
|
||||
* \param kbUsingSubsetSps bool
|
||||
* \return 0 - successful
|
||||
* 1 - failed
|
||||
*/
|
||||
int32_t WelsInitPps (SWelsPPS* pPps,
|
||||
SWelsSPS* pSps,
|
||||
@ -148,15 +148,15 @@ int32_t WelsCheckRefFrameLimitationLevelIdcFirst (SLogContext* pLogCtx, SWelsSvc
|
||||
int32_t WelsAdjustLevel (SSpatialLayerConfig* pSpatialLayer);
|
||||
|
||||
/*!
|
||||
* \brief check if the current parameter can found a presenting sps
|
||||
* \param pParam the current encoding paramter in SWelsSvcCodingParam
|
||||
* \param kbUseSubsetSps bool
|
||||
* \param iDlayerIndex int, the index of current D layer
|
||||
* \param iDlayerCount int, the number of total D layer
|
||||
* \param pSpsArray array of all the stored SPSs
|
||||
* \param pSubsetArray array of all the stored Subset-SPSs
|
||||
* \return 0 - successful
|
||||
* -1 - cannot find existing SPS for current encoder parameter
|
||||
* \brief check if the current parameter can found a presenting sps
|
||||
* \param pParam the current encoding paramter in SWelsSvcCodingParam
|
||||
* \param kbUseSubsetSps bool
|
||||
* \param iDlayerIndex int, the index of current D layer
|
||||
* \param iDlayerCount int, the number of total D layer
|
||||
* \param pSpsArray array of all the stored SPSs
|
||||
* \param pSubsetArray array of all the stored Subset-SPSs
|
||||
* \return 0 - successful
|
||||
* -1 - cannot find existing SPS for current encoder parameter
|
||||
*/
|
||||
int32_t FindExistingSps (SWelsSvcCodingParam* pParam, const bool kbUseSubsetSps, const int32_t iDlayerIndex,
|
||||
const int32_t iDlayerCount, const int32_t iSpsNumInUse,
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
namespace WelsEnc {
|
||||
/*
|
||||
* Dependency Quality IDC
|
||||
* Dependency Quality IDC
|
||||
*/
|
||||
|
||||
typedef struct TagDqIdc {
|
||||
|
@ -44,43 +44,43 @@
|
||||
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
* \brief request specific memory for SVC
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief request specific memory for SVC
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingParasetList);
|
||||
|
||||
/*!
|
||||
* \brief free memory in SVC core encoder
|
||||
* \param pEncCtx sWelsEncCtx**
|
||||
* \return none
|
||||
* \brief free memory in SVC core encoder
|
||||
* \param pEncCtx sWelsEncCtx**
|
||||
* \return none
|
||||
*/
|
||||
void FreeMemorySvc (sWelsEncCtx** ppCtx);
|
||||
|
||||
/*!
|
||||
* \brief allocate or reallocate the output bs buffer
|
||||
* \return: successful - 0; otherwise none 0 for failed
|
||||
* \brief allocate or reallocate the output bs buffer
|
||||
* \return: successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t AllocateBsOutputBuffer (CMemoryAlign* pMa, const int32_t iNeededLen, int32_t iOrigLen, const char* kpTag,
|
||||
uint8_t*& pOutputBuffer);
|
||||
//TODO: to finish this function and call it
|
||||
|
||||
/*!
|
||||
* \brief initialize function pointers that potentially used in Wels encoding
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize function pointers that potentially used in Wels encoding
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t InitFunctionPointers (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* _param, uint32_t uiCpuFlag);
|
||||
|
||||
///*!
|
||||
// * \brief decide frame type (IDR/P frame)
|
||||
// * \param uiFrameType frame type output
|
||||
// * \param frame_idx frame index elapsed currently
|
||||
// * \param idr IDR interval
|
||||
// * \return successful - 0; otherwise none 0 for failed
|
||||
// * \brief decide frame type (IDR/P frame)
|
||||
// * \param uiFrameType frame type output
|
||||
// * \param frame_idx frame index elapsed currently
|
||||
// * \param idr IDR interval
|
||||
// * \return successful - 0; otherwise none 0 for failed
|
||||
// */
|
||||
/*!
|
||||
* \brief initialize frame coding
|
||||
* \brief initialize frame coding
|
||||
*/
|
||||
void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType);
|
||||
|
||||
@ -88,24 +88,24 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum
|
||||
|
||||
int32_t GetTemporalLevel (SSpatialLayerInternal* fDlp, const int32_t kiFrameNum, const int32_t kiGopSize);
|
||||
/*!
|
||||
* \brief Dump reconstruction for dependency layer
|
||||
* \brief Dump reconstruction for dependency layer
|
||||
*/
|
||||
|
||||
extern "C" void DumpDependencyRec (SPicture* pSrcPic, const char* kpFileName, const int8_t kiDid, bool bAppend, SDqLayer* pDqLayer);
|
||||
|
||||
/*!
|
||||
* \brief Dump the reconstruction pictures
|
||||
* \brief Dump the reconstruction pictures
|
||||
*/
|
||||
void DumpRecFrame (SPicture* pSrcPic, const char* kpFileName, const int8_t kiDid, bool bAppend, SDqLayer* pDqLayer);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief encode overall slices pData in a frame
|
||||
* \param pEncCtx sWelsEncCtx*, encoder context
|
||||
* \param count_slice_num count number of slices in a frame
|
||||
* \param eNalType EWelsNalUnitType for a frame
|
||||
* \param nal_idc EWelsNalRefIdc for a frame
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief encode overall slices pData in a frame
|
||||
* \param pEncCtx sWelsEncCtx*, encoder context
|
||||
* \param count_slice_num count number of slices in a frame
|
||||
* \param eNalType EWelsNalUnitType for a frame
|
||||
* \param nal_idc EWelsNalRefIdc for a frame
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t EncodeFrame (sWelsEncCtx* pEncCtx,
|
||||
const int32_t kiSliceNumCount,
|
||||
|
@ -61,7 +61,7 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* reference list for each quality layer in SVC
|
||||
* reference list for each quality layer in SVC
|
||||
*/
|
||||
typedef struct TagRefList {
|
||||
SPicture* pShortRefList[1 + MAX_SHORT_REF_COUNT]; // reference list 0 - int16_t
|
||||
|
@ -46,23 +46,23 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*!
|
||||
* \brief initialize source picture body
|
||||
* \param kpSrc SSourcePicture*
|
||||
* \param kiCsp internal csp format
|
||||
* \param kiWidth widht of picture in pixels
|
||||
* \param kiHeight height of picture in pixels
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize source picture body
|
||||
* \param kpSrc SSourcePicture*
|
||||
* \param kiCsp internal csp format
|
||||
* \param kiWidth widht of picture in pixels
|
||||
* \param kiHeight height of picture in pixels
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t InitPic (const void* kpSrc, const int32_t kiCsp, const int32_t kiWidth, const int32_t kiHeight);
|
||||
|
||||
/*
|
||||
* SVC core encoder external interfaces
|
||||
* SVC core encoder external interfaces
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief validate checking in parameter configuration
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief validate checking in parameter configuration
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pParam);
|
||||
|
||||
@ -70,28 +70,28 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pParam);
|
||||
void GomValidCheck (const int32_t kiMbWidth, const int32_t kiMbHeight, int32_t* pSliceNum);
|
||||
|
||||
/*!
|
||||
* \brief initialize Wels avc encoder core library
|
||||
* \param ppCtx sWelsEncCtx**
|
||||
* \param para SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize Wels avc encoder core library
|
||||
* \param ppCtx sWelsEncCtx**
|
||||
* \param para SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pPara, SLogContext* pLogCtx,
|
||||
SExistingParasetList* pExistingParasetList);
|
||||
|
||||
/*!
|
||||
* \brief uninitialize Wels encoder core library
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
* \brief uninitialize Wels encoder core library
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
*/
|
||||
void WelsUninitEncoderExt (sWelsEncCtx** ppCtx);
|
||||
|
||||
/*!
|
||||
* \brief core svc encoding process
|
||||
* \brief core svc encoding process
|
||||
*
|
||||
* \param h sWelsEncCtx*, encoder context
|
||||
* \param pFbi FrameBSInfo*
|
||||
* \param kpSrcPic Source picture
|
||||
* \return EFrameType (videoFrameTypeIDR/videoFrameTypeI/videoFrameTypeP)
|
||||
* \param h sWelsEncCtx*, encoder context
|
||||
* \param pFbi FrameBSInfo*
|
||||
* \param kpSrcPic Source picture
|
||||
* \return EFrameType (videoFrameTypeIDR/videoFrameTypeI/videoFrameTypeP)
|
||||
*/
|
||||
int32_t WelsEncoderEncodeExt (sWelsEncCtx*, SFrameBSInfo* pFbi, const SSourcePicture* kpSrcPic);
|
||||
|
||||
@ -103,8 +103,8 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst);
|
||||
int32_t ForceCodingIDR (sWelsEncCtx* pCtx);
|
||||
|
||||
/*!
|
||||
* \brief Wels SVC encoder parameters adjustment
|
||||
* SVC adjustment results in new requirement in memory blocks adjustment
|
||||
* \brief Wels SVC encoder parameters adjustment
|
||||
* SVC adjustment results in new requirement in memory blocks adjustment
|
||||
*/
|
||||
int32_t WelsBitRateVerification(SLogContext* pLogCtx,SSpatialLayerConfig* pLayerParam,int32_t iLayerId);
|
||||
int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNew);
|
||||
|
@ -41,15 +41,15 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* MB Cache information, such one cache should be defined within a slice
|
||||
* MB Cache information, such one cache should be defined within a slice
|
||||
*/
|
||||
/*
|
||||
* Cache for Luma Cache for Chroma(Cb, Cr)
|
||||
* Cache for Luma Cache for Chroma(Cb, Cr)
|
||||
*
|
||||
* TL T T T T TL T T
|
||||
* L - - - - L - -
|
||||
* L - - - - L - - TR
|
||||
* L - - - -
|
||||
* TL T T T T TL T T
|
||||
* L - - - - L - -
|
||||
* L - - - - L - - TR
|
||||
* L - - - -
|
||||
* L - - - - TR
|
||||
*
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "WelsThreadLib.h"
|
||||
|
||||
/*
|
||||
* MT_DEBUG: output trace MT related into log file
|
||||
* MT_DEBUG: output trace MT related into log file
|
||||
*/
|
||||
//#define MT_DEBUG
|
||||
//#define ENABLE_TRACE_MT
|
||||
|
@ -86,7 +86,7 @@ void UpdateP8x8MotionInfo (SMbCache* pMbCache, SMB* pCurMb, const int32_t kiPart
|
||||
/*!
|
||||
* \brief get the motion predictor for 4*4 or 8*8 or 16*16 block
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredMv (const SMVComponentUnit* kpMvComp, int8_t iPartIdx, int8_t iPartW, int32_t iRef, SMVUnitXY* sMvp);
|
||||
|
||||
@ -94,7 +94,7 @@ void PredMv (const SMVComponentUnit* kpMvComp, int8_t iPartIdx, int8_t iPartW, i
|
||||
/*!
|
||||
* \brief get the motion predictor for SKIP MB
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredSkipMv (SMbCache* pMbCache, SMVUnitXY* sMvp);
|
||||
|
||||
@ -102,7 +102,7 @@ void PredSkipMv (SMbCache* pMbCache, SMVUnitXY* sMvp);
|
||||
/*!
|
||||
* \brief get the motion predictor for inter16x8 MB
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredInter16x8Mv (SMbCache* pMbCache, int32_t iPartIdx, int8_t iRef, SMVUnitXY* sMvp);
|
||||
|
||||
@ -110,7 +110,7 @@ void PredInter16x8Mv (SMbCache* pMbCache, int32_t iPartIdx, int8_t iRef, SMVUnit
|
||||
/*!
|
||||
* \brief get the motion predictor for inter8x16 MB
|
||||
* \param
|
||||
* \param output mvp_x and mvp_y
|
||||
* \param output mvp_x and mvp_y
|
||||
*/
|
||||
void PredInter8x16Mv (SMbCache* pMbCache, int32_t iPartIdx, int8_t iRef, SMVUnitXY* sMvp);
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace WelsEnc {
|
||||
|
||||
#define NAL_HEADER_SIZE (4)
|
||||
/*
|
||||
* Raw payload pData for NAL unit, AVC/SVC compatible
|
||||
* Raw payload pData for NAL unit, AVC/SVC compatible
|
||||
*/
|
||||
typedef struct TagWelsNalRaw {
|
||||
uint8_t* pRawData; // pRawNal payload for slice pData
|
||||
@ -63,7 +63,7 @@ int32_t iStartPos; //NAL start position in buffer
|
||||
} SWelsNalRaw;
|
||||
|
||||
/*
|
||||
* Encoder majoy output pData
|
||||
* Encoder majoy output pData
|
||||
*/
|
||||
typedef struct TagWelsEncoderOutput {
|
||||
uint8_t* pBsBuffer; // overall bitstream pBuffer allocation for a coded picture, recycling use intend.
|
||||
@ -103,40 +103,40 @@ bool bSliceCodedFlag;
|
||||
} SWelsSliceBs;
|
||||
|
||||
/*!
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
*/
|
||||
void WelsLoadNal (SWelsEncoderOutput* pEncoderOuput, const int32_t/*EWelsNalUnitType*/ kiType,
|
||||
const int32_t/*EWelsNalRefIdc*/ kiNalRefIdc);
|
||||
|
||||
/*!
|
||||
* \brief unload pRawNal NAL
|
||||
* \brief unload pRawNal NAL
|
||||
*/
|
||||
void WelsUnloadNal (SWelsEncoderOutput* pEncoderOuput);
|
||||
|
||||
/*!
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
*/
|
||||
void WelsLoadNalForSlice (SWelsSliceBs* pSliceBs, const int32_t/*EWelsNalUnitType*/ kiType,
|
||||
const int32_t/*EWelsNalRefIdc*/ kiNalRefIdc);
|
||||
|
||||
/*!
|
||||
* \brief unload pRawNal NAL
|
||||
* \brief unload pRawNal NAL
|
||||
*/
|
||||
void WelsUnloadNalForSlice (SWelsSliceBs* pSliceBs);
|
||||
|
||||
/*!
|
||||
* \brief encode NAL with emulation forbidden three bytes checking
|
||||
* \param pDst pDst NAL pData
|
||||
* \param pDstLen length of pDst NAL output
|
||||
* \param annexeb annexeb flag
|
||||
* \param pRawNal pRawNal NAL pData
|
||||
* \return ERR_CODE
|
||||
* \brief encode NAL with emulation forbidden three bytes checking
|
||||
* \param pDst pDst NAL pData
|
||||
* \param pDstLen length of pDst NAL output
|
||||
* \param annexeb annexeb flag
|
||||
* \param pRawNal pRawNal NAL pData
|
||||
* \return ERR_CODE
|
||||
*/
|
||||
int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t kiDstBufferLen, void* pDst,
|
||||
int32_t* pDstLen);
|
||||
|
||||
/*!
|
||||
* \brief write prefix nal
|
||||
* \brief write prefix nal
|
||||
*/
|
||||
int32_t WelsWriteSVCPrefixNal (SBitStringAux* pBitStringAux, const int32_t keNalRefIdc, const bool kbIdrFlag);
|
||||
}
|
||||
|
@ -57,10 +57,10 @@ namespace WelsEnc {
|
||||
extern const uint8_t g_kuiTemporalIdListTable[MAX_TEMPORAL_LEVEL][MAX_GOP_SIZE + 1];
|
||||
|
||||
/*!
|
||||
* \brief get Logarithms base 2 of (upper/base)
|
||||
* \param base based scaler
|
||||
* \param upper input upper value
|
||||
* \return 2 based scaling factor
|
||||
* \brief get Logarithms base 2 of (upper/base)
|
||||
* \param base based scaler
|
||||
* \param upper input upper value
|
||||
* \return 2 based scaling factor
|
||||
*/
|
||||
static inline uint32_t GetLogFactor (float base, float upper) {
|
||||
const double dLog2factor = log10 (1.0 * upper / base) / log10 (2.0);
|
||||
@ -74,7 +74,7 @@ static inline uint32_t GetLogFactor (float base, float upper) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Dependency Layer Parameter
|
||||
* Dependency Layer Parameter
|
||||
*/
|
||||
typedef struct TagDLayerParam {
|
||||
int32_t iActualWidth; // input source picture actual width
|
||||
@ -93,7 +93,7 @@ typedef struct TagDLayerParam {
|
||||
} SSpatialLayerInternal;
|
||||
|
||||
/*
|
||||
* Cisco OpenH264 Encoder Parameter Configuration
|
||||
* Cisco OpenH264 Encoder Parameter Configuration
|
||||
*/
|
||||
typedef struct TagWelsSvcCodingParam: SEncParamExt {
|
||||
SSpatialLayerInternal sDependencyLayers[MAX_DEPENDENCY_LAYER];
|
||||
@ -432,9 +432,9 @@ typedef struct TagWelsSvcCodingParam: SEncParamExt {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief determined key coding tables for temporal scalability, uiProfileIdc etc for each spatial layer settings
|
||||
* \param SWelsSvcCodingParam, and carried with known GOP size, max, input and output frame rate of each spatial
|
||||
* \return NONE (should ensure valid parameter before this procedure)
|
||||
* \brief determined key coding tables for temporal scalability, uiProfileIdc etc for each spatial layer settings
|
||||
* \param SWelsSvcCodingParam, and carried with known GOP size, max, input and output frame rate of each spatial
|
||||
* \return NONE (should ensure valid parameter before this procedure)
|
||||
*/
|
||||
int32_t DetermineTemporalSettings() {
|
||||
const int32_t iDecStages = WELS_LOG2 (
|
||||
|
@ -101,7 +101,7 @@ int32_t iFrameAverageQp;
|
||||
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage;
|
||||
|
||||
/*
|
||||
* set picture as unreferenced
|
||||
* set picture as unreferenced
|
||||
*/
|
||||
void SetUnref () {
|
||||
iFramePoc = -1;
|
||||
|
@ -45,20 +45,20 @@
|
||||
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
* \brief alloc picture pData with borders for each plane based width and height of picture
|
||||
* \param kiWidth width of picture in pixels
|
||||
* \param kiHeight height of picture in pixels
|
||||
* \param bNeedMbInfo need pData allocation
|
||||
* \pram iNeedFeatureStorage need storage for FME
|
||||
* \return successful if effective picture pointer returned, otherwise failed with NULL
|
||||
* \brief alloc picture pData with borders for each plane based width and height of picture
|
||||
* \param kiWidth width of picture in pixels
|
||||
* \param kiHeight height of picture in pixels
|
||||
* \param bNeedMbInfo need pData allocation
|
||||
* \pram iNeedFeatureStorage need storage for FME
|
||||
* \return successful if effective picture pointer returned, otherwise failed with NULL
|
||||
*/
|
||||
SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth, const int32_t kiHeight, bool bNeedMbInfo,
|
||||
int32_t iNeedFeatureStorage);
|
||||
|
||||
/*!
|
||||
* \brief free picture pData planes
|
||||
* \param pic picture pointer to be destoryed
|
||||
* \return none
|
||||
* \brief free picture pData planes
|
||||
* \param pic picture pointer to be destoryed
|
||||
* \return none
|
||||
*/
|
||||
void FreePicture (CMemoryAlign* pMa, SPicture** ppPic);
|
||||
|
||||
|
@ -46,34 +46,34 @@ namespace WelsEnc {
|
||||
|
||||
|
||||
/*!
|
||||
* \brief get code name
|
||||
* \param pBuf pBuffer to restore code name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get code name
|
||||
* \param pBuf pBuffer to restore code name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetCodeName (char* pBuf, int32_t iSize);
|
||||
|
||||
/*!
|
||||
* \brief get library/module name
|
||||
* \param pBuf pBuffer to restore module name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get library/module name
|
||||
* \param pBuf pBuffer to restore module name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetLibName (char* pBuf, int32_t iSize);
|
||||
|
||||
/*!
|
||||
* \brief get version number
|
||||
* \param pBuf pBuffer to restore version number
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get version number
|
||||
* \param pBuf pBuffer to restore version number
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetVerNum (char* pBuf, int32_t iSize);
|
||||
|
||||
/*!
|
||||
* \brief get identify information
|
||||
* \param pBuf pBuffer to restore indentify information
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get identify information
|
||||
* \param pBuf pBuffer to restore indentify information
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetIdentInfo (char* pBuf, int32_t iSize);
|
||||
}
|
||||
|
@ -61,25 +61,25 @@ FRAME_NUM_OVER_MAX = 0x08
|
||||
} COMPARE_FRAME_NUM;
|
||||
|
||||
/*
|
||||
* reset LTR marking , recovery ,feedback state to default
|
||||
* reset LTR marking , recovery ,feedback state to default
|
||||
*/
|
||||
void ResetLtrState (SLTRState* pLtr);
|
||||
/*
|
||||
* reset reference picture list
|
||||
* reset reference picture list
|
||||
*/
|
||||
void WelsResetRefList (sWelsEncCtx* pCtx);
|
||||
|
||||
/*
|
||||
* update reference picture list
|
||||
* update reference picture list
|
||||
*/
|
||||
bool WelsUpdateRefList (sWelsEncCtx* pCtx);
|
||||
/*
|
||||
* build reference picture list
|
||||
* build reference picture list
|
||||
*/
|
||||
bool WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t kiPOC, int32_t iBestLtrRefIdx);
|
||||
|
||||
/*
|
||||
* update syntax for reference base related
|
||||
* update syntax for reference base related
|
||||
*/
|
||||
void WelsUpdateRefSyntax (sWelsEncCtx* pCtx, const int32_t kiPOC, const int32_t kiFrameType);
|
||||
|
||||
@ -89,7 +89,7 @@ void WelsUpdateRefSyntax (sWelsEncCtx* pCtx, const int32_t kiPOC, const int32_t
|
||||
*/
|
||||
bool CheckCurMarkFrameNumUsed (sWelsEncCtx* pCtx);
|
||||
/*
|
||||
* decide whether current frame include long term reference mark and update long term reference mark syntax
|
||||
* decide whether current frame include long term reference mark and update long term reference mark syntax
|
||||
*/
|
||||
void WelsMarkPic (sWelsEncCtx* pCtx);
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace WelsEnc {
|
||||
|
||||
|
||||
/*
|
||||
* Reference picture list reordering syntax, refer to page 64 in JVT X201wcm
|
||||
* Reference picture list reordering syntax, refer to page 64 in JVT X201wcm
|
||||
*/
|
||||
typedef struct TagRefPicListReorderSyntax {
|
||||
struct {
|
||||
|
@ -43,7 +43,7 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* Stat quality
|
||||
* Stat quality
|
||||
*/
|
||||
typedef struct TagStatQuality {
|
||||
|
||||
@ -54,7 +54,7 @@ float rVPsnr[5];
|
||||
} SStatQuality;
|
||||
|
||||
/*
|
||||
* Stat complexity pData
|
||||
* Stat complexity pData
|
||||
*/
|
||||
typedef struct TagComplexityStat {
|
||||
|
||||
@ -70,7 +70,7 @@ int32_t mvb_time;
|
||||
} SComplexityStat;
|
||||
|
||||
/*
|
||||
* Stat slice details information
|
||||
* Stat slice details information
|
||||
*/
|
||||
typedef struct TagStatSliceInfo {
|
||||
|
||||
@ -82,7 +82,7 @@ int32_t iMbCount [5][18];
|
||||
} SStatSliceInfo;
|
||||
|
||||
/*
|
||||
* For overall statistical pData
|
||||
* For overall statistical pData
|
||||
*/
|
||||
typedef struct TagStatData {
|
||||
|
||||
|
@ -47,8 +47,8 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* Frame level in SVC DQLayer instead.
|
||||
* Dependency-Quaility layer struction definition for SVC extension of H.264/AVC
|
||||
* Frame level in SVC DQLayer instead.
|
||||
* Dependency-Quaility layer struction definition for SVC extension of H.264/AVC
|
||||
*/
|
||||
|
||||
///////////////////////////////////DQ Layer level///////////////////////////////////
|
||||
|
@ -53,7 +53,7 @@ namespace WelsEnc {
|
||||
|
||||
|
||||
/*
|
||||
* Get size of unsigned exp golomb codes
|
||||
* Get size of unsigned exp golomb codes
|
||||
*/
|
||||
static inline uint32_t BsSizeUE (const uint32_t kiValue) {
|
||||
if (256 > kiValue) {
|
||||
@ -79,7 +79,7 @@ if (256 > kiValue) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Get size of signed exp golomb codes
|
||||
* Get size of signed exp golomb codes
|
||||
*/
|
||||
static inline uint32_t BsSizeSE (const int32_t kiValue) {
|
||||
uint32_t iTmpValue;
|
||||
@ -95,7 +95,7 @@ if (0 == kiValue) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Write truncated exp golomb codes
|
||||
* Write truncated exp golomb codes
|
||||
*/
|
||||
static inline void BsWriteTE (SBitStringAux* pBs, const int32_t kiX, const uint32_t kuiValue) {
|
||||
if (1 == kiX) {
|
||||
|
@ -73,7 +73,7 @@ namespace WelsEnc {
|
||||
//cur_mb_idx is for early tests, can be omit in optimization
|
||||
|
||||
/*!
|
||||
* \brief SSlice context
|
||||
* \brief SSlice context
|
||||
*/
|
||||
/* Single/multiple slices */
|
||||
typedef struct SlicepEncCtx_s {
|
||||
@ -104,17 +104,17 @@ uint8_t uiLastMbQp;
|
||||
} SDynamicSlicingStack;
|
||||
|
||||
/*!
|
||||
* \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
* \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param bFmoUseFlag flag of using fmo
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
* \param uiSliceMode slice mode
|
||||
* \param mul_slice_arg argument for multiple slice if it is applicable
|
||||
* \param pPpsArg argument for pPps parameter
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param bFmoUseFlag flag of using fmo
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
* \param uiSliceMode slice mode
|
||||
* \param mul_slice_arg argument for multiple slice if it is applicable
|
||||
* \param pPpsArg argument for pPps parameter
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
*/
|
||||
int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
|
||||
CMemoryAlign* pMa,
|
||||
@ -126,66 +126,66 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
* \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
*
|
||||
* \return NONE;
|
||||
* \return NONE;
|
||||
*/
|
||||
void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa);
|
||||
|
||||
/*!
|
||||
* \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)
|
||||
* \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return uiSliceIdc - successful; (uint8_t)(-1) - failed;
|
||||
* \return uiSliceIdc - successful; (uint8_t)(-1) - failed;
|
||||
*/
|
||||
uint16_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int32_t kiMbXY);
|
||||
|
||||
/*!
|
||||
* \brief Get first mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get first mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiSliceIdc slice idc
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiSliceIdc slice idc
|
||||
*
|
||||
* \return first_mb - successful; -1 - failed;
|
||||
* \return first_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetFirstMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiSliceIdc);
|
||||
|
||||
/*!
|
||||
* \brief Get successive mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get successive mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return next_mb - successful; -1 - failed;
|
||||
* \return next_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetNextMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY);
|
||||
|
||||
/*!
|
||||
* \brief Get previous mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get previous mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return prev_mb - successful; -1 - failed;
|
||||
* \return prev_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetPrevMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY);
|
||||
|
||||
/*!
|
||||
* \brief Get number of mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get number of mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiSliceIdc slice/slice_group idc
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiSliceIdc slice/slice_group idc
|
||||
*
|
||||
* \return count_num_of_mb - successful; -1 - failed;
|
||||
* \return count_num_of_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetNumMbInSlice (SSliceCtx* pSliceCtx, const int32_t kiSliceIdc);
|
||||
|
||||
/*!
|
||||
* Get slice count for multiple slice segment
|
||||
* Get slice count for multiple slice segment
|
||||
*
|
||||
*/
|
||||
int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, SSliceConfig* pMso);
|
||||
|
@ -185,10 +185,10 @@ class CWelsPreProcess {
|
||||
void SaveBestRefToVaa (SRefInfoParam& sRefSaved, SRefInfoParam* pVaaBestRef);
|
||||
|
||||
/*!
|
||||
* \brief exchange two picture pData planes
|
||||
* \param ppPic1 picture pointer to picture 1
|
||||
* \param ppPic2 picture pointer to picture 2
|
||||
* \return none
|
||||
* \brief exchange two picture pData planes
|
||||
* \param ppPic1 picture pointer to picture 1
|
||||
* \param ppPic2 picture pointer to picture 2
|
||||
* \return none
|
||||
*/
|
||||
void WelsExchangeSpatialPictures (SPicture** ppPic1, SPicture** ppPic2);
|
||||
|
||||
|
@ -225,15 +225,15 @@ int32_t WelsWriteVUI (SWelsSPS* pSps, SBitStringAux* pBitStringAux) {
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to set Sequence Parameter Set (SPS)
|
||||
* \brief to set Sequence Parameter Set (SPS)
|
||||
*
|
||||
* \param pSps SWelsSPS to be wrote, update iSpsId dependency
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
* \param pSps SWelsSPS to be wrote, update iSpsId dependency
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is SPS.
|
||||
* \note Call it in case EWelsNalUnitType is SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta, bool bBaseLayer) {
|
||||
@ -300,15 +300,15 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t*
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to write SubSet Sequence Parameter Set
|
||||
* \brief to write SubSet Sequence Parameter Set
|
||||
*
|
||||
* \param sub_sps subset pSps parsed
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
* \param sub_sps subset pSps parsed
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is SubSet SPS.
|
||||
* \note Call it in case EWelsNalUnitType is SubSet SPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
@ -349,15 +349,15 @@ int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStr
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief to write Picture Parameter Set (PPS)
|
||||
* \brief to write Picture Parameter Set (PPS)
|
||||
*
|
||||
* \param pPps pPps
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
* \param pPps pPps
|
||||
* \param pBitStringAux bitstream writer auxiliary
|
||||
*
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
* \return 0 - successed
|
||||
* 1 - failed
|
||||
*
|
||||
* \note Call it in case EWelsNalUnitType is PPS.
|
||||
* \note Call it in case EWelsNalUnitType is PPS.
|
||||
*************************************************************************************
|
||||
*/
|
||||
int32_t WelsWritePpsSyntax (SWelsPPS* pPps, SBitStringAux* pBitStringAux, SParaSetOffset* pPSOVector) {
|
||||
|
@ -61,12 +61,12 @@ namespace WelsEnc {
|
||||
|
||||
|
||||
/*!
|
||||
* \brief initialize source picture body
|
||||
* \param pSrc SSourcePicture*
|
||||
* \param csp internal csp format
|
||||
* \param iWidth widht of picture in pixels
|
||||
* \param iHeight iHeight of picture in pixels
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize source picture body
|
||||
* \param pSrc SSourcePicture*
|
||||
* \param csp internal csp format
|
||||
* \param iWidth widht of picture in pixels
|
||||
* \param iHeight iHeight of picture in pixels
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t InitPic (const void* kpSrc, const int32_t kiColorspace, const int32_t kiWidth, const int32_t kiHeight) {
|
||||
SSourcePicture* pSrcPic = (SSourcePicture*)kpSrc;
|
||||
@ -149,9 +149,9 @@ void WelsInitBGDFunc (SWelsFuncPtrList* pFuncList, const bool kbEnableBackground
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief initialize function pointers that potentially used in Wels encoding
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize function pointers that potentially used in Wels encoding
|
||||
* \param pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t InitFunctionPointers (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam, uint32_t uiCpuFlag) {
|
||||
int32_t iReturn = ENC_RETURN_SUCCESS;
|
||||
@ -227,7 +227,7 @@ int32_t InitFunctionPointers (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam,
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief initialize frame coding
|
||||
* \brief initialize frame coding
|
||||
*/
|
||||
void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType) {
|
||||
// for bitstream writing
|
||||
@ -364,7 +364,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Dump reconstruction for dependency layer
|
||||
* \brief Dump reconstruction for dependency layer
|
||||
*/
|
||||
|
||||
extern "C" void DumpDependencyRec (SPicture* pCurPicture, const char* kpFileName, const int8_t kiDid, bool bAppend,
|
||||
@ -432,7 +432,7 @@ extern "C" void DumpDependencyRec (SPicture* pCurPicture, const char* kpFileName
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Dump the reconstruction pictures
|
||||
* \brief Dump the reconstruction pictures
|
||||
*/
|
||||
|
||||
void DumpRecFrame (SPicture* pCurPicture, const char* kpFileName, const int8_t kiDid, bool bAppend,
|
||||
|
@ -166,9 +166,9 @@ void CheckReferenceNumSetting (SLogContext* pLogCtx, SWelsSvcCodingParam* pParam
|
||||
}
|
||||
}
|
||||
/*!
|
||||
* \brief validate checking in parameter configuration
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief validate checking in parameter configuration
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) {
|
||||
const float fEpsn = 0.000001f;
|
||||
@ -654,12 +654,12 @@ int32_t WelsEncoderApplyBitVaryRang (SLogContext* pLogCtx, SWelsSvcCodingParam*
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief acquire count number of layers and NALs based on configurable paramters dependency
|
||||
* \pParam pCtx sWelsEncCtx*
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \pParam pCountLayers pointer of count number of layers indeed
|
||||
* \pParam iCountNals pointer of count number of nals indeed
|
||||
* \return 0 - successful; otherwise failed
|
||||
* \brief acquire count number of layers and NALs based on configurable paramters dependency
|
||||
* \pParam pCtx sWelsEncCtx*
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \pParam pCountLayers pointer of count number of layers indeed
|
||||
* \pParam iCountNals pointer of count number of nals indeed
|
||||
* \return 0 - successful; otherwise failed
|
||||
*/
|
||||
static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam, int32_t* pCountLayers,
|
||||
int32_t* pCountNals) {
|
||||
@ -1054,9 +1054,9 @@ int32_t FindExistingPps (SWelsSPS* pSps, SSubsetSps* pSubsetSps, const bool kbUs
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief initialize ppDqLayerList and slicepEncCtx_list due to count number of layers available
|
||||
* \pParam pCtx sWelsEncCtx*
|
||||
* \return 0 - successful; otherwise failed
|
||||
* \brief initialize ppDqLayerList and slicepEncCtx_list due to count number of layers available
|
||||
* \pParam pCtx sWelsEncCtx*
|
||||
* \return 0 - successful; otherwise failed
|
||||
*/
|
||||
static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingParasetList) {
|
||||
SWelsSvcCodingParam* pParam = NULL;
|
||||
@ -1671,9 +1671,9 @@ void ReleaseMemoryVaaScreen (SVAAFrameInfo* pVaa, CMemoryAlign* pMa, const int3
|
||||
}
|
||||
}
|
||||
/*!
|
||||
* \brief request specific memory for SVC
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief request specific memory for SVC
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
void GetMvMvdRange (SWelsSvcCodingParam* pParam, int32_t& iMvRange, int32_t& iMvdRange) {
|
||||
ELevelIdc iMinLevelIdc = LEVEL_5_2;
|
||||
@ -1941,9 +1941,9 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa
|
||||
|
||||
|
||||
/*!
|
||||
* \brief free memory in SVC core encoder
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
* \brief free memory in SVC core encoder
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
*/
|
||||
void FreeMemorySvc (sWelsEncCtx** ppCtx) {
|
||||
if (NULL != *ppCtx) {
|
||||
@ -2316,7 +2316,7 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief log output for cpu features/capabilities
|
||||
* \brief log output for cpu features/capabilities
|
||||
*/
|
||||
void OutputCpuFeaturesLog (SLogContext* pLogCtx, uint32_t uiCpuFeatureFlags, uint32_t uiCpuCores,
|
||||
int32_t iCacheLineSize) {
|
||||
@ -2412,10 +2412,10 @@ int32_t GetMultipleThreadIdc (SLogContext* pLogCtx, SWelsSvcCodingParam* pCoding
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief initialize Wels avc encoder core library
|
||||
* \pParam ppCtx sWelsEncCtx**
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
* \brief initialize Wels avc encoder core library
|
||||
* \pParam ppCtx sWelsEncCtx**
|
||||
* \pParam pParam SWelsSvcCodingParam*
|
||||
* \return successful - 0; otherwise none 0 for failed
|
||||
*/
|
||||
int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingParam, SLogContext* pLogCtx,
|
||||
SExistingParasetList* pExistingParasetList) {
|
||||
@ -2605,9 +2605,9 @@ void StatOverallEncodingExt (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
#endif
|
||||
/*!
|
||||
* \brief uninitialize Wels encoder core library
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
* \brief uninitialize Wels encoder core library
|
||||
* \pParam pEncCtx sWelsEncCtx*
|
||||
* \return none
|
||||
*/
|
||||
void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) {
|
||||
if (NULL == ppCtx || NULL == *ppCtx)
|
||||
@ -2650,7 +2650,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief get temporal level due to configuration and coding context
|
||||
* \brief get temporal level due to configuration and coding context
|
||||
*/
|
||||
int32_t GetTemporalLevel (SSpatialLayerInternal* fDlp, const int32_t kiFrameNum, const int32_t kiGopSize) {
|
||||
const int32_t kiCodingIdx = kiFrameNum & (kiGopSize - 1);
|
||||
@ -2810,7 +2810,7 @@ void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief initialize current layer
|
||||
* \brief initialize current layer
|
||||
*/
|
||||
void WelsInitCurrentLayer (sWelsEncCtx* pCtx,
|
||||
const int32_t kiWidth,
|
||||
@ -3072,7 +3072,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief swap pDq layers between current pDq layer and reference pDq layer
|
||||
* \brief swap pDq layers between current pDq layer and reference pDq layer
|
||||
*/
|
||||
|
||||
static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx) {
|
||||
@ -3087,7 +3087,7 @@ static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief prefetch reference picture after WelsBuildRefList
|
||||
* \brief prefetch reference picture after WelsBuildRefList
|
||||
*/
|
||||
static inline void PrefetchReferencePicture (sWelsEncCtx* pCtx, const EVideoFrameType keFrameType) {
|
||||
SSlice* pSliceBase = &pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer[0];
|
||||
@ -3208,8 +3208,8 @@ void UpdatePpsList (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief write all parameter sets introduced in SVC extension
|
||||
* \return writing results, success or error
|
||||
* \brief write all parameter sets introduced in SVC extension
|
||||
* \return writing results, success or error
|
||||
*/
|
||||
int32_t WelsWriteParameterSets (sWelsEncCtx* pCtx, int32_t* pNalLen, int32_t* pNumNal, int32_t* pTotalLength) {
|
||||
int32_t iSize = 0;
|
||||
@ -3652,12 +3652,12 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief core svc encoding process
|
||||
* \brief core svc encoding process
|
||||
*
|
||||
* \pParam pCtx sWelsEncCtx*, encoder context
|
||||
* \pParam pFbi FrameBSInfo*
|
||||
* \pParam pSrcPic Source Picture
|
||||
* \return EFrameType (videoFrameTypeIDR/videoFrameTypeI/videoFrameTypeP)
|
||||
* \pParam pCtx sWelsEncCtx*, encoder context
|
||||
* \pParam pFbi FrameBSInfo*
|
||||
* \pParam pSrcPic Source Picture
|
||||
* \return EFrameType (videoFrameTypeIDR/videoFrameTypeI/videoFrameTypeP)
|
||||
*/
|
||||
int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSourcePicture* pSrcPic) {
|
||||
if (pCtx == NULL) {
|
||||
@ -4364,8 +4364,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Wels SVC encoder parameters adjustment
|
||||
* SVC adjustment results in new requirement in memory blocks adjustment
|
||||
* \brief Wels SVC encoder parameters adjustment
|
||||
* SVC adjustment results in new requirement in memory blocks adjustment
|
||||
*/
|
||||
int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewParam) {
|
||||
SWelsSvcCodingParam* pOldParam = NULL;
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "ls_defines.h"
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
*/
|
||||
void WelsLoadNal (SWelsEncoderOutput* pEncoderOuput, const int32_t/*EWelsNalUnitType*/ kiType,
|
||||
const int32_t/*EWelsNalRefIdc*/ kiNalRefIdc) {
|
||||
@ -60,7 +60,7 @@ void WelsLoadNal (SWelsEncoderOutput* pEncoderOuput, const int32_t/*EWelsNalUnit
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief unload pRawNal NAL
|
||||
* \brief unload pRawNal NAL
|
||||
*/
|
||||
void WelsUnloadNal (SWelsEncoderOutput* pEncoderOuput) {
|
||||
SWelsEncoderOutput* pWelsEncoderOuput = pEncoderOuput;
|
||||
@ -75,7 +75,7 @@ void WelsUnloadNal (SWelsEncoderOutput* pEncoderOuput) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
* \brief load an initialize NAL pRawNal pData
|
||||
*/
|
||||
void WelsLoadNalForSlice (SWelsSliceBs* pSliceBsIn, const int32_t/*EWelsNalUnitType*/ kiType,
|
||||
const int32_t/*EWelsNalRefIdc*/ kiNalRefIdc) {
|
||||
@ -95,7 +95,7 @@ void WelsLoadNalForSlice (SWelsSliceBs* pSliceBsIn, const int32_t/*EWelsNalUnitT
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief unload pRawNal NAL
|
||||
* \brief unload pRawNal NAL
|
||||
*/
|
||||
void WelsUnloadNalForSlice (SWelsSliceBs* pSliceBsIn) {
|
||||
SWelsSliceBs* pSliceBs = pSliceBsIn;
|
||||
@ -111,12 +111,12 @@ void WelsUnloadNalForSlice (SWelsSliceBs* pSliceBsIn) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief encode NAL with emulation forbidden three bytes checking
|
||||
* \param pDst pDst NAL pData
|
||||
* \param pDstLen length of pDst NAL output
|
||||
* \param annexeb annexeb flag
|
||||
* \param pRawNal pRawNal NAL pData
|
||||
* \return ERRCODE
|
||||
* \brief encode NAL with emulation forbidden three bytes checking
|
||||
* \param pDst pDst NAL pData
|
||||
* \param pDstLen length of pDst NAL output
|
||||
* \param annexeb annexeb flag
|
||||
* \param pRawNal pRawNal NAL pData
|
||||
* \return ERRCODE
|
||||
*/
|
||||
//TODO 1: refactor the calling of this func in multi-thread
|
||||
//TODO 2: complete the realloc©
|
||||
@ -186,7 +186,7 @@ int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief write prefix nal
|
||||
* \brief write prefix nal
|
||||
*/
|
||||
int32_t WelsWriteSVCPrefixNal (SBitStringAux* pBitStringAux, const int32_t kiNalRefIdc,
|
||||
const bool kbIdrFlag) {
|
||||
|
@ -41,12 +41,12 @@
|
||||
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
* \brief alloc picture pData with borders for each plane based width and height of picture
|
||||
* \param cx width of picture in pixels
|
||||
* \param cy height of picture in pixels
|
||||
* \param need_data need pData allocation
|
||||
* \pram need_expand need borders expanding
|
||||
* \return successful if effective picture pointer returned, otherwise failed with NULL
|
||||
* \brief alloc picture pData with borders for each plane based width and height of picture
|
||||
* \param cx width of picture in pixels
|
||||
* \param cy height of picture in pixels
|
||||
* \param need_data need pData allocation
|
||||
* \pram need_expand need borders expanding
|
||||
* \return successful if effective picture pointer returned, otherwise failed with NULL
|
||||
*/
|
||||
SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth , const int32_t kiHeight,
|
||||
bool bNeedMbInfo, int32_t iNeedFeatureStorage) {
|
||||
@ -122,9 +122,9 @@ SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth , const int32_t
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief free picture pData planes
|
||||
* \param pPic picture pointer to be destoryed
|
||||
* \return none
|
||||
* \brief free picture pData planes
|
||||
* \param pPic picture pointer to be destoryed
|
||||
* \return none
|
||||
*/
|
||||
void FreePicture (CMemoryAlign* pMa, SPicture** ppPic) {
|
||||
if (NULL != ppPic && NULL != *ppPic) {
|
||||
|
@ -53,10 +53,10 @@ namespace WelsEnc {
|
||||
#define WELS_IDENT WELS_CODE_NAME WELS_LIB_NAME "v" WELS_VERSION_STR "b" WELS_BUILD_NUM
|
||||
|
||||
/*!
|
||||
* \brief get code name
|
||||
* \param pBuf pBuffer to restore code name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get code name
|
||||
* \param pBuf pBuffer to restore code name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetCodeName (char* pBuf, int32_t iSize) {
|
||||
int32_t iLen = 0;
|
||||
@ -74,10 +74,10 @@ int32_t GetCodeName (char* pBuf, int32_t iSize) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief get library/module name
|
||||
* \param pBuf pBuffer to restore module name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get library/module name
|
||||
* \param pBuf pBuffer to restore module name
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetLibName (char* pBuf, int32_t iSize) {
|
||||
int32_t iLen = 0;
|
||||
@ -95,10 +95,10 @@ int32_t GetLibName (char* pBuf, int32_t iSize) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief get version number
|
||||
* \param pBuf pBuffer to restore version number
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get version number
|
||||
* \param pBuf pBuffer to restore version number
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetVerNum (char* pBuf, int32_t iSize) {
|
||||
int32_t iLen = 0;
|
||||
@ -116,10 +116,10 @@ int32_t GetVerNum (char* pBuf, int32_t iSize) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief get identify information
|
||||
* \param pBuf pBuffer to restore indentify information
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
* \brief get identify information
|
||||
* \param pBuf pBuffer to restore indentify information
|
||||
* \param iSize size of pBuffer overall
|
||||
* \return actual size of pBuffer used; 0 returned in failure
|
||||
*/
|
||||
int32_t GetIdentInfo (char* pBuf, int32_t iSize) {
|
||||
int32_t iLen = 0;
|
||||
|
@ -37,7 +37,7 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* reset LTR marking , recovery ,feedback state to default
|
||||
* reset LTR marking , recovery ,feedback state to default
|
||||
*/
|
||||
void ResetLtrState (SLTRState* pLtr) {
|
||||
pLtr->bReceivedT0LostFlag = false;
|
||||
@ -60,7 +60,7 @@ void ResetLtrState (SLTRState* pLtr) {
|
||||
}
|
||||
|
||||
/*
|
||||
* reset reference picture list
|
||||
* reset reference picture list
|
||||
*/
|
||||
void WelsResetRefList (sWelsEncCtx* pCtx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -146,7 +146,7 @@ static inline int32_t CompareFrameNum (int32_t iFrameNumA, int32_t iFrameNumB, i
|
||||
|
||||
}
|
||||
/*
|
||||
* delete failed mark according LTR recovery pRequest
|
||||
* delete failed mark according LTR recovery pRequest
|
||||
*/
|
||||
static inline void DeleteInvalidLTR (sWelsEncCtx* pCtx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -188,7 +188,7 @@ static inline void DeleteInvalidLTR (sWelsEncCtx* pCtx) {
|
||||
|
||||
}
|
||||
/*
|
||||
* handle LTR Mark feedback message
|
||||
* handle LTR Mark feedback message
|
||||
*/
|
||||
static inline void HandleLTRMarkFeedback (sWelsEncCtx* pCtx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -243,7 +243,7 @@ static inline void HandleLTRMarkFeedback (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
* LTR mark process
|
||||
* LTR mark process
|
||||
*/
|
||||
static inline void LTRMarkProcess (sWelsEncCtx* pCtx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -344,7 +344,7 @@ static void PrefetchNextBuffer (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
|
||||
/*
|
||||
* update reference picture list
|
||||
* update reference picture list
|
||||
*/
|
||||
bool WelsUpdateRefList (sWelsEncCtx* pCtx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -552,7 +552,7 @@ void FilterLTRMarkingFeedback (sWelsEncCtx* pCtx, SLTRMarkingFeedback* pLTRMarki
|
||||
}
|
||||
|
||||
/*
|
||||
* build reference picture list
|
||||
* build reference picture list
|
||||
*/
|
||||
bool WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t iPOC, int32_t iBestLtrRefIdx) {
|
||||
SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
|
||||
@ -562,9 +562,9 @@ bool WelsBuildRefList (sWelsEncCtx* pCtx, const int32_t iPOC, int32_t iBestLtrRe
|
||||
uint32_t i = 0;
|
||||
|
||||
// to support any type of cur_dq->mgs_control
|
||||
// [ 0: using current layer to do ME/MC;
|
||||
// -1: using store base layer to do ME/MC;
|
||||
// 2: using highest layer to do ME/MC; ]
|
||||
// [ 0: using current layer to do ME/MC;
|
||||
// -1: using store base layer to do ME/MC;
|
||||
// 2: using highest layer to do ME/MC; ]
|
||||
|
||||
// build reference list 0/1 if applicable
|
||||
|
||||
@ -623,7 +623,7 @@ static void UpdateBlockStatic (sWelsEncCtx* pCtx) {
|
||||
}
|
||||
|
||||
/*
|
||||
* update syntax for reference base related
|
||||
* update syntax for reference base related
|
||||
*/
|
||||
void WelsUpdateRefSyntax (sWelsEncCtx* pCtx, const int32_t iPOC, const int32_t uiFrameType) {
|
||||
SLTRState* pLtr = &pCtx->pLtr[pCtx->uiDependencyId];
|
||||
|
@ -51,7 +51,7 @@ const ALIGNED_DECLARE (uint8_t, g_kuiZeroLeftMap[16], 16) = {
|
||||
|
||||
|
||||
/*
|
||||
* Exponential Golomb codes encoding routines
|
||||
* Exponential Golomb codes encoding routines
|
||||
*/
|
||||
|
||||
#define CAVLC_BS_INIT( pBs ) \
|
||||
|
@ -42,12 +42,12 @@
|
||||
|
||||
namespace WelsEnc {
|
||||
/*!
|
||||
* \brief Assign MB map for single slice segment
|
||||
* \brief Assign MB map for single slice segment
|
||||
*
|
||||
* \param pMbMap overall MB map
|
||||
* \param iCountMbNum count number of MB
|
||||
* \param pMbMap overall MB map
|
||||
* \param iCountMbNum count number of MB
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed
|
||||
* \return 0 - successful; none 0 - failed
|
||||
*/
|
||||
int32_t AssignMbMapSingleSlice (void* pMbMap, const int32_t kiCountMbNum, const int32_t kiMapUnitSize) {
|
||||
if (NULL == pMbMap || kiCountMbNum <= 0)
|
||||
@ -59,12 +59,12 @@ int32_t AssignMbMapSingleSlice (void* pMbMap, const int32_t kiCountMbNum, const
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Assign MB map for multiple slice(s) segment
|
||||
* \brief Assign MB map for multiple slice(s) segment
|
||||
*
|
||||
* \param pMbMap overall MB map
|
||||
* \param iCountMbNum count number of MB
|
||||
* \param pMbMap overall MB map
|
||||
* \param iCountMbNum count number of MB
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed
|
||||
* \return 0 - successful; none 0 - failed
|
||||
*/
|
||||
int32_t AssignMbMapMultipleSlices (SSliceCtx* pSliceSeg, const SSliceConfig* kpMso) {
|
||||
if (NULL == pSliceSeg || SM_SINGLE_SLICE == pSliceSeg->uiSliceMode)
|
||||
@ -315,7 +315,7 @@ bool GomValidCheckSliceMbNum (const int32_t kiMbWidth, const int32_t kiMbHeight,
|
||||
|
||||
|
||||
/*!
|
||||
* Get slice count for multiple slice segment
|
||||
* Get slice count for multiple slice segment
|
||||
*
|
||||
*/
|
||||
int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, SSliceConfig* pMso) {
|
||||
@ -343,15 +343,15 @@ int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, S
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Initialize slice segment (Single/multiple slices)
|
||||
* \brief Initialize slice segment (Single/multiple slices)
|
||||
*
|
||||
* \param pSliceSeg SSlice segment to be initialized
|
||||
* \param uiSliceMode SSlice mode
|
||||
* \param multi_slice_argv Multiple slices argument
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
* \param pSliceSeg SSlice segment to be initialized
|
||||
* \param uiSliceMode SSlice mode
|
||||
* \param multi_slice_argv Multiple slices argument
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
*/
|
||||
int32_t InitSliceSegment (SSliceCtx* pSliceSeg,
|
||||
CMemoryAlign* pMa,
|
||||
@ -467,11 +467,11 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg,
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Uninitialize slice segment (Single/multiple slices)
|
||||
* \brief Uninitialize slice segment (Single/multiple slices)
|
||||
*
|
||||
* \param pSliceSeg SSlice segment to be uninitialized
|
||||
* \param pSliceSeg SSlice segment to be uninitialized
|
||||
*
|
||||
* \return none;
|
||||
* \return none;
|
||||
*/
|
||||
void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) {
|
||||
if (NULL != pSliceSeg) {
|
||||
@ -501,17 +501,17 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) {
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
* \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param bFmoUseFlag flag of using fmo
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
* \param uiSliceMode slice mode
|
||||
* \param mul_slice_arg argument for multiple slice if it is applicable
|
||||
* \param pPpsArg argument for pPps parameter
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param bFmoUseFlag flag of using fmo
|
||||
* \param iMbWidth MB width
|
||||
* \param iMbHeight MB height
|
||||
* \param uiSliceMode slice mode
|
||||
* \param mul_slice_arg argument for multiple slice if it is applicable
|
||||
* \param pPpsArg argument for pPps parameter
|
||||
*
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
* \return 0 - successful; none 0 - failed;
|
||||
*/
|
||||
int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
|
||||
CMemoryAlign* pMa,
|
||||
@ -532,11 +532,11 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
* \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
* \param pSliceCtx SSlice context to be initialized
|
||||
*
|
||||
* \return NONE;
|
||||
* \return NONE;
|
||||
*/
|
||||
void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa) {
|
||||
if (NULL != pSliceCtx) {
|
||||
@ -545,12 +545,12 @@ void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)
|
||||
* \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return uiSliceIdc - successful; -1 - failed;
|
||||
* \return uiSliceIdc - successful; -1 - failed;
|
||||
*/
|
||||
uint16_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
if (NULL != pSliceCtx && kiMbXY < pSliceCtx->iMbNumInFrame && kiMbXY >= 0)
|
||||
@ -559,24 +559,24 @@ uint16_t WelsMbToSliceIdc (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get first mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get first mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kuiSliceIdc slice idc
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kuiSliceIdc slice idc
|
||||
*
|
||||
* \return iFirstMb - successful; -1 - failed;
|
||||
* \return iFirstMb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetFirstMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kuiSliceIdc) {
|
||||
return pSliceCtx->pFirstMbInSlice[ kuiSliceIdc ];
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get successive mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get successive mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return next_mb - successful; -1 - failed;
|
||||
* \return next_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetNextMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
if (NULL != pSliceCtx) {
|
||||
@ -605,12 +605,12 @@ int32_t WelsGetNextMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get previous mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get previous mb to be processed in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kiMbXY MB xy index
|
||||
*
|
||||
* \return prev_mb - successful; -1 - failed;
|
||||
* \return prev_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetPrevMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
if (NULL != pSliceCtx) {
|
||||
@ -635,12 +635,12 @@ int32_t WelsGetPrevMbOfSlice (SSliceCtx* pSliceCtx, const int32_t kiMbXY) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Get number of mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
* \brief Get number of mb in slice/slice_group: uiSliceIdc (apply in Single/multiple slices and FMO)
|
||||
*
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kuiSliceIdc slice/slice_group idc
|
||||
* \param pSliceCtx SSlice context
|
||||
* \param kuiSliceIdc slice/slice_group idc
|
||||
*
|
||||
* \return count_num_of_mb - successful; -1 - failed;
|
||||
* \return count_num_of_mb - successful; -1 - failed;
|
||||
*/
|
||||
int32_t WelsGetNumMbInSlice (SSliceCtx* pSliceCtx, const int32_t kuiSliceIdc) {
|
||||
if (NULL == pSliceCtx || kuiSliceIdc < 0)
|
||||
|
@ -175,7 +175,7 @@ void WelsCountMbType (int32_t (*iMbCount)[18], const EWelsSliceType keSt, const
|
||||
#endif//MB_TYPES_CHECK
|
||||
|
||||
/*!
|
||||
* \brief write reference picture list on reordering syntax in Slice header
|
||||
* \brief write reference picture list on reordering syntax in Slice header
|
||||
*/
|
||||
void WriteReferenceReorder (SBitStringAux* pBs, SSliceHeader* sSliceHeader) {
|
||||
SRefPicListReorderSyntax* pRefOrdering = &sSliceHeader->sRefReordering;
|
||||
@ -201,7 +201,7 @@ void WriteReferenceReorder (SBitStringAux* pBs, SSliceHeader* sSliceHeader) {
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief write reference picture marking syntax in pSlice header
|
||||
* \brief write reference picture marking syntax in pSlice header
|
||||
*/
|
||||
void WriteRefPicMarking (SBitStringAux* pBs, SSliceHeader* pSliceHeader, SNalUnitHeaderExt* pNalHdrExt) {
|
||||
SRefPicMarking* sRefMarking = &pSliceHeader->sRefMarking;
|
||||
|
@ -68,7 +68,7 @@ inline void WelsUpdateSpatialIdxMap (sWelsEncCtx* pEncCtx, int32_t iPos, SPic
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* implement of the interface
|
||||
* implement of the interface
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
@ -285,8 +285,8 @@ int32_t CWelsPreProcess::UpdateSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodin
|
||||
|
||||
|
||||
/*
|
||||
* SingleLayerPreprocess: down sampling if applicable
|
||||
* @return: exact number of spatial layers need to encoder indeed
|
||||
* SingleLayerPreprocess: down sampling if applicable
|
||||
* @return: exact number of spatial layers need to encoder indeed
|
||||
*/
|
||||
int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSourcePicture* kpSrc,
|
||||
Scaled_Picture* pScaledPicture) {
|
||||
@ -405,7 +405,7 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Whether input picture need be scaled?
|
||||
* \brief Whether input picture need be scaled?
|
||||
*/
|
||||
bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPicture) {
|
||||
const int32_t kiInputPicWidth = pParam->SUsedPicRect.iWidth;
|
||||
@ -1195,10 +1195,10 @@ int32_t CWelsPreProcess::UpdateBlockIdcForScreen (uint8_t* pCurBlockStaticPoint
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief exchange two picture pData planes
|
||||
* \param ppPic1 picture pointer to picture 1
|
||||
* \param ppPic2 picture pointer to picture 2
|
||||
* \return none
|
||||
* \brief exchange two picture pData planes
|
||||
* \param ppPic1 picture pointer to picture 1
|
||||
* \param ppPic2 picture pointer to picture 2
|
||||
* \return none
|
||||
*/
|
||||
void CWelsPreProcess::WelsExchangeSpatialPictures (SPicture** ppPic1, SPicture** ppPic2) {
|
||||
SPicture* tmp = *ppPic1;
|
||||
|
@ -57,7 +57,7 @@
|
||||
namespace WelsEnc {
|
||||
|
||||
/*
|
||||
* CWelsH264SVCEncoder class implementation
|
||||
* CWelsH264SVCEncoder class implementation
|
||||
*/
|
||||
CWelsH264SVCEncoder::CWelsH264SVCEncoder()
|
||||
: m_pEncContext (NULL),
|
||||
@ -178,7 +178,7 @@ int CWelsH264SVCEncoder::GetDefaultParams (SEncParamExt* argv) {
|
||||
}
|
||||
|
||||
/*
|
||||
* SVC Encoder Initialization
|
||||
* SVC Encoder Initialization
|
||||
*/
|
||||
int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) {
|
||||
if (m_pWelsTrace == NULL) {
|
||||
@ -348,7 +348,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) {
|
||||
}
|
||||
|
||||
/*
|
||||
* SVC Encoder Uninitialization
|
||||
* SVC Encoder Uninitialization
|
||||
*/
|
||||
int32_t CWelsH264SVCEncoder::Uninitialize() {
|
||||
if (!m_bInitialFlag) {
|
||||
@ -370,7 +370,7 @@ int32_t CWelsH264SVCEncoder::Uninitialize() {
|
||||
|
||||
|
||||
/*
|
||||
* SVC core encoding
|
||||
* SVC core encoding
|
||||
*/
|
||||
int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) {
|
||||
if (! (kpSrcPic && m_bInitialFlag && pBsInfo)) {
|
||||
@ -469,7 +469,7 @@ int CWelsH264SVCEncoder::EncodeParameterSets (SFrameBSInfo* pBsInfo) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Force key frame
|
||||
* Force key frame
|
||||
*/
|
||||
int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) {
|
||||
if (! (m_pEncContext && m_bInitialFlag)) {
|
||||
|
@ -61,43 +61,43 @@ inline int32_t WelsMemcmp (const void* kpBuf1, const void* kpBuf2, uint32_t uiSi
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief malloc with zero filled utilization in Wels
|
||||
* \brief malloc with zero filled utilization in Wels
|
||||
*
|
||||
* \param i_size uiSize of memory block required
|
||||
* \param i_size uiSize of memory block required
|
||||
*
|
||||
* \return allocated memory pointer exactly, failed in case of NULL return
|
||||
* \return allocated memory pointer exactly, failed in case of NULL return
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
void* WelsMalloc (const uint32_t kuiSize, char* pTag = NULL);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief free utilization in Wels
|
||||
* \brief free utilization in Wels
|
||||
*
|
||||
* \param p data pointer to be free.
|
||||
* i.e, uint8_t *p = actual data to be free, argv = &p.
|
||||
* \param p data pointer to be free.
|
||||
* i.e, uint8_t *p = actual data to be free, argv = &p.
|
||||
*
|
||||
* \return NONE
|
||||
* \return NONE
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
void WelsFree (void* pPointer, char* pTag = NULL);
|
||||
|
||||
/*!
|
||||
*************************************************************************************
|
||||
* \brief reallocation in Wels. Do nothing and continue using old block
|
||||
* in case the block is large enough currently
|
||||
* \brief reallocation in Wels. Do nothing and continue using old block
|
||||
* in case the block is large enough currently
|
||||
*
|
||||
* \param p memory block required in old time
|
||||
* \param i_size new uiSize of memory block requested
|
||||
* \param sz_real pointer to the old uiSize of memory block
|
||||
* \param p memory block required in old time
|
||||
* \param i_size new uiSize of memory block requested
|
||||
* \param sz_real pointer to the old uiSize of memory block
|
||||
*
|
||||
* \return reallocated memory pointer exactly, failed in case of NULL return
|
||||
* \return reallocated memory pointer exactly, failed in case of NULL return
|
||||
*
|
||||
* \note N/A
|
||||
* \note N/A
|
||||
*************************************************************************************
|
||||
*/
|
||||
void* WelsRealloc (void* pPointer, uint32_t* pRealSize, const uint32_t kuiSize, char* pTag = NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user