This commit introduced a regression to VVC_HDR_UHDTV1_OpenGOP_3840x2160_50fps_HLG10_mosaic.ts. Root Cause: The AV_CEIL_RSHIFT(a, b) macro uses bit tricks that work only when -a is a negative value. However, due to integer promotion rules, this behavior does not extend to the unsigned int type. See "6.3.1.1 Boolean, characters, and integers" in the "ISO/IEC 9899" for details.
Unified · Split
| @@ -1162,7 +1162,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 1161 unmodified lines | |||
| 1162 | for (i = 1; i <= current->sps_num_subpics_minus1; i++) { | 1162 | for (i = 1; i <= current->sps_num_subpics_minus1; i++) { |
| 1163 | if (!current->sps_subpic_same_size_flag) { | 1163 | if (!current->sps_subpic_same_size_flag) { |
| 1164 | if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) { | 1164 | if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) { |
| 1165 | const unsigned int win_right_edge = | 1165 | const int win_right_edge = |
| 1166 | current->sps_pic_width_max_in_luma_samples | 1166 | current->sps_pic_width_max_in_luma_samples |
| 1167 | - current->sps_conf_win_right_offset * sub_width_c; | 1167 | - current->sps_conf_win_right_offset * sub_width_c; |
| 1168 | us(wlen, sps_subpic_ctu_top_left_x[i], 0, | 1168 | us(wlen, sps_subpic_ctu_top_left_x[i], 0, |
| @@ -1172,7 +1172,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 3 unmodified lines | |||
| 1172 | infer(sps_subpic_ctu_top_left_x[i], 0); | 1172 | infer(sps_subpic_ctu_top_left_x[i], 0); |
| 1173 | if (current->sps_pic_height_max_in_luma_samples > | 1173 | if (current->sps_pic_height_max_in_luma_samples > |
| 1174 | ctb_size_y) { | 1174 | ctb_size_y) { |
| 1175 | const unsigned int win_bottom_edge = | 1175 | const int win_bottom_edge = |
| 1176 | current->sps_pic_height_max_in_luma_samples | 1176 | current->sps_pic_height_max_in_luma_samples |
| 1177 | - current->sps_conf_win_bottom_offset * sub_height_c; | 1177 | - current->sps_conf_win_bottom_offset * sub_height_c; |
| 1178 | us(hlen, sps_subpic_ctu_top_left_y[i], 0, | 1178 | us(hlen, sps_subpic_ctu_top_left_y[i], 0, |
| @@ -1183,9 +1183,9 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 4 unmodified lines | |||
| 1183 | if (i < current->sps_num_subpics_minus1 && | 1183 | if (i < current->sps_num_subpics_minus1 && |
| 1184 | current->sps_pic_width_max_in_luma_samples > | 1184 | current->sps_pic_width_max_in_luma_samples > |
| 1185 | ctb_size_y) { | 1185 | ctb_size_y) { |
| 1186 | const unsigned int win_left_edge = | 1186 | const int win_left_edge = |
| 1187 | current->sps_conf_win_left_offset * sub_width_c; | 1187 | current->sps_conf_win_left_offset * sub_width_c; |
| 1188 | const unsigned int win_left_edge_ctus = | 1188 | const int win_left_edge_ctus = |
| 1189 | AV_CEIL_RSHIFT(win_left_edge, ctb_log2_size_y); | 1189 | AV_CEIL_RSHIFT(win_left_edge, ctb_log2_size_y); |
| 1190 | us(wlen, sps_subpic_width_minus1[i], | 1190 | us(wlen, sps_subpic_width_minus1[i], |
| 1191 | win_left_edge_ctus > current->sps_subpic_ctu_top_left_x[i] | 1191 | win_left_edge_ctus > current->sps_subpic_ctu_top_left_x[i] |
| @@ -1200,9 +1200,9 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 8 unmodified lines | |||
| 1200 | if (i < current->sps_num_subpics_minus1 && | 1200 | if (i < current->sps_num_subpics_minus1 && |
| 1201 | current->sps_pic_height_max_in_luma_samples > | 1201 | current->sps_pic_height_max_in_luma_samples > |
| 1202 | ctb_size_y) { | 1202 | ctb_size_y) { |
| 1203 | const unsigned int win_top_edge = | 1203 | const int win_top_edge = |
| 1204 | current->sps_conf_win_top_offset * sub_height_c; | 1204 | current->sps_conf_win_top_offset * sub_height_c; |
| 1205 | const unsigned int win_top_edge_ctus = | 1205 | const int win_top_edge_ctus = |
| 1206 | AV_CEIL_RSHIFT(win_top_edge, ctb_log2_size_y); | 1206 | AV_CEIL_RSHIFT(win_top_edge, ctb_log2_size_y); |
| 1207 | us(hlen, sps_subpic_height_minus1[i], | 1207 | us(hlen, sps_subpic_height_minus1[i], |
| 1208 | win_top_edge_ctus > current->sps_subpic_ctu_top_left_y[i] | 1208 | win_top_edge_ctus > current->sps_subpic_ctu_top_left_y[i] |