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
16dc5f20
Commit
16dc5f20
authored
Aug 05, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace various inlined inverse AVRational with av_inv_q().
parent
ad55244c
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
12 additions
and
13 deletions
+12
-13
ffmpeg.c
ffmpeg.c
+2
-2
fbdev.c
libavdevice/fbdev.c
+1
-1
vfwcap.c
libavdevice/vfwcap.c
+1
-1
x11grab.c
libavdevice/x11grab.c
+1
-1
vf_fps.c
libavfilter/vf_fps.c
+1
-1
electronicarts.c
libavformat/electronicarts.c
+1
-1
mxfenc.c
libavformat/mxfenc.c
+1
-1
r3d.c
libavformat/r3d.c
+2
-3
rawdec.c
libavformat/rawdec.c
+1
-1
utils.c
libavformat/utils.c
+1
-1
No files found.
ffmpeg.c
View file @
16dc5f20
...
...
@@ -3188,7 +3188,7 @@ static int transcode_init(void)
}
if
(
ost
->
frame_rate
.
num
)
codec
->
time_base
=
(
AVRational
){
ost
->
frame_rate
.
den
,
ost
->
frame_rate
.
num
}
;
codec
->
time_base
=
av_inv_q
(
ost
->
frame_rate
)
;
av_reduce
(
&
codec
->
time_base
.
num
,
&
codec
->
time_base
.
den
,
codec
->
time_base
.
num
,
codec
->
time_base
.
den
,
INT_MAX
);
...
...
@@ -3281,7 +3281,7 @@ static int transcode_init(void)
codec
->
time_base
=
(
AVRational
){
1
,
codec
->
sample_rate
};
break
;
case
AVMEDIA_TYPE_VIDEO
:
codec
->
time_base
=
(
AVRational
){
ost
->
frame_rate
.
den
,
ost
->
frame_rate
.
num
}
;
codec
->
time_base
=
av_inv_q
(
ost
->
frame_rate
)
;
if
(
ost
->
filter
&&
!
(
codec
->
time_base
.
num
&&
codec
->
time_base
.
den
))
codec
->
time_base
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
time_base
;
if
(
av_q2d
(
codec
->
time_base
)
<
0
.
001
&&
video_sync_method
!=
VSYNC_PASSTHROUGH
...
...
libavdevice/fbdev.c
View file @
16dc5f20
...
...
@@ -164,7 +164,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
st
->
codec
->
width
=
fbdev
->
width
;
st
->
codec
->
height
=
fbdev
->
height
;
st
->
codec
->
pix_fmt
=
pix_fmt
;
st
->
codec
->
time_base
=
(
AVRational
){
fbdev
->
framerate_q
.
den
,
fbdev
->
framerate_q
.
num
}
;
st
->
codec
->
time_base
=
av_inv_q
(
fbdev
->
framerate_q
)
;
st
->
codec
->
bit_rate
=
fbdev
->
width
*
fbdev
->
height
*
fbdev
->
bytes_per_pixel
*
av_q2d
(
fbdev
->
framerate_q
)
*
8
;
...
...
libavdevice/vfwcap.c
View file @
16dc5f20
...
...
@@ -372,7 +372,7 @@ static int vfw_read_header(AVFormatContext *s)
goto
fail
;
codec
=
st
->
codec
;
codec
->
time_base
=
(
AVRational
){
framerate_q
.
den
,
framerate_q
.
num
}
;
codec
->
time_base
=
av_inv_q
(
framerate_q
)
;
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
codec
->
width
=
bi
->
bmiHeader
.
biWidth
;
codec
->
height
=
bi
->
bmiHeader
.
biHeight
;
...
...
libavdevice/x11grab.c
View file @
16dc5f20
...
...
@@ -302,7 +302,7 @@ x11grab_read_header(AVFormatContext *s1)
x11grab
->
frame_size
=
x11grab
->
width
*
x11grab
->
height
*
image
->
bits_per_pixel
/
8
;
x11grab
->
dpy
=
dpy
;
x11grab
->
time_base
=
(
AVRational
){
framerate
.
den
,
framerate
.
num
}
;
x11grab
->
time_base
=
av_inv_q
(
framerate
)
;
x11grab
->
time_frame
=
av_gettime
()
/
av_q2d
(
x11grab
->
time_base
);
x11grab
->
x_off
=
x_off
;
x11grab
->
y_off
=
y_off
;
...
...
libavfilter/vf_fps.c
View file @
16dc5f20
...
...
@@ -114,7 +114,7 @@ static int config_props(AVFilterLink* link)
{
FPSContext
*
s
=
link
->
src
->
priv
;
link
->
time_base
=
(
AVRational
){
s
->
framerate
.
den
,
s
->
framerate
.
num
}
;
link
->
time_base
=
av_inv_q
(
s
->
framerate
)
;
link
->
frame_rate
=
s
->
framerate
;
link
->
w
=
link
->
src
->
inputs
[
0
]
->
w
;
link
->
h
=
link
->
src
->
inputs
[
0
]
->
h
;
...
...
libavformat/electronicarts.c
View file @
16dc5f20
...
...
@@ -440,7 +440,7 @@ static int ea_read_header(AVFormatContext *s)
if
(
ea
->
time_base
.
num
)
avpriv_set_pts_info
(
st
,
64
,
ea
->
time_base
.
num
,
ea
->
time_base
.
den
);
st
->
r_frame_rate
=
st
->
avg_frame_rate
=
(
AVRational
){
ea
->
time_base
.
den
,
ea
->
time_base
.
num
}
;
st
->
avg_frame_rate
=
av_inv_q
(
ea
->
time_base
)
;
}
if
(
ea
->
audio_codec
)
{
...
...
libavformat/mxfenc.c
View file @
16dc5f20
...
...
@@ -1706,7 +1706,7 @@ static int mxf_write_header(AVFormatContext *s)
av_log
(
s
,
AV_LOG_ERROR
,
"unsupported video frame rate
\n
"
);
return
-
1
;
}
rate
=
(
AVRational
){
mxf
->
time_base
.
den
,
mxf
->
time_base
.
num
}
;
rate
=
av_inv_q
(
mxf
->
time_base
)
;
avpriv_set_pts_info
(
st
,
64
,
mxf
->
time_base
.
num
,
mxf
->
time_base
.
den
);
if
(
!
tcr
)
tcr
=
av_dict_get
(
st
->
metadata
,
"timecode"
,
NULL
,
0
);
...
...
libavformat/r3d.c
View file @
16dc5f20
...
...
@@ -141,8 +141,7 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
if
(
st
->
avg_frame_rate
.
num
)
st
->
duration
=
av_rescale_q
(
r3d
->
video_offsets_count
,
(
AVRational
){
st
->
avg_frame_rate
.
den
,
st
->
avg_frame_rate
.
num
},
av_inv_q
(
st
->
avg_frame_rate
),
st
->
time_base
);
av_dlog
(
s
,
"duration %"
PRId64
"
\n
"
,
st
->
duration
);
...
...
@@ -370,7 +369,7 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
return
-
1
;
frame_num
=
av_rescale_q
(
sample_time
,
st
->
time_base
,
(
AVRational
){
st
->
avg_frame_rate
.
den
,
st
->
avg_frame_rate
.
num
}
);
av_inv_q
(
st
->
avg_frame_rate
)
);
av_dlog
(
s
,
"seek frame num %d timestamp %"
PRId64
"
\n
"
,
frame_num
,
sample_time
);
...
...
libavformat/rawdec.c
View file @
16dc5f20
...
...
@@ -165,7 +165,7 @@ int ff_raw_video_read_header(AVFormatContext *s)
goto
fail
;
}
st
->
codec
->
time_base
=
(
AVRational
){
framerate
.
den
,
framerate
.
num
}
;
st
->
codec
->
time_base
=
av_inv_q
(
framerate
)
;
avpriv_set_pts_info
(
st
,
64
,
1
,
1200000
);
fail:
...
...
libavformat/utils.c
View file @
16dc5f20
...
...
@@ -2670,7 +2670,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
if
(
st
->
time_base
.
den
>
0
)
t
=
av_rescale_q
(
st
->
info
->
codec_info_duration
,
st
->
time_base
,
AV_TIME_BASE_Q
);
if
(
st
->
avg_frame_rate
.
num
>
0
)
t
=
FFMAX
(
t
,
av_rescale_q
(
st
->
codec_info_nb_frames
,
(
AVRational
){
st
->
avg_frame_rate
.
den
,
st
->
avg_frame_rate
.
num
}
,
AV_TIME_BASE_Q
));
t
=
FFMAX
(
t
,
av_rescale_q
(
st
->
codec_info_nb_frames
,
av_inv_q
(
st
->
avg_frame_rate
)
,
AV_TIME_BASE_Q
));
if
(
t
>=
ic
->
max_analyze_duration
)
{
av_log
(
ic
,
AV_LOG_WARNING
,
"max_analyze_duration %d reached at %"
PRId64
"
\n
"
,
ic
->
max_analyze_duration
,
t
);
...
...
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