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
0b42a938
Commit
0b42a938
authored
Feb 13, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil: add av_rescale_q_rnd() to allow different rounding
parent
0996f406
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
APIchanges
doc/APIchanges
+3
-0
avutil.h
libavutil/avutil.h
+1
-1
mathematics.c
libavutil/mathematics.c
+9
-2
mathematics.h
libavutil/mathematics.h
+6
-0
No files found.
doc/APIchanges
View file @
0b42a938
...
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-02-xx - xxxxxxx - lavu 51.23.1 - mathematics.h
Add av_rescale_q_rnd()
2012-02-xx - xxxxxxx - lavu 51.22.1 - pixdesc.h
Add PIX_FMT_PSEUDOPAL flag.
...
...
libavutil/avutil.h
View file @
0b42a938
...
...
@@ -154,7 +154,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 2
2
#define LIBAVUTIL_VERSION_MINOR 2
3
#define LIBAVUTIL_VERSION_MICRO 1
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
libavutil/mathematics.c
View file @
0b42a938
...
...
@@ -130,10 +130,17 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c){
return
av_rescale_rnd
(
a
,
b
,
c
,
AV_ROUND_NEAR_INF
);
}
int64_t
av_rescale_q
(
int64_t
a
,
AVRational
bq
,
AVRational
cq
){
int64_t
av_rescale_q_rnd
(
int64_t
a
,
AVRational
bq
,
AVRational
cq
,
enum
AVRounding
rnd
)
{
int64_t
b
=
bq
.
num
*
(
int64_t
)
cq
.
den
;
int64_t
c
=
cq
.
num
*
(
int64_t
)
bq
.
den
;
return
av_rescale_rnd
(
a
,
b
,
c
,
AV_ROUND_NEAR_INF
);
return
av_rescale_rnd
(
a
,
b
,
c
,
rnd
);
}
int64_t
av_rescale_q
(
int64_t
a
,
AVRational
bq
,
AVRational
cq
)
{
return
av_rescale_q_rnd
(
a
,
bq
,
cq
,
AV_ROUND_NEAR_INF
);
}
int
av_compare_ts
(
int64_t
ts_a
,
AVRational
tb_a
,
int64_t
ts_b
,
AVRational
tb_b
){
...
...
libavutil/mathematics.h
View file @
0b42a938
...
...
@@ -95,6 +95,12 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_cons
*/
int64_t
av_rescale_q
(
int64_t
a
,
AVRational
bq
,
AVRational
cq
)
av_const
;
/**
* Rescale a 64-bit integer by 2 rational numbers with specified rounding.
*/
int64_t
av_rescale_q_rnd
(
int64_t
a
,
AVRational
bq
,
AVRational
cq
,
enum
AVRounding
)
av_const
;
/**
* Compare 2 timestamps each in its own timebases.
* The result of the function is undefined if one of the timestamps
...
...
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