commit
681b1da698
codec
common
decoder/core
encoder/core/src
@ -42,6 +42,21 @@
|
|||||||
namespace WelsCommon {
|
namespace WelsCommon {
|
||||||
/*common use table*/
|
/*common use table*/
|
||||||
|
|
||||||
|
#define LEVEL_NUMBER 17
|
||||||
|
typedef struct TagLevelLimits {
|
||||||
|
uint8_t uiLevelIdc; // level idc
|
||||||
|
uint32_t uiMaxMBPS; // Max macroblock processing rate(MB/s)
|
||||||
|
uint32_t uiMaxFS; // Max frame sizea(MBs)
|
||||||
|
uint32_t uiMaxDPBMbs;// Max decoded picture buffer size(MBs)
|
||||||
|
uint32_t uiMaxBR; // Max video bit rate
|
||||||
|
uint32_t uiMaxCPB; // Max CPB size
|
||||||
|
int16_t iMinVmv; // Vertical MV component range upper bound
|
||||||
|
int16_t iMaxVmv; // Vertical MV component range lower bound
|
||||||
|
uint16_t uiMinCR; // Min compression ration
|
||||||
|
int16_t iMaxMvsPer2Mb; // Max number of motion vectors per two consecutive MBs
|
||||||
|
} SLevelLimits;
|
||||||
|
|
||||||
|
extern const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER];
|
||||||
extern const uint8_t g_kuiMbCountScan4Idx[24];
|
extern const uint8_t g_kuiMbCountScan4Idx[24];
|
||||||
extern const uint8_t g_kuiCache30ScanIdx[16];
|
extern const uint8_t g_kuiCache30ScanIdx[16];
|
||||||
extern const uint8_t g_kuiCache48CountScan4Idx[24];
|
extern const uint8_t g_kuiCache48CountScan4Idx[24];
|
||||||
|
@ -149,5 +149,29 @@ ALIGNED_DECLARE (const uint16_t, g_kuiDequantCoeff[52][8], 16) = {
|
|||||||
/*50*/{ 3328, 4096, 3328, 4096, 4096, 5120, 4096, 5120 }, /*51*/{ 3584, 4608, 3584, 4608, 4608, 5888, 4608, 5888 },
|
/*50*/{ 3328, 4096, 3328, 4096, 4096, 5120, 4096, 5120 }, /*51*/{ 3584, 4608, 3584, 4608, 4608, 5888, 4608, 5888 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// table A-1 - Level limits
|
||||||
|
const SLevelLimits g_ksLevelLimits[LEVEL_NUMBER] = {
|
||||||
|
{10, 1485, 99, 396, 64, 175, -256, 255, 2, 0x7fff}, /* level 1 */
|
||||||
|
{9, 1485, 99, 396, 128, 350, -256, 255, 2, 0x7fff}, /* level 1.b */
|
||||||
|
{11, 3000, 396, 900, 192, 500, -512, 511, 2, 0x7fff}, /* level 1.1 */
|
||||||
|
{12, 6000, 396, 2376, 384, 1000, -512, 511, 2, 0x7fff}, /* level 1.2 */
|
||||||
|
{13, 11880, 396, 2376, 768, 2000, -512, 511, 2, 0x7fff}, /* level 1.3 */
|
||||||
|
|
||||||
|
{20, 11880, 396, 2376, 2000, 2000, -512, 511, 2, 0x7fff}, /* level 2 */
|
||||||
|
{21, 19800, 792, 4752, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.1 */
|
||||||
|
{22, 20250, 1620, 8100, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.2 */
|
||||||
|
|
||||||
|
{30, 40500, 1620, 8100, 10000, 10000, -1024, 1023, 2, 32 }, /* level 3 */
|
||||||
|
{31, 108000, 3600, 18000, 14000, 14000, -2048, 2047, 4, 16}, /* level 3.1 */
|
||||||
|
{32, 216000, 5120, 20480, 20000, 20000, -2048, 2047, 4, 16}, /* level 3.2 */
|
||||||
|
|
||||||
|
{40, 245760, 8192, 32768, 20000, 25000, -2048, 2047, 4, 16}, /* level 4 */
|
||||||
|
{41, 245760, 8192, 32768, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.1 */
|
||||||
|
{42, 522240, 8704, 34816, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.2 */
|
||||||
|
|
||||||
|
{50, 589824, 22080, 110400, 135000, 135000, -2048, 2047, 2, 16}, /* level 5 */
|
||||||
|
{51, 983040, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16}, /* level 5.1 */
|
||||||
|
{52, 2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */
|
||||||
|
};
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
}
|
}
|
||||||
|
@ -39,17 +39,6 @@
|
|||||||
|
|
||||||
namespace WelsDec {
|
namespace WelsDec {
|
||||||
|
|
||||||
typedef struct TagLevelLimits {
|
|
||||||
int32_t iMaxMBPS; // Max macroblock processing rate(MB/s)
|
|
||||||
int32_t iMaxFS; // Max frame sizea(MBs)
|
|
||||||
int32_t iMaxDPBMbs;// Max decoded picture buffer size(MBs)
|
|
||||||
int32_t iMaxBR; // Max video bit rate
|
|
||||||
int32_t iMaxCPB; // Max CPB size
|
|
||||||
int16_t iMinVmv; // Vertical MV component range upper bound
|
|
||||||
int16_t iMaxVmv; // Vertical MV component range lower bound
|
|
||||||
int16_t iMinCR; // Min compression ration
|
|
||||||
int16_t iMaxMvsPer2Mb; // Max number of motion vectors per two consecutive MBs
|
|
||||||
} SLevelLimits;
|
|
||||||
|
|
||||||
/* Sequence Parameter Set, refer to Page 57 in JVT X201wcm */
|
/* Sequence Parameter Set, refer to Page 57 in JVT X201wcm */
|
||||||
typedef struct TagSps {
|
typedef struct TagSps {
|
||||||
|
@ -688,64 +688,43 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// table A-1 - Level limits
|
|
||||||
static const SLevelLimits g_kSLevelLimits[17] = {
|
|
||||||
{1485, 99, 396, 64, 175, -256, 255, 2, 0x7fff}, /* level 1 */
|
|
||||||
{1485, 99, 396, 128, 350, -256, 255, 2, 0x7fff}, /* level 1.b */
|
|
||||||
{3000, 396, 900, 192, 500, -512, 511, 2, 0x7fff}, /* level 1.1 */
|
|
||||||
{6000, 396, 2376, 384, 1000, -512, 511, 2, 0x7fff}, /* level 1.2 */
|
|
||||||
{11880, 396, 2376, 768, 2000, -512, 511, 2, 0x7fff}, /* level 1.3 */
|
|
||||||
{11880, 396, 2376, 2000, 2000, -512, 511, 2, 0x7fff}, /* level 2 */
|
|
||||||
{19800, 792, 4752, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.1 */
|
|
||||||
{20250, 1620, 8100, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.2 */
|
|
||||||
{40500, 1620, 8100, 10000, 10000, -1024, 1023, 2, 32 }, /* level 3 */
|
|
||||||
{108000, 3600, 18000, 14000, 14000, -2048, 2047, 4, 16}, /* level 3.1 */
|
|
||||||
{216000, 5120, 20480, 20000, 20000, -2048, 2047, 4, 16}, /* level 3.2 */
|
|
||||||
{245760, 8192, 32768, 20000, 25000, -2048, 2047, 4, 16}, /* level 4 */
|
|
||||||
{245760, 8192, 32768, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.1 */
|
|
||||||
{522240, 8704, 34816, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.2 */
|
|
||||||
{589824, 22080, 110400, 135000, 135000, -2048, 2047, 2, 16}, /* level 5 */
|
|
||||||
{983040, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16}, /* level 5.1 */
|
|
||||||
{2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */
|
|
||||||
};
|
|
||||||
|
|
||||||
const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
|
const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
|
||||||
switch (iLevelIdx) {
|
switch (iLevelIdx) {
|
||||||
case 10:
|
case 10:
|
||||||
return &g_kSLevelLimits[0];
|
return &g_ksLevelLimits[0];
|
||||||
case 11:
|
case 11:
|
||||||
if (bConstraint3)
|
if (bConstraint3)
|
||||||
return &g_kSLevelLimits[1];
|
return &g_ksLevelLimits[1];
|
||||||
else
|
else
|
||||||
return &g_kSLevelLimits[2];
|
return &g_ksLevelLimits[2];
|
||||||
case 12:
|
case 12:
|
||||||
return &g_kSLevelLimits[3];
|
return &g_ksLevelLimits[3];
|
||||||
case 13:
|
case 13:
|
||||||
return &g_kSLevelLimits[4];
|
return &g_ksLevelLimits[4];
|
||||||
case 20:
|
case 20:
|
||||||
return &g_kSLevelLimits[5];
|
return &g_ksLevelLimits[5];
|
||||||
case 21:
|
case 21:
|
||||||
return &g_kSLevelLimits[6];
|
return &g_ksLevelLimits[6];
|
||||||
case 22:
|
case 22:
|
||||||
return &g_kSLevelLimits[7];
|
return &g_ksLevelLimits[7];
|
||||||
case 30:
|
case 30:
|
||||||
return &g_kSLevelLimits[8];
|
return &g_ksLevelLimits[8];
|
||||||
case 31:
|
case 31:
|
||||||
return &g_kSLevelLimits[9];
|
return &g_ksLevelLimits[9];
|
||||||
case 32:
|
case 32:
|
||||||
return &g_kSLevelLimits[10];
|
return &g_ksLevelLimits[10];
|
||||||
case 40:
|
case 40:
|
||||||
return &g_kSLevelLimits[11];
|
return &g_ksLevelLimits[11];
|
||||||
case 41:
|
case 41:
|
||||||
return &g_kSLevelLimits[12];
|
return &g_ksLevelLimits[12];
|
||||||
case 42:
|
case 42:
|
||||||
return &g_kSLevelLimits[13];
|
return &g_ksLevelLimits[13];
|
||||||
case 50:
|
case 50:
|
||||||
return &g_kSLevelLimits[14];
|
return &g_ksLevelLimits[14];
|
||||||
case 51:
|
case 51:
|
||||||
return &g_kSLevelLimits[15];
|
return &g_ksLevelLimits[15];
|
||||||
case 52:
|
case 52:
|
||||||
return &g_kSLevelLimits[16];
|
return &g_ksLevelLimits[16];
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -923,7 +902,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
||||||
}
|
}
|
||||||
if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
|
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1
|
||||||
@ -932,18 +911,18 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW
|
|||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
|
||||||
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
|
||||||
}
|
}
|
||||||
if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {
|
if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
|
uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
|
||||||
if (uiTmp32 > (uint32_t)pSLevelLimits->iMaxFS) {
|
if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) {
|
||||||
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
|
WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
|
||||||
}
|
}
|
||||||
pSps->uiTotalMbCount = uiTmp32;
|
pSps->uiTotalMbCount = uiTmp32;
|
||||||
WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
|
WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
|
||||||
GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES));
|
GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES));
|
||||||
// here we check max_num_ref_frames
|
// here we check max_num_ref_frames
|
||||||
uint32_t uiMaxDpbMbs = pSLevelLimits->iMaxDPBMbs;
|
uint32_t uiMaxDpbMbs = pSLevelLimits->uiMaxDPBMbs;
|
||||||
uint32_t uiMaxDpbFrames = uiMaxDpbMbs / pSps->uiTotalMbCount;
|
uint32_t uiMaxDpbFrames = uiMaxDpbMbs / pSps->uiTotalMbCount;
|
||||||
if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
|
if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
|
||||||
uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
|
uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;
|
||||||
|
@ -41,50 +41,21 @@
|
|||||||
#include "au_set.h"
|
#include "au_set.h"
|
||||||
#include "svc_enc_golomb.h"
|
#include "svc_enc_golomb.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
|
#include "wels_common_defs.h"
|
||||||
|
|
||||||
|
using namespace WelsCommon;
|
||||||
|
|
||||||
namespace WelsEnc {
|
namespace WelsEnc {
|
||||||
|
|
||||||
|
static inline int32_t WelsCheckLevelLimitation (const SWelsSPS* kpSps, const SLevelLimits* kpLevelLimit,
|
||||||
#define LEVEL_NUMBER 16
|
|
||||||
|
|
||||||
typedef struct TagLevelLimit {
|
|
||||||
uint8_t iLevelIdc;
|
|
||||||
uint32_t uiMaxMbPS; // Max MBs processing speed
|
|
||||||
uint32_t uiMaxFS; // Max Frame size
|
|
||||||
uint32_t uiMaxDPBMB; //Max DPB MB Size
|
|
||||||
uint32_t uiMaxBR; //Max Bitrate
|
|
||||||
} SLevelLimit;
|
|
||||||
|
|
||||||
const SLevelLimit g_ksLevelLimit[LEVEL_NUMBER] = {
|
|
||||||
{ 10, 1485, 99, 396, 64 }, //10
|
|
||||||
{ 9, 1485, 99, 396, 128 }, //9 (1b)
|
|
||||||
{ 11, 3000, 396, 900, 192 }, //11
|
|
||||||
{ 12, 6000, 396, 2376, 384 }, //12
|
|
||||||
{ 13, 11880, 396, 2376, 768 }, //13
|
|
||||||
|
|
||||||
{ 20, 11880, 396, 2376, 2000 }, //20
|
|
||||||
{ 21, 19800, 792, 4752, 4000 }, //21
|
|
||||||
{ 22, 20250, 1620, 8100, 4000 }, //22
|
|
||||||
|
|
||||||
{ 30, 40500, 1620, 8100, 10000 }, //30
|
|
||||||
{ 31, 108000, 3600, 18000, 14000 }, //31
|
|
||||||
{ 32, 216000, 5120, 20480, 20000 }, //32
|
|
||||||
|
|
||||||
{ 40, 245760, 8192, 32768, 20000 }, //40
|
|
||||||
{ 41, 245760, 8192, 32768, 50000 }, //41
|
|
||||||
{ 42, 491520, 8192, 34816, 50000 }, //42
|
|
||||||
|
|
||||||
{ 50, 589824, 22080, 110400, 135000 }, //50
|
|
||||||
{ 51, 983040, 36864, 184320, 240000 } //51
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline int32_t WelsCheckLevelLimitation (const SWelsSPS* kpSps, const SLevelLimit* kpLevelLimit,
|
|
||||||
float fFrameRate, int32_t iTargetBitRate) {
|
float fFrameRate, int32_t iTargetBitRate) {
|
||||||
uint32_t uiPicWidthInMBs = kpSps->iMbWidth;
|
uint32_t uiPicWidthInMBs = kpSps->iMbWidth;
|
||||||
uint32_t uiPicHeightInMBs = kpSps->iMbHeight;
|
uint32_t uiPicHeightInMBs = kpSps->iMbHeight;
|
||||||
uint32_t uiPicInMBs = uiPicWidthInMBs * uiPicHeightInMBs;
|
uint32_t uiPicInMBs = uiPicWidthInMBs * uiPicHeightInMBs;
|
||||||
uint32_t uiNumRefFrames = kpSps->iNumRefFrames;
|
uint32_t uiNumRefFrames = kpSps->iNumRefFrames;
|
||||||
|
|
||||||
if (kpLevelLimit->uiMaxMbPS < (uint32_t) (uiPicInMBs * fFrameRate))
|
if (kpLevelLimit->uiMaxMBPS < (uint32_t) (uiPicInMBs * fFrameRate))
|
||||||
return 0;
|
return 0;
|
||||||
if (kpLevelLimit->uiMaxFS < uiPicInMBs)
|
if (kpLevelLimit->uiMaxFS < uiPicInMBs)
|
||||||
return 0;
|
return 0;
|
||||||
@ -92,7 +63,7 @@ static inline int32_t WelsCheckLevelLimitation (const SWelsSPS* kpSps, const SLe
|
|||||||
return 0;
|
return 0;
|
||||||
if ((kpLevelLimit->uiMaxFS << 3) < (uiPicHeightInMBs * uiPicHeightInMBs))
|
if ((kpLevelLimit->uiMaxFS << 3) < (uiPicHeightInMBs * uiPicHeightInMBs))
|
||||||
return 0;
|
return 0;
|
||||||
if (kpLevelLimit->uiMaxDPBMB < uiNumRefFrames * uiPicInMBs)
|
if (kpLevelLimit->uiMaxDPBMbs < uiNumRefFrames * uiPicInMBs)
|
||||||
return 0;
|
return 0;
|
||||||
if (iTargetBitRate
|
if (iTargetBitRate
|
||||||
&& ((int32_t) kpLevelLimit->uiMaxBR * 1200) < iTargetBitRate) //RC enabled, considering bitrate constraint
|
&& ((int32_t) kpLevelLimit->uiMaxBR * 1200) < iTargetBitRate) //RC enabled, considering bitrate constraint
|
||||||
@ -114,7 +85,7 @@ int32_t WelsCheckRefFrameLimitation (SLogContext* pLogCtx, SWelsSvcCodingParam*
|
|||||||
pSpatialLayer->uiLevelIdc = LEVEL_5_0;
|
pSpatialLayer->uiLevelIdc = LEVEL_5_0;
|
||||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "change level to level5.0\n");
|
WelsLog (pLogCtx, WELS_LOG_WARNING, "change level to level5.0\n");
|
||||||
}
|
}
|
||||||
iRefFrame = g_ksLevelLimit[pSpatialLayer->uiLevelIdc - 1].uiMaxDPBMB / uiPicInMBs;
|
iRefFrame = g_ksLevelLimits[pSpatialLayer->uiLevelIdc - 1].uiMaxDPBMbs / uiPicInMBs;
|
||||||
if (iRefFrame < pParam->iMaxNumRefFrame)
|
if (iRefFrame < pParam->iMaxNumRefFrame)
|
||||||
pParam->iMaxNumRefFrame = iRefFrame;
|
pParam->iMaxNumRefFrame = iRefFrame;
|
||||||
if (pParam->iMaxNumRefFrame < 1) {
|
if (pParam->iMaxNumRefFrame < 1) {
|
||||||
@ -129,8 +100,8 @@ int32_t WelsCheckRefFrameLimitation (SLogContext* pLogCtx, SWelsSvcCodingParam*
|
|||||||
static inline int32_t WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate, int32_t iTargetBitRate) {
|
static inline int32_t WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate, int32_t iTargetBitRate) {
|
||||||
int32_t iOrder;
|
int32_t iOrder;
|
||||||
for (iOrder = 0; iOrder < LEVEL_NUMBER; iOrder++) {
|
for (iOrder = 0; iOrder < LEVEL_NUMBER; iOrder++) {
|
||||||
if (WelsCheckLevelLimitation (kpSps, & (g_ksLevelLimit[iOrder]), fFrameRate, iTargetBitRate)) {
|
if (WelsCheckLevelLimitation (kpSps, & (g_ksLevelLimits[iOrder]), fFrameRate, iTargetBitRate)) {
|
||||||
return (int32_t) (g_ksLevelLimit[iOrder].iLevelIdc);
|
return (int32_t) (g_ksLevelLimits[iOrder].uiLevelIdc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 51; //final decision: select the biggest level
|
return 51; //final decision: select the biggest level
|
||||||
|
Loading…
x
Reference in New Issue
Block a user