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)
91 unsigned abs_delta_rps;
95 if (is_slice_header) {
99 "Invalid value of delta_idx in slice header RPS: %d > %d.\n",
109 if (abs_delta_rps < 1 || abs_delta_rps > 32768) {
111 "Invalid value of abs_delta_rps: %d\n",
115 delta_rps = (1 - (delta_rps_sign << 1)) * abs_delta_rps;
122 if (used || use_delta_flag) {
123 if (i < rps_ridx->num_delta_pocs)
124 delta_poc = delta_rps + rps_ridx->
delta_poc[i];
126 delta_poc = delta_rps;
144 for (k = i - 1; k >= 0; k--) {
146 if (delta_poc < tmp) {
170 unsigned int prev, nb_positive_pics;
190 for (i = 0; i < nb_positive_pics; i++) {
225 for (i = 0; i < 32; i++)
252 for (i = 0; i < max_num_sub_layers - 1; i++) {
257 if (max_num_sub_layers - 1> 0)
258 for (i = max_num_sub_layers - 1; i < 8; i++)
260 for (i = 0; i < max_num_sub_layers - 1; i++) {
264 "PTL information for sublayer %i too short\n", i);
270 "Not enough data for sublayer %i level_idc\n", i);
281 int subpic_params_present)
286 for (i = 0; i < nb_cpb; i++) {
290 if (subpic_params_present) {
302 int nal_params_present = 0, vcl_params_present = 0;
303 int subpic_params_present = 0;
306 if (common_inf_present) {
310 if (nal_params_present || vcl_params_present) {
313 if (subpic_params_present) {
323 if (subpic_params_present)
332 for (i = 0; i < max_sublayers; i++) {
334 unsigned int nb_cpb = 1;
347 if (nb_cpb < 1 || nb_cpb > 32) {
353 if (nal_params_present)
355 if (vcl_params_present)
445 int common_inf_present = 1;
475 int sar_present, alt = 0;
483 vui->
sar = vui_sar[sar_idx];
484 else if (sar_idx == 255) {
489 "Unknown SAR index: %u.\n", sar_idx);
534 memcpy(&backup, gb,
sizeof(backup));
546 "discarding vui default display window, "
547 "original values are l:%u r:%u t:%u b:%u\n",
567 "Strange VUI timing information, retrying...\n");
570 memcpy(gb, &backup,
sizeof(backup));
604 for (matrixId = 0; matrixId < 6; matrixId++) {
606 memset(sl->
sl[0][matrixId], 16, 16);
607 sl->
sl_dc[0][matrixId] = 16;
608 sl->
sl_dc[1][matrixId] = 16;
633 uint8_t scaling_list_pred_mode_flag;
634 int32_t scaling_list_dc_coef[2][6];
635 int size_id, matrix_id, pos;
638 for (size_id = 0; size_id < 4; size_id++)
639 for (matrix_id = 0; matrix_id < 6; matrix_id += ((size_id == 3) ? 3 : 1)) {
640 scaling_list_pred_mode_flag =
get_bits1(gb);
641 if (!scaling_list_pred_mode_flag) {
647 if (matrix_id < delta) {
649 "Invalid delta in scaling list data: %d.\n", delta);
653 memcpy(sl->
sl[size_id][matrix_id],
654 sl->
sl[size_id][matrix_id - delta],
655 size_id > 0 ? 64 : 16);
657 sl->
sl_dc[size_id - 2][matrix_id] = sl->
sl_dc[size_id - 2][matrix_id -
delta];
660 int next_coef, coef_num;
661 int32_t scaling_list_delta_coef;
664 coef_num =
FFMIN(64, 1 << (4 + (size_id << 1)));
666 scaling_list_dc_coef[size_id - 2][matrix_id] =
get_se_golomb(gb) + 8;
667 next_coef = scaling_list_dc_coef[size_id - 2][matrix_id];
668 sl->
sl_dc[size_id - 2][matrix_id] = next_coef;
670 for (i = 0; i < coef_num; i++) {
679 next_coef = (next_coef + scaling_list_delta_coef + 256) % 256;
680 sl->
sl[size_id][matrix_id][pos] = next_coef;
686 for (i = 0; i < 64; i++) {
687 sl->
sl[3][1][i] = sl->
sl[2][1][i];
688 sl->
sl[3][2][i] = sl->
sl[2][2][i];
689 sl->
sl[3][4][i] = sl->
sl[2][4][i];
690 sl->
sl[3][5][i] = sl->
sl[2][5][i];
707 unsigned int sps_id = 0;
708 int log2_diff_max_min_transform_block_size;
709 int bit_depth_chroma,
start, vui_present, sublayer_ordering_info;
780 "discarding sps conformance window, "
781 "original values are l:%u r:%u t:%u b:%u\n",
799 "Luma bit depth (%d) is different from chroma bit depth (%d), "
800 "this is unsupported.\n",
833 "4:2:0, 4:2:2, 4:4:4 supports are currently specified for 8, 10 and 12 bits.\n");
882 if (!sublayer_ordering_info) {
883 for (i = 0; i <
start; i++) {
915 if (log2_diff_max_min_transform_block_size < 0 || log2_diff_max_min_transform_block_size > 30) {
916 av_log(s->
avctx,
AV_LOG_ERROR,
"Invalid value %d for log2_diff_max_min_transform_block_size", log2_diff_max_min_transform_block_size);
947 "PCM bit depth (%d) is greater than normal bit depth (%d)\n",
991 int sps_extension_flag[1];
992 for (i = 0; i < 1; i++)
995 if (sps_extension_flag[0]) {
996 int extended_precision_processing_flag;
997 int high_precision_offsets_enabled_flag;
998 int cabac_bypass_alignment_enabled_flag;
1006 extended_precision_processing_flag =
get_bits1(gb);
1007 if (extended_precision_processing_flag)
1009 "extended_precision_processing_flag not yet implemented\n");
1012 high_precision_offsets_enabled_flag =
get_bits1(gb);
1013 if (high_precision_offsets_enabled_flag)
1015 "high_precision_offsets_enabled_flag not yet implemented\n");
1019 cabac_bypass_alignment_enabled_flag =
get_bits1(gb);
1020 if (cabac_bypass_alignment_enabled_flag)
1022 "cabac_bypass_alignment_enabled_flag not yet implemented\n");
1035 "chroma samples to preserve alignment.\n",
1050 "Displaying the whole video surface.\n");
1089 "log2_ctb_size %d differs from the bounds of any known profile\n",
1106 "max transform block size out of range: %d\n",
1119 "Parsed SPS: id %d; coded wxh: %dx%d; "
1120 "cropped wxh: %dx%d; pix_fmt: %s.\n",
1186 "chroma_qp_offset_list_len_minus1 shall be in the range [0, 5].\n");
1193 "cb_qp_offset_list not tested yet.\n");
1198 "cb_qp_offset_list not tested yet.\n");
1212 int pic_area_in_ctbs;
1213 int log2_diff_ctb_min_tb_size;
1214 int i, j, x,
y, ctb_addr_rs, tile_id;
1216 unsigned int pps_id = 0;
1412 int pps_range_extensions_flag =
get_bits1(gb);
1479 for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
1480 int tb_x = ctb_addr_rs % sps->
ctb_width;
1481 int tb_y = ctb_addr_rs / sps->
ctb_width;
1487 if (tb_x < pps->col_bd[i + 1]) {
1494 if (tb_y < pps->row_bd[i + 1]) {
1500 for (i = 0; i < tile_x; i++)
1502 for (i = 0; i < tile_y; i++)
1506 tb_x - pps->
col_bd[tile_x];
1514 for (y = pps->
row_bd[j]; y < pps->row_bd[j + 1]; y++)
1515 for (x = pps->
col_bd[i]; x < pps->col_bd[i + 1]; x++)
1530 for (y = 0; y < sps->
tb_mask+2; y++) {
1534 for (y = 0; y < sps->
tb_mask+1; y++) {
1535 for (x = 0; x < sps->
tb_mask+1; x++) {
1536 int tb_x = x >> log2_diff_ctb_min_tb_size;
1537 int tb_y = y >> log2_diff_ctb_min_tb_size;
1538 int ctb_addr_rs = sps->
ctb_width * tb_y + tb_x;
1540 (log2_diff_ctb_min_tb_size * 2);
1541 for (i = 0; i < log2_diff_ctb_min_tb_size; i++) {
1543 val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);