[media] fixp-arith: replace sin/cos table by a better precision one
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 4 Feb 2015 09:07:30 +0000 (06:07 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 2 Mar 2015 17:50:06 +0000 (14:50 -0300)
commit559addc25b00ff3a40eff03a0b3873c2b6d726f8
tree1bad1442f4bd55fe063f6b04ce00573927fc9517
parent96df988bb935959e6380c2333e03911839079ee1
[media] fixp-arith: replace sin/cos table by a better precision one

The cos table used at fixp-arith.h has only 8 bits of precision.
That causes problems if it is reused on other drivers.

As some media drivers require a higher precision sin/cos
implementation, replace the current implementation by one that
will provide 32 bits precision.

The values generated by the new implementation matches the
32 bit precision of glibc's sin for an angle measured in
integer degrees.

It also provides support for fractional angles via linear
interpolation. On experimental calculus, when used a table
with a 0.001 degree angle, the maximum error for sin is
0.000038, which is likely good enough for practical purposes.

There are some logic there that seems to be specific to the
usage inside ff-memless.c. Move those logic to there, as they're
not needed elsewhere.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/input/ff-memless.c
drivers/media/usb/gspca/ov534.c
include/linux/fixp-arith.h
This page took 0.027899 seconds and 5 git commands to generate.