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 EE3B846506 for ; Mon, 19 Jun 2023 23:04:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E83AF68C097; Tue, 20 Jun 2023 02:04:35 +0300 (EEST) Received: from mail-02-2.mymagenta.at (mail-02-2.mymagenta.at [80.109.253.249]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A7C068AAB3 for ; Tue, 20 Jun 2023 02:04:27 +0300 (EEST) Received: from [192.168.232.135] (helo=ren-mail-psmtp-mg01.) by mail-02.mymagenta.at with esmtp (Exim 4.93) (envelope-from ) id 1qBNv8-002cPq-Hr for ffmpeg-devel@ffmpeg.org; Tue, 20 Jun 2023 01:04:26 +0200 Received: from localhost ([84.115.40.24]) by ren-mail-psmtp-mg01. with ESMTP id BNv6qHTJVOG5ZBNv6qPHLu; Tue, 20 Jun 2023 01:04:24 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 84.115.40.24 X-CNFS-Analysis: v=2.4 cv=KJo5sHJo c=1 sm=1 tr=0 ts=6490def8 a=4thelYDX6rwh+ygQwvsI+Q==:117 a=4thelYDX6rwh+ygQwvsI+Q==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=VsWyEgZ-WJsrnXd58aoA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 20 Jun 2023 01:04:24 +0200 Message-Id: <20230619230424.30270-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230619230424.30270-1-michael@niedermayer.cc> References: <20230619230424.30270-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4xfDZLMx3BfJkRM8NCy4sjVvgdjJkcB8CL+XWDv12aPc3MNny4NVNUEaGmy0pa3bE7skqFgsfzSEaLMgAc01P+pRyjda4OpB7tCtX3hXj4UKu3RMOog/Wy dcooQfqLbOwE+iFpwJXGmtWyZFMHysS5hTSwfa0nfJ3FEGOsp/lf2sdbJmf6ckoVBobcYrtQaD1JOQ== Subject: [FFmpeg-devel] [PATCH 3/3] avutil/softfloat: fix av_sincos_sf() 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- libavutil/softfloat.h | 2 +- libavutil/tests/softfloat.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h index a651406f74..1520027ddc 100644 --- a/libavutil/softfloat.h +++ b/libavutil/softfloat.h @@ -281,7 +281,7 @@ static av_unused void av_sincos_sf(int a, int *s, int *c) (int64_t)av_sintbl_4_sf[(idx & 0x1f) + 1] * (a & 0x7ff) + 0x400) >> 11); - *c = (int)(((int64_t)cv * ct + (int64_t)sv * st + 0x20000000) >> 30); + *c = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30); *s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30); } diff --git a/libavutil/tests/softfloat.c b/libavutil/tests/softfloat.c index c06de44933..a2e628fe81 100644 --- a/libavutil/tests/softfloat.c +++ b/libavutil/tests/softfloat.c @@ -148,7 +148,7 @@ int main(void){ av_sincos_sf(i*(1ULL<<32)/36/4, &s, &c); errs = (double)s/ (1<<30) - sin(i*M_PI/36); errc = (double)c/ (1<<30) - cos(i*M_PI/36); - if (fabs(errs) > 0.00000002 || fabs(errc) >0.001) { + if (fabs(errs) > 0.000000004 || fabs(errc) >0.000000004) { printf("sincos FAIL %d %f %f %f %f\n", i, (float)s/ (1<<30), (float)c/ (1<<30), sin(i*M_PI/36), cos(i*M_PI/36)); } -- 2.17.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".