Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -528,6 +528,26 @@ static av_always_inline int deblock_bs(const VVCLocalContext *lc, · 527 unmodified lines | ||
| 528 | 528 | return boundary_strength(lc, mvf_q, mvf_p, rpl_p); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | +static int deblock_is_boundary(const VVCLocalContext *lc, const int boundary, | |
| 532 | + const int pos, const int vertical) | |
| 533 | +{ | |
| 534 | + const VVCFrameContext *fc = lc->fc; | |
| 535 | + const H266RawPPS *rpps = fc->ps.pps->r; | |
| 536 | + int flag; | |
| 537 | + if (boundary && (pos % fc->ps.sps->ctb_size_y) == 0) { | |
| 538 | + flag = vertical ? BOUNDARY_LEFT_SLICE : BOUNDARY_UPPER_SLICE; | |
| 539 | + if (lc->boundary_flags & flag && | |
| 540 | + !rpps->pps_loop_filter_across_slices_enabled_flag) | |
| 541 | + return 0; | |
| 542 | + | |
| 543 | + flag = vertical ? BOUNDARY_LEFT_TILE : BOUNDARY_UPPER_TILE; | |
| 544 | + if (lc->boundary_flags & flag && | |
| 545 | + !rpps->pps_loop_filter_across_tiles_enabled_flag) | |
| 546 | + return 0; | |
| 547 | + } | |
| 548 | + return boundary; | |
| 549 | +} | |
| 550 | + | |
| 531 | 551 | static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc, |
| 532 | 552 | const int x0, const int y0, const int width, const int height) |
| 533 | 553 | { |
| @@ -554,15 +574,7 @@ static void vvc_deblock_bs_luma_vertical(const VVCLocalContext *lc, · 20 unmodified lines | ||
| 554 | 574 | } |
| 555 | 575 | |
| 556 | 576 | // bs for vertical TU boundaries |
| 557 | − boundary_left = x0 > 0 && !(x0 & 3); | |
| 558 | − if (boundary_left && | |
| 559 | − ((!fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag && | |
| 560 | − lc->boundary_flags & BOUNDARY_LEFT_SLICE && | |
| 561 | − (x0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0) || | |
| 562 | − (!fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag && | |
| 563 | − lc->boundary_flags & BOUNDARY_LEFT_TILE && | |
| 564 | − (x0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0))) | |
| 565 | − boundary_left = 0; | |
| 577 | + boundary_left = deblock_is_boundary(lc, x0 > 0 && !(x0 & 3), x0, 1); | |
| 566 | 578 | |
| 567 | 579 | if (boundary_left) { |
| 568 | 580 | const RefPicList *rpl_left = |
| @@ -610,15 +622,7 @@ static void vvc_deblock_bs_luma_horizontal(const VVCLocalContext *lc, · 41 unmodified lines | ||
| 610 | 622 | has_horizontal_sb = cb_height > 8; |
| 611 | 623 | } |
| 612 | 624 | |
| 613 | − boundary_upper = y0 > 0 && !(y0 & 3); | |
| 614 | − if (boundary_upper && | |
| 615 | − ((!fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag && | |
| 616 | − lc->boundary_flags & BOUNDARY_UPPER_SLICE && | |
| 617 | − (y0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0) || | |
| 618 | − (!fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag && | |
| 619 | − lc->boundary_flags & BOUNDARY_UPPER_TILE && | |
| 620 | − (y0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0))) | |
| 621 | − boundary_upper = 0; | |
| 625 | + boundary_upper = deblock_is_boundary(lc, y0 > 0 && !(y0 & 3), y0, 0); | |
| 622 | 626 | |
| 623 | 627 | if (boundary_upper) { |
| 624 | 628 | const RefPicList *rpl_top = |
| @@ -646,18 +650,9 @@ static void vvc_deblock_bs_chroma_vertical(const VVCLocalContext *lc, · 21 unmodified lines | ||
| 646 | 650 | const int x0, const int y0, const int width, const int height) |
| 647 | 651 | { |
| 648 | 652 | const VVCFrameContext *fc = lc->fc; |
| 649 | − int boundary_left; | |
| 650 | − | |
| 651 | 653 | // bs for vertical TU boundaries |
| 652 | − boundary_left = x0 > 0 && !(x0 & ((CHROMA_GRID << fc->ps.sps->hshift[1]) - 1)); | |
| 653 | − if (boundary_left && | |
| 654 | − ((!fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag && | |
| 655 | − lc->boundary_flags & BOUNDARY_LEFT_SLICE && | |
| 656 | − (x0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0) || | |
| 657 | − (!fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag && | |
| 658 | − lc->boundary_flags & BOUNDARY_LEFT_TILE && | |
| 659 | − (x0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0))) | |
| 660 | − boundary_left = 0; | |
| 654 | + const int boundary_left = deblock_is_boundary(lc, | |
| 655 | + x0 > 0 && !(x0 & ((CHROMA_GRID << fc->ps.sps->hshift[CHROMA]) - 1)), x0, 1); | |
| 661 | 656 | |
| 662 | 657 | if (boundary_left) { |
| 663 | 658 | for (int i = 0; i < height; i += 2) { |
| @@ -674,17 +669,8 @@ static void vvc_deblock_bs_chroma_horizontal(const VVCLocalContext *lc, · 10 unmodified lines | ||
| 674 | 669 | const int x0, const int y0, const int width, const int height) |
| 675 | 670 | { |
| 676 | 671 | const VVCFrameContext *fc = lc->fc; |
| 677 | − int boundary_upper; | |
| 678 | − | |
| 679 | − boundary_upper = y0 > 0 && !(y0 & ((CHROMA_GRID << fc->ps.sps->vshift[1]) - 1)); | |
| 680 | − if (boundary_upper && | |
| 681 | − ((!fc->ps.pps->r->pps_loop_filter_across_slices_enabled_flag && | |
| 682 | − lc->boundary_flags & BOUNDARY_UPPER_SLICE && | |
| 683 | − (y0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0) || | |
| 684 | − (!fc->ps.pps->r->pps_loop_filter_across_tiles_enabled_flag && | |
| 685 | − lc->boundary_flags & BOUNDARY_UPPER_TILE && | |
| 686 | − (y0 % (1 << fc->ps.sps->ctb_log2_size_y)) == 0))) | |
| 687 | − boundary_upper = 0; | |
| 672 | + const int boundary_upper = deblock_is_boundary(lc, | |
| 673 | + y0 > 0 && !(y0 & ((CHROMA_GRID << fc->ps.sps->vshift[CHROMA]) - 1)), y0, 0); | |
| 688 | 674 | |
| 689 | 675 | if (boundary_upper) { |
| 690 | 676 | for (int i = 0; i < width; i += 2) { |