From: Nuo Mi <nuomi2021@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: benjamin.bross@hhi.fraunhofer.de, Nuo Mi <nuomi2021@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/4] checkasm/vvc_alf: random select alf virtual boundaries position Date: Sat, 22 Jun 2024 12:21:12 +0800 Message-ID: <TYSPR06MB64336D96C4B15B678016D4B0AACA2@TYSPR06MB6433.apcprd06.prod.outlook.com> (raw) In-Reply-To: <20240622042114.92873-1-nuomi2021@gmail.com> A picture's virtual boundaries will split a CTU into 4 ALF blocks. The ALF virtual boundary may cross or not cross a ALF block. --- tests/checkasm/vvc_alf.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/checkasm/vvc_alf.c b/tests/checkasm/vvc_alf.c index 902757aff1..be8b930810 100644 --- a/tests/checkasm/vvc_alf.c +++ b/tests/checkasm/vvc_alf.c @@ -66,6 +66,14 @@ static const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }; } \ } while (0) +static int get_alf_vb_pos(const int h, const int vb_pos_above) +{ + if (h == MAX_CTU_SIZE) + return MAX_CTU_SIZE - vb_pos_above; + // If h < MAX_CTU_SIZE and picture virtual boundaries are involved, ALF virtual boundaries can either be within or outside this ALF block. + return ((rnd() & 1) ? h : MAX_CTU_SIZE) - vb_pos_above; +} + static void check_alf_filter(VVCDSPContext *c, const int bit_depth) { LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]); @@ -92,11 +100,10 @@ static void check_alf_filter(VVCDSPContext *c, const int bit_depth) for (int h = 4; h <= MAX_CTU_SIZE; h += 4) { for (int w = 4; w <= MAX_CTU_SIZE; w += 4) { - const int ctu_size = MAX_CTU_SIZE; //Both picture size and virtual boundaries are 8-aligned. For luma, we only need to check 8-aligned sizes. if (!(w % 8) && !(h % 8)) { if (check_func(c->alf.filter[LUMA], "vvc_alf_filter_luma_%dx%d_%d", w, h, bit_depth)) { - const int vb_pos = ctu_size - ALF_VB_POS_ABOVE_LUMA; + const int vb_pos = get_alf_vb_pos(h, ALF_VB_POS_ABOVE_LUMA); memset(dst0, 0, DST_BUF_SIZE); memset(dst1, 0, DST_BUF_SIZE); call_ref(dst0, dst_stride, src0 + offset, src_stride, w, h, filter, clip, vb_pos); @@ -113,7 +120,7 @@ static void check_alf_filter(VVCDSPContext *c, const int bit_depth) //For chroma, once it exceeds 64, it's not a 4:2:0 format, so we only need to check 8-aligned sizes as well. if ((w <= 64 || !(w % 8)) && (h <= 64 || !(h % 8))) { if (check_func(c->alf.filter[CHROMA], "vvc_alf_filter_chroma_%dx%d_%d", w, h, bit_depth)) { - const int vb_pos = ctu_size - ALF_VB_POS_ABOVE_CHROMA; + const int vb_pos = get_alf_vb_pos(h, ALF_VB_POS_ABOVE_CHROMA); memset(dst0, 0, DST_BUF_SIZE); memset(dst1, 0, DST_BUF_SIZE); call_ref(dst0, dst_stride, src0 + offset, src_stride, w, h, filter, clip, vb_pos); @@ -152,7 +159,7 @@ static void check_alf_classify(VVCDSPContext *c, const int bit_depth) for (int h = 8; h <= MAX_CTU_SIZE; h += 8) { for (int w = 8; w <= MAX_CTU_SIZE; w += 8) { const int id_size = w * h / ALF_BLOCK_SIZE / ALF_BLOCK_SIZE * sizeof(int); - const int vb_pos = MAX_CTU_SIZE - ALF_BLOCK_SIZE; + const int vb_pos = get_alf_vb_pos(h, ALF_VB_POS_ABOVE_LUMA); if (check_func(c->alf.classify, "vvc_alf_classify_%dx%d_%d", w, h, bit_depth)) { memset(class_idx0, 0, id_size); memset(class_idx1, 0, id_size); -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next parent reply other threads:[~2024-06-22 4:56 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20240622042114.92873-1-nuomi2021@gmail.com> 2024-06-22 4:21 ` Nuo Mi [this message] 2024-06-22 4:21 ` [FFmpeg-devel] [PATCH 3/4] x86/vvc_alf: avoid overwriting for non-16 aligned widths Nuo Mi 2024-06-22 4:21 ` [FFmpeg-devel] [PATCH 4/4] checkasm/vvc_alf: ensure right and bottom boundaries are not overwritten by asm Nuo Mi 2024-06-25 11:55 ` Nuo Mi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=TYSPR06MB64336D96C4B15B678016D4B0AACA2@TYSPR06MB6433.apcprd06.prod.outlook.com \ --to=nuomi2021@gmail.com \ --cc=benjamin.bross@hhi.fraunhofer.de \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git