45 printf(
"test1 double=%d\n", (
int)(d1 * (1<<24)));
51 printf(
"test1 sf =%d\n",
av_sf2int(sf1, 24));
54 for(i= 0; i<100; i++){
58 for(j= 0; j<1000; j++){
63 printf(
"test2 double=%d\n", (
int)(d1 * (1<<24)));
65 for(i= 0; i<100; i++){
69 for(j= 0; j<1000; j++){
81 printf(
"test3 double: %.10lf\n", d3);
88 printf(
"test3 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf3), sf3.
mant, sf3.
exp);
91 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
93 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
96 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
98 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
103 printf(
"test5 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
110 printf(
"test6 softfloat: %.10lf (0x%08x %d) %d %d\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp, i, j);
112 for(i= -50; i<50; i++) {
114 for(j= -50; j<50; j++) {
119 printf(
"av_cmp_sf failed at %d %d as %X\n", i, j, c);
123 printf(
"av_gt_sf failed at %d %d as %X\n", i, j, c);
127 for(j = -50; j < 50; j++) {
132 printf(
"av_cmp_sf failed2 at %d %d as %X\n", i, j, c);
136 printf(
"av_gt_sf failed2 at %d %d as %X\n", i, j, c);
142 for(i= 0; i<4*36; i++){
147 errs = (double)s/ (1<<30) - sin(i*
M_PI/36);
148 errc = (double)c/ (1<<30) - cos(i*
M_PI/36);
149 if (fabs(errs) > 0.00000002 || fabs(errc) >0.001) {
150 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));
static const SoftFloat FLOAT_1374_40625
void av_log_set_level(int level)
Set the log level.
static av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b)
b has to be normalized and not zero.
static av_const double av_sf2double(SoftFloat v)
Convert a SoftFloat to a double precision float.
static av_const SoftFloat av_normalize_sf(SoftFloat a)
static const SoftFloat FLOAT_0_017776489257
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static av_unused void av_sincos_sf(int a, int *s, int *c)
Rounding-to-nearest used.
#define FFDIFFSIGN(x, y)
Comparator.
static av_const int av_cmp_sf(SoftFloat a, SoftFloat b)
Compares two SoftFloats.
static av_const int av_gt_sf(SoftFloat a, SoftFloat b)
Compares two SoftFloats.
static av_const int av_sf2int(SoftFloat v, int frac_bits)
Converts a SoftFloat to an integer.
static av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b)
common internal and external API header
static av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b)
static av_const SoftFloat av_int2sf(int v, int frac_bits)
Converts a mantisse and exponent to a SoftFloat.
static const SoftFloat FLOAT_0_1249694824218