Showing the changes to codec/encoder/core/src/au_set.cpp (1 of 8 files). Show all
Unified · Split
| @@ -196,6 +196,32 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate · 195 unmodified lines | ||
| 196 | 196 | return LEVEL_5_1; //final decision: select the biggest level |
| 197 | 197 | } |
| 198 | 198 | |
| 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 | +} | |
| 199 | 225 | |
| 200 | 226 | /*! |
| 201 | 227 | ************************************************************************************* |
| @@ -210,7 +236,7 @@ static inline ELevelIdc WelsGetLevelIdc (const SWelsSPS* kpSps, float fFrameRate · 8 unmodified lines | ||
| 210 | 236 | * \note Call it in case EWelsNalUnitType is SPS. |
| 211 | 237 | ************************************************************************************* |
| 212 | 238 | */ |
| 213 | −int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) { | |
| 239 | +int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta, bool bBaseLayer) { | |
| 214 | 240 | SBitStringAux* pLocalBitStringAux = pBitStringAux; |
| 215 | 241 | |
| 216 | 242 | assert (pSps != NULL && pBitStringAux != NULL); |
| @@ -255,14 +281,15 @@ int32_t WelsWriteSpsSyntax (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_ · 38 unmodified lines | ||
| 255 | 281 | BsWriteUE (pLocalBitStringAux, pSps->sFrameCrop.iCropBottom); // frame_crop_bottom_offset |
| 256 | 282 | } |
| 257 | 283 | |
| 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); | |
| 260 | 287 | return 0; |
| 261 | 288 | } |
| 262 | 289 | |
| 263 | 290 | |
| 264 | 291 | int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* pSpsIdDelta) { |
| 265 | − WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta); | |
| 292 | + WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, true); | |
| 266 | 293 | |
| 267 | 294 | BsRbspTrailingBits (pBitStringAux); |
| 268 | 295 | |
| @@ -286,7 +313,7 @@ int32_t WelsWriteSpsNal (SWelsSPS* pSps, SBitStringAux* pBitStringAux, int32_t* · 17 unmodified lines | ||
| 286 | 313 | int32_t WelsWriteSubsetSpsSyntax (SSubsetSps* pSubsetSps, SBitStringAux* pBitStringAux , int32_t* pSpsIdDelta) { |
| 287 | 314 | SWelsSPS* pSps = &pSubsetSps->pSps; |
| 288 | 315 | |
| 289 | − WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta); | |
| 316 | + WelsWriteSpsSyntax (pSps, pBitStringAux, pSpsIdDelta, false); | |
| 290 | 317 | |
| 291 | 318 | if (pSps->uiProfileIdc == PRO_SCALABLE_BASELINE || pSps->uiProfileIdc == PRO_SCALABLE_HIGH) { |
| 292 | 319 | SSpsSvcExt* pSubsetSpsExt = &pSubsetSps->sSpsSvcExt; |
| @@ -481,6 +508,7 @@ int32_t WelsInitSps (SWelsSPS* pSps, SSpatialLayerConfig* pLayerParam, SSpatialL · 188 unmodified lines | ||
| 481 | 508 | pLayerParam->uiLevelIdc = uiLevel; |
| 482 | 509 | } |
| 483 | 510 | pSps->iLevelIdc = g_kuiLevelMaps[pLayerParam->uiLevelIdc - 1]; |
| 511 | + pSps->bVuiParamPresentFlag = true; | |
| 484 | 512 | return 0; |
| 485 | 513 | } |
| 486 | 514 | |