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
6b65c4ec
Commit
6b65c4ec
authored
Apr 16, 2020
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu: add av_gcd_q().
parent
beb98c01
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
APIchanges
doc/APIchanges
+3
-0
rational.c
libavutil/rational.c
+9
-0
rational.h
libavutil/rational.h
+6
-0
version.h
libavutil/version.h
+2
-2
No files found.
doc/APIchanges
View file @
6b65c4ec
...
...
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
API changes, most recent first:
2020-05-23 - xxxxxxxxxx - lavu 56.47.100 - rational.h
Add av_gcd_q().
2020-05-22 - xxxxxxxxxx - lavu 56.46.101 - opt.h
Add AV_OPT_FLAG_CHILD_CONSTS.
...
...
libavutil/rational.c
View file @
6b65c4ec
...
...
@@ -182,3 +182,12 @@ uint32_t av_q2intfloat(AVRational q) {
return
sign
<<
31
|
(
150
-
shift
)
<<
23
|
(
n
-
(
1
<<
23
));
}
AVRational
av_gcd_q
(
AVRational
a
,
AVRational
b
,
int
max_den
,
AVRational
def
)
{
int64_t
gcd
,
lcm
;
gcd
=
av_gcd
(
a
.
den
,
b
.
den
);
lcm
=
(
a
.
den
/
gcd
)
*
b
.
den
;
return
lcm
<
max_den
?
av_make_q
(
av_gcd
(
a
.
num
,
b
.
num
),
lcm
)
:
def
;
}
libavutil/rational.h
View file @
6b65c4ec
...
...
@@ -207,6 +207,12 @@ int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
*/
uint32_t
av_q2intfloat
(
AVRational
q
);
/**
* Return the best rational so that a and b are multiple of it.
* If the resulting denominator is larger than max_den, return def.
*/
AVRational
av_gcd_q
(
AVRational
a
,
AVRational
b
,
int
max_den
,
AVRational
def
);
/**
* @}
*/
...
...
libavutil/version.h
View file @
6b65c4ec
...
...
@@ -79,8 +79,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR 4
6
#define LIBAVUTIL_VERSION_MICRO 10
1
#define LIBAVUTIL_VERSION_MINOR 4
7
#define LIBAVUTIL_VERSION_MICRO 10
0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
...
...
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