[FFmpeg-devel] [PATCH 3/3] libavutil/softfloat: Add functions.

Michael Niedermayer michael at niedermayer.cc
Mon Jul 27 17:45:47 CEST 2015


On Mon, Jul 27, 2015 at 01:36:42PM +0000, Nedeljko Babic wrote:
> >> +/**
> >> + * Rounding-to-nearest used.
> >> + */
> >> +static av_always_inline void av_sincos_sf(int a, int *s, int *c)
> >
> >this function seems to be buggy
> >the sine values are very accurate but the cosine values are not
> >
> >look: (tested with libavutil/softfloat-test and tightened up thresholds)
> 
> Could you please send me configuration which you used here?
> 
> I tried with several configurations and didn't have a problem with sincos on this test.

sure

first apply: (to use the same threshold for cosine as sine
diff --git a/libavutil/softfloat.c b/libavutil/softfloat.c
index a9d1b0c..597be04 100644
--- a/libavutil/softfloat.c
+++ b/libavutil/softfloat.c
@@ -104,7 +104,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.00000002 || fabs(errc) >0.00000002) {
             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));
         }

./configure && make -j12 libavutil/softfloat-test && libavutil/softfloat-test



 [...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150727/d3d10ebc/attachment.sig>


More information about the ffmpeg-devel mailing list