History

avcodec/evc_ps: use get_bits1() where useful

James Almer committed 3 years ago

Commit 5b372c71 parent ea190b81 file · +37 −37Browse files

Unified · Split

libavcodec/evc_ps.c+37−37
@@ -177,7 +177,7 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 176 unmodified lines
177177 sps->bit_depth_luma_minus8 = get_ue_golomb(&gb);
178178 sps->bit_depth_chroma_minus8 = get_ue_golomb(&gb);
179179
180− sps->sps_btt_flag = get_bits(&gb, 1);
180+ sps->sps_btt_flag = get_bits1(&gb);
181181 if (sps->sps_btt_flag) {
182182 sps->log2_ctu_size_minus5 = get_ue_golomb(&gb);
183183 sps->log2_min_cb_size_minus2 = get_ue_golomb(&gb);
@@ -186,43 +186,43 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 2 unmodified lines
186186 sps->log2_diff_min_cb_min_tt_cb_size_minus2 = get_ue_golomb(&gb);
187187 }
188188
189− sps->sps_suco_flag = get_bits(&gb, 1);
189+ sps->sps_suco_flag = get_bits1(&gb);
190190 if (sps->sps_suco_flag) {
191191 sps->log2_diff_ctu_size_max_suco_cb_size = get_ue_golomb(&gb);
192192 sps->log2_diff_max_suco_min_suco_cb_size = get_ue_golomb(&gb);
193193 }
194194
195− sps->sps_admvp_flag = get_bits(&gb, 1);
195+ sps->sps_admvp_flag = get_bits1(&gb);
196196 if (sps->sps_admvp_flag) {
197− sps->sps_affine_flag = get_bits(&gb, 1);
198− sps->sps_amvr_flag = get_bits(&gb, 1);
199− sps->sps_dmvr_flag = get_bits(&gb, 1);
200− sps->sps_mmvd_flag = get_bits(&gb, 1);
201− sps->sps_hmvp_flag = get_bits(&gb, 1);
197+ sps->sps_affine_flag = get_bits1(&gb);
198+ sps->sps_amvr_flag = get_bits1(&gb);
199+ sps->sps_dmvr_flag = get_bits1(&gb);
200+ sps->sps_mmvd_flag = get_bits1(&gb);
201+ sps->sps_hmvp_flag = get_bits1(&gb);
202202 }
203203
204− sps->sps_eipd_flag = get_bits(&gb, 1);
204+ sps->sps_eipd_flag = get_bits1(&gb);
205205 if (sps->sps_eipd_flag) {
206− sps->sps_ibc_flag = get_bits(&gb, 1);
206+ sps->sps_ibc_flag = get_bits1(&gb);
207207 if (sps->sps_ibc_flag)
208208 sps->log2_max_ibc_cand_size_minus2 = get_ue_golomb(&gb);
209209 }
210210
211− sps->sps_cm_init_flag = get_bits(&gb, 1);
211+ sps->sps_cm_init_flag = get_bits1(&gb);
212212 if (sps->sps_cm_init_flag)
213− sps->sps_adcc_flag = get_bits(&gb, 1);
213+ sps->sps_adcc_flag = get_bits1(&gb);
214214
215− sps->sps_iqt_flag = get_bits(&gb, 1);
215+ sps->sps_iqt_flag = get_bits1(&gb);
216216 if (sps->sps_iqt_flag)
217− sps->sps_ats_flag = get_bits(&gb, 1);
217+ sps->sps_ats_flag = get_bits1(&gb);
218218
219− sps->sps_addb_flag = get_bits(&gb, 1);
220− sps->sps_alf_flag = get_bits(&gb, 1);
221− sps->sps_htdf_flag = get_bits(&gb, 1);
222− sps->sps_rpl_flag = get_bits(&gb, 1);
223− sps->sps_pocs_flag = get_bits(&gb, 1);
224− sps->sps_dquant_flag = get_bits(&gb, 1);
225− sps->sps_dra_flag = get_bits(&gb, 1);
219+ sps->sps_addb_flag = get_bits1(&gb);
220+ sps->sps_alf_flag = get_bits1(&gb);
221+ sps->sps_htdf_flag = get_bits1(&gb);
222+ sps->sps_rpl_flag = get_bits1(&gb);
223+ sps->sps_pocs_flag = get_bits1(&gb);
224+ sps->sps_dquant_flag = get_bits1(&gb);
225+ sps->sps_dra_flag = get_bits1(&gb);
226226
227227 if (sps->sps_pocs_flag) {
228228 sps->log2_max_pic_order_cnt_lsb_minus4 = get_ue_golomb(&gb);
@@ -246,8 +246,8 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 17 unmodified lines
246246 sps->max_num_tid0_ref_pics = get_ue_golomb(&gb);
247247 else {
248248 sps->sps_max_dec_pic_buffering_minus1 = get_ue_golomb(&gb);
249− sps->long_term_ref_pic_flag = get_bits(&gb, 1);
250− sps->rpl1_same_as_rpl0_flag = get_bits(&gb, 1);
249+ sps->long_term_ref_pic_flag = get_bits1(&gb);
250+ sps->rpl1_same_as_rpl0_flag = get_bits1(&gb);
251251 sps->num_ref_pic_list_in_sps[0] = get_ue_golomb(&gb);
252252
253253 for (int i = 0; i < sps->num_ref_pic_list_in_sps[0]; ++i)
@@ -260,7 +260,7 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 6 unmodified lines
260260 }
261261 }
262262
263− sps->picture_cropping_flag = get_bits(&gb, 1);
263+ sps->picture_cropping_flag = get_bits1(&gb);
264264
265265 if (sps->picture_cropping_flag) {
266266 sps->picture_crop_left_offset = get_ue_golomb(&gb);
@@ -270,11 +270,11 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 3 unmodified lines
270270 }
271271
272272 if (sps->chroma_format_idc != 0) {
273− sps->chroma_qp_table_struct.chroma_qp_table_present_flag = get_bits(&gb, 1);
273+ sps->chroma_qp_table_struct.chroma_qp_table_present_flag = get_bits1(&gb);
274274
275275 if (sps->chroma_qp_table_struct.chroma_qp_table_present_flag) {
276− sps->chroma_qp_table_struct.same_qp_table_for_chroma = get_bits(&gb, 1);
277− sps->chroma_qp_table_struct.global_offset_flag = get_bits(&gb, 1);
276+ sps->chroma_qp_table_struct.same_qp_table_for_chroma = get_bits1(&gb);
277+ sps->chroma_qp_table_struct.global_offset_flag = get_bits1(&gb);
278278 for (int i = 0; i < (sps->chroma_qp_table_struct.same_qp_table_for_chroma ? 1 : 2); i++) {
279279 sps->chroma_qp_table_struct.num_points_in_qp_table_minus1[i] = get_ue_golomb(&gb);
280280 if (sps->chroma_qp_table_struct.num_points_in_qp_table_minus1[i] >= EVC_MAX_QP_TABLE_SIZE) {
@@ -289,7 +289,7 @@ int ff_evc_parse_sps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 8 unmodified lines
289289 }
290290 }
291291
292− sps->vui_parameters_present_flag = get_bits(&gb, 1);
292+ sps->vui_parameters_present_flag = get_bits1(&gb);
293293 if (sps->vui_parameters_present_flag)
294294 vui_parameters(&gb, &(sps->vui_parameters));
295295
@@ -345,8 +345,8 @@ int ff_evc_parse_pps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 49 unmodified lines
345345 pps->num_ref_idx_default_active_minus1[0] = get_ue_golomb(&gb);
346346 pps->num_ref_idx_default_active_minus1[1] = get_ue_golomb(&gb);
347347 pps->additional_lt_poc_lsb_len = get_ue_golomb(&gb);
348− pps->rpl1_idx_present_flag = get_bits(&gb, 1);
349− pps->single_tile_in_pic_flag = get_bits(&gb, 1);
348+ pps->rpl1_idx_present_flag = get_bits1(&gb);
349+ pps->single_tile_in_pic_flag = get_bits1(&gb);
350350
351351 if (!pps->single_tile_in_pic_flag) {
352352 pps->num_tile_columns_minus1 = get_ue_golomb(&gb);
@@ -356,7 +356,7 @@ int ff_evc_parse_pps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 3 unmodified lines
356356 ret = AVERROR_INVALIDDATA;
357357 goto fail;
358358 }
359− pps->uniform_tile_spacing_flag = get_bits(&gb, 1);
359+ pps->uniform_tile_spacing_flag = get_bits1(&gb);
360360
361361 if (!pps->uniform_tile_spacing_flag) {
362362 for (int i = 0; i < pps->num_tile_columns_minus1; i++)
@@ -365,7 +365,7 @@ int ff_evc_parse_pps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 2 unmodified lines
365365 for (int i = 0; i < pps->num_tile_rows_minus1; i++)
366366 pps->tile_row_height_minus1[i] = get_ue_golomb(&gb);
367367 }
368− pps->loop_filter_across_tiles_enabled_flag = get_bits(&gb, 1);
368+ pps->loop_filter_across_tiles_enabled_flag = get_bits1(&gb);
369369 pps->tile_offset_len_minus1 = get_ue_golomb(&gb);
370370 }
371371
@@ -374,7 +374,7 @@ int ff_evc_parse_pps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 2 unmodified lines
374374 ret = AVERROR_INVALIDDATA;
375375 goto fail;
376376 }
377− pps->explicit_tile_id_flag = get_bits(&gb, 1);
377+ pps->explicit_tile_id_flag = get_bits1(&gb);
378378
379379 if (pps->explicit_tile_id_flag) {
380380 for (int i = 0; i <= pps->num_tile_rows_minus1; i++) {
@@ -384,14 +384,14 @@ int ff_evc_parse_pps(EVCParamSets *ps, const uint8_t *bs, int bs_size) · 3 unmodified lines
384384 }
385385
386386 pps->pic_dra_enabled_flag = 0;
387− pps->pic_dra_enabled_flag = get_bits(&gb, 1);
387+ pps->pic_dra_enabled_flag = get_bits1(&gb);
388388
389389 if (pps->pic_dra_enabled_flag)
390390 pps->pic_dra_aps_id = get_bits(&gb, 5);
391391
392− pps->arbitrary_slice_present_flag = get_bits(&gb, 1);
393− pps->constrained_intra_pred_flag = get_bits(&gb, 1);
394− pps->cu_qp_delta_enabled_flag = get_bits(&gb, 1);
392+ pps->arbitrary_slice_present_flag = get_bits1(&gb);
393+ pps->constrained_intra_pred_flag = get_bits1(&gb);
394+ pps->cu_qp_delta_enabled_flag = get_bits1(&gb);
395395
396396 if (pps->cu_qp_delta_enabled_flag)
397397 pps->log2_cu_qp_delta_area_minus6 = get_ue_golomb(&gb);

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