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 43E5743CA5 for ; Thu, 4 Aug 2022 20:29:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5956568B9FF; Thu, 4 Aug 2022 23:29:49 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 64DAD68B93D for ; Thu, 4 Aug 2022 23:29:43 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 274KTfgt005427-274KTfgu005427 for ; Thu, 4 Aug 2022 23:29:41 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id D474AA1468 for ; Thu, 4 Aug 2022 23:29:41 +0300 (EEST) Date: Thu, 4 Aug 2022 23:29:40 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20220804153120.GM2088045@pb2> Message-ID: <5a82de87-85a1-b8c-1e8c-373286cea9b1@martin.st> References: <20220713204716.3114529-1-martin@martin.st> <773f8bab-9f4d-9b62-ed40-26ebf9355766@martin.st> <20220804153120.GM2088045@pb2> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 1/2] x86: Don't hardcode the height to 8 in sad8_xy2_mmx 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: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 4 Aug 2022, Michael Niedermayer wrote: > On Thu, Aug 04, 2022 at 10:47:34AM +0300, Martin Storsj=F6 wrote: >> On Wed, 13 Jul 2022, Martin Storsj=F6 wrote: >> >>> The height is hardcoded in some of the me_cmp functions, but not >>> in all of them. But in the case of all other functions, it's hardcoded >>> in the same place in SIMD functions as in the C reference functions, >>> while this one function differs from the behaviour of the C code. >>> >>> (Before 542765ce3eccbca587d54262a512cbdb1407230d, there were a >>> couple other sad8_*_mmx functions with similar hardcoded height.) >>> --- >>> libavcodec/x86/me_cmp_init.c | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c >>> index 61e9396b8f..dcc2621276 100644 >>> --- a/libavcodec/x86/me_cmp_init.c >>> +++ b/libavcodec/x86/me_cmp_init.c >>> @@ -202,13 +202,12 @@ static inline int sum_mmx(void) >>> static int sad8_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, = \ >>> uint8_t *blk1, ptrdiff_t stride, int h) = \ >>> { = \ >>> - av_assert2(h =3D=3D 8); = \ >>> __asm__ volatile ( = \ >>> "pxor %%mm7, %%mm7 \n\t" = \ >>> "pxor %%mm6, %%mm6 \n\t" = \ >>> ::); = \ >>> = \ >>> - sad8_4_ ## suf(blk1, blk2, stride, 8); = \ >>> + sad8_4_ ## suf(blk1, blk2, stride, h); = \ >>> = \ >>> return sum_ ## suf(); = \ >>> } = \ >>> -- >>> 2.25.1 >> >> Ping, does this seem reasonable? Michael indicated a desire to make the >> me_cmp functions more general and flexible than what they are today, and >> this would be a first step to making checkasm test such cases. > > LGTM assuming it doesnt have any problematic perforamce impact Thanks - I didn't notice any significant change in the checkasm bench = numbers for it. // 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".