History

merge level table

ruil2 committed 12 years ago

Commit 493d2541 parent 49f8fe85 files · +227 −249Browse files

Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 5 files). Show all

Unified · Split

codec/decoder/core/src/au_parser.cpp+21−42
@@ -688,64 +688,43 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin · 687 unmodified lines
688 return 0;688 return 0;
689}689}
690 690
691// table A-1 - Level limits
692static const SLevelLimits g_kSLevelLimits[17] = {
693 {1485, 99, 396, 64, 175, -256, 255, 2, 0x7fff}, /* level 1 */
694 {1485, 99, 396, 128, 350, -256, 255, 2, 0x7fff}, /* level 1.b */
695 {3000, 396, 900, 192, 500, -512, 511, 2, 0x7fff}, /* level 1.1 */
696 {6000, 396, 2376, 384, 1000, -512, 511, 2, 0x7fff}, /* level 1.2 */
697 {11880, 396, 2376, 768, 2000, -512, 511, 2, 0x7fff}, /* level 1.3 */
698 {11880, 396, 2376, 2000, 2000, -512, 511, 2, 0x7fff}, /* level 2 */
699 {19800, 792, 4752, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.1 */
700 {20250, 1620, 8100, 4000, 4000, -1024, 1023, 2, 0x7fff}, /* level 2.2 */
701 {40500, 1620, 8100, 10000, 10000, -1024, 1023, 2, 32 }, /* level 3 */
702 {108000, 3600, 18000, 14000, 14000, -2048, 2047, 4, 16}, /* level 3.1 */
703 {216000, 5120, 20480, 20000, 20000, -2048, 2047, 4, 16}, /* level 3.2 */
704 {245760, 8192, 32768, 20000, 25000, -2048, 2047, 4, 16}, /* level 4 */
705 {245760, 8192, 32768, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.1 */
706 {522240, 8704, 34816, 50000, 62500, -2048, 2047, 2, 16}, /* level 4.2 */
707 {589824, 22080, 110400, 135000, 135000, -2048, 2047, 2, 16}, /* level 5 */
708 {983040, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16}, /* level 5.1 */
709 {2073600, 36864, 184320, 240000, 240000, -2048, 2047, 2, 16} /* level 5.2 */
710};
711
712const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {691const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
713 switch (iLevelIdx) {692 switch (iLevelIdx) {
714 case 10:693 case 10:
715 return &g_kSLevelLimits[0];694 return &g_ksLevelLimits[0];
716 case 11:695 case 11:
717 if (bConstraint3)696 if (bConstraint3)
718 return &g_kSLevelLimits[1];697 return &g_ksLevelLimits[1];
719 else698 else
720 return &g_kSLevelLimits[2];699 return &g_ksLevelLimits[2];
721 case 12:700 case 12:
722 return &g_kSLevelLimits[3];701 return &g_ksLevelLimits[3];
723 case 13:702 case 13:
724 return &g_kSLevelLimits[4];703 return &g_ksLevelLimits[4];
725 case 20:704 case 20:
726 return &g_kSLevelLimits[5];705 return &g_ksLevelLimits[5];
727 case 21:706 case 21:
728 return &g_kSLevelLimits[6];707 return &g_ksLevelLimits[6];
729 case 22:708 case 22:
730 return &g_kSLevelLimits[7];709 return &g_ksLevelLimits[7];
731 case 30:710 case 30:
732 return &g_kSLevelLimits[8];711 return &g_ksLevelLimits[8];
733 case 31:712 case 31:
734 return &g_kSLevelLimits[9];713 return &g_ksLevelLimits[9];
735 case 32:714 case 32:
736 return &g_kSLevelLimits[10];715 return &g_ksLevelLimits[10];
737 case 40:716 case 40:
738 return &g_kSLevelLimits[11];717 return &g_ksLevelLimits[11];
739 case 41:718 case 41:
740 return &g_kSLevelLimits[12];719 return &g_ksLevelLimits[12];
741 case 42:720 case 42:
742 return &g_kSLevelLimits[13];721 return &g_ksLevelLimits[13];
743 case 50:722 case 50:
744 return &g_kSLevelLimits[14];723 return &g_ksLevelLimits[14];
745 case 51:724 case 51:
746 return &g_kSLevelLimits[15];725 return &g_ksLevelLimits[15];
747 case 52:726 case 52:
748 return &g_kSLevelLimits[16];727 return &g_ksLevelLimits[16];
749 default:728 default:
750 return NULL;729 return NULL;
751 }730 }
@@ -923,7 +902,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 171 unmodified lines
923 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);902 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_width_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbWidth);
924 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);903 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
925 }904 }
926 if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {905 if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) {
927 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");906 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!\n");
928 }907 }
929 WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1908 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 · 2 unmodified lines
932 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);911 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "pic_height_in_mbs(%d) exceeds the maximum allowed!\n", pSps->iMbHeight);
933 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);912 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE);
934 }913 }
935 if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->iMaxFS)) {914 if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) {
936 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");915 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!\n");
937 }916 }
938 uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;917 uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight;
939 if (uiTmp32 > (uint32_t)pSLevelLimits->iMaxFS) {918 if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) {
940 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");919 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the total count of mb exceeds the level limits!\n");
941 }920 }
942 pSps->uiTotalMbCount = uiTmp32;921 pSps->uiTotalMbCount = uiTmp32;
943 WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",922 WELS_CHECK_SE_UPPER_ERROR (pSps->iNumRefFrames, SPS_MAX_NUM_REF_FRAMES_MAX, "max_num_ref_frames",
944 GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES));923 GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_NUM_REF_FRAMES));
945 // here we check max_num_ref_frames924 // here we check max_num_ref_frames
946 uint32_t uiMaxDpbMbs = pSLevelLimits->iMaxDPBMbs;925 uint32_t uiMaxDpbMbs = pSLevelLimits->uiMaxDPBMbs;
947 uint32_t uiMaxDpbFrames = uiMaxDpbMbs / pSps->uiTotalMbCount;926 uint32_t uiMaxDpbFrames = uiMaxDpbMbs / pSps->uiTotalMbCount;
948 if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)927 if (uiMaxDpbFrames > SPS_MAX_NUM_REF_FRAMES_MAX)
949 uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;928 uiMaxDpbFrames = SPS_MAX_NUM_REF_FRAMES_MAX;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t