Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
cd7037dd
Commit
cd7037dd
authored
Jan 03, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/rational: av_add_stable() test code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b317f945
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
rational.c
libavutil/rational.c
+30
-0
No files found.
libavutil/rational.c
View file @
cd7037dd
...
@@ -171,6 +171,36 @@ int main(void)
...
@@ -171,6 +171,36 @@ int main(void)
}
}
}
}
}
}
for
(
a
.
num
=
1
;
a
.
num
<=
10
;
a
.
num
++
)
{
for
(
a
.
den
=
1
;
a
.
den
<=
10
;
a
.
den
++
)
{
if
(
av_gcd
(
a
.
num
,
a
.
den
)
>
1
)
continue
;
for
(
b
.
num
=
1
;
b
.
num
<=
10
;
b
.
num
++
)
{
for
(
b
.
den
=
1
;
b
.
den
<=
10
;
b
.
den
++
)
{
int
start
;
if
(
av_gcd
(
b
.
num
,
b
.
den
)
>
1
)
continue
;
if
(
av_cmp_q
(
b
,
a
)
<
0
)
continue
;
for
(
start
=
0
;
start
<
10
;
start
++
)
{
int
acc
=
start
;
int
i
;
for
(
i
=
0
;
i
<
100
;
i
++
)
{
int
exact
=
start
+
av_rescale_q
(
i
+
1
,
b
,
a
);
acc
=
av_add_stable
(
a
,
acc
,
b
,
1
);
if
(
FFABS
(
acc
-
exact
)
>
2
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"%d/%d %d/%d, %d %d
\n
"
,
a
.
num
,
a
.
den
,
b
.
num
,
b
.
den
,
acc
,
exact
);
return
1
;
}
}
}
}
}
}
}
return
0
;
return
0
;
}
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment