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
e9add0d8
Commit
e9add0d8
authored
Jun 02, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
av_add_stable: Add fast special case where step can be represented exactly
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4956d0e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
mathematics.c
libavutil/mathematics.c
+8
-0
No files found.
libavutil/mathematics.c
View file @
e9add0d8
...
...
@@ -188,9 +188,17 @@ simple_round:
int64_t
av_add_stable
(
AVRational
ts_tb
,
int64_t
ts
,
AVRational
inc_tb
,
int64_t
inc
)
{
int64_t
m
,
d
;
if
(
inc
!=
1
)
inc_tb
=
av_mul_q
(
inc_tb
,
(
AVRational
)
{
inc
,
1
});
m
=
inc_tb
.
num
*
(
int64_t
)
ts_tb
.
den
;
d
=
inc_tb
.
den
*
(
int64_t
)
ts_tb
.
num
;
if
(
m
%
d
==
0
)
return
ts
+
m
/
d
;
if
(
av_cmp_q
(
inc_tb
,
ts_tb
)
<
0
)
{
//increase step is too small for even 1 step to be representable
return
ts
;
...
...
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