From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 0B319431BA for ; Tue, 24 May 2022 20:28:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E41268B554; Tue, 24 May 2022 23:27:59 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 019F168B428 for ; Tue, 24 May 2022 23:27:52 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 24OKRqZq004367-24OKRqZr004367 for ; Tue, 24 May 2022 23:27:52 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 5FE94A142D for ; Tue, 24 May 2022 23:27:52 +0300 (EEST) Date: Tue, 24 May 2022 23:27:52 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20220517115429.2020-1-jdek@itanimul.li> Message-ID: References: <5625a69f-a280-df32-7e1d-304511bd055@martin.st> <20220517115429.2020-1-jdek@itanimul.li> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH] checkasm: improve hevc_sao test X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 17 May 2022, J. Dekker wrote: > The HEVC decoder can call these functions with smaller widths than the > functions themselves are designed to operate on so we should only check > the relevant output > > Signed-off-by: J. Dekker > --- > tests/checkasm/hevc_sao.c | 51 ++++++++++++++++++++++++--------------- > 1 file changed, 31 insertions(+), 20 deletions(-) > > diff --git a/tests/checkasm/hevc_sao.c b/tests/checkasm/hevc_sao.c > index 6b750758e2..72cdb87dd1 100644 > --- a/tests/checkasm/hevc_sao.c > +++ b/tests/checkasm/hevc_sao.c > @@ -78,20 +78,26 @@ static void check_sao_band(HEVCDSPContext h, int bit_depth) > > for (i = 0; i <= 4; i++) { > int block_size = sao_size[i]; > + int prev_size = i > 0 ? sao_size[i - 1] : 0; > ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; > declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride, > int16_t *sao_offset_val, int sao_left_class, int width, int height); > > - randomize_buffers(src0, src1, BUF_SIZE); > - randomize_buffers2(offset_val, OFFSET_LENGTH); > - memset(dst0, 0, BUF_SIZE); > - memset(dst1, 0, BUF_SIZE); > - > - if (check_func(h.sao_band_filter[i], "hevc_sao_band_%dx%d_%d", block_size, block_size, bit_depth)) { > - call_ref(dst0, src0, stride, stride, offset_val, left_class, block_size, block_size); > - call_new(dst1, src1, stride, stride, offset_val, left_class, block_size, block_size); > - if (memcmp(dst0, dst1, BUF_SIZE)) > - fail(); > + if (check_func(h.sao_band_filter[i], "hevc_sao_band_%d_%d", block_size, bit_depth)) { > + > + for (int w = prev_size + 4; w <= block_size; w += 4) { > + randomize_buffers(src0, src1, BUF_SIZE); > + randomize_buffers2(offset_val, OFFSET_LENGTH); > + memset(dst0, 0, BUF_SIZE); > + memset(dst1, 0, BUF_SIZE); > + > + call_ref(dst0, src0, stride, stride, offset_val, left_class, w, block_size); > + call_new(dst1, src1, stride, stride, offset_val, left_class, w, block_size); > + for (int j = 0; j < block_size; j++) { > + if (memcmp(dst0 + j*MAX_PB_SIZE*2, dst1 + j*MAX_PB_SIZE*2, w)) I'm not quite sure about the MAX_PB_SIZE*2 part here - shouldn't that be just the 'stride' variable instead? And for the compared length ('w'), shouldn't that be multiplied by SIZEOF_PIXEL? Other than that, this looks good to me! // Martin _______________________________________________ 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".