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
196196 return LEVEL_5_1; //final decision: select the biggest level
197197 }
198198
199+int32_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+}
199225
200226 /*!
201227 *************************************************************************************
@@ -210,7 +236,7 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate · 8 unmodified lines
210236 * \note Call it in case EWelsNalUnitType is SPS.
211237 *************************************************************************************
212238 */
213−int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {
239+int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta, bool bBaseLayer) {
214240 SBitStringAux* pLocalBitStringAux = pBitStringAux;
215241
216242 assert (pSps != NULL && pBitStringAux != NULL);
@@ -255,14 +281,15 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_ · 38 unmodified lines
255281 BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropBottom); // frame_crop_bottom_offset
256282 }
257283
258− BsWriteOneBit (pLocalBitStringAux, 0/*pSps->bVuiParamPresentFlag*/); // vui_parameters_present_flag
259−
284+ BsWriteOneBit (pLocalBitStringAux, pSps->bVuiParamPresentFlag); // vui_parameters_present_flag
285+ if (pSps->bVuiParamPresentFlag && bBaseLayer)
286+ WelsWriteVUI (pSps, pBitStringAux);
260287 return 0;
261288 }
262289
263290
264291 int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) {
265− WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);
292+ WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, true);
266293
267294 BsRbspTrailingBits (pBitStringAux);
268295
@@ -286,7 +313,7 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* · 17 unmodified lines
286313 int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta) {
287314 SWelsSPS* pSps = &pSubsetSps->pSps;
288315
289− WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta);
316+ WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, false);
290317
291318 if (pSps->uiProfileIdc == PRO_SCALABLE_BASELINE || pSps->uiProfileIdc == PRO_SCALABLE_HIGH) {
292319 SSpsSvcExt* pSubsetSpsExt = &pSubsetSps->sSpsSvcExt;
@@ -481,6 +508,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 188 unmodified lines
481508 pLayerParam->uiLevelIdc = uiLevel;
482509 }
483510 pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1];
511+ pSps->bVuiParamPresentFlag = true;
484512 return 0;
485513 }
486514

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