Lines Matching refs:rbsp

38 static void nal_hevc_write_start_code_prefix(struct rbsp *rbsp)  in nal_hevc_write_start_code_prefix()  argument
40 u8 *p = rbsp->data + DIV_ROUND_UP(rbsp->pos, 8); in nal_hevc_write_start_code_prefix()
43 if (DIV_ROUND_UP(rbsp->pos, 8) + i > rbsp->size) { in nal_hevc_write_start_code_prefix()
44 rbsp->error = -EINVAL; in nal_hevc_write_start_code_prefix()
53 rbsp->pos += i * 8; in nal_hevc_write_start_code_prefix()
56 static void nal_hevc_read_start_code_prefix(struct rbsp *rbsp) in nal_hevc_read_start_code_prefix() argument
58 u8 *p = rbsp->data + DIV_ROUND_UP(rbsp->pos, 8); in nal_hevc_read_start_code_prefix()
61 if (DIV_ROUND_UP(rbsp->pos, 8) + i > rbsp->size) { in nal_hevc_read_start_code_prefix()
62 rbsp->error = -EINVAL; in nal_hevc_read_start_code_prefix()
67 rbsp->error = -EINVAL; in nal_hevc_read_start_code_prefix()
71 rbsp->pos += i * 8; in nal_hevc_read_start_code_prefix()
74 static void nal_hevc_write_filler_data(struct rbsp *rbsp) in nal_hevc_write_filler_data() argument
76 u8 *p = rbsp->data + DIV_ROUND_UP(rbsp->pos, 8); in nal_hevc_write_filler_data()
80 i = rbsp->size - DIV_ROUND_UP(rbsp->pos, 8) - 1; in nal_hevc_write_filler_data()
82 rbsp->pos += i * 8; in nal_hevc_write_filler_data()
85 static void nal_hevc_read_filler_data(struct rbsp *rbsp) in nal_hevc_read_filler_data() argument
87 u8 *p = rbsp->data + DIV_ROUND_UP(rbsp->pos, 8); in nal_hevc_read_filler_data()
90 if (DIV_ROUND_UP(rbsp->pos, 8) > rbsp->size) { in nal_hevc_read_filler_data()
91 rbsp->error = -EINVAL; in nal_hevc_read_filler_data()
96 rbsp->pos += 8; in nal_hevc_read_filler_data()
100 static void nal_hevc_rbsp_profile_tier_level(struct rbsp *rbsp, in nal_hevc_rbsp_profile_tier_level() argument
106 rbsp_bits(rbsp, 2, &ptl->general_profile_space); in nal_hevc_rbsp_profile_tier_level()
107 rbsp_bit(rbsp, &ptl->general_tier_flag); in nal_hevc_rbsp_profile_tier_level()
108 rbsp_bits(rbsp, 5, &ptl->general_profile_idc); in nal_hevc_rbsp_profile_tier_level()
110 rbsp_bit(rbsp, &ptl->general_profile_compatibility_flag[i]); in nal_hevc_rbsp_profile_tier_level()
111 rbsp_bit(rbsp, &ptl->general_progressive_source_flag); in nal_hevc_rbsp_profile_tier_level()
112 rbsp_bit(rbsp, &ptl->general_interlaced_source_flag); in nal_hevc_rbsp_profile_tier_level()
113 rbsp_bit(rbsp, &ptl->general_non_packed_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
114 rbsp_bit(rbsp, &ptl->general_frame_only_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
129 rbsp_bit(rbsp, &ptl->general_max_12bit_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
130 rbsp_bit(rbsp, &ptl->general_max_10bit_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
131 rbsp_bit(rbsp, &ptl->general_max_8bit_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
132 rbsp_bit(rbsp, &ptl->general_max_422chroma_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
133 rbsp_bit(rbsp, &ptl->general_max_420chroma_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
134 rbsp_bit(rbsp, &ptl->general_max_monochrome_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
135 rbsp_bit(rbsp, &ptl->general_intra_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
136 rbsp_bit(rbsp, &ptl->general_one_picture_only_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
137 rbsp_bit(rbsp, &ptl->general_lower_bit_rate_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
144 rbsp_bit(rbsp, &ptl->general_max_14bit_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
145 rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_33bits); in nal_hevc_rbsp_profile_tier_level()
146 rbsp_bits(rbsp, 33 - 32, &ptl->general_reserved_zero_33bits); in nal_hevc_rbsp_profile_tier_level()
148 rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_34bits); in nal_hevc_rbsp_profile_tier_level()
149 rbsp_bits(rbsp, 34 - 2, &ptl->general_reserved_zero_34bits); in nal_hevc_rbsp_profile_tier_level()
153 rbsp_bits(rbsp, 7, &ptl->general_reserved_zero_7bits); in nal_hevc_rbsp_profile_tier_level()
154 rbsp_bit(rbsp, &ptl->general_one_picture_only_constraint_flag); in nal_hevc_rbsp_profile_tier_level()
155 rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_35bits); in nal_hevc_rbsp_profile_tier_level()
156 rbsp_bits(rbsp, 35 - 32, &ptl->general_reserved_zero_35bits); in nal_hevc_rbsp_profile_tier_level()
158 rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_43bits); in nal_hevc_rbsp_profile_tier_level()
159 rbsp_bits(rbsp, 43 - 32, &ptl->general_reserved_zero_43bits); in nal_hevc_rbsp_profile_tier_level()
169 rbsp_bit(rbsp, &ptl->general_inbld_flag); in nal_hevc_rbsp_profile_tier_level()
171 rbsp_bit(rbsp, &ptl->general_reserved_zero_bit); in nal_hevc_rbsp_profile_tier_level()
172 rbsp_bits(rbsp, 8, &ptl->general_level_idc); in nal_hevc_rbsp_profile_tier_level()
174 rbsp_unsupported(rbsp); in nal_hevc_rbsp_profile_tier_level()
177 static void nal_hevc_rbsp_vps(struct rbsp *rbsp, struct nal_hevc_vps *vps) in nal_hevc_rbsp_vps() argument
182 rbsp_bits(rbsp, 4, &vps->video_parameter_set_id); in nal_hevc_rbsp_vps()
183 rbsp_bit(rbsp, &vps->base_layer_internal_flag); in nal_hevc_rbsp_vps()
184 rbsp_bit(rbsp, &vps->base_layer_available_flag); in nal_hevc_rbsp_vps()
185 rbsp_bits(rbsp, 6, &vps->max_layers_minus1); in nal_hevc_rbsp_vps()
186 rbsp_bits(rbsp, 3, &vps->max_sub_layers_minus1); in nal_hevc_rbsp_vps()
187 rbsp_bits(rbsp, 1, &vps->temporal_id_nesting_flag); in nal_hevc_rbsp_vps()
188 rbsp_bits(rbsp, 16, &reserved_0xffff_16bits); in nal_hevc_rbsp_vps()
189 nal_hevc_rbsp_profile_tier_level(rbsp, &vps->profile_tier_level); in nal_hevc_rbsp_vps()
190 rbsp_bit(rbsp, &vps->sub_layer_ordering_info_present_flag); in nal_hevc_rbsp_vps()
193 rbsp_uev(rbsp, &vps->max_dec_pic_buffering_minus1[i]); in nal_hevc_rbsp_vps()
194 rbsp_uev(rbsp, &vps->max_num_reorder_pics[i]); in nal_hevc_rbsp_vps()
195 rbsp_uev(rbsp, &vps->max_latency_increase_plus1[i]); in nal_hevc_rbsp_vps()
197 rbsp_bits(rbsp, 6, &vps->max_layer_id); in nal_hevc_rbsp_vps()
198 rbsp_uev(rbsp, &vps->num_layer_sets_minus1); in nal_hevc_rbsp_vps()
201 rbsp_bit(rbsp, &vps->layer_id_included_flag[i][j]); in nal_hevc_rbsp_vps()
202 rbsp_bit(rbsp, &vps->timing_info_present_flag); in nal_hevc_rbsp_vps()
204 rbsp_unsupported(rbsp); in nal_hevc_rbsp_vps()
205 rbsp_bit(rbsp, &vps->extension_flag); in nal_hevc_rbsp_vps()
207 rbsp_unsupported(rbsp); in nal_hevc_rbsp_vps()
210 static void nal_hevc_rbsp_sub_layer_hrd_parameters(struct rbsp *rbsp, in nal_hevc_rbsp_sub_layer_hrd_parameters() argument
217 rbsp_uev(rbsp, &hrd->bit_rate_value_minus1[i]); in nal_hevc_rbsp_sub_layer_hrd_parameters()
218 rbsp_uev(rbsp, &hrd->cpb_size_value_minus1[i]); in nal_hevc_rbsp_sub_layer_hrd_parameters()
219 rbsp_bit(rbsp, &hrd->cbr_flag[i]); in nal_hevc_rbsp_sub_layer_hrd_parameters()
223 static void nal_hevc_rbsp_hrd_parameters(struct rbsp *rbsp, in nal_hevc_rbsp_hrd_parameters() argument
229 rbsp_bit(rbsp, &hrd->nal_hrd_parameters_present_flag); in nal_hevc_rbsp_hrd_parameters()
230 rbsp_bit(rbsp, &hrd->vcl_hrd_parameters_present_flag); in nal_hevc_rbsp_hrd_parameters()
232 rbsp_bit(rbsp, &hrd->sub_pic_hrd_params_present_flag); in nal_hevc_rbsp_hrd_parameters()
234 rbsp_bits(rbsp, 8, &hrd->tick_divisor_minus2); in nal_hevc_rbsp_hrd_parameters()
235 rbsp_bits(rbsp, 5, &hrd->du_cpb_removal_delay_increment_length_minus1); in nal_hevc_rbsp_hrd_parameters()
236 rbsp_bit(rbsp, &hrd->sub_pic_cpb_params_in_pic_timing_sei_flag); in nal_hevc_rbsp_hrd_parameters()
237 rbsp_bits(rbsp, 5, &hrd->dpb_output_delay_du_length_minus1); in nal_hevc_rbsp_hrd_parameters()
239 rbsp_bits(rbsp, 4, &hrd->bit_rate_scale); in nal_hevc_rbsp_hrd_parameters()
240 rbsp_bits(rbsp, 4, &hrd->cpb_size_scale); in nal_hevc_rbsp_hrd_parameters()
242 rbsp_bits(rbsp, 4, &hrd->cpb_size_du_scale); in nal_hevc_rbsp_hrd_parameters()
243 rbsp_bits(rbsp, 5, &hrd->initial_cpb_removal_delay_length_minus1); in nal_hevc_rbsp_hrd_parameters()
244 rbsp_bits(rbsp, 5, &hrd->au_cpb_removal_delay_length_minus1); in nal_hevc_rbsp_hrd_parameters()
245 rbsp_bits(rbsp, 5, &hrd->dpb_output_delay_length_minus1); in nal_hevc_rbsp_hrd_parameters()
248 rbsp_bit(rbsp, &hrd->fixed_pic_rate_general_flag[i]); in nal_hevc_rbsp_hrd_parameters()
250 rbsp_bit(rbsp, &hrd->fixed_pic_rate_within_cvs_flag[i]); in nal_hevc_rbsp_hrd_parameters()
252 rbsp_uev(rbsp, &hrd->elemental_duration_in_tc_minus1[i]); in nal_hevc_rbsp_hrd_parameters()
254 rbsp_bit(rbsp, &hrd->low_delay_hrd_flag[i]); in nal_hevc_rbsp_hrd_parameters()
256 rbsp_uev(rbsp, &hrd->cpb_cnt_minus1[i]); in nal_hevc_rbsp_hrd_parameters()
258 nal_hevc_rbsp_sub_layer_hrd_parameters(rbsp, &hrd->vcl_hrd[i]); in nal_hevc_rbsp_hrd_parameters()
260 nal_hevc_rbsp_sub_layer_hrd_parameters(rbsp, &hrd->vcl_hrd[i]); in nal_hevc_rbsp_hrd_parameters()
264 static void nal_hevc_rbsp_vui_parameters(struct rbsp *rbsp, in nal_hevc_rbsp_vui_parameters() argument
268 rbsp->error = -EINVAL; in nal_hevc_rbsp_vui_parameters()
272 rbsp_bit(rbsp, &vui->aspect_ratio_info_present_flag); in nal_hevc_rbsp_vui_parameters()
274 rbsp_bits(rbsp, 8, &vui->aspect_ratio_idc); in nal_hevc_rbsp_vui_parameters()
276 rbsp_bits(rbsp, 16, &vui->sar_width); in nal_hevc_rbsp_vui_parameters()
277 rbsp_bits(rbsp, 16, &vui->sar_height); in nal_hevc_rbsp_vui_parameters()
281 rbsp_bit(rbsp, &vui->overscan_info_present_flag); in nal_hevc_rbsp_vui_parameters()
283 rbsp_bit(rbsp, &vui->overscan_appropriate_flag); in nal_hevc_rbsp_vui_parameters()
285 rbsp_bit(rbsp, &vui->video_signal_type_present_flag); in nal_hevc_rbsp_vui_parameters()
287 rbsp_bits(rbsp, 3, &vui->video_format); in nal_hevc_rbsp_vui_parameters()
288 rbsp_bit(rbsp, &vui->video_full_range_flag); in nal_hevc_rbsp_vui_parameters()
290 rbsp_bit(rbsp, &vui->colour_description_present_flag); in nal_hevc_rbsp_vui_parameters()
292 rbsp_bits(rbsp, 8, &vui->colour_primaries); in nal_hevc_rbsp_vui_parameters()
293 rbsp_bits(rbsp, 8, &vui->transfer_characteristics); in nal_hevc_rbsp_vui_parameters()
294 rbsp_bits(rbsp, 8, &vui->matrix_coeffs); in nal_hevc_rbsp_vui_parameters()
298 rbsp_bit(rbsp, &vui->chroma_loc_info_present_flag); in nal_hevc_rbsp_vui_parameters()
300 rbsp_uev(rbsp, &vui->chroma_sample_loc_type_top_field); in nal_hevc_rbsp_vui_parameters()
301 rbsp_uev(rbsp, &vui->chroma_sample_loc_type_bottom_field); in nal_hevc_rbsp_vui_parameters()
304 rbsp_bit(rbsp, &vui->neutral_chroma_indication_flag); in nal_hevc_rbsp_vui_parameters()
305 rbsp_bit(rbsp, &vui->field_seq_flag); in nal_hevc_rbsp_vui_parameters()
306 rbsp_bit(rbsp, &vui->frame_field_info_present_flag); in nal_hevc_rbsp_vui_parameters()
307 rbsp_bit(rbsp, &vui->default_display_window_flag); in nal_hevc_rbsp_vui_parameters()
309 rbsp_uev(rbsp, &vui->def_disp_win_left_offset); in nal_hevc_rbsp_vui_parameters()
310 rbsp_uev(rbsp, &vui->def_disp_win_right_offset); in nal_hevc_rbsp_vui_parameters()
311 rbsp_uev(rbsp, &vui->def_disp_win_top_offset); in nal_hevc_rbsp_vui_parameters()
312 rbsp_uev(rbsp, &vui->def_disp_win_bottom_offset); in nal_hevc_rbsp_vui_parameters()
315 rbsp_bit(rbsp, &vui->vui_timing_info_present_flag); in nal_hevc_rbsp_vui_parameters()
317 rbsp_bits(rbsp, 32, &vui->vui_num_units_in_tick); in nal_hevc_rbsp_vui_parameters()
318 rbsp_bits(rbsp, 32, &vui->vui_time_scale); in nal_hevc_rbsp_vui_parameters()
319 rbsp_bit(rbsp, &vui->vui_poc_proportional_to_timing_flag); in nal_hevc_rbsp_vui_parameters()
321 rbsp_uev(rbsp, &vui->vui_num_ticks_poc_diff_one_minus1); in nal_hevc_rbsp_vui_parameters()
322 rbsp_bit(rbsp, &vui->vui_hrd_parameters_present_flag); in nal_hevc_rbsp_vui_parameters()
324 nal_hevc_rbsp_hrd_parameters(rbsp, &vui->nal_hrd_parameters); in nal_hevc_rbsp_vui_parameters()
327 rbsp_bit(rbsp, &vui->bitstream_restriction_flag); in nal_hevc_rbsp_vui_parameters()
329 rbsp_bit(rbsp, &vui->tiles_fixed_structure_flag); in nal_hevc_rbsp_vui_parameters()
330 rbsp_bit(rbsp, &vui->motion_vectors_over_pic_boundaries_flag); in nal_hevc_rbsp_vui_parameters()
331 rbsp_bit(rbsp, &vui->restricted_ref_pic_lists_flag); in nal_hevc_rbsp_vui_parameters()
332 rbsp_uev(rbsp, &vui->min_spatial_segmentation_idc); in nal_hevc_rbsp_vui_parameters()
333 rbsp_uev(rbsp, &vui->max_bytes_per_pic_denom); in nal_hevc_rbsp_vui_parameters()
334 rbsp_uev(rbsp, &vui->max_bits_per_min_cu_denom); in nal_hevc_rbsp_vui_parameters()
335 rbsp_uev(rbsp, &vui->log2_max_mv_length_horizontal); in nal_hevc_rbsp_vui_parameters()
336 rbsp_uev(rbsp, &vui->log2_max_mv_length_vertical); in nal_hevc_rbsp_vui_parameters()
340 static void nal_hevc_rbsp_sps(struct rbsp *rbsp, struct nal_hevc_sps *sps) in nal_hevc_rbsp_sps() argument
344 rbsp_bits(rbsp, 4, &sps->video_parameter_set_id); in nal_hevc_rbsp_sps()
345 rbsp_bits(rbsp, 3, &sps->max_sub_layers_minus1); in nal_hevc_rbsp_sps()
346 rbsp_bit(rbsp, &sps->temporal_id_nesting_flag); in nal_hevc_rbsp_sps()
347 nal_hevc_rbsp_profile_tier_level(rbsp, &sps->profile_tier_level); in nal_hevc_rbsp_sps()
348 rbsp_uev(rbsp, &sps->seq_parameter_set_id); in nal_hevc_rbsp_sps()
350 rbsp_uev(rbsp, &sps->chroma_format_idc); in nal_hevc_rbsp_sps()
352 rbsp_bit(rbsp, &sps->separate_colour_plane_flag); in nal_hevc_rbsp_sps()
353 rbsp_uev(rbsp, &sps->pic_width_in_luma_samples); in nal_hevc_rbsp_sps()
354 rbsp_uev(rbsp, &sps->pic_height_in_luma_samples); in nal_hevc_rbsp_sps()
355 rbsp_bit(rbsp, &sps->conformance_window_flag); in nal_hevc_rbsp_sps()
357 rbsp_uev(rbsp, &sps->conf_win_left_offset); in nal_hevc_rbsp_sps()
358 rbsp_uev(rbsp, &sps->conf_win_right_offset); in nal_hevc_rbsp_sps()
359 rbsp_uev(rbsp, &sps->conf_win_top_offset); in nal_hevc_rbsp_sps()
360 rbsp_uev(rbsp, &sps->conf_win_bottom_offset); in nal_hevc_rbsp_sps()
362 rbsp_uev(rbsp, &sps->bit_depth_luma_minus8); in nal_hevc_rbsp_sps()
363 rbsp_uev(rbsp, &sps->bit_depth_chroma_minus8); in nal_hevc_rbsp_sps()
365 rbsp_uev(rbsp, &sps->log2_max_pic_order_cnt_lsb_minus4); in nal_hevc_rbsp_sps()
367 rbsp_bit(rbsp, &sps->sub_layer_ordering_info_present_flag); in nal_hevc_rbsp_sps()
370 rbsp_uev(rbsp, &sps->max_dec_pic_buffering_minus1[i]); in nal_hevc_rbsp_sps()
371 rbsp_uev(rbsp, &sps->max_num_reorder_pics[i]); in nal_hevc_rbsp_sps()
372 rbsp_uev(rbsp, &sps->max_latency_increase_plus1[i]); in nal_hevc_rbsp_sps()
374 rbsp_uev(rbsp, &sps->log2_min_luma_coding_block_size_minus3); in nal_hevc_rbsp_sps()
375 rbsp_uev(rbsp, &sps->log2_diff_max_min_luma_coding_block_size); in nal_hevc_rbsp_sps()
376 rbsp_uev(rbsp, &sps->log2_min_luma_transform_block_size_minus2); in nal_hevc_rbsp_sps()
377 rbsp_uev(rbsp, &sps->log2_diff_max_min_luma_transform_block_size); in nal_hevc_rbsp_sps()
378 rbsp_uev(rbsp, &sps->max_transform_hierarchy_depth_inter); in nal_hevc_rbsp_sps()
379 rbsp_uev(rbsp, &sps->max_transform_hierarchy_depth_intra); in nal_hevc_rbsp_sps()
381 rbsp_bit(rbsp, &sps->scaling_list_enabled_flag); in nal_hevc_rbsp_sps()
383 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
385 rbsp_bit(rbsp, &sps->amp_enabled_flag); in nal_hevc_rbsp_sps()
386 rbsp_bit(rbsp, &sps->sample_adaptive_offset_enabled_flag); in nal_hevc_rbsp_sps()
387 rbsp_bit(rbsp, &sps->pcm_enabled_flag); in nal_hevc_rbsp_sps()
389 rbsp_bits(rbsp, 4, &sps->pcm_sample_bit_depth_luma_minus1); in nal_hevc_rbsp_sps()
390 rbsp_bits(rbsp, 4, &sps->pcm_sample_bit_depth_chroma_minus1); in nal_hevc_rbsp_sps()
391 rbsp_uev(rbsp, &sps->log2_min_pcm_luma_coding_block_size_minus3); in nal_hevc_rbsp_sps()
392 rbsp_uev(rbsp, &sps->log2_diff_max_min_pcm_luma_coding_block_size); in nal_hevc_rbsp_sps()
393 rbsp_bit(rbsp, &sps->pcm_loop_filter_disabled_flag); in nal_hevc_rbsp_sps()
396 rbsp_uev(rbsp, &sps->num_short_term_ref_pic_sets); in nal_hevc_rbsp_sps()
398 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
400 rbsp_bit(rbsp, &sps->long_term_ref_pics_present_flag); in nal_hevc_rbsp_sps()
402 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
404 rbsp_bit(rbsp, &sps->sps_temporal_mvp_enabled_flag); in nal_hevc_rbsp_sps()
405 rbsp_bit(rbsp, &sps->strong_intra_smoothing_enabled_flag); in nal_hevc_rbsp_sps()
406 rbsp_bit(rbsp, &sps->vui_parameters_present_flag); in nal_hevc_rbsp_sps()
408 nal_hevc_rbsp_vui_parameters(rbsp, &sps->vui); in nal_hevc_rbsp_sps()
410 rbsp_bit(rbsp, &sps->extension_present_flag); in nal_hevc_rbsp_sps()
412 rbsp_bit(rbsp, &sps->sps_range_extension_flag); in nal_hevc_rbsp_sps()
413 rbsp_bit(rbsp, &sps->sps_multilayer_extension_flag); in nal_hevc_rbsp_sps()
414 rbsp_bit(rbsp, &sps->sps_3d_extension_flag); in nal_hevc_rbsp_sps()
415 rbsp_bit(rbsp, &sps->sps_scc_extension_flag); in nal_hevc_rbsp_sps()
416 rbsp_bits(rbsp, 5, &sps->sps_extension_4bits); in nal_hevc_rbsp_sps()
419 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
421 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
423 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
425 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
427 rbsp_unsupported(rbsp); in nal_hevc_rbsp_sps()
430 static void nal_hevc_rbsp_pps(struct rbsp *rbsp, struct nal_hevc_pps *pps) in nal_hevc_rbsp_pps() argument
434 rbsp_uev(rbsp, &pps->pps_pic_parameter_set_id); in nal_hevc_rbsp_pps()
435 rbsp_uev(rbsp, &pps->pps_seq_parameter_set_id); in nal_hevc_rbsp_pps()
436 rbsp_bit(rbsp, &pps->dependent_slice_segments_enabled_flag); in nal_hevc_rbsp_pps()
437 rbsp_bit(rbsp, &pps->output_flag_present_flag); in nal_hevc_rbsp_pps()
438 rbsp_bits(rbsp, 3, &pps->num_extra_slice_header_bits); in nal_hevc_rbsp_pps()
439 rbsp_bit(rbsp, &pps->sign_data_hiding_enabled_flag); in nal_hevc_rbsp_pps()
440 rbsp_bit(rbsp, &pps->cabac_init_present_flag); in nal_hevc_rbsp_pps()
441 rbsp_uev(rbsp, &pps->num_ref_idx_l0_default_active_minus1); in nal_hevc_rbsp_pps()
442 rbsp_uev(rbsp, &pps->num_ref_idx_l1_default_active_minus1); in nal_hevc_rbsp_pps()
443 rbsp_sev(rbsp, &pps->init_qp_minus26); in nal_hevc_rbsp_pps()
444 rbsp_bit(rbsp, &pps->constrained_intra_pred_flag); in nal_hevc_rbsp_pps()
445 rbsp_bit(rbsp, &pps->transform_skip_enabled_flag); in nal_hevc_rbsp_pps()
446 rbsp_bit(rbsp, &pps->cu_qp_delta_enabled_flag); in nal_hevc_rbsp_pps()
448 rbsp_uev(rbsp, &pps->diff_cu_qp_delta_depth); in nal_hevc_rbsp_pps()
449 rbsp_sev(rbsp, &pps->pps_cb_qp_offset); in nal_hevc_rbsp_pps()
450 rbsp_sev(rbsp, &pps->pps_cr_qp_offset); in nal_hevc_rbsp_pps()
451 rbsp_bit(rbsp, &pps->pps_slice_chroma_qp_offsets_present_flag); in nal_hevc_rbsp_pps()
452 rbsp_bit(rbsp, &pps->weighted_pred_flag); in nal_hevc_rbsp_pps()
453 rbsp_bit(rbsp, &pps->weighted_bipred_flag); in nal_hevc_rbsp_pps()
454 rbsp_bit(rbsp, &pps->transquant_bypass_enabled_flag); in nal_hevc_rbsp_pps()
455 rbsp_bit(rbsp, &pps->tiles_enabled_flag); in nal_hevc_rbsp_pps()
456 rbsp_bit(rbsp, &pps->entropy_coding_sync_enabled_flag); in nal_hevc_rbsp_pps()
458 rbsp_uev(rbsp, &pps->num_tile_columns_minus1); in nal_hevc_rbsp_pps()
459 rbsp_uev(rbsp, &pps->num_tile_rows_minus1); in nal_hevc_rbsp_pps()
460 rbsp_bit(rbsp, &pps->uniform_spacing_flag); in nal_hevc_rbsp_pps()
463 rbsp_uev(rbsp, &pps->column_width_minus1[i]); in nal_hevc_rbsp_pps()
465 rbsp_uev(rbsp, &pps->row_height_minus1[i]); in nal_hevc_rbsp_pps()
467 rbsp_bit(rbsp, &pps->loop_filter_across_tiles_enabled_flag); in nal_hevc_rbsp_pps()
469 rbsp_bit(rbsp, &pps->pps_loop_filter_across_slices_enabled_flag); in nal_hevc_rbsp_pps()
470 rbsp_bit(rbsp, &pps->deblocking_filter_control_present_flag); in nal_hevc_rbsp_pps()
472 rbsp_bit(rbsp, &pps->deblocking_filter_override_enabled_flag); in nal_hevc_rbsp_pps()
473 rbsp_bit(rbsp, &pps->pps_deblocking_filter_disabled_flag); in nal_hevc_rbsp_pps()
475 rbsp_sev(rbsp, &pps->pps_beta_offset_div2); in nal_hevc_rbsp_pps()
476 rbsp_sev(rbsp, &pps->pps_tc_offset_div2); in nal_hevc_rbsp_pps()
479 rbsp_bit(rbsp, &pps->pps_scaling_list_data_present_flag); in nal_hevc_rbsp_pps()
481 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
482 rbsp_bit(rbsp, &pps->lists_modification_present_flag); in nal_hevc_rbsp_pps()
483 rbsp_uev(rbsp, &pps->log2_parallel_merge_level_minus2); in nal_hevc_rbsp_pps()
484 rbsp_bit(rbsp, &pps->slice_segment_header_extension_present_flag); in nal_hevc_rbsp_pps()
485 rbsp_bit(rbsp, &pps->pps_extension_present_flag); in nal_hevc_rbsp_pps()
487 rbsp_bit(rbsp, &pps->pps_range_extension_flag); in nal_hevc_rbsp_pps()
488 rbsp_bit(rbsp, &pps->pps_multilayer_extension_flag); in nal_hevc_rbsp_pps()
489 rbsp_bit(rbsp, &pps->pps_3d_extension_flag); in nal_hevc_rbsp_pps()
490 rbsp_bit(rbsp, &pps->pps_scc_extension_flag); in nal_hevc_rbsp_pps()
491 rbsp_bits(rbsp, 4, &pps->pps_extension_4bits); in nal_hevc_rbsp_pps()
494 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
496 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
498 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
500 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
502 rbsp_unsupported(rbsp); in nal_hevc_rbsp_pps()
522 struct rbsp rbsp; in nal_hevc_write_vps() local
531 rbsp_init(&rbsp, dest, n, &write); in nal_hevc_write_vps()
533 nal_hevc_write_start_code_prefix(&rbsp); in nal_hevc_write_vps()
536 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_write_vps()
537 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_write_vps()
538 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_write_vps()
539 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_write_vps()
541 nal_hevc_rbsp_vps(&rbsp, vps); in nal_hevc_write_vps()
543 rbsp_trailing_bits(&rbsp); in nal_hevc_write_vps()
545 if (rbsp.error) in nal_hevc_write_vps()
546 return rbsp.error; in nal_hevc_write_vps()
548 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_write_vps()
566 struct rbsp rbsp; in nal_hevc_read_vps() local
575 rbsp_init(&rbsp, src, n, &read); in nal_hevc_read_vps()
577 nal_hevc_read_start_code_prefix(&rbsp); in nal_hevc_read_vps()
579 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_read_vps()
580 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_read_vps()
581 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_read_vps()
582 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_read_vps()
584 if (rbsp.error || in nal_hevc_read_vps()
589 nal_hevc_rbsp_vps(&rbsp, vps); in nal_hevc_read_vps()
591 rbsp_trailing_bits(&rbsp); in nal_hevc_read_vps()
593 if (rbsp.error) in nal_hevc_read_vps()
594 return rbsp.error; in nal_hevc_read_vps()
596 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_read_vps()
617 struct rbsp rbsp; in nal_hevc_write_sps() local
626 rbsp_init(&rbsp, dest, n, &write); in nal_hevc_write_sps()
628 nal_hevc_write_start_code_prefix(&rbsp); in nal_hevc_write_sps()
631 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_write_sps()
632 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_write_sps()
633 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_write_sps()
634 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_write_sps()
636 nal_hevc_rbsp_sps(&rbsp, sps); in nal_hevc_write_sps()
638 rbsp_trailing_bits(&rbsp); in nal_hevc_write_sps()
640 if (rbsp.error) in nal_hevc_write_sps()
641 return rbsp.error; in nal_hevc_write_sps()
643 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_write_sps()
661 struct rbsp rbsp; in nal_hevc_read_sps() local
670 rbsp_init(&rbsp, src, n, &read); in nal_hevc_read_sps()
672 nal_hevc_read_start_code_prefix(&rbsp); in nal_hevc_read_sps()
674 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_read_sps()
675 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_read_sps()
676 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_read_sps()
677 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_read_sps()
679 if (rbsp.error || in nal_hevc_read_sps()
684 nal_hevc_rbsp_sps(&rbsp, sps); in nal_hevc_read_sps()
686 rbsp_trailing_bits(&rbsp); in nal_hevc_read_sps()
688 if (rbsp.error) in nal_hevc_read_sps()
689 return rbsp.error; in nal_hevc_read_sps()
691 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_read_sps()
712 struct rbsp rbsp; in nal_hevc_write_pps() local
721 rbsp_init(&rbsp, dest, n, &write); in nal_hevc_write_pps()
723 nal_hevc_write_start_code_prefix(&rbsp); in nal_hevc_write_pps()
726 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_write_pps()
727 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_write_pps()
728 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_write_pps()
729 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_write_pps()
731 nal_hevc_rbsp_pps(&rbsp, pps); in nal_hevc_write_pps()
733 rbsp_trailing_bits(&rbsp); in nal_hevc_write_pps()
735 if (rbsp.error) in nal_hevc_write_pps()
736 return rbsp.error; in nal_hevc_write_pps()
738 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_write_pps()
756 struct rbsp rbsp; in nal_hevc_read_pps() local
765 rbsp_init(&rbsp, src, n, &read); in nal_hevc_read_pps()
767 nal_hevc_read_start_code_prefix(&rbsp); in nal_hevc_read_pps()
770 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_read_pps()
771 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_read_pps()
772 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_read_pps()
773 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_read_pps()
775 nal_hevc_rbsp_pps(&rbsp, pps); in nal_hevc_read_pps()
777 rbsp_trailing_bits(&rbsp); in nal_hevc_read_pps()
779 if (rbsp.error) in nal_hevc_read_pps()
780 return rbsp.error; in nal_hevc_read_pps()
782 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_read_pps()
805 struct rbsp rbsp; in nal_hevc_write_filler() local
814 rbsp_init(&rbsp, dest, n, &write); in nal_hevc_write_filler()
816 nal_hevc_write_start_code_prefix(&rbsp); in nal_hevc_write_filler()
818 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_write_filler()
819 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_write_filler()
820 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_write_filler()
821 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_write_filler()
823 nal_hevc_write_filler_data(&rbsp); in nal_hevc_write_filler()
824 rbsp_trailing_bits(&rbsp); in nal_hevc_write_filler()
826 if (rbsp.error) in nal_hevc_write_filler()
827 return rbsp.error; in nal_hevc_write_filler()
829 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_write_filler()
852 struct rbsp rbsp; in nal_hevc_read_filler() local
861 rbsp_init(&rbsp, src, n, &read); in nal_hevc_read_filler()
863 nal_hevc_read_start_code_prefix(&rbsp); in nal_hevc_read_filler()
865 rbsp_bit(&rbsp, &forbidden_zero_bit); in nal_hevc_read_filler()
866 rbsp_bits(&rbsp, 6, &nal_unit_type); in nal_hevc_read_filler()
867 rbsp_bits(&rbsp, 6, &nuh_layer_id); in nal_hevc_read_filler()
868 rbsp_bits(&rbsp, 3, &nuh_temporal_id_plus1); in nal_hevc_read_filler()
870 if (rbsp.error) in nal_hevc_read_filler()
871 return rbsp.error; in nal_hevc_read_filler()
876 nal_hevc_read_filler_data(&rbsp); in nal_hevc_read_filler()
877 rbsp_trailing_bits(&rbsp); in nal_hevc_read_filler()
879 if (rbsp.error) in nal_hevc_read_filler()
880 return rbsp.error; in nal_hevc_read_filler()
882 return DIV_ROUND_UP(rbsp.pos, 8); in nal_hevc_read_filler()