| 195 | } |
| 196 | |
| 197 | int32_t WelsWriteVUI (SWelsSPS* pSps, SBitStringAux* pBitStringAux) { |
| 198 | SBitStringAux* pLocalBitStringAux = pBitStringAux; |
| 199 | assert (pSps != NULL && pBitStringAux != NULL); |
| 200 | |
| 201 | BsWriteOneBit (pLocalBitStringAux, pSps->bAspectRatioPresent); //aspect_ratio_info_present_flag |
| 202 | if (pSps->bAspectRatioPresent) { |
| 203 | BsWriteBits (pLocalBitStringAux, 8, pSps->eAspectRatio); // aspect_ratio_idc |
| 204 | if (pSps->eAspectRatio == ASP_EXT_SAR) { |
| 205 | BsWriteBits (pLocalBitStringAux, 16, pSps->sAspectRatioExtWidth); // sar_width |
| 206 | BsWriteBits (pLocalBitStringAux, 16, pSps->sAspectRatioExtHeight); // sar_height |
| 207 | } |
| 208 | } |
| 209 | BsWriteOneBit (pLocalBitStringAux, false); //overscan_info_present_flag |
| 210 | |
| 211 | // See codec_app_def.h and parameter_sets.h for more info about members bVideoSignalTypePresent through uiColorMatrix. |
| 212 | BsWriteOneBit (pLocalBitStringAux, pSps->bVideoSignalTypePresent); //video_signal_type_present_flag |
| 213 | if (pSps->bVideoSignalTypePresent) { |
| 214 | //write video signal type info to header |
| 215 | |
| 216 | BsWriteBits (pLocalBitStringAux, 3, pSps->uiVideoFormat); |
| 217 | BsWriteOneBit (pLocalBitStringAux, pSps->bFullRange); |
| 218 | BsWriteOneBit (pLocalBitStringAux, pSps->bColorDescriptionPresent); |
| 219 | |
| 220 | if (pSps->bColorDescriptionPresent) { |
| 221 | //write color description info to header |
| 222 | |
| 223 | BsWriteBits (pLocalBitStringAux, 8, pSps->uiColorPrimaries); |
| 224 | BsWriteBits (pLocalBitStringAux, 8, pSps->uiTransferCharacteristics); |
| 225 | BsWriteBits (pLocalBitStringAux, 8, pSps->uiColorMatrix); |
| 226 | |
| 227 | }//write color description info to header |
| 228 | |
| 229 | }//write video signal type info to header |
| 230 | |
| 231 | BsWriteOneBit (pLocalBitStringAux, false); //chroma_loc_info_present_flag |
| 232 | BsWriteOneBit (pLocalBitStringAux, false); //timing_info_present_flag |
| 233 | BsWriteOneBit (pLocalBitStringAux, false); //nal_hrd_parameters_present_flag |
| 234 | BsWriteOneBit (pLocalBitStringAux, false); //vcl_hrd_parameters_present_flag |
| 235 | BsWriteOneBit (pLocalBitStringAux, false); //pic_struct_present_flag |
| 236 | BsWriteOneBit (pLocalBitStringAux, true); //bitstream_restriction_flag |
| 237 | |
| 238 | // |
| 239 | BsWriteOneBit (pLocalBitStringAux, true); //motion_vectors_over_pic_boundaries_flag |
| 240 | BsWriteUE (pLocalBitStringAux, 0); //max_bytes_per_pic_denom |
| 241 | BsWriteUE (pLocalBitStringAux, 0); //max_bits_per_mb_denom |
| 242 | BsWriteUE (pLocalBitStringAux, 16); //log2_max_mv_length_horizontal |
| 243 | BsWriteUE (pLocalBitStringAux, 16); //log2_max_mv_length_vertical |
| 244 | |
| 245 | BsWriteUE (pLocalBitStringAux, 0); //max_num_reorder_frames |
| 246 | BsWriteUE (pLocalBitStringAux, pSps->iNumRefFrames); //max_dec_frame_buffering |
| 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | /*! |
| 252 | ************************************************************************************* |
no test coverage detected