31 16, 16, 16, 16, 17, 18, 21, 24,
32 16, 16, 16, 16, 17, 19, 22, 25,
33 16, 16, 17, 18, 20, 22, 25, 29,
34 16, 16, 18, 21, 24, 27, 31, 36,
35 17, 17, 20, 24, 30, 35, 41, 47,
36 18, 19, 22, 27, 35, 44, 54, 65,
37 21, 22, 25, 31, 41, 54, 70, 88,
38 24, 25, 29, 36, 47, 65, 88, 115
42 16, 16, 16, 16, 17, 18, 20, 24,
43 16, 16, 16, 17, 18, 20, 24, 25,
44 16, 16, 17, 18, 20, 24, 25, 28,
45 16, 17, 18, 20, 24, 25, 28, 33,
46 17, 18, 20, 24, 25, 28, 33, 41,
47 18, 20, 24, 25, 28, 33, 41, 54,
48 20, 24, 25, 28, 33, 41, 54, 71,
49 24, 25, 28, 33, 41, 54, 71, 91
73 const HEVCSPS *sps,
int is_slice_header)
90 int delta_rps, abs_delta_rps;
94 if (is_slice_header) {
98 "Invalid value of delta_idx in slice header RPS: %d > %d.\n",
108 delta_rps = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
115 if (used || use_delta_flag) {
116 if (i < rps_ridx->num_delta_pocs)
117 delta_poc = delta_rps + rps_ridx->
delta_poc[i];
119 delta_poc = delta_rps;
137 for (k = i - 1; k >= 0; k--) {
139 if (delta_poc < tmp) {
163 unsigned int prev, nb_positive_pics;
183 for (i = 0; i < nb_positive_pics; i++) {
213 for (i = 0; i < 32; i++)
233 for (i = 0; i < max_num_sub_layers - 1; i++) {
237 if (max_num_sub_layers - 1> 0)
238 for (i = max_num_sub_layers - 1; i < 8; i++)
240 for (i = 0; i < max_num_sub_layers - 1; i++) {
249 int subpic_params_present)
254 for (i = 0; i < nb_cpb; i++) {
258 if (subpic_params_present) {
270 int nal_params_present = 0, vcl_params_present = 0;
271 int subpic_params_present = 0;
274 if (common_inf_present) {
278 if (nal_params_present || vcl_params_present) {
281 if (subpic_params_present) {
291 if (subpic_params_present)
300 for (i = 0; i < max_sublayers; i++) {
302 unsigned int nb_cpb = 1;
316 if (nal_params_present)
318 if (vcl_params_present)
400 int common_inf_present = 1;
431 vui->
sar = vui_sar[sar_idx];
432 else if (sar_idx == 255) {
437 "Unknown SAR index: %u.\n", sar_idx);
487 "discarding vui default display window, "
488 "original values are l:%u r:%u t:%u b:%u\n",
531 for (matrixId = 0; matrixId < 6; matrixId++) {
533 memset(sl->
sl[0][matrixId], 16, 16);
534 sl->
sl_dc[0][matrixId] = 16;
535 sl->
sl_dc[1][matrixId] = 16;
556 uint8_t scaling_list_pred_mode_flag[4][6];
557 int32_t scaling_list_dc_coef[2][6];
558 int size_id, matrix_id, i, pos;
560 for (size_id = 0; size_id < 4; size_id++)
561 for (matrix_id = 0; matrix_id < (size_id == 3 ? 2 : 6); matrix_id++) {
562 scaling_list_pred_mode_flag[size_id][matrix_id] =
get_bits1(gb);
563 if (!scaling_list_pred_mode_flag[size_id][matrix_id]) {
569 if (matrix_id < delta) {
571 "Invalid delta in scaling list data: %d.\n", delta);
575 memcpy(sl->
sl[size_id][matrix_id],
576 sl->
sl[size_id][matrix_id - delta],
577 size_id > 0 ? 64 : 16);
579 sl->
sl_dc[size_id - 2][matrix_id] = sl->
sl_dc[size_id - 2][matrix_id -
delta];
582 int next_coef, coef_num;
583 int32_t scaling_list_delta_coef;
586 coef_num =
FFMIN(64, 1 << (4 + (size_id << 1)));
588 scaling_list_dc_coef[size_id - 2][matrix_id] =
get_se_golomb(gb) + 8;
589 next_coef = scaling_list_dc_coef[size_id - 2][matrix_id];
590 sl->
sl_dc[size_id - 2][matrix_id] = next_coef;
592 for (i = 0; i < coef_num; i++) {
601 next_coef = (next_coef + scaling_list_delta_coef + 256) % 256;
602 sl->
sl[size_id][matrix_id][pos] = next_coef;
615 unsigned int sps_id = 0;
616 int log2_diff_max_min_transform_block_size;
617 int bit_depth_chroma,
start, vui_present, sublayer_ordering_info;
689 "discarding sps conformance window, "
690 "original values are l:%u r:%u t:%u b:%u\n",
706 if (bit_depth_chroma != sps->
bit_depth) {
708 "Luma bit depth (%d) is different from chroma bit depth (%d), "
709 "this is unsupported.\n",
728 "non-4:2:0 support is currently unspecified.\n");
775 if (!sublayer_ordering_info) {
776 for (i = 0; i <
start; i++) {
821 "PCM bit depth (%d) is greater than normal bit depth (%d)\n",
870 "chroma samples to preserve alignment.\n",
885 "Displaying the whole video surface.\n");
934 "max transform block size out of range: %d\n",
941 "Parsed SPS: id %d; coded wxh: %dx%d; "
942 "cropped wxh: %dx%d; pix_fmt: %s.\n",
993 int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
994 int log2_diff_ctb_min_tb_size;
995 int i, j, x,
y, ctb_addr_rs, tile_id;
997 unsigned int pps_id = 0;
1237 pps->
tile_id = av_malloc_array(pic_area_in_ctbs,
sizeof(*pps->
tile_id));
1246 for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
1247 int tb_x = ctb_addr_rs % sps->
ctb_width;
1248 int tb_y = ctb_addr_rs / sps->
ctb_width;
1254 if (tb_x < pps->col_bd[i + 1]) {
1261 if (tb_y < pps->row_bd[i + 1]) {
1267 for (i = 0; i < tile_x; i++)
1269 for (i = 0; i < tile_y; i++)
1273 tb_x - pps->
col_bd[tile_x];
1281 for (y = pps->
row_bd[j]; y < pps->row_bd[j + 1]; y++)
1282 for (x = pps->
col_bd[i]; x < pps->col_bd[i + 1]; x++)
1299 int ctb_addr_rs = sps->
ctb_width * tb_y + tb_x;
1304 val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
1313 int tb_x = x >> log2_diff_ctb_min_tb_size;
1314 int tb_y = y >> log2_diff_ctb_min_tb_size;
1315 int ctb_addr_rs = sps->
ctb_width * tb_y + tb_x;
1317 (log2_diff_ctb_min_tb_size * 2);
1318 for (i = 0; i < log2_diff_ctb_min_tb_size; i++) {
1320 val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);