Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -516,6 +516,24 @@ static void pps_ref_wraparound_offset(VVCPPS *pps, const VVCSPS *sps) · 515 unmodified lines | |||
| 516 | pps->ref_wraparound_offset = (pps->width / sps->min_cb_size_y) - r->pps_pic_width_minus_wraparound_offset; | 516 | pps->ref_wraparound_offset = (pps->width / sps->min_cb_size_y) - r->pps_pic_width_minus_wraparound_offset; |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | static void pps_subpic(VVCPPS *pps, const VVCSPS *sps) | ||
| 520 | { | ||
| 521 | const H266RawSPS *rsps = sps->r; | ||
| 522 | for (int i = 0; i < rsps->sps_num_subpics_minus1 + 1; i++) { | ||
| 523 | if (rsps->sps_subpic_treated_as_pic_flag[i]) { | ||
| 524 | pps->subpic_x[i] = rsps->sps_subpic_ctu_top_left_x[i] << sps->ctb_log2_size_y; | ||
| 525 | pps->subpic_y[i] = rsps->sps_subpic_ctu_top_left_y[i] << sps->ctb_log2_size_y; | ||
| 526 | pps->subpic_width[i] = FFMIN(pps->width - pps->subpic_x[i], (rsps->sps_subpic_width_minus1[i] + 1) << sps->ctb_log2_size_y); | ||
| 527 | pps->subpic_height[i] = FFMIN(pps->height - pps->subpic_y[i], (rsps->sps_subpic_height_minus1[i] + 1) << sps->ctb_log2_size_y); | ||
| 528 | } else { | ||
| 529 | pps->subpic_x[i] = 0; | ||
| 530 | pps->subpic_y[i] = 0; | ||
| 531 | pps->subpic_width[i] = pps->width; | ||
| 532 | pps->subpic_height[i] = pps->height; | ||
| 533 | } | ||
| 534 | } | ||
| 535 | } | ||
| 536 | |||
| 519 | static int pps_derive(VVCPPS *pps, const VVCSPS *sps) | 537 | static int pps_derive(VVCPPS *pps, const VVCSPS *sps) |
| 520 | { | 538 | { |
| 521 | int ret; | 539 | int ret; |
| @@ -532,6 +550,7 @@ static int pps_derive(VVCPPS *pps, const VVCSPS *sps) · 10 unmodified lines | |||
| 532 | return ret; | 550 | return ret; |
| 533 | 551 | ||
| 534 | pps_ref_wraparound_offset(pps, sps); | 552 | pps_ref_wraparound_offset(pps, sps); |
| 553 | pps_subpic(pps, sps); | ||
| 535 | 554 | ||
| 536 | return 0; | 555 | return 0; |
| 537 | } | 556 | } |
| @@ -127,6 +127,10 @@ typedef struct VVCPPS { · 126 unmodified lines | |||
| 127 | 127 | ||
| 128 | uint16_t ref_wraparound_offset; ///< PpsRefWraparoundOffset | 128 | uint16_t ref_wraparound_offset; ///< PpsRefWraparoundOffset |
| 129 | 129 | ||
| 130 | uint16_t subpic_x[VVC_MAX_SLICES]; ///< SubpicLeftBoundaryPos | ||
| 131 | uint16_t subpic_y[VVC_MAX_SLICES]; ///< SubpicTopBoundaryPos | ||
| 132 | uint16_t subpic_width[VVC_MAX_SLICES]; | ||
| 133 | uint16_t subpic_height[VVC_MAX_SLICES]; | ||
| 130 | } VVCPPS; | 134 | } VVCPPS; |
| 131 | 135 | ||
| 132 | #define MAX_WEIGHTS 15 | 136 | #define MAX_WEIGHTS 15 |