History

B-frame decoding support for Main and High Profile with two test cases.

xiaotianshi2 committed 8 years ago

Commit 657d2171 parent e3e838355 files · +17936 −13825Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+39−2
@@ -46,6 +46,8 @@ · 45 unmodified lines
4646 #include "bit_stream.h"
4747 #include "memory_align.h"
4848
49+#define _PARSE_NALHRD_VCLHRD_PARAMS_ 1
50+
4951 namespace WelsDec {
5052 /*!
5153 *************************************************************************************
@@ -1558,16 +1560,51 @@ int32_t ParseVui (PWelsDecoderContext pCtx, PSps pSps, PBitStringAux pBsAux) { · 1506 unmodified lines
15581560 }
15591561 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //nal_hrd_parameters_present_flag
15601562 pVui->bNalHrdParamPresentFlag = !!uiCode;
1561− if (pVui->bNalHrdParamPresentFlag) { //HRD parse not supported
1563+ if (pVui->bNalHrdParamPresentFlag) { //Add HRD parse. the values are not being used though.
1564+#ifdef _PARSE_NALHRD_VCLHRD_PARAMS_
1565+ int32_t cpb_cnt_minus1 = BsGetUe (pBsAux, &uiCode);
1566+ /*bit_rate_scale = */BsGetBits (pBsAux, 4, &uiCode);
1567+ /*cpb_size_scale = */BsGetBits (pBsAux, 4, &uiCode);
1568+ for (int32_t i = 0; i <= cpb_cnt_minus1; i++) {
1569+ /*bit_rate_value_minus1[i] = */BsGetUe (pBsAux, &uiCode);
1570+ /*cpb_size_value_minus1[i] = */BsGetUe (pBsAux, &uiCode);
1571+ /*cbr_flag[i] = */BsGetOneBit (pBsAux, &uiCode);
1572+ }
1573+ /*initial_cpb_removal_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1574+ /*cpb_removal_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1575+ /*dpb_output_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1576+ /*time_offset_length = */BsGetBits (pBsAux, 5, &uiCode);
1577+#else
15621578 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "nal_hrd_parameters_present_flag = 1 not supported.");
15631579 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_VUI_HRD);
1580+#endif
15641581 }
15651582 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //vcl_hrd_parameters_present_flag
15661583 pVui->bVclHrdParamPresentFlag = !!uiCode;
1567− if (pVui->bVclHrdParamPresentFlag) { //HRD parse not supported
1584+ if (pVui->bVclHrdParamPresentFlag) {//Add HRD parse. the values are not being used though.
1585+#ifdef _PARSE_NALHRD_VCLHRD_PARAMS_
1586+ int32_t cpb_cnt_minus1 = BsGetUe (pBsAux, &uiCode);
1587+ /*bit_rate_scale = */BsGetBits (pBsAux, 4, &uiCode);
1588+ /*cpb_size_scale = */BsGetBits (pBsAux, 4, &uiCode);
1589+ for (int32_t i = 0; i <= cpb_cnt_minus1; i++) {
1590+ /*bit_rate_value_minus1[i] = */BsGetUe (pBsAux, &uiCode);
1591+ /*cpb_size_value_minus1[i] = */BsGetUe (pBsAux, &uiCode);
1592+ /*cbr_flag[i] = */BsGetOneBit (pBsAux, &uiCode);
1593+ }
1594+ /*initial_cpb_removal_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1595+ /*cpb_removal_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1596+ /*dpb_output_delay_length_minus1 = */BsGetBits (pBsAux, 5, &uiCode);
1597+ /*time_offset_length = */BsGetBits (pBsAux, 5, &uiCode);
1598+#else
15681599 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "vcl_hrd_parameters_present_flag = 1 not supported.");
15691600 return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_UNSUPPORTED_VUI_HRD);
1601+#endif
1602+ }
1603+#ifdef _PARSE_NALHRD_VCLHRD_PARAMS_
1604+ if (pVui->bNalHrdParamPresentFlag | pVui->bVclHrdParamPresentFlag) {
1605+ /*low_delay_hrd_flag = */BsGetOneBit (pBsAux, &uiCode);
15701606 }
1607+#endif
15711608 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //pic_struct_present_flag
15721609 pVui->bPicStructPresentFlag = !!uiCode;
15731610 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //bitstream_restriction_flag

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