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
79dc59b7
Commit
79dc59b7
authored
Jul 20, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify
Originally committed as revision 5802 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0912bf57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
rational.c
libavutil/rational.c
+4
-5
No files found.
libavutil/rational.c
View file @
79dc59b7
...
...
@@ -76,8 +76,7 @@ AVRational av_mul_q(AVRational b, AVRational c){
* returns b/c.
*/
AVRational
av_div_q
(
AVRational
b
,
AVRational
c
){
av_reduce
(
&
b
.
num
,
&
b
.
den
,
b
.
num
*
(
int64_t
)
c
.
den
,
b
.
den
*
(
int64_t
)
c
.
num
,
INT_MAX
);
return
b
;
return
av_mul_q
(
b
,
(
AVRational
){
c
.
den
,
c
.
num
});
}
/**
...
...
@@ -92,8 +91,7 @@ AVRational av_add_q(AVRational b, AVRational c){
* returns b-c.
*/
AVRational
av_sub_q
(
AVRational
b
,
AVRational
c
){
av_reduce
(
&
b
.
num
,
&
b
.
den
,
b
.
num
*
(
int64_t
)
c
.
den
-
c
.
num
*
(
int64_t
)
b
.
den
,
b
.
den
*
(
int64_t
)
c
.
den
,
INT_MAX
);
return
b
;
return
av_add_q
(
b
,
(
AVRational
){
-
c
.
num
,
c
.
den
});
}
/**
...
...
@@ -102,7 +100,8 @@ AVRational av_sub_q(AVRational b, AVRational c){
*/
AVRational
av_d2q
(
double
d
,
int
max
){
AVRational
a
;
int
exponent
=
FFMAX
(
(
int
)(
log
(
fabs
(
d
)
+
1e-20
)
/
log
(
2
)),
0
);
#define LOG2 0.69314718055994530941723212145817656807550013436025
int
exponent
=
FFMAX
(
(
int
)(
log
(
fabs
(
d
)
+
1e-20
)
/
LOG2
),
0
);
int64_t
den
=
1LL
<<
(
61
-
exponent
);
av_reduce
(
&
a
.
num
,
&
a
.
den
,
(
int64_t
)(
d
*
den
+
0
.
5
),
den
,
max
);
...
...
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