add win 64 warnings remove
This commit is contained in:
@@ -48,6 +48,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#ifdef __LP64__
|
||||||
|
typedef int64_t intX_t;
|
||||||
|
#else
|
||||||
|
typedef int32_t intX_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// FIXME: all singed type should be declared explicit, for example, int8_t should be declared as signed char.
|
// FIXME: all singed type should be declared explicit, for example, int8_t should be declared as signed char.
|
||||||
@@ -61,6 +67,12 @@ typedef __int64 int64_t ;
|
|||||||
typedef unsigned __int64 uint64_t;
|
typedef unsigned __int64 uint64_t;
|
||||||
#define PRId64 "I64d"
|
#define PRId64 "I64d"
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
typedef int64_t intX_t;
|
||||||
|
#else
|
||||||
|
typedef int32_t intX_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _MSC_VER defined
|
#endif // _MSC_VER defined
|
||||||
|
|
||||||
// The 'float' type is portable and usable without any need for any extra typedefs.
|
// The 'float' type is portable and usable without any need for any extra typedefs.
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ int32_t WelsStrftime (char* pBuffer, int32_t iSize, const char* kpFormat, const
|
|||||||
|
|
||||||
localtime_s (&sTimeNow, &kpTp->time);
|
localtime_s (&sTimeNow, &kpTp->time);
|
||||||
|
|
||||||
iRc = strftime (pBuffer, iSize, kpFormat, &sTimeNow);
|
iRc = (int32_t)strftime (pBuffer, iSize, kpFormat, &sTimeNow);
|
||||||
if (iRc == 0)
|
if (iRc == 0)
|
||||||
pBuffer[0] = '\0';
|
pBuffer[0] = '\0';
|
||||||
return iRc;
|
return iRc;
|
||||||
@@ -244,12 +244,12 @@ int32_t WelsStrftime (char* pBuffer, int32_t iSize, const char* kpFormat, const
|
|||||||
|
|
||||||
|
|
||||||
char* WelsStrcat (char* pDest, int32_t iSizeInBytes, const char* kpSrc) {
|
char* WelsStrcat (char* pDest, int32_t iSizeInBytes, const char* kpSrc) {
|
||||||
int32_t iCurLen = strlen (pDest);
|
int32_t iCurLen = (int32_t)strlen (pDest);
|
||||||
return WelsStrncpy (pDest + iCurLen, iSizeInBytes - iCurLen, kpSrc);
|
return WelsStrncpy (pDest + iCurLen, iSizeInBytes - iCurLen, kpSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t WelsFwrite (const void* kpBuffer, int32_t iSize, int32_t iCount, WelsFileHandle* pFp) {
|
int32_t WelsFwrite (const void* kpBuffer, int32_t iSize, int32_t iCount, WelsFileHandle* pFp) {
|
||||||
return fwrite (kpBuffer, iSize, iCount, pFp);
|
return (int32_t)fwrite (kpBuffer, iSize, iCount, pFp);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t WelsGetMillisecond (const SWelsTime* kpTp) {
|
uint16_t WelsGetMillisecond (const SWelsTime* kpTp) {
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
|
|||||||
strOutputFile = strTag[1];
|
strOutputFile = strTag[1];
|
||||||
} else if (strTag[0].compare ("RestructionFile") == 0) {
|
} else if (strTag[0].compare ("RestructionFile") == 0) {
|
||||||
strReconFile = strTag[1];
|
strReconFile = strTag[1];
|
||||||
int32_t iLen = strReconFile.length();
|
int32_t iLen = (int32_t)strReconFile.length();
|
||||||
sDecParam.pFileNameRestructed = new char[iLen + 1];
|
sDecParam.pFileNameRestructed = new char[iLen + 1];
|
||||||
if (sDecParam.pFileNameRestructed != NULL) {
|
if (sDecParam.pFileNameRestructed != NULL) {
|
||||||
sDecParam.pFileNameRestructed[iLen] = 0;
|
sDecParam.pFileNameRestructed[iLen] = 0;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ int ParseLayerConfig (CReadConfig& cRdLayerCfg, const int iLayer, SEncParamExt&
|
|||||||
|
|
||||||
string strTag[4];
|
string strTag[4];
|
||||||
string str_ ("SlicesAssign");
|
string str_ ("SlicesAssign");
|
||||||
const int kiSize = str_.size();
|
const int kiSize = (int)str_.size();
|
||||||
|
|
||||||
while (!cRdLayerCfg.EndOfFile()) {
|
while (!cRdLayerCfg.EndOfFile()) {
|
||||||
long iLayerRd = cRdLayerCfg.ReadLine (&strTag[0]);
|
long iLayerRd = cRdLayerCfg.ReadLine (&strTag[0]);
|
||||||
@@ -130,7 +130,7 @@ int ParseLayerConfig (CReadConfig& cRdLayerCfg, const int iLayer, SEncParamExt&
|
|||||||
} else if (strTag[0].compare ("FrameRateOut") == 0) {
|
} else if (strTag[0].compare ("FrameRateOut") == 0) {
|
||||||
pDLayer->fFrameRate = (float)atof (strTag[1].c_str());
|
pDLayer->fFrameRate = (float)atof (strTag[1].c_str());
|
||||||
} else if (strTag[0].compare ("ReconFile") == 0) {
|
} else if (strTag[0].compare ("ReconFile") == 0) {
|
||||||
const unsigned int kiLen = strTag[1].length();
|
const unsigned int kiLen = (unsigned int)strTag[1].length();
|
||||||
if (kiLen >= sizeof (sFileSet.sRecFileName[iLayer]))
|
if (kiLen >= sizeof (sFileSet.sRecFileName[iLayer]))
|
||||||
return -1;
|
return -1;
|
||||||
sFileSet.sRecFileName[iLayer][kiLen] = '\0';
|
sFileSet.sRecFileName[iLayer][kiLen] = '\0';
|
||||||
@@ -436,7 +436,7 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
|||||||
pSvcParam.iLtrMarkPeriod = atoi (argv[n++]);
|
pSvcParam.iLtrMarkPeriod = atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-threadIdc") && (n < argc))
|
else if (!strcmp (pCommand, "-threadIdc") && (n < argc))
|
||||||
pSvcParam.iMultipleThreadIdc= atoi (argv[n++]);
|
pSvcParam.iMultipleThreadIdc = atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-deblockIdc") && (n < argc))
|
else if (!strcmp (pCommand, "-deblockIdc") && (n < argc))
|
||||||
pSvcParam.iLoopFilterDisableIdc = atoi (argv[n++]);
|
pSvcParam.iLoopFilterDisableIdc = atoi (argv[n++]);
|
||||||
@@ -454,15 +454,17 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
|||||||
g_LevelSetting = atoi (argv[n++]);
|
g_LevelSetting = atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-tarb") && (n < argc))
|
else if (!strcmp (pCommand, "-tarb") && (n < argc))
|
||||||
pSvcParam.iTargetBitrate = 1000*atoi (argv[n++]);
|
pSvcParam.iTargetBitrate = 1000 * atoi (argv[n++]);
|
||||||
|
|
||||||
|
else if (!strcmp (pCommand, "-maxbrTotal") && (n < argc))
|
||||||
|
pSvcParam.iMaxBitrate = 1000 * atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-maxbrTotal") && (n < argc))
|
else if (!strcmp (pCommand, "-maxbrTotal") && (n < argc))
|
||||||
pSvcParam.iMaxBitrate = 1000*atoi (argv[n++]);
|
pSvcParam.iMaxBitrate = 1000*atoi (argv[n++]);
|
||||||
|
|
||||||
else if (!strcmp (pCommand, "-numl") && (n < argc)) {
|
else if (!strcmp (pCommand, "-numl") && (n < argc)) {
|
||||||
pSvcParam.iSpatialLayerNum = atoi (argv[n++]);
|
pSvcParam.iSpatialLayerNum = atoi (argv[n++]);
|
||||||
}
|
} else if (!strcmp (pCommand, "-lconfig") && (n < argc)) {
|
||||||
else if (!strcmp (pCommand, "-lconfig") && (n < argc)) {
|
|
||||||
unsigned int iLayer = atoi (argv[n++]);
|
unsigned int iLayer = atoi (argv[n++]);
|
||||||
sFileSet.strLayerCfgFile[iLayer].assign (argv[n++]);
|
sFileSet.strLayerCfgFile[iLayer].assign (argv[n++]);
|
||||||
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
CReadConfig cRdLayerCfg (sFileSet.strLayerCfgFile[iLayer]);
|
||||||
@@ -471,7 +473,7 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
|||||||
}
|
}
|
||||||
} 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 = (unsigned int)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';
|
||||||
@@ -630,7 +632,7 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ProcessEncoding(ISVCEncoder* pPtrEnc, int argc, char** argv,bool bConfigFile) {
|
int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFile) {
|
||||||
int iRet = 0;
|
int iRet = 0;
|
||||||
|
|
||||||
if (pPtrEnc == NULL)
|
if (pPtrEnc == NULL)
|
||||||
@@ -677,7 +679,7 @@ int ProcessEncoding(ISVCEncoder* pPtrEnc, int argc, char** argv,bool bConfigFile
|
|||||||
pSrcPic->uiTimeStamp = 0;
|
pSrcPic->uiTimeStamp = 0;
|
||||||
|
|
||||||
// if configure file exit, reading configure file firstly
|
// if configure file exit, reading configure file firstly
|
||||||
if(bConfigFile){
|
if (bConfigFile) {
|
||||||
iParsedNum = 2;
|
iParsedNum = 2;
|
||||||
cRdCfg.Openf (argv[1]);
|
cRdCfg.Openf (argv[1]);
|
||||||
if (!cRdCfg.ExistFile()) {
|
if (!cRdCfg.ExistFile()) {
|
||||||
@@ -969,7 +971,7 @@ int main (int argc, char** argv)
|
|||||||
} else {
|
} else {
|
||||||
if (!strstr (argv[1], ".cfg")) { // check configuration type (like .cfg?)
|
if (!strstr (argv[1], ".cfg")) { // check configuration type (like .cfg?)
|
||||||
if (argc > 2) {
|
if (argc > 2) {
|
||||||
iRet = ProcessEncoding(pSVCEncoder, argc, argv,false);
|
iRet = ProcessEncoding (pSVCEncoder, argc, argv, false);
|
||||||
if (iRet != 0)
|
if (iRet != 0)
|
||||||
goto exit;
|
goto exit;
|
||||||
} else if (argc == 2 && ! strcmp (argv[1], "-h"))
|
} else if (argc == 2 && ! strcmp (argv[1], "-h"))
|
||||||
@@ -979,7 +981,7 @@ int main (int argc, char** argv)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iRet = ProcessEncoding(pSVCEncoder, argc, argv,true);
|
iRet = ProcessEncoding (pSVCEncoder, argc, argv, true);
|
||||||
if (iRet > 0)
|
if (iRet > 0)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ typedef struct TagBitStringAux {
|
|||||||
uint8_t* pEndBuf; // buffer + length
|
uint8_t* pEndBuf; // buffer + length
|
||||||
int32_t iBits; // count bits of overall bitstreaming input
|
int32_t iBits; // count bits of overall bitstreaming input
|
||||||
|
|
||||||
int32_t iIndex; //only for cavlc usage
|
intX_t iIndex; //only for cavlc usage
|
||||||
uint8_t* pCurBuf; // current reading position
|
uint8_t* pCurBuf; // current reading position
|
||||||
uint32_t uiCurBits;
|
uint32_t uiCurBits;
|
||||||
int32_t iLeftBits; // count number of available bits left ([1, 8]),
|
int32_t iLeftBits; // count number of available bits left ([1, 8]),
|
||||||
|
|||||||
@@ -75,11 +75,11 @@ namespace WelsDec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t* pCode) {
|
static inline int32_t BsGetBits (PBitStringAux pBs, int32_t iNumBits, uint32_t* pCode) {
|
||||||
int32_t iRc = UBITS (pBs->uiCurBits, iNumBits);
|
intX_t iRc = UBITS (pBs->uiCurBits, iNumBits);
|
||||||
int32_t iAllowedBytes = pBs->pEndBuf - pBs->pStartBuf; //actual stream bytes
|
intX_t iAllowedBytes = pBs->pEndBuf - pBs->pStartBuf; //actual stream bytes
|
||||||
int32_t iReadBytes = pBs->pCurBuf - pBs->pStartBuf;
|
intX_t iReadBytes = pBs->pCurBuf - pBs->pStartBuf;
|
||||||
DUMP_BITS (pBs->uiCurBits, pBs->pCurBuf, pBs->iLeftBits, iNumBits, iAllowedBytes, iReadBytes);
|
DUMP_BITS (pBs->uiCurBits, pBs->pCurBuf, pBs->iLeftBits, iNumBits, iAllowedBytes, iReadBytes);
|
||||||
*pCode = iRc;
|
*pCode = (uint32_t)iRc;
|
||||||
return ERR_NONE;
|
return ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ static inline int32_t GetLeadingZeroBits (uint32_t iCurBits) { //<=32 bits
|
|||||||
static inline uint32_t BsGetUe (PBitStringAux pBs, uint32_t* pCode) {
|
static inline uint32_t BsGetUe (PBitStringAux pBs, uint32_t* pCode) {
|
||||||
uint32_t iValue = 0;
|
uint32_t iValue = 0;
|
||||||
int32_t iLeadingZeroBits = GetLeadingZeroBits (pBs->uiCurBits);
|
int32_t iLeadingZeroBits = GetLeadingZeroBits (pBs->uiCurBits);
|
||||||
int32_t iAllowedBytes, iReadBytes;
|
intX_t iAllowedBytes, iReadBytes;
|
||||||
iAllowedBytes = pBs->pEndBuf - pBs->pStartBuf; //actual stream bytes
|
iAllowedBytes = pBs->pEndBuf - pBs->pStartBuf; //actual stream bytes
|
||||||
|
|
||||||
if (iLeadingZeroBits == -1) { //bistream error
|
if (iLeadingZeroBits == -1) { //bistream error
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ uint8_t* DetectStartCodePrefix (const uint8_t* kpBuf, int32_t* pOffset, int32_t
|
|||||||
++ pBits;
|
++ pBits;
|
||||||
|
|
||||||
if ((iIdx >= 3) && ((* (pBits - 1)) == 0x1)) {
|
if ((iIdx >= 3) && ((* (pBits - 1)) == 0x1)) {
|
||||||
*pOffset = ((uintptr_t)pBits) - ((uintptr_t)kpBuf);
|
*pOffset = (int32_t) (((uintptr_t)pBits) - ((uintptr_t)kpBuf));
|
||||||
return pBits;
|
return pBits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer) {
|
|||||||
GetInterPred (pDstY, pDstCb, pDstCr, pCtx);
|
GetInterPred (pDstY, pDstCb, pDstCr, pCtx);
|
||||||
WelsMbInterSampleConstruction (pCtx, pCurLayer, pDstY, pDstCb, pDstCr, iLumaStride, iChromaStride);
|
WelsMbInterSampleConstruction (pCtx, pCurLayer, pDstY, pDstCb, pDstCr, iLumaStride, iChromaStride);
|
||||||
|
|
||||||
pCtx->sBlockFunc.pWelsSetNonZeroCountFunc (pCurLayer->pNzc[pCurLayer->iMbXyIndex]); // set all none-zero nzc to 1; dbk can be opti!
|
pCtx->sBlockFunc.pWelsSetNonZeroCountFunc (
|
||||||
|
pCurLayer->pNzc[pCurLayer->iMbXyIndex]); // set all none-zero nzc to 1; dbk can be opti!
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +323,7 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal
|
|||||||
int32_t iMbX, iMbY;
|
int32_t iMbX, iMbY;
|
||||||
const int32_t kiCountNumMb = pSliceHeader->pSps->uiTotalMbCount; //need to be correct when fmo or multi slice
|
const int32_t kiCountNumMb = pSliceHeader->pSps->uiTotalMbCount; //need to be correct when fmo or multi slice
|
||||||
PBitStringAux pBs = pCurLayer->pBitStringAux;
|
PBitStringAux pBs = pCurLayer->pBitStringAux;
|
||||||
int32_t iUsedBits = 0;
|
intX_t iUsedBits = 0;
|
||||||
|
|
||||||
PWelsDecMbCavlcFunc pDecMbCavlcFunc;
|
PWelsDecMbCavlcFunc pDecMbCavlcFunc;
|
||||||
|
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ int32_t WelsResidualBlockCavlc (SVlcTable* pVlcTable, uint8_t* pNonZeroCountCach
|
|||||||
int8_t nA, nB, nC;
|
int8_t nA, nB, nC;
|
||||||
uint8_t uiTotalCoeff, uiTrailingOnes;
|
uint8_t uiTotalCoeff, uiTrailingOnes;
|
||||||
int32_t iUsedBits = 0;
|
int32_t iUsedBits = 0;
|
||||||
int32_t iCurIdx = pBs->iIndex;
|
intX_t iCurIdx = pBs->iIndex;
|
||||||
uint8_t* pBuf = ((uint8_t*)pBs->pStartBuf) + (iCurIdx >> 3);
|
uint8_t* pBuf = ((uint8_t*)pBs->pStartBuf) + (iCurIdx >> 3);
|
||||||
bool bChromaDc = (CHROMA_DC == iResidualProperty);
|
bool bChromaDc = (CHROMA_DC == iResidualProperty);
|
||||||
uint8_t bChroma = (bChromaDc || CHROMA_AC == iResidualProperty);
|
uint8_t bChroma = (bChromaDc || CHROMA_AC == iResidualProperty);
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ static inline bool BsCheckByteAlign (SBitStringAux* pBs) {
|
|||||||
|
|
||||||
|
|
||||||
static inline int32_t BsGetBitsPos (SBitStringAux* pBs) {
|
static inline int32_t BsGetBitsPos (SBitStringAux* pBs) {
|
||||||
return (((pBs->pBufPtr - pBs->pBuf) << 3) + 32 - pBs->iLeftBits);
|
return (int32_t) (((pBs->pBufPtr - pBs->pBuf) << 3) + 32 - pBs->iLeftBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ int32_t WelsEncodeNal (SWelsNalRaw* pRawNal, void* pNalHeaderExt, const int32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* count length of NAL Unit */
|
/* count length of NAL Unit */
|
||||||
iNalLength = pDstPointer - pDstStart;
|
iNalLength = (int32_t) (pDstPointer - pDstStart);
|
||||||
if (NULL != pDstLen)
|
if (NULL != pDstLen)
|
||||||
*pDstLen = iNalLength;
|
*pDstLen = iNalLength;
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ int32_t GetCodeName (char* pBuf, int32_t iSize) {
|
|||||||
if (NULL == pBuf)
|
if (NULL == pBuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
iLen = strlen (WELS_CODE_NAME); // confirmed_safe_unsafe_usage
|
iLen = (int32_t)strlen (WELS_CODE_NAME); // confirmed_safe_unsafe_usage
|
||||||
if (iSize <= iLen)
|
if (iSize <= iLen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ int32_t GetLibName (char* pBuf, int32_t iSize) {
|
|||||||
if (NULL == pBuf)
|
if (NULL == pBuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
iLen = strlen (WELS_LIB_NAME); // confirmed_safe_unsafe_usage
|
iLen = (int32_t)strlen (WELS_LIB_NAME); // confirmed_safe_unsafe_usage
|
||||||
if (iSize <= iLen)
|
if (iSize <= iLen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ int32_t GetVerNum (char* pBuf, int32_t iSize) {
|
|||||||
if (NULL == pBuf)
|
if (NULL == pBuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
iLen = strlen (WELS_VERSION_STR); // confirmed_safe_unsafe_usage
|
iLen = (int32_t)strlen (WELS_VERSION_STR); // confirmed_safe_unsafe_usage
|
||||||
if (iSize <= iLen)
|
if (iSize <= iLen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ int32_t GetIdentInfo (char* pBuf, int32_t iSize) {
|
|||||||
if (NULL == pBuf)
|
if (NULL == pBuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
iLen = strlen (WELS_IDENT); // confirmed_safe_unsafe_usage
|
iLen = (int32_t)strlen (WELS_IDENT); // confirmed_safe_unsafe_usage
|
||||||
if (iSize <= iLen)
|
if (iSize <= iLen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ void CalcSliceComplexRatio (void* pRatio, SSliceCtx* pSliceCtx, uint32_t* pSlice
|
|||||||
WelsEmms();
|
WelsEmms();
|
||||||
|
|
||||||
while (iSliceIdx < kiSliceCount) {
|
while (iSliceIdx < kiSliceCount) {
|
||||||
iAvI[iSliceIdx] = WELS_DIV_ROUND(INT_MULTIPLY * pCountMbInSlice[iSliceIdx], pSliceTime[iSliceIdx]);
|
iAvI[iSliceIdx] = WELS_DIV_ROUND (INT_MULTIPLY * pCountMbInSlice[iSliceIdx], pSliceTime[iSliceIdx]);
|
||||||
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] CalcSliceComplexRatio(), pSliceConsumeTime[%d]= %d us, slice_run= %d\n",
|
MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] CalcSliceComplexRatio(), pSliceConsumeTime[%d]= %d us, slice_run= %d\n",
|
||||||
iSliceIdx,
|
iSliceIdx,
|
||||||
pSliceTime[iSliceIdx], pCountMbInSlice[iSliceIdx]);
|
pSliceTime[iSliceIdx], pCountMbInSlice[iSliceIdx]);
|
||||||
@@ -140,7 +140,7 @@ void CalcSliceComplexRatio (void* pRatio, SSliceCtx* pSliceCtx, uint32_t* pSlice
|
|||||||
++ iSliceIdx;
|
++ iSliceIdx;
|
||||||
}
|
}
|
||||||
while (-- iSliceIdx >= 0) {
|
while (-- iSliceIdx >= 0) {
|
||||||
pRatioList[iSliceIdx] = WELS_DIV_ROUND(INT_MULTIPLY * iAvI[iSliceIdx], iSumAv);
|
pRatioList[iSliceIdx] = WELS_DIV_ROUND (INT_MULTIPLY * iAvI[iSliceIdx], iSumAv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx,
|
|||||||
|
|
||||||
iSliceIdx = 0;
|
iSliceIdx = 0;
|
||||||
while (iSliceIdx + 1 < kiCountSliceNum) {
|
while (iSliceIdx + 1 < kiCountSliceNum) {
|
||||||
int32_t iNumMbAssigning = WELS_DIV_ROUND(kiCountNumMb * pSliceComplexRatio[iSliceIdx], INT_MULTIPLY);
|
int32_t iNumMbAssigning = WELS_DIV_ROUND (kiCountNumMb * pSliceComplexRatio[iSliceIdx], INT_MULTIPLY);
|
||||||
|
|
||||||
// GOM boundary aligned
|
// GOM boundary aligned
|
||||||
if (pCtx->pSvcParam->iRCMode != RC_OFF_MODE) {
|
if (pCtx->pSvcParam->iRCMode != RC_OFF_MODE) {
|
||||||
@@ -259,14 +259,15 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx,
|
|||||||
iRunLen[iSliceIdx] = iNumMbAssigning;
|
iRunLen[iSliceIdx] = iNumMbAssigning;
|
||||||
MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
|
MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
|
||||||
"[MT] DynamicAdjustSlicing(), uiSliceIdx= %d, pSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d\n",
|
"[MT] DynamicAdjustSlicing(), uiSliceIdx= %d, pSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d\n",
|
||||||
iSliceIdx, pSliceComplexRatio[iSliceIdx]* 1.0f / INT_MULTIPLY, pSliceCtx->pCountMbNumInSlice[iSliceIdx], iNumMbAssigning);
|
iSliceIdx, pSliceComplexRatio[iSliceIdx] * 1.0f / INT_MULTIPLY, pSliceCtx->pCountMbNumInSlice[iSliceIdx],
|
||||||
|
iNumMbAssigning);
|
||||||
++ iSliceIdx;
|
++ iSliceIdx;
|
||||||
iMaximalMbNum = iMbNumLeft - (kiCountSliceNum - iSliceIdx - 1) * iMinimalMbNum; // get maximal num_mb in left parts
|
iMaximalMbNum = iMbNumLeft - (kiCountSliceNum - iSliceIdx - 1) * iMinimalMbNum; // get maximal num_mb in left parts
|
||||||
}
|
}
|
||||||
iRunLen[iSliceIdx] = iMbNumLeft;
|
iRunLen[iSliceIdx] = iMbNumLeft;
|
||||||
MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
|
MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
|
||||||
"[MT] DynamicAdjustSlicing(), iSliceIdx= %d, pSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d\n",
|
"[MT] DynamicAdjustSlicing(), iSliceIdx= %d, pSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d\n",
|
||||||
iSliceIdx, pSliceComplexRatio[iSliceIdx]* 1.0f / INT_MULTIPLY, pSliceCtx->pCountMbNumInSlice[iSliceIdx], iMbNumLeft);
|
iSliceIdx, pSliceComplexRatio[iSliceIdx] * 1.0f / INT_MULTIPLY, pSliceCtx->pCountMbNumInSlice[iSliceIdx], iMbNumLeft);
|
||||||
|
|
||||||
|
|
||||||
if (DynamicAdjustSlicePEncCtxAll (pSliceCtx, iRunLen) == 0) {
|
if (DynamicAdjustSlicePEncCtxAll (pSliceCtx, iRunLen) == 0) {
|
||||||
@@ -651,7 +652,7 @@ int32_t WriteSliceBs (sWelsEncCtx* pCtx, uint8_t* pSliceBsBuf, const int32_t iSl
|
|||||||
int32_t iNalIdx = 0;
|
int32_t iNalIdx = 0;
|
||||||
int32_t iNalSize = 0;
|
int32_t iNalSize = 0;
|
||||||
int32_t iReturn = ENC_RETURN_SUCCESS;
|
int32_t iReturn = ENC_RETURN_SUCCESS;
|
||||||
const int32_t kiWrittenLength = pSliceBs->sBsWrite.pBufPtr - pSliceBs->sBsWrite.pBuf;
|
const int32_t kiWrittenLength = (int32_t) (pSliceBs->sBsWrite.pBufPtr - pSliceBs->sBsWrite.pBuf);
|
||||||
|
|
||||||
iSliceSize = 0;
|
iSliceSize = 0;
|
||||||
assert (kiNalCnt <= 2);
|
assert (kiNalCnt <= 2);
|
||||||
|
|||||||
@@ -209,7 +209,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 intX_t iLeftLength = pBs->pBufEnd - pBs->pBufPtr - 1;
|
||||||
assert (iLeftLength > 0);
|
assert (iLeftLength > 0);
|
||||||
|
|
||||||
if (iLeftLength < MAX_MACROBLOCK_SIZE_IN_BYTE) {
|
if (iLeftLength < MAX_MACROBLOCK_SIZE_IN_BYTE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user