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 "in slice header RPS: %d > %d.\n", delta_idx,
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++) {
202 for (i = 0; i < 32; i++)
216 for (i = 0; i < max_num_sub_layers - 1; i++) {
220 if (max_num_sub_layers - 1 > 0)
221 for (i = max_num_sub_layers - 1; i < 8; i++)
223 for (i = 0; i < max_num_sub_layers - 1; i++) {
228 for (j = 0; j < 32; j++)
253 for (i = 0; i < nb_cpb; i++) {
257 if (subpic_params_present) {
268 int nal_params_present = 0, vcl_params_present = 0;
269 int subpic_params_present = 0;
272 if (common_inf_present) {
276 if (nal_params_present || vcl_params_present) {
279 if (subpic_params_present) {
289 if (subpic_params_present)
298 for (i = 0; i < max_sublayers; i++) {
314 if (nal_params_present)
316 if (vcl_params_present)
399 int common_inf_present = 1;
430 vui->
sar = vui_sar[sar_idx];
431 else if (sar_idx == 255) {
476 "discarding vui default display window, "
477 "original values are l:%u r:%u t:%u b:%u\n",
519 for (matrixId = 0; matrixId < 6; matrixId++) {
521 memset(sl->
sl[0][matrixId], 16, 16);
522 sl->
sl_dc[0][matrixId] = 16;
523 sl->
sl_dc[1][matrixId] = 16;
544 uint8_t scaling_list_pred_mode_flag[4][6];
545 int32_t scaling_list_dc_coef[2][6];
547 int size_id, matrix_id, i, pos,
delta;
548 for (size_id = 0; size_id < 4; size_id++)
549 for (matrix_id = 0; matrix_id < ((size_id == 3) ? 2 : 6); matrix_id++) {
550 scaling_list_pred_mode_flag[size_id][matrix_id] =
get_bits1(gb);
551 if (!scaling_list_pred_mode_flag[size_id][matrix_id]) {
556 if (matrix_id - delta < 0) {
558 "Invalid delta in scaling list data: %d.\n", delta);
562 memcpy(sl->
sl[size_id][matrix_id],
563 sl->
sl[size_id][matrix_id - delta],
564 size_id > 0 ? 64 : 16);
566 sl->
sl_dc[size_id - 2][matrix_id] = sl->
sl_dc[size_id - 2][matrix_id -
delta];
571 int32_t scaling_list_delta_coef;
574 coef_num =
FFMIN(64, (1 << (4 + (size_id << 1))));
576 scaling_list_dc_coef[size_id - 2][matrix_id] =
get_se_golomb(gb) + 8;
577 next_coef = scaling_list_dc_coef[size_id - 2][matrix_id];
578 sl->
sl_dc[size_id - 2][matrix_id] = next_coef;
580 for (i = 0; i < coef_num; i++) {
587 next_coef = (next_coef + scaling_list_delta_coef + 256 ) % 256;
588 sl->
sl[size_id][matrix_id][pos] = next_coef;
602 int log2_diff_max_min_transform_block_size;
603 int bit_depth_chroma,
start, vui_present, sublayer_ordering_info;
676 "discarding sps conformance window, "
677 "original values are l:%u r:%u t:%u b:%u\n",
693 if (bit_depth_chroma != sps->
bit_depth) {
695 "Luma bit depth (%d) is different from chroma bit depth (%d), this is unsupported.\n",
757 if (!sublayer_ordering_info) {
758 for (i = 0; i <
start; i++){
802 "PCM bit depth (%d) is greater than normal bit depth (%d)\n",
851 "chroma samples to preserve alignment.\n",
920 "cropped wxh: %dx%d; pix_fmt: %s.\n",
971 int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
972 int log2_diff_ctb_min_tb_size;
973 int i, j, x,
y, ctb_addr_rs, tile_id;
1214 pps->
tile_id = av_malloc_array(pic_area_in_ctbs,
sizeof(*pps->
tile_id));
1223 for (ctb_addr_rs = 0; ctb_addr_rs < pic_area_in_ctbs; ctb_addr_rs++) {
1224 int tb_x = ctb_addr_rs % sps->
ctb_width;
1225 int tb_y = ctb_addr_rs / sps->
ctb_width;
1231 if (tb_x < pps->col_bd[i + 1]) {
1238 if (tb_y < pps->row_bd[i + 1]) {
1244 for (i = 0; i < tile_x; i++ )
1246 for (i = 0; i < tile_y; i++ )
1250 tb_x - pps->
col_bd[tile_x];
1258 for (y = pps->
row_bd[j]; y < pps->row_bd[j + 1]; y++)
1259 for (x = pps->
col_bd[i]; x < pps->col_bd[i + 1]; x++)
1276 int ctb_addr_rs = sps->
ctb_width * tb_y + tb_x;
1281 val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);
1290 int tb_x = x >> log2_diff_ctb_min_tb_size;
1291 int tb_y = y >> log2_diff_ctb_min_tb_size;
1292 int ctb_addr_rs = sps->
ctb_width * tb_y + tb_x;
1294 (log2_diff_ctb_min_tb_size * 2);
1295 for (i = 0; i < log2_diff_ctb_min_tb_size; i++) {
1297 val += (m & x ? m * m : 0) + (m & y ? 2 * m * m : 0);