47 printf(
"test1 double=%d\n", (
int)(d1 * (1<<24)));
53 printf(
"test1 sf =%d\n",
av_sf2int(sf1, 24));
56 for(i= 0; i<100; i++){
60 for(j= 0; j<1000; j++){
65 printf(
"test2 double=%d\n", (
int)(d1 * (1<<24)));
67 for(i= 0; i<100; i++){
71 for(j= 0; j<1000; j++){
83 printf(
"test3 double: %.10lf\n", d3);
90 printf(
"test3 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf3), sf3.
mant, sf3.
exp);
93 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
95 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);
100 printf(
"test4 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
105 printf(
"test5 softfloat: %.10lf (0x%08x %d)\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp);
112 printf(
"test6 softfloat: %.10lf (0x%08x %d) %d %d\n", (
double)
av_sf2double(sf1), sf1.
mant, sf1.
exp, i, j);
114 for(i= -50; i<50; i++) {
116 for(j= -50; j<50; j++) {
121 printf(
"av_cmp_sf failed at %d %d as %X\n", i, j, c);
125 printf(
"av_gt_sf failed at %d %d as %X\n", i, j, c);
129 for(j = -50; j < 50; j++) {
134 printf(
"av_cmp_sf failed2 at %d %d as %X\n", i, j, c);
138 printf(
"av_gt_sf failed2 at %d %d as %X\n", i, j, c);
144 for(i= 0; i<4*36; i++){
149 errs = (double)s/ (1<<30) - sin(i*
M_PI/36);
150 errc = (double)c/ (1<<30) - cos(i*
M_PI/36);
151 if (fabs(errs) > 0.00000002 || fabs(errc) >0.001) {
152 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.
high precision timer, useful to profile code
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