History

add VUI for base layer

ruil2 committed 11 years ago

Commit c109f4d1 parent d7af7ce8 files · +7732 −7704Browse files

Showing the changes to codec/encoder/core/src/au_set.cpp (1 of 8 files). Show all

Unified · Split

codec/encoder/core/src/au_set.cpp+33−5
@@ -196,6 +196,32 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate · 195 unmodified lines
196 return LEVEL_5_1; //final decision: select the biggest level196 return LEVEL_5_1; //final decision: select the biggest level
197}197}
198 198
199int32_t WelsWriteVUI (SWelsSPS* pSps, SBitStringAux* pBitStringAux) {
200 SBitStringAux* pLocalBitStringAux = pBitStringAux;
201 assert (pSps != NULL && pBitStringAux != NULL);
202
203 BsWriteOneBit (pLocalBitStringAux, false); //aspect_ratio_info_present_flag
204 BsWriteOneBit (pLocalBitStringAux, false); //overscan_info_present_flag
205 BsWriteOneBit (pLocalBitStringAux, false); //video_signal_type_present_flag
206 BsWriteOneBit (pLocalBitStringAux, false); //chroma_loc_info_present_flag
207 BsWriteOneBit (pLocalBitStringAux, false); //timing_info_present_flag
208 BsWriteOneBit (pLocalBitStringAux, false); //nal_hrd_parameters_present_flag
209 BsWriteOneBit (pLocalBitStringAux, false); //vcl_hrd_parameters_present_flag
210 BsWriteOneBit (pLocalBitStringAux, false); //pic_struct_present_flag
211 BsWriteOneBit (pLocalBitStringAux, true); //bitstream_restriction_flag
212
213 //
214 BsWriteOneBit (pLocalBitStringAux, false); //motion_vectors_over_pic_boundaries_flag
215 BsWriteUE (pLocalBitStringAux, 0); //max_bytes_per_pic_denom
216 BsWriteUE (pLocalBitStringAux, 0); //max_bits_per_mb_denom
217 BsWriteUE (pLocalBitStringAux, 0); //log2_max_mv_length_horizontal
218 BsWriteUE (pLocalBitStringAux, 0); //log2_max_mv_length_vertical
219
220 BsWriteUE (pLocalBitStringAux, 0); //max_num_reorder_frames
221 BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); //max_dec_frame_buffering
222
223 return 0;
224}
199 225
200/*!226/*!
201 *************************************************************************************227 *************************************************************************************
@@ -210,7 +236,7 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate · 8 unmodified lines
210 * \note Call it in case EWelsNalUnitType is SPS.236 * \note Call it in case EWelsNalUnitType is SPS.
211 *************************************************************************************237 *************************************************************************************
212 */238 */
213int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {239int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta, bool bBaseLayer) {
214 SBitStringAux* pLocalBitStringAux = pBitStringAux;240 SBitStringAux* pLocalBitStringAux = pBitStringAux;
215 241
216 assert (pSps != NULL && pBitStringAux != NULL);242 assert (pSps != NULL && pBitStringAux != NULL);
@@ -255,14 +281,15 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_ · 38 unmodified lines
255 BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropBottom); // frame_crop_bottom_offset281 BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropBottom); // frame_crop_bottom_offset
256 }282 }
257 283
258 BsWriteOneBit (pLocalBitStringAux, 0/*pSps->bVuiParamPresentFlag*/); // vui_parameters_present_flag284 BsWriteOneBit (pLocalBitStringAux, pSps->bVuiParamPresentFlag); // vui_parameters_present_flag
259 285 if (pSps->bVuiParamPresentFlag && bBaseLayer)
286 WelsWriteVUI (pSps, pBitStringAux);
260 return 0;287 return 0;
261}288}
262 289
263 290
264int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {291int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {
265 WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);292 WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, true);
266 293
267 BsRbspTrailingBits (pBitStringAux);294 BsRbspTrailingBits (pBitStringAux);
268 295
@@ -286,7 +313,7 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* · 17 unmodified lines
286int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta) {313int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta) {
287 SWelsSPS* pSps = &pSubsetSps->pSps;314 SWelsSPS* pSps = &pSubsetSps->pSps;
288 315
289 WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);316 WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, false);
290 317
291 if (pSps->uiProfileIdc == PRO_SCALABLE_BASELINE || pSps->uiProfileIdc == PRO_SCALABLE_HIGH) {318 if (pSps->uiProfileIdc == PRO_SCALABLE_BASELINE || pSps->uiProfileIdc == PRO_SCALABLE_HIGH) {
292 SSpsSvcExt* pSubsetSpsExt = &pSubsetSps->sSpsSvcExt;319 SSpsSvcExt* pSubsetSpsExt = &pSubsetSps->sSpsSvcExt;
@@ -481,6 +508,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 188 unmodified lines
481 pLayerParam->uiLevelIdc = uiLevel;508 pLayerParam->uiLevelIdc = uiLevel;
482 }509 }
483 pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1];510 pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1];
511 pSps->bVuiParamPresentFlag = true;
484 return 0;512 return 0;
485}513}
486 514

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