astyle all files
This commit is contained in:
@@ -252,7 +252,8 @@ typedef enum {
|
|||||||
// TODO: Refine the parameters definition.
|
// TODO: Refine the parameters definition.
|
||||||
// SVC Encoding Parameters
|
// SVC Encoding Parameters
|
||||||
typedef struct TagEncParamBase {
|
typedef struct TagEncParamBase {
|
||||||
EUsageType iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
EUsageType
|
||||||
|
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
||||||
int iInputCsp; // color space of input sequence
|
int iInputCsp; // color space of input sequence
|
||||||
|
|
||||||
int iPicWidth; // width of picture in samples
|
int iPicWidth; // width of picture in samples
|
||||||
@@ -264,9 +265,9 @@ typedef struct TagEncParamBase{
|
|||||||
} SEncParamBase, *PEncParamBase;
|
} SEncParamBase, *PEncParamBase;
|
||||||
|
|
||||||
|
|
||||||
typedef struct TagEncParamExt
|
typedef struct TagEncParamExt {
|
||||||
{
|
EUsageType
|
||||||
EUsageType iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
||||||
int iInputCsp; // color space of input sequence
|
int iInputCsp; // color space of input sequence
|
||||||
|
|
||||||
int iPicWidth; // width of picture in samples
|
int iPicWidth; // width of picture in samples
|
||||||
@@ -301,7 +302,8 @@ typedef struct TagEncParamExt
|
|||||||
unsigned int iLtrMarkPeriod;
|
unsigned int iLtrMarkPeriod;
|
||||||
|
|
||||||
/* multi-thread settings*/
|
/* multi-thread settings*/
|
||||||
unsigned short iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
|
unsigned short
|
||||||
|
iMultipleThreadIdc; // 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
|
||||||
|
|
||||||
/* Deblocking loop filter */
|
/* Deblocking loop filter */
|
||||||
int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
|
int iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
|
||||||
|
|||||||
@@ -41,10 +41,12 @@ void DeblockLumaEq4V_neon(uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32
|
|||||||
void DeblockLumaLt4H_neon (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTc);
|
void DeblockLumaLt4H_neon (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTc);
|
||||||
void DeblockLumaEq4H_neon (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockLumaEq4H_neon (uint8_t* pPixY, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
|
||||||
void DeblockChromaLt4V_neon(uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTC);
|
void DeblockChromaLt4V_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* pTC);
|
||||||
void DeblockChromaEq4V_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4V_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
|
|
||||||
void DeblockChromaLt4H_neon(uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta, int8_t* pTC);
|
void DeblockChromaLt4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta,
|
||||||
|
int8_t* pTC);
|
||||||
void DeblockChromaEq4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
void DeblockChromaEq4H_neon (uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, int32_t iAlpha, int32_t iBeta);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ void ExpandPictureChroma_neon(uint8_t *pDst, const int32_t kiStride, const int32
|
|||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_NEON_AARCH64)
|
#if defined(HAVE_NEON_AARCH64)
|
||||||
void ExpandPictureLuma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
|
void ExpandPictureLuma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
|
||||||
void ExpandPictureChroma_AArch64_neon(uint8_t *pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
|
void ExpandPictureChroma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
|
||||||
|
const int32_t kiPicH);
|
||||||
#endif
|
#endif
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,8 +209,7 @@ void WelsCPURestore (const uint32_t kuiCPU) {
|
|||||||
|
|
||||||
#elif defined(HAVE_NEON) //For supporting both android platform and iOS platform
|
#elif defined(HAVE_NEON) //For supporting both android platform and iOS platform
|
||||||
#if defined(ANDROID_NDK)
|
#if defined(ANDROID_NDK)
|
||||||
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors)
|
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) {
|
||||||
{
|
|
||||||
uint32_t uiCPU = 0;
|
uint32_t uiCPU = 0;
|
||||||
AndroidCpuFamily cpuFamily = ANDROID_CPU_FAMILY_UNKNOWN;
|
AndroidCpuFamily cpuFamily = ANDROID_CPU_FAMILY_UNKNOWN;
|
||||||
uint64_t uiFeatures = 0;
|
uint64_t uiFeatures = 0;
|
||||||
@@ -236,8 +235,7 @@ uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors)
|
uint32_t WelsCPUFeatureDetect (int32_t* pNumberOfLogicProcessors) {
|
||||||
{
|
|
||||||
uint32_t uiCPU = 0;
|
uint32_t uiCPU = 0;
|
||||||
|
|
||||||
#if defined(__ARM_NEON__)
|
#if defined(__ARM_NEON__)
|
||||||
|
|||||||
@@ -104,8 +104,7 @@ static void SigIntHandler (int a) {
|
|||||||
}
|
}
|
||||||
static int g_LevelSetting = 0;
|
static int g_LevelSetting = 0;
|
||||||
|
|
||||||
int ParseLayerConfig( CReadConfig & cRdLayerCfg, const int iLayer, SEncParamExt& pSvcParam,SFilesSet& sFileSet)
|
int ParseLayerConfig (CReadConfig& cRdLayerCfg, const int iLayer, SEncParamExt& pSvcParam, SFilesSet& sFileSet) {
|
||||||
{
|
|
||||||
if (!cRdLayerCfg.ExistFile()) {
|
if (!cRdLayerCfg.ExistFile()) {
|
||||||
fprintf (stderr, "Unabled to open layer #%d configuration file: %s.\n", iLayer, cRdLayerCfg.GetFileName().c_str());
|
fprintf (stderr, "Unabled to open layer #%d configuration file: %s.\n", iLayer, cRdLayerCfg.GetFileName().c_str());
|
||||||
return 1;
|
return 1;
|
||||||
@@ -302,8 +301,7 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv
|
|||||||
|
|
||||||
for (int8_t iLayer = 0; iLayer < kiActualLayerNum; ++ iLayer) {
|
for (int8_t iLayer = 0; iLayer < kiActualLayerNum; ++ iLayer) {
|
||||||
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
||||||
if (-1==ParseLayerConfig( cRdLayerCfg, iLayer, pSvcParam,sFileSet ))
|
if (-1 == ParseLayerConfig (cRdLayerCfg, iLayer, pSvcParam, sFileSet)) {
|
||||||
{
|
|
||||||
iRet = 1;
|
iRet = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -489,21 +487,18 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
|||||||
|
|
||||||
for (int8_t iLayer = 0; iLayer < pSvcParam.iSpatialLayerNum; ++ iLayer) {
|
for (int8_t iLayer = 0; iLayer < pSvcParam.iSpatialLayerNum; ++ iLayer) {
|
||||||
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
||||||
if (-1==ParseLayerConfig( cRdLayerCfg, iLayer, pSvcParam,sFileSet ))
|
if (-1 == ParseLayerConfig (cRdLayerCfg, iLayer, pSvcParam, sFileSet)) {
|
||||||
{
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (!strcmp (pCommand, "-drec") && (n + 1 < argc)) {
|
||||||
else if (!strcmp (pCommand, "-drec") && (n + 1 < argc)) {
|
|
||||||
unsigned int iLayer = atoi (argv[n++]);
|
unsigned int iLayer = atoi (argv[n++]);
|
||||||
const unsigned int iLen = strlen (argv[n]);
|
const unsigned int iLen = strlen (argv[n]);
|
||||||
if (iLen >= sizeof (sFileSet.sRecFileName[iLayer]))
|
if (iLen >= sizeof (sFileSet.sRecFileName[iLayer]))
|
||||||
return 1;
|
return 1;
|
||||||
sFileSet.sRecFileName[iLayer][iLen] = '\0';
|
sFileSet.sRecFileName[iLayer][iLen] = '\0';
|
||||||
strncpy (sFileSet.sRecFileName[iLayer], argv[n++], iLen); // confirmed_safe_unsafe_usage
|
strncpy (sFileSet.sRecFileName[iLayer], argv[n++], iLen); // confirmed_safe_unsafe_usage
|
||||||
}
|
} else if (!strcmp (pCommand, "-dw") && (n + 1 < argc)) {
|
||||||
else if (!strcmp (pCommand, "-dw") && (n + 1 < argc)) {
|
|
||||||
unsigned int iLayer = atoi (argv[n++]);
|
unsigned int iLayer = atoi (argv[n++]);
|
||||||
SSpatialLayerConfig* pDLayer = &pSvcParam.sSpatialLayers[iLayer];
|
SSpatialLayerConfig* pDLayer = &pSvcParam.sSpatialLayers[iLayer];
|
||||||
pDLayer->iVideoWidth = atoi (argv[n++]);
|
pDLayer->iVideoWidth = atoi (argv[n++]);
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ int32_t ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePi
|
|||||||
|
|
||||||
int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs);
|
int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs);
|
||||||
|
|
||||||
bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PNalUnit kpLastNal, const PSps kpSps);
|
bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PNalUnit kpLastNal,
|
||||||
|
const PSps kpSps);
|
||||||
bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeaderExt pCurNalHeaderExt,
|
bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeaderExt pCurNalHeaderExt,
|
||||||
PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader);
|
PSliceHeader pLastSliceHeader, PSliceHeader pCurSliceHeader);
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -399,7 +399,8 @@ bool CheckAccessUnitBoundaryExt (PNalUnitHeaderExt pLastNalHdrExt, PNalUnitHeade
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PNalUnit kpLastNal, const PSps kpSps) {
|
bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PNalUnit kpLastNal,
|
||||||
|
const PSps kpSps) {
|
||||||
const PNalUnitHeaderExt kpLastNalHeaderExt = &kpLastNal->sNalHeaderExt;
|
const PNalUnitHeaderExt kpLastNalHeaderExt = &kpLastNal->sNalHeaderExt;
|
||||||
const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt;
|
const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt;
|
||||||
const SSliceHeader* kpLastSliceHeader = &kpLastNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
|
const SSliceHeader* kpLastSliceHeader = &kpLastNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
|
||||||
@@ -411,7 +412,8 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal,
|
|||||||
}
|
}
|
||||||
if (kpLastSliceHeader->iFrameNum != kpCurSliceHeader->iFrameNum)
|
if (kpLastSliceHeader->iFrameNum != kpCurSliceHeader->iFrameNum)
|
||||||
return true;
|
return true;
|
||||||
if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {
|
if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL
|
||||||
|
&& pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {
|
||||||
pCtx->bNextNewSeqBegin = true;
|
pCtx->bNextNewSeqBegin = true;
|
||||||
return true; // the active sps changed, new sequence begins, so the current au is ready
|
return true; // the active sps changed, new sequence begins, so the current au is ready
|
||||||
}
|
}
|
||||||
@@ -423,7 +425,8 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal,
|
|||||||
if (kpLastNalHeaderExt->uiDependencyId > kpCurNalHeaderExt->uiDependencyId)
|
if (kpLastNalHeaderExt->uiDependencyId > kpCurNalHeaderExt->uiDependencyId)
|
||||||
return true;
|
return true;
|
||||||
// Subclause 7.4.1.2.4
|
// Subclause 7.4.1.2.4
|
||||||
if (kpLastNalHeaderExt->uiDependencyId == kpCurNalHeaderExt->uiDependencyId && kpLastSliceHeader->iPpsId != kpCurSliceHeader->iPpsId)
|
if (kpLastNalHeaderExt->uiDependencyId == kpCurNalHeaderExt->uiDependencyId
|
||||||
|
&& kpLastSliceHeader->iPpsId != kpCurSliceHeader->iPpsId)
|
||||||
return true;
|
return true;
|
||||||
if (kpLastSliceHeader->bFieldPicFlag != kpCurSliceHeader->bFieldPicFlag)
|
if (kpLastSliceHeader->bFieldPicFlag != kpCurSliceHeader->bFieldPicFlag)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -720,8 +720,7 @@ void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
if ( iCpu & WELS_CPU_NEON )
|
if (iCpu & WELS_CPU_NEON) {
|
||||||
{
|
|
||||||
pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_neon;
|
pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_neon;
|
||||||
pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_neon;
|
pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_neon;
|
||||||
pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_neon;
|
pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_neon;
|
||||||
|
|||||||
@@ -970,7 +970,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid
|
|||||||
pCtx->sMb.pInterPredictionDoneFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
|
pCtx->sMb.pInterPredictionDoneFlag[i] = (int8_t*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (
|
||||||
int8_t), "pCtx->sMb.pInterPredictionDoneFlag[]");
|
int8_t), "pCtx->sMb.pInterPredictionDoneFlag[]");
|
||||||
|
|
||||||
pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool), "pCtx->sMb.pMbCorrectlyDecodedFlag[]");
|
pCtx->sMb.pMbCorrectlyDecodedFlag[i] = (bool*) WelsMalloc (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (bool),
|
||||||
|
"pCtx->sMb.pMbCorrectlyDecodedFlag[]");
|
||||||
|
|
||||||
// check memory block valid due above allocated..
|
// check memory block valid due above allocated..
|
||||||
WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
|
WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY,
|
||||||
@@ -1493,7 +1494,8 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) {
|
|||||||
for (unsigned int i = pCurAu->uiStartPos; i <= pCurAu->uiEndPos; i++) {
|
for (unsigned int i = pCurAu->uiStartPos; i <= pCurAu->uiEndPos; i++) {
|
||||||
uint32_t uiDid = pCurAu->pNalUnitsList[i]->sNalHeaderExt.uiDependencyId;
|
uint32_t uiDid = pCurAu->pNalUnitsList[i]->sNalHeaderExt.uiDependencyId;
|
||||||
pTmpLayerSps[uiDid] = pCurAu->pNalUnitsList[i]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
|
pTmpLayerSps[uiDid] = pCurAu->pNalUnitsList[i]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
|
||||||
if ((pCurAu->pNalUnitsList[i]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR) || (pCurAu->pNalUnitsList[i]->sNalHeaderExt.bIdrFlag))
|
if ((pCurAu->pNalUnitsList[i]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR)
|
||||||
|
|| (pCurAu->pNalUnitsList[i]->sNalHeaderExt.bIdrFlag))
|
||||||
bNewSeq = true;
|
bNewSeq = true;
|
||||||
}
|
}
|
||||||
int iMaxActiveLayer = 0, iMaxCurrentLayer = 0;
|
int iMaxActiveLayer = 0, iMaxCurrentLayer = 0;
|
||||||
@@ -1509,7 +1511,8 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((iMaxCurrentLayer != iMaxActiveLayer) || (pTmpLayerSps[iMaxCurrentLayer] != pCtx->pActiveLayerSps[iMaxActiveLayer])) {
|
if ((iMaxCurrentLayer != iMaxActiveLayer)
|
||||||
|
|| (pTmpLayerSps[iMaxCurrentLayer] != pCtx->pActiveLayerSps[iMaxActiveLayer])) {
|
||||||
bNewSeq = true;
|
bNewSeq = true;
|
||||||
}
|
}
|
||||||
// fill active sps if the current sps is not null while active layer is null
|
// fill active sps if the current sps is not null while active layer is null
|
||||||
@@ -1535,7 +1538,8 @@ static void WriteBackActiveParameters(PWelsDecoderContext pCtx) {
|
|||||||
pCtx->bNewSeqBegin = true;
|
pCtx->bNewSeqBegin = true;
|
||||||
}
|
}
|
||||||
if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) {
|
if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) {
|
||||||
memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps));
|
memcpy (&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId],
|
||||||
|
&pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof (SSubsetSps));
|
||||||
pCtx->bNewSeqBegin = true;
|
pCtx->bNewSeqBegin = true;
|
||||||
}
|
}
|
||||||
pCtx->iOverwriteFlags = OVERWRITE_NONE;
|
pCtx->iOverwriteFlags = OVERWRITE_NONE;
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ void WelsResetRefPic (PWelsDecoderContext pCtx) {
|
|||||||
int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
|
int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
|
||||||
int32_t i, iCount = 0;
|
int32_t i, iCount = 0;
|
||||||
|
|
||||||
if ((pCtx->sRefPic.uiShortRefCount[LIST_0] + pCtx->sRefPic.uiLongRefCount[LIST_0] <= 0) && (pCtx->eSliceType != I_SLICE && pCtx->eSliceType != SI_SLICE)) {
|
if ((pCtx->sRefPic.uiShortRefCount[LIST_0] + pCtx->sRefPic.uiLongRefCount[LIST_0] <= 0) && (pCtx->eSliceType != I_SLICE
|
||||||
|
&& pCtx->eSliceType != SI_SLICE)) {
|
||||||
if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) { //IDR lost!, recover it for future decoding with data all set to 0
|
if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) { //IDR lost!, recover it for future decoding with data all set to 0
|
||||||
PPicture pRef = PrefetchPic (pCtx->pPicBuff[0]);
|
PPicture pRef = PrefetchPic (pCtx->pPicBuff[0]);
|
||||||
if (pRef != NULL) {
|
if (pRef != NULL) {
|
||||||
@@ -561,7 +562,8 @@ static int32_t RemainOneBufferInDpbForEC (PWelsDecoderContext pCtx) {
|
|||||||
uiLongTermFrameIdx++;
|
uiLongTermFrameIdx++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pRefPic->uiShortRefCount[0] + pRefPic->uiLongRefCount[0] >= pCtx->pSps->iNumRefFrames) { //fail to remain one empty buffer in DPB
|
if (pRefPic->uiShortRefCount[0] + pRefPic->uiLongRefCount[0] >=
|
||||||
|
pCtx->pSps->iNumRefFrames) { //fail to remain one empty buffer in DPB
|
||||||
WelsLog (pCtx, WELS_LOG_WARNING, "RemainOneBufferInDpbForEC(): empty one DPB failed for EC!\n");
|
WelsLog (pCtx, WELS_LOG_WARNING, "RemainOneBufferInDpbForEC(): empty one DPB failed for EC!\n");
|
||||||
iRet = ERR_INFO_REF_COUNT_OVERFLOW;
|
iRet = ERR_INFO_REF_COUNT_OVERFLOW;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ extern "C" {
|
|||||||
#endif//__cplusplus
|
#endif//__cplusplus
|
||||||
#if defined(HAVE_NEON)
|
#if defined(HAVE_NEON)
|
||||||
void WelsNonZeroCount_neon (int8_t* pNonZeroCount);
|
void WelsNonZeroCount_neon (int8_t* pNonZeroCount);
|
||||||
void DeblockingBSCalcEnc_neon(int8_t *pNzc, SMVUnitXY *pMv, int32_t iBoundryFlag, int32_t iMbStride, uint8_t (*pBS)[4][4]);
|
void DeblockingBSCalcEnc_neon (int8_t* pNzc, SMVUnitXY* pMv, int32_t iBoundryFlag, int32_t iMbStride,
|
||||||
|
uint8_t (*pBS)[4][4]);
|
||||||
#endif
|
#endif
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ void WelsDequantIHadamard4x4_neon(int16_t* pRes, const uint16_t kuiMF);
|
|||||||
|
|
||||||
void WelsIDctT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
|
void WelsIDctT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
|
||||||
void WelsIDctFourT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
|
void WelsIDctFourT4Rec_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDct);
|
||||||
void WelsIDctRecI16x16Dc_neon(uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride, int16_t* pDctDc);
|
void WelsIDctRecI16x16Dc_neon (uint8_t* pRec, int32_t iStride, uint8_t* pPrediction, int32_t iPredStride,
|
||||||
|
int16_t* pDctDc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx);
|
|||||||
* \brief allocate or reallocate the output bs buffer
|
* \brief allocate or reallocate the output bs buffer
|
||||||
* \return: successful - 0; otherwise none 0 for failed
|
* \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 );
|
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
|
//TODO: to finish this function and call it
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ WELS_EVENT pReadySliceCodingEvent[MAX_THREADS_NUM]; // events for slice codi
|
|||||||
WELS_EVENT pUpdateMbListEvent[MAX_THREADS_NUM]; // signal to update mb list neighbor for various slices
|
WELS_EVENT pUpdateMbListEvent[MAX_THREADS_NUM]; // signal to update mb list neighbor for various slices
|
||||||
WELS_EVENT pFinUpdateMbListEvent[MAX_THREADS_NUM]; // signal to indicate finish updating mb list
|
WELS_EVENT pFinUpdateMbListEvent[MAX_THREADS_NUM]; // signal to indicate finish updating mb list
|
||||||
WELS_EVENT pExitEncodeEvent[MAX_THREADS_NUM]; // event for exit encoding event
|
WELS_EVENT pExitEncodeEvent[MAX_THREADS_NUM]; // event for exit encoding event
|
||||||
WELS_EVENT pThreadMasterEvent[MAX_THREADS_NUM]; // event for indicating that some event has been signalled to the thread
|
WELS_EVENT
|
||||||
|
pThreadMasterEvent[MAX_THREADS_NUM]; // event for indicating that some event has been signalled to the thread
|
||||||
|
|
||||||
WELS_MUTEX mutexSliceNumUpdate; // for dynamic slicing mode MT
|
WELS_MUTEX mutexSliceNumUpdate; // for dynamic slicing mode MT
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ void WelsUnloadNalForSlice (SWelsSliceBs* pSliceBs);
|
|||||||
* \param pRawNal pRawNal NAL pData
|
* \param pRawNal pRawNal NAL pData
|
||||||
* \return ERR_CODE
|
* \return ERR_CODE
|
||||||
*/
|
*/
|
||||||
int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t kiDstBufferLen, void* pDst, int32_t* pDstLen);
|
int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t kiDstBufferLen, void* pDst,
|
||||||
|
int32_t* pDstLen);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief write prefix nal
|
* \brief write prefix nal
|
||||||
|
|||||||
@@ -125,7 +125,8 @@ char* pCurPath; // record current lib path such as:/pData/pData/com.wels.e
|
|||||||
|
|
||||||
bool bDeblockingParallelFlag; // deblocking filter parallelization control flag
|
bool bDeblockingParallelFlag; // deblocking filter parallelization control flag
|
||||||
|
|
||||||
short iCountThreadsNum; // # derived from disable_multiple_slice_idc (=0 or >1) means;
|
short
|
||||||
|
iCountThreadsNum; // # derived from disable_multiple_slice_idc (=0 or >1) means;
|
||||||
|
|
||||||
int8_t iDecompStages; // GOP size dependency
|
int8_t iDecompStages; // GOP size dependency
|
||||||
|
|
||||||
@@ -352,7 +353,8 @@ int32_t ParamTranscode (const SEncParamExt& pCodingParam) {
|
|||||||
/* Layer definition */
|
/* Layer definition */
|
||||||
iSpatialLayerNum = (int8_t)WELS_CLIP3 (pCodingParam.iSpatialLayerNum, 1,
|
iSpatialLayerNum = (int8_t)WELS_CLIP3 (pCodingParam.iSpatialLayerNum, 1,
|
||||||
MAX_DEPENDENCY_LAYER); // number of dependency(Spatial/CGS) layers used to be encoded
|
MAX_DEPENDENCY_LAYER); // number of dependency(Spatial/CGS) layers used to be encoded
|
||||||
iTemporalLayerNum = (int8_t)WELS_CLIP3(pCodingParam.iTemporalLayerNum, 1, MAX_TEMPORAL_LEVEL);// number of temporal layer specified
|
iTemporalLayerNum = (int8_t)WELS_CLIP3 (pCodingParam.iTemporalLayerNum, 1,
|
||||||
|
MAX_TEMPORAL_LEVEL); // number of temporal layer specified
|
||||||
|
|
||||||
uiGopSize = 1 << (iTemporalLayerNum - 1); // Override GOP size based temporal layer
|
uiGopSize = 1 << (iTemporalLayerNum - 1); // Override GOP size based temporal layer
|
||||||
iDecompStages = iTemporalLayerNum - 1; // WELS_LOG2( uiGopSize );// GOP size dependency
|
iDecompStages = iTemporalLayerNum - 1; // WELS_LOG2( uiGopSize );// GOP size dependency
|
||||||
@@ -393,8 +395,10 @@ int32_t ParamTranscode (const SEncParamExt& pCodingParam) {
|
|||||||
uint8_t uiProfileIdc = PRO_BASELINE;
|
uint8_t uiProfileIdc = PRO_BASELINE;
|
||||||
int8_t iIdxSpatial = 0;
|
int8_t iIdxSpatial = 0;
|
||||||
while (iIdxSpatial < iSpatialLayerNum) {
|
while (iIdxSpatial < iSpatialLayerNum) {
|
||||||
pDlp->uiProfileIdc = (pCodingParam.sSpatialLayers[iIdxSpatial].uiProfileIdc == PRO_UNKNOWN)?uiProfileIdc:pCodingParam.sSpatialLayers[iIdxSpatial].uiProfileIdc;
|
pDlp->uiProfileIdc = (pCodingParam.sSpatialLayers[iIdxSpatial].uiProfileIdc == PRO_UNKNOWN) ? uiProfileIdc :
|
||||||
pDlp->uiLevelIdc = (pCodingParam.sSpatialLayers[iIdxSpatial].uiLevelIdc == LEVEL_UNKNOWN)?LEVEL_5_0:pCodingParam.sSpatialLayers[iIdxSpatial].uiLevelIdc;
|
pCodingParam.sSpatialLayers[iIdxSpatial].uiProfileIdc;
|
||||||
|
pDlp->uiLevelIdc = (pCodingParam.sSpatialLayers[iIdxSpatial].uiLevelIdc == LEVEL_UNKNOWN) ? LEVEL_5_0 :
|
||||||
|
pCodingParam.sSpatialLayers[iIdxSpatial].uiLevelIdc;
|
||||||
|
|
||||||
float fLayerFrameRate = WELS_CLIP3 (pCodingParam.sSpatialLayers[iIdxSpatial].fFrameRate,
|
float fLayerFrameRate = WELS_CLIP3 (pCodingParam.sSpatialLayers[iIdxSpatial].fFrameRate,
|
||||||
MIN_FRAME_RATE, fParamMaxFrameRate);
|
MIN_FRAME_RATE, fParamMaxFrameRate);
|
||||||
|
|||||||
@@ -40,8 +40,7 @@
|
|||||||
|
|
||||||
namespace WelsSVCEnc {
|
namespace WelsSVCEnc {
|
||||||
#define LIST_SIZE 0x10000 //(256*256)
|
#define LIST_SIZE 0x10000 //(256*256)
|
||||||
typedef struct TagScreenBlockFeatureStorage
|
typedef struct TagScreenBlockFeatureStorage {
|
||||||
{
|
|
||||||
//Input
|
//Input
|
||||||
uint16_t* pFeatureOfBlockPointer; // Pointer to pFeatureOfBlock
|
uint16_t* pFeatureOfBlockPointer; // Pointer to pFeatureOfBlock
|
||||||
int32_t iIs16x16; //Feature block size
|
int32_t iIs16x16; //Feature block size
|
||||||
@@ -49,7 +48,8 @@ typedef struct TagScreenBlockFeatureStorage
|
|||||||
|
|
||||||
//Modify
|
//Modify
|
||||||
uint32_t* pTimesOfFeatureValue; // times of every value in Feature
|
uint32_t* pTimesOfFeatureValue; // times of every value in Feature
|
||||||
uint16_t** pLocationOfFeature; // uint16_t *pLocationOfFeature[LIST_SIZE], pLocationOfFeature[i] saves all the location(x,y) whose Feature = i;
|
uint16_t**
|
||||||
|
pLocationOfFeature; // uint16_t *pLocationOfFeature[LIST_SIZE], pLocationOfFeature[i] saves all the location(x,y) whose Feature = i;
|
||||||
uint16_t* pLocationPointer; // buffer of position array
|
uint16_t* pLocationPointer; // buffer of position array
|
||||||
int32_t iActualListSize; // actual list size
|
int32_t iActualListSize; // actual list size
|
||||||
uint32_t uiSadCostThreshold[BLOCK_SIZE_ALL];
|
uint32_t uiSadCostThreshold[BLOCK_SIZE_ALL];
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ namespace WelsSVCEnc {
|
|||||||
* \pram iNeedFeatureStorage need storage for FME
|
* \pram iNeedFeatureStorage need storage for FME
|
||||||
* \return successful if effective picture pointer returned, otherwise failed with NULL
|
* \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);
|
SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth, const int32_t kiHeight, bool bNeedMbInfo,
|
||||||
|
int32_t iNeedFeatureStorage);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief free picture pData planes
|
* \brief free picture pData planes
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ int32_t WelsSampleSatd8x8_c (uint8_t*, int32_t, uint8_t*, int32_t);
|
|||||||
//int32_t WelsSampleSatd4x8( uint8_t *, int32_t, uint8_t *, int32_t );
|
//int32_t WelsSampleSatd4x8( uint8_t *, int32_t, uint8_t *, int32_t );
|
||||||
int32_t WelsSampleSatd4x4_c (uint8_t*, int32_t, uint8_t*, int32_t);
|
int32_t WelsSampleSatd4x4_c (uint8_t*, int32_t, uint8_t*, int32_t);
|
||||||
|
|
||||||
int32_t WelsSampleSatdIntra4x4Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, int32_t);
|
int32_t WelsSampleSatdIntra4x4Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t,
|
||||||
|
int32_t);
|
||||||
int32_t WelsSampleSatdIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
int32_t WelsSampleSatdIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
||||||
int32_t WelsSampleSadIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
int32_t WelsSampleSadIntra16x16Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
||||||
int32_t WelsSampleSatdIntra8x8Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*,
|
int32_t WelsSampleSatdIntra8x8Combined3_c (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*,
|
||||||
@@ -92,9 +93,12 @@ int32_t WelsSampleSatd4x4_neon (uint8_t*, int32_t, uint8_t*, int32_t);
|
|||||||
|
|
||||||
int32_t WelsIntra16x16Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
int32_t WelsIntra16x16Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
||||||
int32_t WelsIntra16x16Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
int32_t WelsIntra16x16Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*);
|
||||||
int32_t WelsIntra8x8Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, uint8_t*);
|
int32_t WelsIntra8x8Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*,
|
||||||
int32_t WelsIntra8x8Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*, uint8_t*);
|
uint8_t*);
|
||||||
int32_t WelsIntra4x4Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t, int32_t);
|
int32_t WelsIntra8x8Combined3Sad_neon (uint8_t*, int32_t, uint8_t*, int32_t, int32_t*, int32_t, uint8_t*, uint8_t*,
|
||||||
|
uint8_t*);
|
||||||
|
int32_t WelsIntra4x4Combined3Satd_neon (uint8_t*, int32_t, uint8_t*, int32_t, uint8_t*, int32_t*, int32_t, int32_t,
|
||||||
|
int32_t);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam, con
|
|||||||
void ReleaseMtResource (sWelsEncCtx** ppCtx);
|
void ReleaseMtResource (sWelsEncCtx** ppCtx);
|
||||||
|
|
||||||
int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32_t kiSliceCount);
|
int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32_t kiSliceCount);
|
||||||
int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFrameBsBuffer, const int32_t iSliceIdx, int32_t& iSliceSize);
|
int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFrameBsBuffer, const int32_t iSliceIdx,
|
||||||
|
int32_t& iSliceSize);
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
WELS_THREAD_ROUTINE_TYPE UpdateMbListThreadProc (void* arg);
|
WELS_THREAD_ROUTINE_TYPE UpdateMbListThreadProc (void* arg);
|
||||||
@@ -80,7 +81,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg);
|
|||||||
|
|
||||||
int32_t CreateSliceThreads (sWelsEncCtx* pCtx);
|
int32_t CreateSliceThreads (sWelsEncCtx* pCtx);
|
||||||
|
|
||||||
int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, WELS_EVENT* pMasterEventsList, SLayerBSInfo* pLayerBsInfo,
|
int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, WELS_EVENT* pMasterEventsList,
|
||||||
|
SLayerBSInfo* pLayerBsInfo,
|
||||||
const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const bool kbIsDynamicSlicingMode);
|
const uint32_t kuiNumThreads/*, int32_t *iLayerNum*/, SSliceCtx* pSliceCtx, const bool kbIsDynamicSlicingMode);
|
||||||
|
|
||||||
int32_t DynamicDetectCpuCores();
|
int32_t DynamicDetectCpuCores();
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ typedef struct TagWelsME {
|
|||||||
/* input */
|
/* input */
|
||||||
uint16_t* pMvdCost;
|
uint16_t* pMvdCost;
|
||||||
union SadPredISatdUnit uSadPredISatd; //reuse the sad_pred as a temp pData
|
union SadPredISatdUnit uSadPredISatd; //reuse the sad_pred as a temp pData
|
||||||
uint32_t uiSadCost; //used by ME and RC //max SAD should be max_delta*size+lambda*mvdsize = 255*256+91*33*2 = 65280 + 6006 = 71286 > (2^16)-1 = 65535
|
uint32_t
|
||||||
|
uiSadCost; //used by ME and RC //max SAD should be max_delta*size+lambda*mvdsize = 255*256+91*33*2 = 65280 + 6006 = 71286 > (2^16)-1 = 65535
|
||||||
uint32_t uiSatdCost; /* satd + lm * nbits */
|
uint32_t uiSatdCost; /* satd + lm * nbits */
|
||||||
uint32_t uiSadCostThreshold;
|
uint32_t uiSadCostThreshold;
|
||||||
int32_t iCurMeBlockPixX;
|
int32_t iCurMeBlockPixX;
|
||||||
@@ -179,13 +180,15 @@ bool WelsMotionEstimateInitialPoint (SWelsFuncPtrList* pFuncList, SWelsME* pMe,
|
|||||||
*
|
*
|
||||||
* \return NONE
|
* \return NONE
|
||||||
*/
|
*/
|
||||||
void WelsDiamondSearch (SWelsFuncPtrList* pFuncList, void* pLpme, void* pLpslice, const int32_t kiEncStride, const int32_t kiRefStride);
|
void WelsDiamondSearch (SWelsFuncPtrList* pFuncList, void* pLpme, void* pLpslice, const int32_t kiEncStride,
|
||||||
|
const int32_t kiRefStride);
|
||||||
|
|
||||||
bool WelsMeSadCostSelect (int32_t* pSadCost, const uint16_t* kpMvdCost, int32_t* pBestCost, const int32_t kiDx,
|
bool WelsMeSadCostSelect (int32_t* pSadCost, const uint16_t* kpMvdCost, int32_t* pBestCost, const int32_t kiDx,
|
||||||
const int32_t kiDy, int32_t* pIx, int32_t* pIy);
|
const int32_t kiDy, int32_t* pIx, int32_t* pIy);
|
||||||
|
|
||||||
void CalculateSatdCost (PSampleSadSatdCostFunc pSatd, void* vpMe, const int32_t kiEncStride, const int32_t kiRefStride);
|
void CalculateSatdCost (PSampleSadSatdCostFunc pSatd, void* vpMe, const int32_t kiEncStride, const int32_t kiRefStride);
|
||||||
void NotCalculateSatdCost( PSampleSadSatdCostFunc pSatd, void * vpMe, const int32_t kiEncStride, const int32_t kiRefStride );
|
void NotCalculateSatdCost (PSampleSadSatdCostFunc pSatd, void* vpMe, const int32_t kiEncStride,
|
||||||
|
const int32_t kiRefStride);
|
||||||
bool CheckDirectionalMv (PSampleSadSatdCostFunc pSad, void* vpMe,
|
bool CheckDirectionalMv (PSampleSadSatdCostFunc pSad, void* vpMe,
|
||||||
const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride,
|
const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride,
|
||||||
int32_t& iBestSadCost);
|
int32_t& iBestSadCost);
|
||||||
@@ -230,14 +233,18 @@ void WelsMotionCrossSearch(SWelsFuncPtrList *pFuncList, SDqLayer* pCurLayer, SW
|
|||||||
|
|
||||||
int32_t SumOf8x8SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
|
int32_t SumOf8x8SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
|
||||||
int32_t SumOf16x16SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
|
int32_t SumOf16x16SingleBlock_c (uint8_t* pRef, const int32_t kiRefStride);
|
||||||
void SumOf8x8BlockOfFrame_c(uint8_t *pRefPicture, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
|
void SumOf8x8BlockOfFrame_c (uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
|
const int32_t kiRefStride,
|
||||||
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
||||||
void SumOf16x16BlockOfFrame_c(uint8_t *pRefPicture, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
|
void SumOf16x16BlockOfFrame_c (uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
|
const int32_t kiRefStride,
|
||||||
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
||||||
int32_t RequestScreenBlockFeatureStorage( CMemoryAlign *pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight, const int32_t iNeedFeatureStorage,
|
int32_t RequestScreenBlockFeatureStorage (CMemoryAlign* pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight,
|
||||||
|
const int32_t iNeedFeatureStorage,
|
||||||
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);
|
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);
|
||||||
int32_t ReleaseScreenBlockFeatureStorage (CMemoryAlign* pMa, SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);
|
int32_t ReleaseScreenBlockFeatureStorage (CMemoryAlign* pMa, SScreenBlockFeatureStorage* pScreenBlockFeatureStorage);
|
||||||
int32_t RequestFeatureSearchPreparation( CMemoryAlign *pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight, const int32_t iNeedFeatureStorage,
|
int32_t RequestFeatureSearchPreparation (CMemoryAlign* pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight,
|
||||||
|
const int32_t iNeedFeatureStorage,
|
||||||
SFeatureSearchPreparation* pFeatureSearchPreparation);
|
SFeatureSearchPreparation* pFeatureSearchPreparation);
|
||||||
int32_t ReleaseFeatureSearchPreparation (CMemoryAlign* pMa, uint16_t*& pFeatureOfBlock);
|
int32_t ReleaseFeatureSearchPreparation (CMemoryAlign* pMa, uint16_t*& pFeatureOfBlock);
|
||||||
|
|
||||||
@@ -250,7 +257,8 @@ void UpdateFMESwitch(SDqLayer* pCurLayer);
|
|||||||
void UpdateFMESwitchNull (SDqLayer* pCurLayer);
|
void UpdateFMESwitchNull (SDqLayer* pCurLayer);
|
||||||
|
|
||||||
//inline functions
|
//inline functions
|
||||||
inline void SetMvWithinIntegerMvRange( const int32_t kiMbWidth, const int32_t kiMbHeight, const int32_t kiMbX, const int32_t kiMbY,
|
inline void SetMvWithinIntegerMvRange (const int32_t kiMbWidth, const int32_t kiMbHeight, const int32_t kiMbX,
|
||||||
|
const int32_t kiMbY,
|
||||||
const int32_t kiMaxMvRange,
|
const int32_t kiMaxMvRange,
|
||||||
SMVUnitXY* pMvMin, SMVUnitXY* pMvMax) {
|
SMVUnitXY* pMvMin, SMVUnitXY* pMvMax) {
|
||||||
pMvMin->iMvX = WELS_MAX (-1 * ((kiMbX + 1) << 4) + INTPEL_NEEDED_MARGIN, -1 * kiMaxMvRange);
|
pMvMin->iMvX = WELS_MAX (-1 * ((kiMbX + 1) << 4) + INTPEL_NEEDED_MARGIN, -1 * kiMaxMvRange);
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ typedef void (*PChromaDeblockingLT4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr
|
|||||||
int32_t iBeta, int8_t* iTc);
|
int32_t iBeta, int8_t* iTc);
|
||||||
typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha,
|
typedef void (*PChromaDeblockingEQ4Func) (uint8_t* iSampleCb, uint8_t* iSampleCr, int32_t iStride, int32_t iAlpha,
|
||||||
int32_t iBeta);
|
int32_t iBeta);
|
||||||
typedef void (*PDeblockingBSCalc) (SWelsFuncPtrList* pFunc, SMB* pCurMb, uint8_t uiBS[2][4][4], Mb_Type uiCurMbType, int32_t iMbStride, int32_t iLeftFlag, int32_t iTopFlag);
|
typedef void (*PDeblockingBSCalc) (SWelsFuncPtrList* pFunc, SMB* pCurMb, uint8_t uiBS[2][4][4], Mb_Type uiCurMbType,
|
||||||
|
int32_t iMbStride, int32_t iLeftFlag, int32_t iTopFlag);
|
||||||
|
|
||||||
typedef struct tagDeblockingFunc {
|
typedef struct tagDeblockingFunc {
|
||||||
PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver;
|
PLumaDeblockingLT4Func pfLumaDeblockingLT4Ver;
|
||||||
@@ -145,8 +146,10 @@ typedef int32_t (*PIntraPred8x8Combined3Func) (uint8_t*, int32_t, uint8_t*, int3
|
|||||||
typedef uint32_t (*PSampleSadHor8Func) (uint8_t*, int32_t, uint8_t*, int32_t, uint16_t*, int32_t*);
|
typedef uint32_t (*PSampleSadHor8Func) (uint8_t*, int32_t, uint8_t*, int32_t, uint16_t*, int32_t*);
|
||||||
typedef void (*PMotionSearchFunc) (SWelsFuncPtrList* pFuncList, void* pCurDqLayer, void* pMe,
|
typedef void (*PMotionSearchFunc) (SWelsFuncPtrList* pFuncList, void* pCurDqLayer, void* pMe,
|
||||||
void* pSlice);
|
void* pSlice);
|
||||||
typedef void (*PSearchMethodFunc) (SWelsFuncPtrList* pFuncList, void* pMe, void* pSlice, const int32_t kiEncStride, const int32_t kiRefStride);
|
typedef void (*PSearchMethodFunc) (SWelsFuncPtrList* pFuncList, void* pMe, void* pSlice, const int32_t kiEncStride,
|
||||||
typedef void (*PCalculateSatdFunc) ( PSampleSadSatdCostFunc pSatd, void * vpMe, const int32_t kiEncStride, const int32_t kiRefStride );
|
const int32_t kiRefStride);
|
||||||
|
typedef void (*PCalculateSatdFunc) (PSampleSadSatdCostFunc pSatd, void* vpMe, const int32_t kiEncStride,
|
||||||
|
const int32_t kiRefStride);
|
||||||
typedef bool (*PCheckDirectionalMv) (PSampleSadSatdCostFunc pSad, void* vpMe,
|
typedef bool (*PCheckDirectionalMv) (PSampleSadSatdCostFunc pSad, void* vpMe,
|
||||||
const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride,
|
const SMVUnitXY ksMinMv, const SMVUnitXY ksMaxMv, const int32_t kiEncStride, const int32_t kiRefStride,
|
||||||
int32_t& iBestSadCost);
|
int32_t& iBestSadCost);
|
||||||
@@ -155,7 +158,8 @@ typedef void (*PLineFullSearchFunc) ( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
|
|||||||
const int32_t kiEncStride, const int32_t kiRefStride,
|
const int32_t kiEncStride, const int32_t kiRefStride,
|
||||||
const int32_t kiMinPos, const int32_t kiMaxPos,
|
const int32_t kiMinPos, const int32_t kiMaxPos,
|
||||||
const bool bVerticalSearch);
|
const bool bVerticalSearch);
|
||||||
typedef void (*PCalculateBlockFeatureOfFrame)(uint8_t *pRef, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
|
typedef void (*PCalculateBlockFeatureOfFrame) (uint8_t* pRef, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
|
const int32_t kiRefStride,
|
||||||
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]);
|
||||||
typedef int32_t (*PCalculateSingleBlockFeature) (uint8_t* pRef, const int32_t kiRefStride);
|
typedef int32_t (*PCalculateSingleBlockFeature) (uint8_t* pRef, const int32_t kiRefStride);
|
||||||
typedef void (*PUpdateFMESwitch) (SDqLayer* pCurLayer);
|
typedef void (*PUpdateFMESwitch) (SDqLayer* pCurLayer);
|
||||||
|
|||||||
@@ -102,8 +102,7 @@ typedef struct {
|
|||||||
bool bIdrPeriodFlag;
|
bool bIdrPeriodFlag;
|
||||||
} SVAAFrameInfo;
|
} SVAAFrameInfo;
|
||||||
|
|
||||||
typedef struct SVAAFrameInfoExt_t: public SVAAFrameInfo
|
typedef struct SVAAFrameInfoExt_t: public SVAAFrameInfo {
|
||||||
{
|
|
||||||
SComplexityAnalysisScreenParam sComplexityScreenParam;
|
SComplexityAnalysisScreenParam sComplexityScreenParam;
|
||||||
SScrollDetectionResult sScrollDetectInfo;
|
SScrollDetectionResult sScrollDetectInfo;
|
||||||
//TOP3_BEST_REF_NO_TID
|
//TOP3_BEST_REF_NO_TID
|
||||||
@@ -125,7 +124,8 @@ class CWelsPreProcess {
|
|||||||
void FreeSpatialPictures (sWelsEncCtx* pCtx);
|
void FreeSpatialPictures (sWelsEncCtx* pCtx);
|
||||||
int32_t BuildSpatialPicList (sWelsEncCtx* pEncCtx, const SSourcePicture* kpSrcPic);
|
int32_t BuildSpatialPicList (sWelsEncCtx* pEncCtx, const SSourcePicture* kpSrcPic);
|
||||||
int32_t AnalyzeSpatialPic (sWelsEncCtx* pEncCtx, const int32_t kiDIdx);
|
int32_t AnalyzeSpatialPic (sWelsEncCtx* pEncCtx, const int32_t kiDIdx);
|
||||||
int32_t UpdateSpatialPictures(sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam, const int8_t iCurTid, const int32_t d_idx);
|
int32_t UpdateSpatialPictures (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam, const int8_t iCurTid,
|
||||||
|
const int32_t d_idx);
|
||||||
int32_t GetRefCandidateLtrIndex (int32_t iRefIdx);
|
int32_t GetRefCandidateLtrIndex (int32_t iRefIdx);
|
||||||
void AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCurPicture, SPicture* pRefPicture,
|
void AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCurPicture, SPicture* pRefPicture,
|
||||||
const int32_t kiDependencyId, const bool kbCalculateBGD);
|
const int32_t kiDependencyId, const bool kbCalculateBGD);
|
||||||
@@ -161,9 +161,11 @@ class CWelsPreProcess {
|
|||||||
void GetAvailableRefList (SPicture** pSrcPicList, uint8_t iCurTid, const int32_t iClosestLtrFrameNum,
|
void GetAvailableRefList (SPicture** pSrcPicList, uint8_t iCurTid, const int32_t iClosestLtrFrameNum,
|
||||||
SRefInfoParam* pAvailableRefList, int32_t& iAvailableRefNum, int32_t& iAvailableSceneRefNum);
|
SRefInfoParam* pAvailableRefList, int32_t& iAvailableRefNum, int32_t& iAvailableSceneRefNum);
|
||||||
void InitRefJudgement (SRefJudgement* pRefJudgement);
|
void InitRefJudgement (SRefJudgement* pRefJudgement);
|
||||||
bool JudgeBestRef(SPicture* pRefPic,const SRefJudgement& sRefJudgement, const int32_t iFrameComplexity, const bool bIsClosestLtrFrame);
|
bool JudgeBestRef (SPicture* pRefPic, const SRefJudgement& sRefJudgement, const int32_t iFrameComplexity,
|
||||||
|
const bool bIsClosestLtrFrame);
|
||||||
void SaveBestRefToJudgement (const int32_t iRefPictureAvQP, const int32_t iComplexity, SRefJudgement* pRefJudgement);
|
void SaveBestRefToJudgement (const int32_t iRefPictureAvQP, const int32_t iComplexity, SRefJudgement* pRefJudgement);
|
||||||
void SaveBestRefToLocal(SRefInfoParam *pRefPicInfo,const SSceneChangeResult& sSceneChangeResult, SRefInfoParam* pRefSaved);
|
void SaveBestRefToLocal (SRefInfoParam* pRefPicInfo, const SSceneChangeResult& sSceneChangeResult,
|
||||||
|
SRefInfoParam* pRefSaved);
|
||||||
void SaveBestRefToVaa (SRefInfoParam& sRefSaved, SRefInfoParam* pVaaBestRef);
|
void SaveBestRefToVaa (SRefInfoParam& sRefSaved, SRefInfoParam* pVaaBestRef);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -39,15 +39,19 @@ namespace WelsSVCEnc {
|
|||||||
#ifdef X86_ASM
|
#ifdef X86_ASM
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
void TransposeMatrixBlocksx16_sse2( void *pDst, const int32_t kiDstStride, void *pSrc, const int32_t kiSrcStride, const int32_t kiBlocksNum );
|
void TransposeMatrixBlocksx16_sse2 (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride,
|
||||||
|
const int32_t kiBlocksNum);
|
||||||
void TransposeMatrixBlock16x16_sse2 (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride);
|
void TransposeMatrixBlock16x16_sse2 (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride);
|
||||||
void TransposeMatrixBlocksx8_mmx( void *pDst, const int32_t kiDstStride, void *pSrc, const int32_t kiSrcStride, const int32_t kiBlocksNum );
|
void TransposeMatrixBlocksx8_mmx (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride,
|
||||||
|
const int32_t kiBlocksNum);
|
||||||
void TransposeMatrixBlock8x8_mmx (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride);
|
void TransposeMatrixBlock8x8_mmx (void* pDst, const int32_t kiDstStride, void* pSrc, const int32_t kiSrcStride);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef void (*PTransposeMatrixBlockFunc)( void *pDst, const int32_t kiDstStride, void *pSrc, const int32_t kiSrcStride );
|
typedef void (*PTransposeMatrixBlockFunc) (void* pDst, const int32_t kiDstStride, void* pSrc,
|
||||||
typedef void (*PTransposeMatrixBlocksFunc)( void *pDst, const int32_t kiDstStride, void *pSrc, const int32_t kiSrcStride, const int32_t kiBlocksNum );
|
const int32_t kiSrcStride);
|
||||||
|
typedef void (*PTransposeMatrixBlocksFunc) (void* pDst, const int32_t kiDstStride, void* pSrc,
|
||||||
|
const int32_t kiSrcStride, const int32_t kiBlocksNum);
|
||||||
|
|
||||||
}// end of namespace declaration
|
}// end of namespace declaration
|
||||||
|
|
||||||
|
|||||||
@@ -733,7 +733,8 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) {
|
|||||||
pRefList = (SRefList*)pMa->WelsMallocz (sizeof (SRefList), "pRefList");
|
pRefList = (SRefList*)pMa->WelsMallocz (sizeof (SRefList), "pRefList");
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pRefList), FreeMemorySvc (ppCtx))
|
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pRefList), FreeMemorySvc (ppCtx))
|
||||||
do {
|
do {
|
||||||
pRefList->pRef[i] = AllocPicture (pMa, kiWidth, kiHeight, true, (iDlayerIndex == iDlayerCount-1)?kiNeedFeatureStorage:0); // to use actual size of current layer
|
pRefList->pRef[i] = AllocPicture (pMa, kiWidth, kiHeight, true,
|
||||||
|
(iDlayerIndex == iDlayerCount - 1) ? kiNeedFeatureStorage : 0); // to use actual size of current layer
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pRefList->pRef[i]), FreeMemorySvc (ppCtx))
|
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pRefList->pRef[i]), FreeMemorySvc (ppCtx))
|
||||||
++ i;
|
++ i;
|
||||||
} while (i < 1 + iNumRef);
|
} while (i < 1 + iNumRef);
|
||||||
@@ -831,11 +832,12 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if (kiNeedFeatureStorage && iDlayerIndex==iDlayerCount-1)
|
if (kiNeedFeatureStorage && iDlayerIndex == iDlayerCount - 1) {
|
||||||
{
|
pDqLayer->pFeatureSearchPreparation = static_cast<SFeatureSearchPreparation*> (pMa->WelsMallocz (sizeof (
|
||||||
pDqLayer->pFeatureSearchPreparation = static_cast<SFeatureSearchPreparation*> (pMa->WelsMallocz (sizeof (SFeatureSearchPreparation), "pFeatureSearchPreparation"));
|
SFeatureSearchPreparation), "pFeatureSearchPreparation"));
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, NULL == pDqLayer->pFeatureSearchPreparation, FreeMemorySvc (ppCtx));
|
WELS_VERIFY_RETURN_PROC_IF (1, NULL == pDqLayer->pFeatureSearchPreparation, FreeMemorySvc (ppCtx));
|
||||||
int32_t iReturn = RequestFeatureSearchPreparation(pMa, pDlayer->iFrameWidth, pDlayer->iFrameHeight, kiNeedFeatureStorage,
|
int32_t iReturn = RequestFeatureSearchPreparation (pMa, pDlayer->iFrameWidth, pDlayer->iFrameHeight,
|
||||||
|
kiNeedFeatureStorage,
|
||||||
pDqLayer->pFeatureSearchPreparation);
|
pDqLayer->pFeatureSearchPreparation);
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, ENC_RETURN_SUCCESS != iReturn, FreeMemorySvc (ppCtx));
|
WELS_VERIFY_RETURN_PROC_IF (1, ENC_RETURN_SUCCESS != iReturn, FreeMemorySvc (ppCtx));
|
||||||
} else {
|
} else {
|
||||||
@@ -2468,7 +2470,8 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) {
|
|||||||
if (pFeatureSearchPreparation->bFMESwitchFlag
|
if (pFeatureSearchPreparation->bFMESwitchFlag
|
||||||
&& !pScreenBlockFeatureStorage->bRefBlockFeatureCalculated) {
|
&& !pScreenBlockFeatureStorage->bRefBlockFeatureCalculated) {
|
||||||
//TODO: use ORIGIN of reference when preprocessing is ready
|
//TODO: use ORIGIN of reference when preprocessing is ready
|
||||||
PerformFMEPreprocess( pFuncList, pCurLayer->pRefPic,pFeatureSearchPreparation->pFeatureOfBlock,pScreenBlockFeatureStorage);
|
PerformFMEPreprocess (pFuncList, pCurLayer->pRefPic, pFeatureSearchPreparation->pFeatureOfBlock,
|
||||||
|
pScreenBlockFeatureStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
//assign ME pointer
|
//assign ME pointer
|
||||||
@@ -3012,7 +3015,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
DumpRef (pCtx);
|
DumpRef (pCtx);
|
||||||
#endif
|
#endif
|
||||||
if ((pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) && (pSvcParam->iRCMode != RC_OFF_MODE))
|
if ((pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) && (pSvcParam->iRCMode != RC_OFF_MODE))
|
||||||
pCtx->pVpp->AnalyzePictureComplexity(pCtx,pCtx->pEncPic,((pCtx->eSliceType == P_SLICE)&&(pCtx->iNumRef0>0))?pCtx->pRefList0[0]:NULL,
|
pCtx->pVpp->AnalyzePictureComplexity (pCtx, pCtx->pEncPic, ((pCtx->eSliceType == P_SLICE)
|
||||||
|
&& (pCtx->iNumRef0 > 0)) ? pCtx->pRefList0[0] : NULL,
|
||||||
iCurDid, pSvcParam->bEnableBackgroundDetection);
|
iCurDid, pSvcParam->bEnableBackgroundDetection);
|
||||||
|
|
||||||
WelsUpdateRefSyntax (pCtx, pCtx->iPOC,
|
WelsUpdateRefSyntax (pCtx, pCtx->iPOC,
|
||||||
|
|||||||
@@ -120,7 +120,8 @@ void WelsUnloadNalForSlice (SWelsSliceBs* pSliceBsIn) {
|
|||||||
*/
|
*/
|
||||||
//TODO 1: refactor the calling of this func in multi-thread
|
//TODO 1: refactor the calling of this func in multi-thread
|
||||||
//TODO 2: complete the realloc©
|
//TODO 2: complete the realloc©
|
||||||
int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t kiDstBufferLen, void* pDst, int32_t* pDstLen) {
|
int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t kiDstBufferLen, void* pDst,
|
||||||
|
int32_t* pDstLen) {
|
||||||
const bool kbNALExt = pRawNal->sNalExt.sNalHeader.eNalUnitType == NAL_UNIT_PREFIX
|
const bool kbNALExt = pRawNal->sNalExt.sNalHeader.eNalUnitType == NAL_UNIT_PREFIX
|
||||||
|| pRawNal->sNalExt.sNalHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_EXT;
|
|| pRawNal->sNalExt.sNalHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_EXT;
|
||||||
int32_t iAssumedNeededLength = NAL_HEADER_SIZE + (kbNALExt ? 3 : 0) + pRawNal->iPayloadSize + 1;
|
int32_t iAssumedNeededLength = NAL_HEADER_SIZE + (kbNALExt ? 3 : 0) + pRawNal->iPayloadSize + 1;
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth , const int32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (iNeedFeatureStorage) {
|
if (iNeedFeatureStorage) {
|
||||||
pPic->pScreenBlockFeatureStorage = static_cast<SScreenBlockFeatureStorage*> (pMa->WelsMallocz (sizeof (SScreenBlockFeatureStorage), "pScreenBlockFeatureStorage"));
|
pPic->pScreenBlockFeatureStorage = static_cast<SScreenBlockFeatureStorage*> (pMa->WelsMallocz (sizeof (
|
||||||
|
SScreenBlockFeatureStorage), "pScreenBlockFeatureStorage"));
|
||||||
int32_t iReturn = RequestScreenBlockFeatureStorage (pMa, kiWidth, kiHeight, iNeedFeatureStorage,
|
int32_t iReturn = RequestScreenBlockFeatureStorage (pMa, kiWidth, kiHeight, iNeedFeatureStorage,
|
||||||
pPic->pScreenBlockFeatureStorage);
|
pPic->pScreenBlockFeatureStorage);
|
||||||
WELS_VERIFY_RETURN_PROC_IF (NULL, ENC_RETURN_SUCCESS != iReturn, FreePicture (pMa, &pPic));
|
WELS_VERIFY_RETURN_PROC_IF (NULL, ENC_RETURN_SUCCESS != iReturn, FreePicture (pMa, &pPic));
|
||||||
|
|||||||
@@ -429,9 +429,7 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) {
|
|||||||
|
|
||||||
if (0 == pTOverRc->iPFrameNum) {
|
if (0 == pTOverRc->iPFrameNum) {
|
||||||
iLumaQp = pWelsSvcRc->iInitialQp;
|
iLumaQp = pWelsSvcRc->iInitialQp;
|
||||||
}
|
} else if (pWelsSvcRc->iCurrentBitsLevel == BITS_EXCEEDED) {
|
||||||
else if (pWelsSvcRc->iCurrentBitsLevel==BITS_EXCEEDED)
|
|
||||||
{
|
|
||||||
iLumaQp = MAX_LOW_BR_QP;
|
iLumaQp = MAX_LOW_BR_QP;
|
||||||
//limit QP
|
//limit QP
|
||||||
int32_t iLastIdxCodecInVGop = pWelsSvcRc->iFrameCodedInVGop - 1;
|
int32_t iLastIdxCodecInVGop = pWelsSvcRc->iFrameCodedInVGop - 1;
|
||||||
@@ -459,8 +457,7 @@ void RcCalculatePictureQp (sWelsEncCtx* pEncCtx) {
|
|||||||
pEncCtx->iGlobalQp = iLumaQp;
|
pEncCtx->iGlobalQp = iLumaQp;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
double dCmplxRatio = (double)pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity / pTOverRc->iFrameCmplxMean;
|
double dCmplxRatio = (double)pEncCtx->pVaa->sComplexityAnalysisParam.iFrameComplexity / pTOverRc->iFrameCmplxMean;
|
||||||
dCmplxRatio = WELS_CLIP3 (dCmplxRatio, 1.0 - FRAME_CMPLX_RATIO_RANGE, 1.0 + FRAME_CMPLX_RATIO_RANGE);
|
dCmplxRatio = WELS_CLIP3 (dCmplxRatio, 1.0 - FRAME_CMPLX_RATIO_RANGE, 1.0 + FRAME_CMPLX_RATIO_RANGE);
|
||||||
|
|
||||||
@@ -531,12 +528,9 @@ void RcDecideTargetBits (sWelsEncCtx* pEncCtx) {
|
|||||||
} else {
|
} else {
|
||||||
pWelsSvcRc->iTargetBits = (int32_t) (pWelsSvcRc->iRemainingBits * pTOverRc->dTlayerWeight /
|
pWelsSvcRc->iTargetBits = (int32_t) (pWelsSvcRc->iRemainingBits * pTOverRc->dTlayerWeight /
|
||||||
pWelsSvcRc->dRemainingWeights);
|
pWelsSvcRc->dRemainingWeights);
|
||||||
if ((pWelsSvcRc->iTargetBits <= 0) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE))
|
if ((pWelsSvcRc->iTargetBits <= 0) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE)) {
|
||||||
{
|
|
||||||
pWelsSvcRc->iCurrentBitsLevel = BITS_EXCEEDED;
|
pWelsSvcRc->iCurrentBitsLevel = BITS_EXCEEDED;
|
||||||
}
|
} else if ((pWelsSvcRc->iTargetBits <= pTOverRc->iMinBitsTl) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE)) {
|
||||||
else if ((pWelsSvcRc->iTargetBits <= pTOverRc->iMinBitsTl) && (pEncCtx->pSvcParam->iRCMode == RC_LOW_BW_MODE))
|
|
||||||
{
|
|
||||||
pWelsSvcRc->iCurrentBitsLevel = BITS_LIMITED;
|
pWelsSvcRc->iCurrentBitsLevel = BITS_LIMITED;
|
||||||
}
|
}
|
||||||
pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, pTOverRc->iMinBitsTl, pTOverRc->iMaxBitsTl);
|
pWelsSvcRc->iTargetBits = WELS_CLIP3 (pWelsSvcRc->iTargetBits, pTOverRc->iMinBitsTl, pTOverRc->iMaxBitsTl);
|
||||||
|
|||||||
@@ -691,7 +691,8 @@ static int32_t UpdateSrcPicList (sWelsEncCtx* pCtx) {
|
|||||||
}
|
}
|
||||||
PrefetchNextBuffer (pCtx);
|
PrefetchNextBuffer (pCtx);
|
||||||
for (int32_t i = 0; i < MAX_REF_PIC_COUNT; ++i) {
|
for (int32_t i = 0; i < MAX_REF_PIC_COUNT; ++i) {
|
||||||
if (NULL == pLongRefSrcList[i + 1] || (NULL != pLongRefList[i] && pLongRefList[i]->bUsedAsRef&& pLongRefList[i]->bIsLongRef)) {
|
if (NULL == pLongRefSrcList[i + 1] || (NULL != pLongRefList[i] && pLongRefList[i]->bUsedAsRef
|
||||||
|
&& pLongRefList[i]->bIsLongRef)) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
SetUnref (pLongRefSrcList[i + 1]);
|
SetUnref (pLongRefSrcList[i + 1]);
|
||||||
@@ -772,7 +773,8 @@ bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtr
|
|||||||
"WelsBuildRefListScreen(), ref !current iFrameNum = %d, ref iFrameNum = %d,LTR number = %d,iNumRef = %d ref is Scene LTR = %d\n",
|
"WelsBuildRefListScreen(), ref !current iFrameNum = %d, ref iFrameNum = %d,LTR number = %d,iNumRef = %d ref is Scene LTR = %d\n",
|
||||||
pCtx->iFrameNum, pCtx->pRefList0[pCtx->iNumRef0 - 1]->iFrameNum, pRefList->uiLongRefCount, iNumRef,
|
pCtx->iFrameNum, pCtx->pRefList0[pCtx->iNumRef0 - 1]->iFrameNum, pRefList->uiLongRefCount, iNumRef,
|
||||||
pRefPic->bIsSceneLTR);
|
pRefPic->bIsSceneLTR);
|
||||||
WelsLog (pCtx, WELS_LOG_INFO, "WelsBuildRefListScreen pCtx->uiTemporalId = %d,pRef->iFrameNum = %d,pRef->uiTemporalId = %d\n",
|
WelsLog (pCtx, WELS_LOG_INFO,
|
||||||
|
"WelsBuildRefListScreen pCtx->uiTemporalId = %d,pRef->iFrameNum = %d,pRef->uiTemporalId = %d\n",
|
||||||
pCtx->uiTemporalId, pRefPic->iFrameNum, pRefPic->uiTemporalId);
|
pCtx->uiTemporalId, pRefPic->iFrameNum, pRefPic->uiTemporalId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,8 @@ void CalcSliceComplexRatio (void* pRatio, SSliceCtx* pSliceCtx, uint32_t* pSlice
|
|||||||
|
|
||||||
while (iSliceIdx < kiSliceCount) {
|
while (iSliceIdx < kiSliceCount) {
|
||||||
fAvI[iSliceIdx] = 1.0f * pCountMbInSlice[iSliceIdx] / pSliceTime[iSliceIdx];
|
fAvI[iSliceIdx] = 1.0f * pCountMbInSlice[iSliceIdx] / pSliceTime[iSliceIdx];
|
||||||
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] CalcSliceComplexRatio(), pSliceConsumeTime[%d]= %d us, slice_run= %d\n", iSliceIdx,
|
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] CalcSliceComplexRatio(), pSliceConsumeTime[%d]= %d us, slice_run= %d\n",
|
||||||
|
iSliceIdx,
|
||||||
pSliceTime[iSliceIdx], pCountMbInSlice[iSliceIdx]);
|
pSliceTime[iSliceIdx], pCountMbInSlice[iSliceIdx]);
|
||||||
fSumAv += fAvI[iSliceIdx];
|
fSumAv += fAvI[iSliceIdx];
|
||||||
|
|
||||||
@@ -156,7 +157,8 @@ int32_t NeedDynamicAdjust (void* pConsumeTime, const int32_t iSliceNum) {
|
|||||||
iSliceIdx += 2;
|
iSliceIdx += 2;
|
||||||
}
|
}
|
||||||
if (uiTotalConsume == 0) {
|
if (uiTotalConsume == 0) {
|
||||||
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] NeedDynamicAdjust(), herein do no adjust due first picture, iCountSliceNum= %d\n",
|
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG,
|
||||||
|
"[MT] NeedDynamicAdjust(), herein do no adjust due first picture, iCountSliceNum= %d\n",
|
||||||
iSliceNum);
|
iSliceNum);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -322,7 +324,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara
|
|||||||
while (iIdx < iNumSpatialLayers) {
|
while (iIdx < iNumSpatialLayers) {
|
||||||
SSliceConfig* pMso = &pPara->sDependencyLayers[iIdx].sSliceCfg;
|
SSliceConfig* pMso = &pPara->sDependencyLayers[iIdx].sSliceCfg;
|
||||||
const int32_t kiSliceNum = pMso->sSliceArgument.uiSliceNum;
|
const int32_t kiSliceNum = pMso->sSliceArgument.uiSliceNum;
|
||||||
if (((pMso->uiSliceMode == SM_FIXEDSLCNUM_SLICE)||(pMso->uiSliceMode == SM_AUTO_SLICE)) && pPara->iMultipleThreadIdc > 1
|
if (((pMso->uiSliceMode == SM_FIXEDSLCNUM_SLICE) || (pMso->uiSliceMode == SM_AUTO_SLICE))
|
||||||
|
&& pPara->iMultipleThreadIdc > 1
|
||||||
&& pPara->iMultipleThreadIdc >= kiSliceNum) {
|
&& pPara->iMultipleThreadIdc >= kiSliceNum) {
|
||||||
pSmt->pSliceConsumeTime[iIdx] = (uint32_t*)pMa->WelsMallocz (kiSliceNum * sizeof (uint32_t), "pSliceConsumeTime[]");
|
pSmt->pSliceConsumeTime[iIdx] = (uint32_t*)pMa->WelsMallocz (kiSliceNum * sizeof (uint32_t), "pSliceConsumeTime[]");
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceConsumeTime[iIdx]), FreeMemorySvc (ppCtx))
|
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pSmt->pSliceConsumeTime[iIdx]), FreeMemorySvc (ppCtx))
|
||||||
@@ -371,7 +374,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara
|
|||||||
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
|
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
|
||||||
WelsSnprintf (name, SEM_NAME_MAX, "fu%d%s", iIdx, pSmt->eventNamespace);
|
WelsSnprintf (name, SEM_NAME_MAX, "fu%d%s", iIdx, pSmt->eventNamespace);
|
||||||
err = WelsEventOpen (&pSmt->pFinUpdateMbListEvent[iIdx], name);
|
err = WelsEventOpen (&pSmt->pFinUpdateMbListEvent[iIdx], name);
|
||||||
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
|
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pFinUpdateMbListEvent%d named(%s) ret%d err%d\n", iIdx, name, err,
|
||||||
|
errno);
|
||||||
WelsSnprintf (name, SEM_NAME_MAX, "sc%d%s", iIdx, pSmt->eventNamespace);
|
WelsSnprintf (name, SEM_NAME_MAX, "sc%d%s", iIdx, pSmt->eventNamespace);
|
||||||
err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);
|
err = WelsEventOpen (&pSmt->pSliceCodedEvent[iIdx], name);
|
||||||
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pSliceCodedEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
|
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "[MT] Open pSliceCodedEvent%d named(%s) ret%d err%d\n", iIdx, name, err, errno);
|
||||||
@@ -418,7 +422,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara
|
|||||||
iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError);
|
iReturn = WelsMutexInit (& (*ppCtx)->mutexEncoderError);
|
||||||
WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
|
WELS_VERIFY_RETURN_PROC_IF (1, (WELS_THREAD_ERROR_OK != iReturn), FreeMemorySvc (ppCtx))
|
||||||
|
|
||||||
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "RequestMtResource(), iThreadNum=%d, iCountSliceNum= %d\n", pPara->iCountThreadsNum,
|
MT_TRACE_LOG (*ppCtx, WELS_LOG_INFO, "RequestMtResource(), iThreadNum=%d, iCountSliceNum= %d\n",
|
||||||
|
pPara->iCountThreadsNum,
|
||||||
iMaxSliceNum);
|
iMaxSliceNum);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -595,7 +600,8 @@ int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32
|
|||||||
return iLayerSize;
|
return iLayerSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFrameBsBuffer, const int32_t iSliceIdx, int32_t& iSliceSize) {
|
int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFrameBsBuffer, const int32_t iSliceIdx,
|
||||||
|
int32_t& iSliceSize) {
|
||||||
SWelsSliceBs* pSliceBs = &pCtx->pSliceBs[iSliceIdx];
|
SWelsSliceBs* pSliceBs = &pCtx->pSliceBs[iSliceIdx];
|
||||||
SNalUnitHeaderExt* pNalHdrExt = &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt;
|
SNalUnitHeaderExt* pNalHdrExt = &pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt;
|
||||||
uint8_t* pDst = pFrameBsBuffer;
|
uint8_t* pDst = pFrameBsBuffer;
|
||||||
@@ -610,7 +616,8 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr
|
|||||||
|
|
||||||
while (iNalIdx < kiNalCnt) {
|
while (iNalIdx < kiNalCnt) {
|
||||||
iNalSize = 0;
|
iNalSize = 0;
|
||||||
iReturn = WelsEncodeNal (&pSliceBs->sNalList[iNalIdx], pNalHdrExt, pCtx->iFrameBsSize-kiWrittenLength-iSliceSize, pDst, &iNalSize);
|
iReturn = WelsEncodeNal (&pSliceBs->sNalList[iNalIdx], pNalHdrExt, pCtx->iFrameBsSize - kiWrittenLength - iSliceSize,
|
||||||
|
pDst, &iNalSize);
|
||||||
WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
|
WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
|
||||||
iSliceSize += iNalSize;
|
iSliceSize += iNalSize;
|
||||||
pDst += iNalSize;
|
pDst += iNalSize;
|
||||||
@@ -653,7 +660,8 @@ int32_t WriteSliceBs (sWelsEncCtx* pCtx, uint8_t* pSliceBsBuf, const int32_t iSl
|
|||||||
|
|
||||||
while (iNalIdx < kiNalCnt) {
|
while (iNalIdx < kiNalCnt) {
|
||||||
iNalSize = 0;
|
iNalSize = 0;
|
||||||
iReturn = WelsEncodeNal (&pSliceBs->sNalList[iNalIdx], pNalHdrExt, pSliceBs->uiSize-kiWrittenLength-iSliceSize, pDst, &iNalSize);
|
iReturn = WelsEncodeNal (&pSliceBs->sNalList[iNalIdx], pNalHdrExt, pSliceBs->uiSize - kiWrittenLength - iSliceSize,
|
||||||
|
pDst, &iNalSize);
|
||||||
WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
|
WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
|
||||||
pNalLen[iNalIdx] = iNalSize;
|
pNalLen[iNalIdx] = iNalSize;
|
||||||
iSliceSize += iNalSize;
|
iSliceSize += iNalSize;
|
||||||
@@ -702,7 +710,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
|||||||
"[MT] CodingSliceThreadProc(), try to call WelsMultipleEventsWaitSingleBlocking(pEventsList= %p %p %p), pEncPEncCtx= %p!\n",
|
"[MT] CodingSliceThreadProc(), try to call WelsMultipleEventsWaitSingleBlocking(pEventsList= %p %p %p), pEncPEncCtx= %p!\n",
|
||||||
pEventsList[0], pEventsList[1], pEventsList[1], (void*)pEncPEncCtx);
|
pEventsList[0], pEventsList[1], pEventsList[1], (void*)pEncPEncCtx);
|
||||||
iWaitRet = WelsMultipleEventsWaitSingleBlocking (iEventCount,
|
iWaitRet = WelsMultipleEventsWaitSingleBlocking (iEventCount,
|
||||||
&pEventsList[0], &pEncPEncCtx->pSliceThreading->pThreadMasterEvent[iEventIdx]); // blocking until at least one event is signalled
|
&pEventsList[0],
|
||||||
|
&pEncPEncCtx->pSliceThreading->pThreadMasterEvent[iEventIdx]); // blocking until at least one event is signalled
|
||||||
if (WELS_THREAD_ERROR_WAIT_OBJECT_0 == iWaitRet) { // start pSlice coding signal waited
|
if (WELS_THREAD_ERROR_WAIT_OBJECT_0 == iWaitRet) { // start pSlice coding signal waited
|
||||||
SLayerBSInfo* pLbi = pPrivateData->pLayerBs;
|
SLayerBSInfo* pLbi = pPrivateData->pLayerBs;
|
||||||
const int32_t kiCurDid = pEncPEncCtx->uiDependencyId;
|
const int32_t kiCurDid = pEncPEncCtx->uiDependencyId;
|
||||||
@@ -722,7 +731,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
|||||||
pSlice = &pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx];
|
pSlice = &pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx];
|
||||||
pSliceBs = &pEncPEncCtx->pSliceBs[iSliceIdx];
|
pSliceBs = &pEncPEncCtx->pSliceBs[iSliceIdx];
|
||||||
|
|
||||||
bDsaFlag = (((pParamD->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE)||(pParamD->sSliceCfg.uiSliceMode == SM_AUTO_SLICE)) &&
|
bDsaFlag = (((pParamD->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE)
|
||||||
|
|| (pParamD->sSliceCfg.uiSliceMode == SM_AUTO_SLICE)) &&
|
||||||
pCodingParam->iMultipleThreadIdc > 1 &&
|
pCodingParam->iMultipleThreadIdc > 1 &&
|
||||||
pCodingParam->iMultipleThreadIdc >= pParamD->sSliceCfg.sSliceArgument.uiSliceNum);
|
pCodingParam->iMultipleThreadIdc >= pParamD->sSliceCfg.sSliceArgument.uiSliceNum);
|
||||||
if (bDsaFlag)
|
if (bDsaFlag)
|
||||||
@@ -767,8 +777,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pEncPEncCtx->iPosBsBuffer += iSliceSize;
|
pEncPEncCtx->iPosBsBuffer += iSliceSize;
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs, iSliceIdx, iSliceSize);
|
iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs, iSliceIdx, iSliceSize);
|
||||||
if (ENC_RETURN_SUCCESS != iReturn) {
|
if (ENC_RETURN_SUCCESS != iReturn) {
|
||||||
uiThrdRet = iReturn;
|
uiThrdRet = iReturn;
|
||||||
@@ -869,14 +878,14 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
|||||||
if (0 == kiPartitionId) {
|
if (0 == kiPartitionId) {
|
||||||
if (0 == iSliceIdx)
|
if (0 == iSliceIdx)
|
||||||
pLbi->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer;
|
pLbi->pBsBuf = pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer;
|
||||||
iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbi, pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer, iSliceIdx, iSliceSize);
|
iReturn = WriteSliceToFrameBs (pEncPEncCtx, pLbi, pEncPEncCtx->pFrameBs + pEncPEncCtx->iPosBsBuffer, iSliceIdx,
|
||||||
|
iSliceSize);
|
||||||
if (ENC_RETURN_SUCCESS != iReturn) {
|
if (ENC_RETURN_SUCCESS != iReturn) {
|
||||||
uiThrdRet = iReturn;
|
uiThrdRet = iReturn;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pEncPEncCtx->iPosBsBuffer += iSliceSize;
|
pEncPEncCtx->iPosBsBuffer += iSliceSize;
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
iSliceSize = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs, iSliceIdx, iSliceSize);
|
iSliceSize = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs, iSliceIdx, iSliceSize);
|
||||||
if (ENC_RETURN_SUCCESS != iReturn) {
|
if (ENC_RETURN_SUCCESS != iReturn) {
|
||||||
uiThrdRet = iReturn;
|
uiThrdRet = iReturn;
|
||||||
@@ -918,20 +927,17 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) {
|
|||||||
WelsEventSignal (&pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice
|
WelsEventSignal (&pEncPEncCtx->pSliceThreading->pSliceCodedEvent[iEventIdx]); // mean finished coding current pSlice
|
||||||
WelsEventSignal (&pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent);
|
WelsEventSignal (&pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent);
|
||||||
}
|
}
|
||||||
}
|
} else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 1 == iWaitRet) { // exit thread signal
|
||||||
else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 1 == iWaitRet) { // exit thread signal
|
|
||||||
uiThrdRet = 0;
|
uiThrdRet = 0;
|
||||||
break;
|
break;
|
||||||
}
|
} else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 2 == iWaitRet) { // update pMb list singal
|
||||||
else if (WELS_THREAD_ERROR_WAIT_OBJECT_0 + 2 == iWaitRet) { // update pMb list singal
|
|
||||||
iSliceIdx =
|
iSliceIdx =
|
||||||
iEventIdx; // pPrivateData->iSliceIndex; old threads can not be terminated, pPrivateData is not correct for applicable
|
iEventIdx; // pPrivateData->iSliceIndex; old threads can not be terminated, pPrivateData is not correct for applicable
|
||||||
pCurDq = pEncPEncCtx->pCurDqLayer;
|
pCurDq = pEncPEncCtx->pCurDqLayer;
|
||||||
UpdateMbListNeighborParallel (pCurDq->pSliceEncCtx, pCurDq->sMbDataP, iSliceIdx);
|
UpdateMbListNeighborParallel (pCurDq->pSliceEncCtx, pCurDq->sMbDataP, iSliceIdx);
|
||||||
WelsEventSignal (
|
WelsEventSignal (
|
||||||
&pEncPEncCtx->pSliceThreading->pFinUpdateMbListEvent[iEventIdx]); // mean finished update pMb list for this pSlice
|
&pEncPEncCtx->pSliceThreading->pFinUpdateMbListEvent[iEventIdx]); // mean finished update pMb list for this pSlice
|
||||||
}
|
} else { // WELS_THREAD_ERROR_WAIT_TIMEOUT, or WELS_THREAD_ERROR_WAIT_FAILED
|
||||||
else { // WELS_THREAD_ERROR_WAIT_TIMEOUT, or WELS_THREAD_ERROR_WAIT_FAILED
|
|
||||||
WelsLog (pEncPEncCtx, WELS_LOG_WARNING,
|
WelsLog (pEncPEncCtx, WELS_LOG_WARNING,
|
||||||
"[MT] CodingSliceThreadProc(), waiting pReadySliceCodingEvent[%d] failed(%d) and thread%d terminated!\n", iEventIdx,
|
"[MT] CodingSliceThreadProc(), waiting pReadySliceCodingEvent[%d] failed(%d) and thread%d terminated!\n", iEventIdx,
|
||||||
iWaitRet, iThreadIdx);
|
iWaitRet, iThreadIdx);
|
||||||
@@ -962,9 +968,9 @@ int32_t CreateSliceThreads (sWelsEncCtx* pCtx) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, WELS_EVENT* pMasterEventsList, SLayerBSInfo* pLbi,
|
int32_t FiredSliceThreads (SSliceThreadPrivateData* pPriData, WELS_EVENT* pEventsList, WELS_EVENT* pMasterEventsList,
|
||||||
const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const bool bIsDynamicSlicingMode)
|
SLayerBSInfo* pLbi,
|
||||||
{
|
const uint32_t uiNumThreads, SSliceCtx* pSliceCtx, const bool bIsDynamicSlicingMode) {
|
||||||
int32_t iEndMbIdx = 0;
|
int32_t iEndMbIdx = 0;
|
||||||
int32_t iIdx = 0;
|
int32_t iIdx = 0;
|
||||||
const int32_t kiEventCnt = uiNumThreads;
|
const int32_t kiEventCnt = uiNumThreads;
|
||||||
|
|||||||
@@ -358,7 +358,8 @@ void WelsMdInterInit (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb, const i
|
|||||||
ST32 (&pCurMb->sP16x16Mv, 0);
|
ST32 (&pCurMb->sP16x16Mv, 0);
|
||||||
ST32 (&pCurLayer->pDecPic->sMvList[kiMbXY], 0);
|
ST32 (&pCurLayer->pDecPic->sMvList[kiMbXY], 0);
|
||||||
|
|
||||||
SetMvWithinIntegerMvRange( kiMbWidth, kiMbHeight, kiMbX, kiMbY, CAMERA_STARTMV_RANGE, &(pSlice->sMvStartMin), &(pSlice->sMvStartMax));
|
SetMvWithinIntegerMvRange (kiMbWidth, kiMbHeight, kiMbX, kiMbY, CAMERA_STARTMV_RANGE, & (pSlice->sMvStartMin),
|
||||||
|
& (pSlice->sMvStartMax));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t WelsMdI16x16 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SMbCache* pMbCache, int32_t iLambda) {
|
int32_t WelsMdI16x16 (SWelsFuncPtrList* pFunc, SDqLayer* pCurDqLayer, SMbCache* pMbCache, int32_t iLambda) {
|
||||||
@@ -970,8 +971,7 @@ void WelsMdIntraMb (sWelsEncCtx* pEncCtx, SWelsMD* pWelsMd, SMB* pCurMb, SMbCach
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void InitMe (const SWelsMD& sWelsMd, const int32_t iBlockSize, uint8_t* pEnc, uint8_t* pRef,
|
static inline void InitMe (const SWelsMD& sWelsMd, const int32_t iBlockSize, uint8_t* pEnc, uint8_t* pRef,
|
||||||
SWelsME& sWelsMe )
|
SWelsME& sWelsMe) {
|
||||||
{
|
|
||||||
sWelsMe.iCurMeBlockPixX = sWelsMd.iMbPixX;
|
sWelsMe.iCurMeBlockPixX = sWelsMd.iMbPixX;
|
||||||
sWelsMe.iCurMeBlockPixY = sWelsMd.iMbPixY;
|
sWelsMe.iCurMeBlockPixY = sWelsMd.iMbPixY;
|
||||||
sWelsMe.uiBlockSize = iBlockSize;
|
sWelsMe.uiBlockSize = iBlockSize;
|
||||||
|
|||||||
@@ -693,7 +693,8 @@ int32_t WelsCodeOneSlice (sWelsEncCtx* pEncCtx, const int32_t kiSliceIdx, const
|
|||||||
SNalUnitHeaderExt* pNalHeadExt = &pCurLayer->sLayerInfo.sNalHeaderExt;
|
SNalUnitHeaderExt* pNalHeadExt = &pCurLayer->sLayerInfo.sNalHeaderExt;
|
||||||
SSlice* pCurSlice = &pCurLayer->sLayerInfo.pSliceInLayer[kiSliceIdx];
|
SSlice* pCurSlice = &pCurLayer->sLayerInfo.pSliceInLayer[kiSliceIdx];
|
||||||
SBitStringAux* pBs = pCurSlice->pSliceBsa;
|
SBitStringAux* pBs = pCurSlice->pSliceBsa;
|
||||||
const int32_t kiDynamicSliceFlag = (pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId].sSliceCfg.uiSliceMode ==
|
const int32_t kiDynamicSliceFlag = (pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId].sSliceCfg.uiSliceMode
|
||||||
|
==
|
||||||
SM_DYN_SLICE);
|
SM_DYN_SLICE);
|
||||||
|
|
||||||
assert (kiSliceIdx == pCurSlice->uiSliceIdx);
|
assert (kiSliceIdx == pCurSlice->uiSliceIdx);
|
||||||
@@ -903,8 +904,8 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli
|
|||||||
///////////////
|
///////////////
|
||||||
// pMb loop
|
// pMb loop
|
||||||
///////////////
|
///////////////
|
||||||
inline void WelsInitInterMDStruc(const SMB* pCurMb, uint16_t *pMvdCostTableInter, const int32_t kiMvdInterTableStride, SWelsMD* pMd )
|
inline void WelsInitInterMDStruc (const SMB* pCurMb, uint16_t* pMvdCostTableInter, const int32_t kiMvdInterTableStride,
|
||||||
{
|
SWelsMD* pMd) {
|
||||||
pMd->iLambda = g_kiQpCostTable[pCurMb->uiLumaQp];
|
pMd->iLambda = g_kiQpCostTable[pCurMb->uiLumaQp];
|
||||||
pMd->pMvdCost = &pMvdCostTableInter[pCurMb->uiLumaQp * kiMvdInterTableStride];
|
pMd->pMvdCost = &pMvdCostTableInter[pCurMb->uiLumaQp * kiMvdInterTableStride];
|
||||||
pMd-> iMbPixX = (pCurMb->iMbX << 4);
|
pMd-> iMbPixX = (pCurMb->iMbX << 4);
|
||||||
|
|||||||
@@ -166,7 +166,8 @@ bool WelsMdInterJudgeScrollingPskip(void* pEncCtx, void* pWelsMd, SSlice* slice,
|
|||||||
//TBD
|
//TBD
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool WelsMdInterJudgeScrollingPskipFalse(void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb, SMbCache* pMbCache) {
|
bool WelsMdInterJudgeScrollingPskipFalse (void* pEncCtx, void* pWelsMd, SSlice* slice, SMB* pCurMb,
|
||||||
|
SMbCache* pMbCache) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ const int32_t QStepx16ByQp[52] = { /* save QStep<<4 for int32_t */
|
|||||||
2560, 2816, 3328, 3584 /* 48~51 */
|
2560, 2816, 3328, 3584 /* 48~51 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void UpdateMeResults( const SMVUnitXY ksBestMv, const uint32_t kiBestSadCost, uint8_t* pRef, SWelsME * pMe ) {
|
static inline void UpdateMeResults (const SMVUnitXY ksBestMv, const uint32_t kiBestSadCost, uint8_t* pRef,
|
||||||
|
SWelsME* pMe) {
|
||||||
pMe->sMv = ksBestMv;
|
pMe->sMv = ksBestMv;
|
||||||
pMe->pRefMb = pRef;
|
pMe->pRefMb = pRef;
|
||||||
pMe->uiSadCost = kiBestSadCost;
|
pMe->uiSadCost = kiBestSadCost;
|
||||||
@@ -124,7 +125,8 @@ void WelsMotionEstimateSearch (SWelsFuncPtrList* pFuncList, void* pLplayer, void
|
|||||||
MeEndIntepelSearch (pMe);
|
MeEndIntepelSearch (pMe);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFuncList->pfCalculateSatd( pFuncList->sSampleDealingFuncs.pfSampleSatd[pMe->uiBlockSize], pMe, kiStrideEnc, kiStrideRef );
|
pFuncList->pfCalculateSatd (pFuncList->sSampleDealingFuncs.pfSampleSatd[pMe->uiBlockSize], pMe, kiStrideEnc,
|
||||||
|
kiStrideRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -327,8 +329,7 @@ bool CheckDirectionalMvFalse(PSampleSadSatdCostFunc pSad, void * vpMe,
|
|||||||
// Cross Search Basics
|
// Cross Search Basics
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
#if defined (X86_ASM)
|
#if defined (X86_ASM)
|
||||||
void CalcMvdCostx8_c( uint16_t *pMvdCost, const int32_t kiStartMv, uint16_t* pMvdTable, const uint16_t kiFixedCost )
|
void CalcMvdCostx8_c (uint16_t* pMvdCost, const int32_t kiStartMv, uint16_t* pMvdTable, const uint16_t kiFixedCost) {
|
||||||
{
|
|
||||||
uint16_t* pBaseCost = pMvdCost;
|
uint16_t* pBaseCost = pMvdCost;
|
||||||
const int32_t kiOffset = (kiStartMv << 2);
|
const int32_t kiOffset = (kiStartMv << 2);
|
||||||
uint16_t* pMvd = pMvdTable + kiOffset;
|
uint16_t* pMvd = pMvdTable + kiOffset;
|
||||||
@@ -349,8 +350,10 @@ void VerticalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
|
|||||||
const int32_t kiEdgeBlocks = kIsBlock16x16 ? 16 : 8;
|
const int32_t kiEdgeBlocks = kIsBlock16x16 ? 16 : 8;
|
||||||
PSampleSadHor8Func pSampleSadHor8 = pFuncList->pfSampleSadHor8[kIsBlock16x16];
|
PSampleSadHor8Func pSampleSadHor8 = pFuncList->pfSampleSadHor8[kIsBlock16x16];
|
||||||
PSampleSadSatdCostFunc pSad = pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize];
|
PSampleSadSatdCostFunc pSad = pFuncList->sSampleDealingFuncs.pfSampleSad[pMe->uiBlockSize];
|
||||||
PTransposeMatrixBlockFunc TransposeMatrixBlock = kIsBlock16x16 ? TransposeMatrixBlock16x16_sse2 : TransposeMatrixBlock8x8_mmx;
|
PTransposeMatrixBlockFunc TransposeMatrixBlock = kIsBlock16x16 ? TransposeMatrixBlock16x16_sse2 :
|
||||||
PTransposeMatrixBlocksFunc TransposeMatrixBlocks= kIsBlock16x16 ? TransposeMatrixBlocksx16_sse2 : TransposeMatrixBlocksx8_mmx;
|
TransposeMatrixBlock8x8_mmx;
|
||||||
|
PTransposeMatrixBlocksFunc TransposeMatrixBlocks = kIsBlock16x16 ? TransposeMatrixBlocksx16_sse2 :
|
||||||
|
TransposeMatrixBlocksx8_mmx;
|
||||||
|
|
||||||
const int32_t kiDiff = kiMaxPos - kiMinPos;
|
const int32_t kiDiff = kiMaxPos - kiMinPos;
|
||||||
const int32_t kiRowNum = WELS_ALIGN ((kiDiff - kiEdgeBlocks + 1), kiEdgeBlocks);
|
const int32_t kiRowNum = WELS_ALIGN ((kiDiff - kiEdgeBlocks + 1), kiEdgeBlocks);
|
||||||
@@ -410,8 +413,7 @@ void HorizontalFullSearchUsingSSE41( SWelsFuncPtrList *pFuncList, SWelsME *pMe,
|
|||||||
uint16_t* pMvdTable, const int32_t kiFixedMvd,
|
uint16_t* pMvdTable, const int32_t kiFixedMvd,
|
||||||
const int32_t kiEncStride, const int32_t kiRefStride,
|
const int32_t kiEncStride, const int32_t kiRefStride,
|
||||||
const int32_t kiMinPos, const int32_t kiMaxPos,
|
const int32_t kiMinPos, const int32_t kiMaxPos,
|
||||||
const bool bVerticalSearch )
|
const bool bVerticalSearch) {
|
||||||
{
|
|
||||||
uint8_t* kpEncMb = pMe->pEncMb;
|
uint8_t* kpEncMb = pMe->pEncMb;
|
||||||
const int32_t kiCurMeBlockPix = pMe->iCurMeBlockPixX;
|
const int32_t kiCurMeBlockPix = pMe->iCurMeBlockPixX;
|
||||||
uint8_t* pRef = &pMe->pColoRefMb[kiMinPos - kiCurMeBlockPix];
|
uint8_t* pRef = &pMe->pColoRefMb[kiMinPos - kiCurMeBlockPix];
|
||||||
@@ -525,7 +527,8 @@ void WelsMotionCrossSearch(SWelsFuncPtrList *pFuncList, SWelsME * pMe,
|
|||||||
// Feature Search Basics
|
// Feature Search Basics
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
//memory related
|
//memory related
|
||||||
int32_t RequestFeatureSearchPreparation( CMemoryAlign *pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight, const int32_t iNeedFeatureStorage,
|
int32_t RequestFeatureSearchPreparation (CMemoryAlign* pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight,
|
||||||
|
const int32_t iNeedFeatureStorage,
|
||||||
SFeatureSearchPreparation* pFeatureSearchPreparation) {
|
SFeatureSearchPreparation* pFeatureSearchPreparation) {
|
||||||
const int32_t kiFeatureStrategyIndex = iNeedFeatureStorage >> 16;
|
const int32_t kiFeatureStrategyIndex = iNeedFeatureStorage >> 16;
|
||||||
const bool bFme8x8 = ((iNeedFeatureStorage & 0x0000FF & ME_FME) == ME_FME);
|
const bool bFme8x8 = ((iNeedFeatureStorage & 0x0000FF & ME_FME) == ME_FME);
|
||||||
@@ -559,7 +562,8 @@ int32_t ReleaseFeatureSearchPreparation( CMemoryAlign *pMa, uint16_t*& pFeatureO
|
|||||||
return ENC_RETURN_UNEXPECTED;
|
return ENC_RETURN_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t RequestScreenBlockFeatureStorage( CMemoryAlign *pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight, const int32_t iNeedFeatureStorage,
|
int32_t RequestScreenBlockFeatureStorage (CMemoryAlign* pMa, const int32_t kiFrameWidth, const int32_t kiFrameHeight,
|
||||||
|
const int32_t iNeedFeatureStorage,
|
||||||
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage) {
|
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage) {
|
||||||
|
|
||||||
const int32_t kiFeatureStrategyIndex = iNeedFeatureStorage >> 16;
|
const int32_t kiFeatureStrategyIndex = iNeedFeatureStorage >> 16;
|
||||||
@@ -573,15 +577,19 @@ int32_t RequestScreenBlockFeatureStorage( CMemoryAlign *pMa, const int32_t kiFra
|
|||||||
const bool bIsBlock8x8 = (kiMe8x8FME == ME_FME);
|
const bool bIsBlock8x8 = (kiMe8x8FME == ME_FME);
|
||||||
const int32_t kiMarginSize = bIsBlock8x8 ? 8 : 16;
|
const int32_t kiMarginSize = bIsBlock8x8 ? 8 : 16;
|
||||||
const int32_t kiFrameSize = (kiFrameWidth - kiMarginSize) * (kiFrameHeight - kiMarginSize);
|
const int32_t kiFrameSize = (kiFrameWidth - kiMarginSize) * (kiFrameHeight - kiMarginSize);
|
||||||
const int32_t kiListSize = (0==kiFeatureStrategyIndex)?(bIsBlock8x8 ? LIST_SIZE_SUM_8x8 : LIST_SIZE_SUM_16x16):256;
|
const int32_t kiListSize = (0 == kiFeatureStrategyIndex) ? (bIsBlock8x8 ? LIST_SIZE_SUM_8x8 : LIST_SIZE_SUM_16x16) :
|
||||||
|
256;
|
||||||
|
|
||||||
pScreenBlockFeatureStorage->pTimesOfFeatureValue = (uint32_t*)pMa->WelsMalloc(kiListSize*sizeof(uint32_t),"pScreenBlockFeatureStorage->pTimesOfFeatureValue");
|
pScreenBlockFeatureStorage->pTimesOfFeatureValue = (uint32_t*)pMa->WelsMalloc (kiListSize * sizeof (uint32_t),
|
||||||
|
"pScreenBlockFeatureStorage->pTimesOfFeatureValue");
|
||||||
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pTimesOfFeatureValue)
|
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pTimesOfFeatureValue)
|
||||||
|
|
||||||
pScreenBlockFeatureStorage->pLocationOfFeature = (uint16_t**)pMa->WelsMalloc(kiListSize*sizeof(uint16_t*),"pScreenBlockFeatureStorage->pLocationOfFeature");
|
pScreenBlockFeatureStorage->pLocationOfFeature = (uint16_t**)pMa->WelsMalloc (kiListSize * sizeof (uint16_t*),
|
||||||
|
"pScreenBlockFeatureStorage->pLocationOfFeature");
|
||||||
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pLocationOfFeature)
|
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pLocationOfFeature)
|
||||||
|
|
||||||
pScreenBlockFeatureStorage->pLocationPointer = (uint16_t*)pMa->WelsMalloc(2*kiFrameSize*sizeof(uint16_t), "pScreenBlockFeatureStorage->pLocationPointer");
|
pScreenBlockFeatureStorage->pLocationPointer = (uint16_t*)pMa->WelsMalloc (2 * kiFrameSize * sizeof (uint16_t),
|
||||||
|
"pScreenBlockFeatureStorage->pLocationPointer");
|
||||||
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pLocationPointer)
|
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pLocationPointer)
|
||||||
|
|
||||||
pScreenBlockFeatureStorage->pFeatureOfBlockPointer = NULL;
|
pScreenBlockFeatureStorage->pFeatureOfBlockPointer = NULL;
|
||||||
@@ -637,9 +645,9 @@ int32_t SumOf16x16SingleBlock_c(uint8_t* pRef, const int32_t kiRefStride) {
|
|||||||
return iSum;
|
return iSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SumOf8x8BlockOfFrame_c(uint8_t *pRefPicture, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
|
void SumOf8x8BlockOfFrame_c (uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[])
|
const int32_t kiRefStride,
|
||||||
{
|
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]) {
|
||||||
int32_t x, y;
|
int32_t x, y;
|
||||||
uint8_t* pRef;
|
uint8_t* pRef;
|
||||||
uint16_t* pBuffer;
|
uint16_t* pBuffer;
|
||||||
@@ -656,9 +664,10 @@ void SumOf8x8BlockOfFrame_c(uint8_t *pRefPicture, const int32_t kiWidth, const i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SumOf16x16BlockOfFrame_c(uint8_t *pRefPicture, const int32_t kiWidth, const int32_t kiHeight, const int32_t kiRefStride,
|
void SumOf16x16BlockOfFrame_c (uint8_t* pRefPicture, const int32_t kiWidth, const int32_t kiHeight,
|
||||||
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[])
|
const int32_t kiRefStride,
|
||||||
{//TODO: this is similar to SumOf8x8BlockOfFrame_c expect the calling of single block func, refactor-able?
|
uint16_t* pFeatureOfBlock, uint32_t pTimesOfFeatureValue[]) {
|
||||||
|
//TODO: this is similar to SumOf8x8BlockOfFrame_c expect the calling of single block func, refactor-able?
|
||||||
int32_t x, y;
|
int32_t x, y;
|
||||||
uint8_t* pRef;
|
uint8_t* pRef;
|
||||||
uint16_t* pBuffer;
|
uint16_t* pBuffer;
|
||||||
@@ -718,7 +727,8 @@ void CalculateFeatureOfBlock( SWelsFuncPtrList *pFunc, SPicture* pRef,
|
|||||||
uint16_t* pFeatureValuePointerList[WELS_MAX (LIST_SIZE_SUM_16x16, LIST_SIZE_MSE_16x16)] = {0};
|
uint16_t* pFeatureValuePointerList[WELS_MAX (LIST_SIZE_SUM_16x16, LIST_SIZE_MSE_16x16)] = {0};
|
||||||
|
|
||||||
memset (pTimesOfFeatureValue, 0, sizeof (int32_t)*kiActualListSize);
|
memset (pTimesOfFeatureValue, 0, sizeof (int32_t)*kiActualListSize);
|
||||||
(pFunc->pfCalculateBlockFeatureOfFrame[iIs16x16])(pRefData,iWidth, kiHeight, iRefStride, pFeatureOfBlock, pTimesOfFeatureValue);
|
(pFunc->pfCalculateBlockFeatureOfFrame[iIs16x16]) (pRefData, iWidth, kiHeight, iRefStride, pFeatureOfBlock,
|
||||||
|
pTimesOfFeatureValue);
|
||||||
|
|
||||||
//assign pLocationOfFeature pointer
|
//assign pLocationOfFeature pointer
|
||||||
InitializeHashforFeature_c (pTimesOfFeatureValue, pBuf, kiActualListSize,
|
InitializeHashforFeature_c (pTimesOfFeatureValue, pBuf, kiActualListSize,
|
||||||
@@ -729,8 +739,7 @@ void CalculateFeatureOfBlock( SWelsFuncPtrList *pFunc, SPicture* pRef,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PerformFMEPreprocess (SWelsFuncPtrList* pFunc, SPicture* pRef, uint16_t* pFeatureOfBlock,
|
void PerformFMEPreprocess (SWelsFuncPtrList* pFunc, SPicture* pRef, uint16_t* pFeatureOfBlock,
|
||||||
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage)
|
SScreenBlockFeatureStorage* pScreenBlockFeatureStorage) {
|
||||||
{
|
|
||||||
pScreenBlockFeatureStorage->pFeatureOfBlockPointer = pFeatureOfBlock;
|
pScreenBlockFeatureStorage->pFeatureOfBlockPointer = pFeatureOfBlock;
|
||||||
CalculateFeatureOfBlock (pFunc, pRef, pScreenBlockFeatureStorage);
|
CalculateFeatureOfBlock (pFunc, pRef, pScreenBlockFeatureStorage);
|
||||||
pScreenBlockFeatureStorage->bRefBlockFeatureCalculated = true;
|
pScreenBlockFeatureStorage->bRefBlockFeatureCalculated = true;
|
||||||
@@ -750,7 +759,8 @@ void SetFeatureSearchIn( SWelsFuncPtrList *pFunc, const SWelsME& sMe,
|
|||||||
const int32_t kiEncStride, const int32_t kiRefStride,
|
const int32_t kiEncStride, const int32_t kiRefStride,
|
||||||
SFeatureSearchIn* pFeatureSearchIn) {
|
SFeatureSearchIn* pFeatureSearchIn) {
|
||||||
pFeatureSearchIn->pSad = pFunc->sSampleDealingFuncs.pfSampleSad[sMe.uiBlockSize];
|
pFeatureSearchIn->pSad = pFunc->sSampleDealingFuncs.pfSampleSad[sMe.uiBlockSize];
|
||||||
pFeatureSearchIn->iFeatureOfCurrent=pFunc->pfCalculateSingleBlockFeature[BLOCK_16x16==sMe.uiBlockSize](sMe.pEncMb, kiEncStride);
|
pFeatureSearchIn->iFeatureOfCurrent = pFunc->pfCalculateSingleBlockFeature[BLOCK_16x16 == sMe.uiBlockSize] (sMe.pEncMb,
|
||||||
|
kiEncStride);
|
||||||
|
|
||||||
pFeatureSearchIn->pEnc = sMe.pEncMb;
|
pFeatureSearchIn->pEnc = sMe.pEncMb;
|
||||||
pFeatureSearchIn->pColoRef = sMe.pColoRefMb;
|
pFeatureSearchIn->pColoRef = sMe.pColoRefMb;
|
||||||
@@ -773,13 +783,15 @@ void SetFeatureSearchIn( SWelsFuncPtrList *pFunc, const SWelsME& sMe,
|
|||||||
pFeatureSearchIn->iMaxQpelX = pFeatureSearchIn->iCurPixXQpel + ((pSlice->sMvStartMax.iMvX) << 2);
|
pFeatureSearchIn->iMaxQpelX = pFeatureSearchIn->iCurPixXQpel + ((pSlice->sMvStartMax.iMvX) << 2);
|
||||||
pFeatureSearchIn->iMaxQpelY = pFeatureSearchIn->iCurPixYQpel + ((pSlice->sMvStartMax.iMvY) << 2);
|
pFeatureSearchIn->iMaxQpelY = pFeatureSearchIn->iCurPixYQpel + ((pSlice->sMvStartMax.iMvY) << 2);
|
||||||
}
|
}
|
||||||
void SaveFeatureSearchOut( const SMVUnitXY sBestMv, const uint32_t uiBestSadCost, uint8_t* pRef, SFeatureSearchOut* pFeatureSearchOut) {
|
void SaveFeatureSearchOut (const SMVUnitXY sBestMv, const uint32_t uiBestSadCost, uint8_t* pRef,
|
||||||
|
SFeatureSearchOut* pFeatureSearchOut) {
|
||||||
pFeatureSearchOut->sBestMv = sBestMv;
|
pFeatureSearchOut->sBestMv = sBestMv;
|
||||||
pFeatureSearchOut->uiBestSadCost = uiBestSadCost;
|
pFeatureSearchOut->uiBestSadCost = uiBestSadCost;
|
||||||
pFeatureSearchOut->pBestRef = pRef;
|
pFeatureSearchOut->pBestRef = pRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FeatureSearchOne( SFeatureSearchIn &sFeatureSearchIn, const int32_t iFeatureDifference, const uint32_t kuiExpectedSearchTimes,
|
bool FeatureSearchOne (SFeatureSearchIn& sFeatureSearchIn, const int32_t iFeatureDifference,
|
||||||
|
const uint32_t kuiExpectedSearchTimes,
|
||||||
SFeatureSearchOut* pFeatureSearchOut) {
|
SFeatureSearchOut* pFeatureSearchOut) {
|
||||||
const int32_t iFeatureOfRef = (sFeatureSearchIn.iFeatureOfCurrent + iFeatureDifference);
|
const int32_t iFeatureOfRef = (sFeatureSearchIn.iFeatureOfCurrent + iFeatureDifference);
|
||||||
if (iFeatureOfRef < 0 || iFeatureOfRef >= LIST_SIZE)
|
if (iFeatureOfRef < 0 || iFeatureOfRef >= LIST_SIZE)
|
||||||
@@ -905,7 +917,8 @@ void UpdateFMESwitchNull(SDqLayer* pCurLayer) {
|
|||||||
/////////////////////////
|
/////////////////////////
|
||||||
// Search function options
|
// Search function options
|
||||||
/////////////////////////
|
/////////////////////////
|
||||||
void WelsDiamondCrossSearch(SWelsFuncPtrList *pFunc, void* vpMe, void* vpSlice, const int32_t kiEncStride, const int32_t kiRefStride) {
|
void WelsDiamondCrossSearch (SWelsFuncPtrList* pFunc, void* vpMe, void* vpSlice, const int32_t kiEncStride,
|
||||||
|
const int32_t kiRefStride) {
|
||||||
SWelsME* pMe = static_cast<SWelsME*> (vpMe);
|
SWelsME* pMe = static_cast<SWelsME*> (vpMe);
|
||||||
SSlice* pSlice = static_cast<SSlice*> (vpSlice);
|
SSlice* pSlice = static_cast<SSlice*> (vpSlice);
|
||||||
|
|
||||||
@@ -919,7 +932,8 @@ void WelsDiamondCrossSearch(SWelsFuncPtrList *pFunc, void* vpMe, void* vpSlice,
|
|||||||
WelsMotionCrossSearch (pFunc, pMe, pSlice, kiEncStride, kiRefStride);
|
WelsMotionCrossSearch (pFunc, pMe, pSlice, kiEncStride, kiRefStride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void WelsDiamondCrossFeatureSearch(SWelsFuncPtrList *pFunc, void* vpMe, void* vpSlice, const int32_t kiEncStride, const int32_t kiRefStride) {
|
void WelsDiamondCrossFeatureSearch (SWelsFuncPtrList* pFunc, void* vpMe, void* vpSlice, const int32_t kiEncStride,
|
||||||
|
const int32_t kiRefStride) {
|
||||||
SWelsME* pMe = static_cast<SWelsME*> (vpMe);
|
SWelsME* pMe = static_cast<SWelsME*> (vpMe);
|
||||||
SSlice* pSlice = static_cast<SSlice*> (vpSlice);
|
SSlice* pSlice = static_cast<SSlice*> (vpSlice);
|
||||||
|
|
||||||
|
|||||||
@@ -208,8 +208,7 @@ void WelsSpatialWriteSubMbPred (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CheckBitstreamBuffer(const uint8_t kuiSliceIdx, sWelsEncCtx* pEncCtx, SBitStringAux* pBs)
|
int32_t CheckBitstreamBuffer (const uint8_t kuiSliceIdx, sWelsEncCtx* pEncCtx, SBitStringAux* pBs) {
|
||||||
{
|
|
||||||
const int32_t iLeftLength = pBs->pBufEnd - pBs->pBufPtr - 1;
|
const int32_t iLeftLength = pBs->pBufEnd - pBs->pBufPtr - 1;
|
||||||
assert (iLeftLength > 0);
|
assert (iLeftLength > 0);
|
||||||
|
|
||||||
|
|||||||
@@ -1047,7 +1047,8 @@ ESceneChangeIdc CWelsPreProcess::DetectSceneChangeScreen (sWelsEncCtx* pCtx, SPi
|
|||||||
iVaaFrameSceneChangeIdc = SIMILAR_SCENE;
|
iVaaFrameSceneChangeIdc = SIMILAR_SCENE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WelsLog(pCtx,WELS_LOG_INFO,"iVaaFrameSceneChangeIdc = %d,codingIdx = %d\n",iVaaFrameSceneChangeIdc,pCtx->iCodingIndex);
|
WelsLog (pCtx, WELS_LOG_INFO, "iVaaFrameSceneChangeIdc = %d,codingIdx = %d\n", iVaaFrameSceneChangeIdc,
|
||||||
|
pCtx->iCodingIndex);
|
||||||
|
|
||||||
SaveBestRefToVaa (sLtrSaved, & (pVaaExt->sVaaStrBestRefCandidate[0]));
|
SaveBestRefToVaa (sLtrSaved, & (pVaaExt->sVaaStrBestRefCandidate[0]));
|
||||||
|
|
||||||
|
|||||||
@@ -443,8 +443,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr
|
|||||||
if (kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
|
if (kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
|
||||||
WelsUninitEncoderExt (&m_pEncContext);
|
WelsUninitEncoderExt (&m_pEncContext);
|
||||||
return cmMallocMemeError;
|
return cmMallocMemeError;
|
||||||
}
|
} else if ((kiEncoderReturn != ENC_RETURN_SUCCESS) && (kiEncoderReturn == ENC_RETURN_CORRECTED)) {
|
||||||
else if((kiEncoderReturn != ENC_RETURN_SUCCESS)&&(kiEncoderReturn == ENC_RETURN_CORRECTED)){
|
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn);
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn);
|
||||||
return cmUnkonwReason;
|
return cmUnkonwReason;
|
||||||
}
|
}
|
||||||
@@ -709,7 +708,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
m_uiCountFrameNum, m_iCspInternal, iValue);
|
m_uiCountFrameNum, m_iCspInternal, iValue);
|
||||||
#endif//REC_FRAME_COUNT
|
#endif//REC_FRAME_COUNT
|
||||||
if (iBitrate <= 0) {
|
if (iBitrate <= 0) {
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n",iBitrate);
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n",
|
||||||
|
iBitrate);
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
}
|
}
|
||||||
iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
|
iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
|
||||||
@@ -730,7 +730,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
m_pEncContext->pSvcParam->sSpatialLayers[3].iSpatialBitrate = iBitrate;
|
m_pEncContext->pSvcParam->sSpatialLayers[3].iSpatialBitrate = iBitrate;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n",pInfo->iLayer);
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n",
|
||||||
|
pInfo->iLayer);
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -748,7 +749,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
m_uiCountFrameNum, m_iCspInternal, iValue);
|
m_uiCountFrameNum, m_iCspInternal, iValue);
|
||||||
#endif//REC_FRAME_COUNT
|
#endif//REC_FRAME_COUNT
|
||||||
if (iBitrate <= 0) {
|
if (iBitrate <= 0) {
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n",iBitrate);
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n",
|
||||||
|
iBitrate);
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
}
|
}
|
||||||
iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
|
iBitrate = WELS_CLIP3 (iBitrate, MIN_BIT_RATE, MAX_BIT_RATE);
|
||||||
@@ -769,7 +771,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
m_pEncContext->pSvcParam->sSpatialLayers[3].iMaxSpatialBitrate = iBitrate;
|
m_pEncContext->pSvcParam->sSpatialLayers[3].iMaxSpatialBitrate = iBitrate;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WelsLog (m_pEncContext, WELS_LOG_ERROR,"CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n",pInfo->iLayer);
|
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n",
|
||||||
|
pInfo->iLayer);
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -842,7 +845,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
#ifdef ENABLE_FRAME_DUMP
|
#ifdef ENABLE_FRAME_DUMP
|
||||||
if (m_pEncContext->pSvcParam != NULL) {
|
if (m_pEncContext->pSvcParam != NULL) {
|
||||||
SDumpLayer* pDump = (static_cast<SDumpLayer*> (pOption));
|
SDumpLayer* pDump = (static_cast<SDumpLayer*> (pOption));
|
||||||
WelsStrncpy(m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName, sizeof(m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName),pDump->pFileName);
|
WelsStrncpy (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName,
|
||||||
|
sizeof (m_pEncContext->pSvcParam->sDependencyLayers[pDump->iLayer].sRecFileName), pDump->pFileName);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -928,7 +932,8 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
m_uiCountFrameNum, m_iCspInternal);
|
m_uiCountFrameNum, m_iCspInternal);
|
||||||
#endif//REC_FRAME_COUNT
|
#endif//REC_FRAME_COUNT
|
||||||
SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
|
SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
|
||||||
if((pInfo->iLayer!=SPATIAL_LAYER_ALL)&&(pInfo->iLayer!=SPATIAL_LAYER_0)&&(pInfo->iLayer!=SPATIAL_LAYER_1)&&(pInfo->iLayer!=SPATIAL_LAYER_2)&&(pInfo->iLayer!=SPATIAL_LAYER_3))
|
if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
|
||||||
|
&& (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
|
if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
|
||||||
pInfo->iBitrate = m_pEncContext->pSvcParam->iTargetBitrate;
|
pInfo->iBitrate = m_pEncContext->pSvcParam->iTargetBitrate;
|
||||||
@@ -939,11 +944,13 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
|||||||
break;
|
break;
|
||||||
case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
|
case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate
|
||||||
#ifdef REC_FRAME_COUNT
|
#ifdef REC_FRAME_COUNT
|
||||||
WelsLog (m_pEncContext, WELS_LOG_INFO,"CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
|
WelsLog (m_pEncContext, WELS_LOG_INFO,
|
||||||
|
"CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n",
|
||||||
m_uiCountFrameNum, m_iCspInternal);
|
m_uiCountFrameNum, m_iCspInternal);
|
||||||
#endif//REC_FRAME_COUNT
|
#endif//REC_FRAME_COUNT
|
||||||
SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
|
SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption));
|
||||||
if((pInfo->iLayer!=SPATIAL_LAYER_ALL)&&(pInfo->iLayer!=SPATIAL_LAYER_0)&&(pInfo->iLayer!=SPATIAL_LAYER_1)&&(pInfo->iLayer!=SPATIAL_LAYER_2)&&(pInfo->iLayer!=SPATIAL_LAYER_3))
|
if ((pInfo->iLayer != SPATIAL_LAYER_ALL) && (pInfo->iLayer != SPATIAL_LAYER_0) && (pInfo->iLayer != SPATIAL_LAYER_1)
|
||||||
|
&& (pInfo->iLayer != SPATIAL_LAYER_2) && (pInfo->iLayer != SPATIAL_LAYER_3))
|
||||||
return cmInitParaError;
|
return cmInitParaError;
|
||||||
if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
|
if (pInfo->iLayer == SPATIAL_LAYER_ALL) {
|
||||||
pInfo->iBitrate = m_pEncContext->pSvcParam->iMaxBitrate;
|
pInfo->iBitrate = m_pEncContext->pSvcParam->iMaxBitrate;
|
||||||
|
|||||||
@@ -216,8 +216,7 @@ typedef enum {
|
|||||||
GOM_VAR = -2
|
GOM_VAR = -2
|
||||||
} EComplexityAnalysisMode;
|
} EComplexityAnalysisMode;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
int iScrollMvX;
|
int iScrollMvX;
|
||||||
int iScrollMvY;
|
int iScrollMvY;
|
||||||
bool bScrollDetectFlag; // 0:false ; 1:ltr; 2: scene change
|
bool bScrollDetectFlag; // 0:false ; 1:ltr; 2: scene change
|
||||||
@@ -235,8 +234,7 @@ typedef struct {
|
|||||||
SVAACalcResult* pCalcResult;
|
SVAACalcResult* pCalcResult;
|
||||||
} SComplexityAnalysisParam;
|
} SComplexityAnalysisParam;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
int iMbRowInGom;
|
int iMbRowInGom;
|
||||||
int* pGomComplexity;
|
int* pGomComplexity;
|
||||||
int iGomNumInFrame;
|
int iGomNumInFrame;
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ class CComplexityAnalysis : public IStrategy {
|
|||||||
|
|
||||||
//for screen content
|
//for screen content
|
||||||
|
|
||||||
class CComplexityAnalysisScreen : public IStrategy
|
class CComplexityAnalysisScreen : public IStrategy {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
CComplexityAnalysisScreen (int32_t cpu_flag);
|
CComplexityAnalysisScreen (int32_t cpu_flag);
|
||||||
~CComplexityAnalysisScreen();
|
~CComplexityAnalysisScreen();
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ HalveDownsampleFunc DyadicBilinearDownsamplerWidthx32_neon;
|
|||||||
|
|
||||||
GeneralDownsampleFunc GeneralBilinearAccurateDownsamplerWrap_neon;
|
GeneralDownsampleFunc GeneralBilinearAccurateDownsamplerWrap_neon;
|
||||||
|
|
||||||
void GeneralBilinearAccurateDownsampler_neon( uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight,
|
void GeneralBilinearAccurateDownsampler_neon (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth,
|
||||||
|
const int32_t kiDstHeight,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride, const uint32_t kuiScaleX, const uint32_t kuiScaleY);
|
uint8_t* pSrc, const int32_t kiSrcStride, const uint32_t kuiScaleX, const uint32_t kuiScaleY);
|
||||||
|
|
||||||
WELSVP_EXTERN_C_END
|
WELSVP_EXTERN_C_END
|
||||||
|
|||||||
@@ -230,13 +230,15 @@ void GeneralBilinearAccurateDownsampler_c (uint8_t* pDst, const int32_t kiDstStr
|
|||||||
#endif //X86_ASM
|
#endif //X86_ASM
|
||||||
|
|
||||||
#ifdef HAVE_NEON
|
#ifdef HAVE_NEON
|
||||||
void GeneralBilinearAccurateDownsamplerWrap_neon(uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth, const int32_t kiDstHeight,
|
void GeneralBilinearAccurateDownsamplerWrap_neon (uint8_t* pDst, const int32_t kiDstStride, const int32_t kiDstWidth,
|
||||||
|
const int32_t kiDstHeight,
|
||||||
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
uint8_t* pSrc, const int32_t kiSrcStride, const int32_t kiSrcWidth, const int32_t kiSrcHeight) {
|
||||||
const int32_t kiScaleBit = 15;
|
const int32_t kiScaleBit = 15;
|
||||||
const uint32_t kuiScale = (1 << kiScaleBit);
|
const uint32_t kuiScale = (1 << kiScaleBit);
|
||||||
uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
|
uint32_t uiScalex = (uint32_t) ((float)kiSrcWidth / (float)kiDstWidth * kuiScale);
|
||||||
uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
|
uint32_t uiScaley = (uint32_t) ((float)kiSrcHeight / (float)kiDstHeight * kuiScale);
|
||||||
GeneralBilinearAccurateDownsampler_neon(pDst, kiDstStride, kiDstWidth, kiDstHeight, pSrc, kiSrcStride, uiScalex, uiScaley);
|
GeneralBilinearAccurateDownsampler_neon (pDst, kiDstStride, kiDstWidth, kiDstHeight, pSrc, kiSrcStride, uiScalex,
|
||||||
|
uiScaley);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
WELSVP_NAMESPACE_END
|
WELSVP_NAMESPACE_END
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ protected:
|
|||||||
|
|
||||||
class CSceneChangeDetectorScreen : public CSceneChangeDetectorVideo {
|
class CSceneChangeDetectorScreen : public CSceneChangeDetectorVideo {
|
||||||
public:
|
public:
|
||||||
CSceneChangeDetectorScreen(SSceneChangeResult & sParam, int32_t iCpuFlag) : CSceneChangeDetectorVideo(sParam, iCpuFlag) {
|
CSceneChangeDetectorScreen (SSceneChangeResult& sParam, int32_t iCpuFlag) : CSceneChangeDetectorVideo (sParam,
|
||||||
|
iCpuFlag) {
|
||||||
}
|
}
|
||||||
virtual ~CSceneChangeDetectorScreen() {
|
virtual ~CSceneChangeDetectorScreen() {
|
||||||
}
|
}
|
||||||
@@ -117,8 +118,10 @@ class CSceneChangeDetection : public IStrategy {
|
|||||||
int32_t iBlock8x8Width = iWidth >> 3;
|
int32_t iBlock8x8Width = iWidth >> 3;
|
||||||
int32_t iBlock8x8Height = iHeight >> 3;
|
int32_t iBlock8x8Height = iHeight >> 3;
|
||||||
int32_t iBlock8x8Num = iBlock8x8Width * iBlock8x8Height;
|
int32_t iBlock8x8Num = iBlock8x8Width * iBlock8x8Height;
|
||||||
int32_t iSceneChangeThresholdLarge = WelsStaticCast (int32_t, SCENE_CHANGE_MOTION_RATIO_LARGE * iBlock8x8Num + 0.5f + PESN);
|
int32_t iSceneChangeThresholdLarge = WelsStaticCast (int32_t,
|
||||||
int32_t iSceneChangeThresholdMedium = WelsStaticCast(int32_t, SCENE_CHANGE_MOTION_RATIO_MEDIUM * iBlock8x8Num + 0.5f + PESN);
|
SCENE_CHANGE_MOTION_RATIO_LARGE * iBlock8x8Num + 0.5f + PESN);
|
||||||
|
int32_t iSceneChangeThresholdMedium = WelsStaticCast (int32_t,
|
||||||
|
SCENE_CHANGE_MOTION_RATIO_MEDIUM * iBlock8x8Num + 0.5f + PESN);
|
||||||
uint8_t* pRefY = NULL, *pCurY = NULL;
|
uint8_t* pRefY = NULL, *pCurY = NULL;
|
||||||
int32_t iRefStride = 0, iCurStride = 0;
|
int32_t iRefStride = 0, iCurStride = 0;
|
||||||
int32_t iRefRowStride = 0, iCurRowStride = 0;
|
int32_t iRefRowStride = 0, iCurRowStride = 0;
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ WELSVP_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
EResult CScrollDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) {
|
EResult CScrollDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) {
|
||||||
if (pRefPixMap->pPixel[0] == NULL || pSrcPixMap->pPixel[0] == NULL ||
|
if (pRefPixMap->pPixel[0] == NULL || pSrcPixMap->pPixel[0] == NULL ||
|
||||||
pRefPixMap->sRect.iRectWidth != pSrcPixMap->sRect.iRectWidth || pRefPixMap->sRect.iRectHeight != pSrcPixMap->sRect.iRectHeight){
|
pRefPixMap->sRect.iRectWidth != pSrcPixMap->sRect.iRectWidth
|
||||||
|
|| pRefPixMap->sRect.iRectHeight != pSrcPixMap->sRect.iRectHeight) {
|
||||||
return RET_INVALIDPARAM;
|
return RET_INVALIDPARAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,8 +95,7 @@ int32_t SelectTestLine(uint8_t* pY, int32_t iWidth, int32_t iHeight, int32_t iPi
|
|||||||
* compare pixel line between previous and current one
|
* compare pixel line between previous and current one
|
||||||
* return: 0 for totally equal, otherwise 1
|
* return: 0 for totally equal, otherwise 1
|
||||||
*/
|
*/
|
||||||
int32_t CompareLine(uint8_t *pYSrc, uint8_t *pYRef, const int32_t kiWidth)
|
int32_t CompareLine (uint8_t* pYSrc, uint8_t* pYRef, const int32_t kiWidth) {
|
||||||
{
|
|
||||||
int32_t iCmp = 1;
|
int32_t iCmp = 1;
|
||||||
|
|
||||||
if (* ((int32_t*)pYSrc) != * ((int32_t*)pYRef)) return 1;
|
if (* ((int32_t*)pYSrc) != * ((int32_t*)pYRef)) return 1;
|
||||||
@@ -163,8 +162,7 @@ void ScrollDetectionCore(SPixMap* pSrcPixMap, SPixMap* pRefPixMap, int32_t iWidt
|
|||||||
iSearchPos = iTestPos - iOffsetAbs - 1;
|
iSearchPos = iTestPos - iOffsetAbs - 1;
|
||||||
if (iSearchPos >= iMinHeight) {
|
if (iSearchPos >= iMinHeight) {
|
||||||
pYTmp = pYRef + iSearchPos * iYStride + iOffsetX;
|
pYTmp = pYRef + iSearchPos * iYStride + iOffsetX;
|
||||||
if (!CompareLine(pYLine, pYTmp, iWidth))
|
if (!CompareLine (pYLine, pYTmp, iWidth)) {
|
||||||
{
|
|
||||||
uint8_t* pYUpper, *pYLineUpper;
|
uint8_t* pYUpper, *pYLineUpper;
|
||||||
int32_t iCheckedLines;
|
int32_t iCheckedLines;
|
||||||
int32_t iUpOffset = WELS_MIN (iSearchPos - iMinHeight, CHECK_OFFSET);
|
int32_t iUpOffset = WELS_MIN (iSearchPos - iMinHeight, CHECK_OFFSET);
|
||||||
@@ -191,8 +189,7 @@ void ScrollDetectionCore(SPixMap* pSrcPixMap, SPixMap* pRefPixMap, int32_t iWidt
|
|||||||
|
|
||||||
if (!bScrollDetected) {
|
if (!bScrollDetected) {
|
||||||
sScrollDetectionParam.bScrollDetectFlag = 0;
|
sScrollDetectionParam.bScrollDetectFlag = 0;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
sScrollDetectionParam.bScrollDetectFlag = 1;
|
sScrollDetectionParam.bScrollDetectFlag = 1;
|
||||||
sScrollDetectionParam.iScrollMvY = iSearchPos - iTestPos; // pre_pos - cur_pos, change to mv
|
sScrollDetectionParam.iScrollMvY = iSearchPos - iTestPos; // pre_pos - cur_pos, change to mv
|
||||||
sScrollDetectionParam.iScrollMvX = 0;
|
sScrollDetectionParam.iScrollMvX = 0;
|
||||||
|
|||||||
@@ -34,7 +34,8 @@
|
|||||||
|
|
||||||
WELSVP_NAMESPACE_BEGIN
|
WELSVP_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void VAACalcSadSsd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight, int32_t iPicStride,
|
void VAACalcSadSsd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
||||||
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* psqsum16x16, int32_t* psqdiff16x16) {
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* psqsum16x16, int32_t* psqdiff16x16) {
|
||||||
const uint8_t* tmp_ref = pRefData;
|
const uint8_t* tmp_ref = pRefData;
|
||||||
const uint8_t* tmp_cur = pCurData;
|
const uint8_t* tmp_cur = pCurData;
|
||||||
@@ -145,7 +146,8 @@ void VAACalcSadSsd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t
|
|||||||
tmp_cur += step;
|
tmp_cur += step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void VAACalcSadVar_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight, int32_t iPicStride,
|
void VAACalcSadVar_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
||||||
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* psqsum16x16) {
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* psqsum16x16) {
|
||||||
const uint8_t* tmp_ref = pRefData;
|
const uint8_t* tmp_ref = pRefData;
|
||||||
const uint8_t* tmp_cur = pCurData;
|
const uint8_t* tmp_cur = pCurData;
|
||||||
@@ -249,7 +251,8 @@ void VAACalcSadVar_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void VAACalcSad_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight, int32_t iPicStride,
|
void VAACalcSad_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
||||||
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8) {
|
int32_t* pFrameSad, int32_t* pSad8x8) {
|
||||||
const uint8_t* tmp_ref = pRefData;
|
const uint8_t* tmp_ref = pRefData;
|
||||||
const uint8_t* tmp_cur = pCurData;
|
const uint8_t* tmp_cur = pCurData;
|
||||||
@@ -480,7 +483,8 @@ void VAACalcSadSsdBgd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VAACalcSadBgd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight, int32_t iPicStride,
|
void VAACalcSadBgd_c (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
||||||
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSd8x8, uint8_t* pMad8x8) {
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSd8x8, uint8_t* pMad8x8) {
|
||||||
const uint8_t* tmp_ref = pRefData;
|
const uint8_t* tmp_ref = pRefData;
|
||||||
const uint8_t* tmp_cur = pCurData;
|
const uint8_t* tmp_cur = pCurData;
|
||||||
|
|||||||
@@ -49,11 +49,13 @@
|
|||||||
|
|
||||||
WELSVP_NAMESPACE_BEGIN
|
WELSVP_NAMESPACE_BEGIN
|
||||||
|
|
||||||
typedef void (VAACalcSadBgdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
typedef void (VAACalcSadBgdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth,
|
||||||
|
int32_t iPicHeight,
|
||||||
int32_t iPicStride,
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSd8x8, uint8_t* pMad8x8);
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSd8x8, uint8_t* pMad8x8);
|
||||||
|
|
||||||
typedef void (VAACalcSadSsdBgdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
typedef void (VAACalcSadSsdBgdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth,
|
||||||
|
int32_t iPicHeight,
|
||||||
int32_t iPicStride,
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16,
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16,
|
||||||
int32_t* pSsd16x16, int32_t* pSd8x8, uint8_t* pMad8x8);
|
int32_t* pSsd16x16, int32_t* pSd8x8, uint8_t* pMad8x8);
|
||||||
@@ -62,11 +64,13 @@ typedef void (VAACalcSadFunc) (const uint8_t* pCurData, const uint8_t* pRefData,
|
|||||||
int32_t iPicStride,
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8);
|
int32_t* pFrameSad, int32_t* pSad8x8);
|
||||||
|
|
||||||
typedef void (VAACalcSadVarFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
typedef void (VAACalcSadVarFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth,
|
||||||
|
int32_t iPicHeight,
|
||||||
int32_t iPicStride,
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16);
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16);
|
||||||
|
|
||||||
typedef void (VAACalcSadSsdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth, int32_t iPicHeight,
|
typedef void (VAACalcSadSsdFunc) (const uint8_t* pCurData, const uint8_t* pRefData, int32_t iPicWidth,
|
||||||
|
int32_t iPicHeight,
|
||||||
int32_t iPicStride,
|
int32_t iPicStride,
|
||||||
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16, int32_t* pSsd16x16);
|
int32_t* pFrameSad, int32_t* pSad8x8, int32_t* pSum16x16, int32_t* pSumSquare16x16, int32_t* pSsd16x16);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user