Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
c1bce6b0
Commit
c1bce6b0
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Cleaning up ivf-related code."
parents
c37d54a9
df46372e
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivfdec.c
+21
-21
ivfdec.c
ivfenc.c
+0
-3
ivfenc.c
with
21 additions
and
24 deletions
ivfdec.c
+
21
−
21
View file @
c1bce6b0
...
@@ -13,6 +13,25 @@
...
@@ -13,6 +13,25 @@
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdlib.h>
static
void
fix_framerate
(
int
*
num
,
int
*
den
)
{
// Some versions of vpxenc used 1/(2*fps) for the timebase, so
// we can guess the framerate using only the timebase in this
// case. Other files would require reading ahead to guess the
// timebase, like we do for webm.
if
(
*
num
<
1000
)
{
// Correct for the factor of 2 applied to the timebase in the encoder.
if
(
*
num
&
1
)
*
den
*=
2
;
else
*
num
/=
2
;
}
else
{
// Don't know FPS for sure, and don't have readahead code
// (yet?), so just default to 30fps.
*
num
=
30
;
*
den
=
1
;
}
}
int
file_is_ivf
(
struct
VpxInputContext
*
input_ctx
)
{
int
file_is_ivf
(
struct
VpxInputContext
*
input_ctx
)
{
char
raw_hdr
[
32
];
char
raw_hdr
[
32
];
int
is_ivf
=
0
;
int
is_ivf
=
0
;
...
@@ -32,27 +51,8 @@ int file_is_ivf(struct VpxInputContext *input_ctx) {
...
@@ -32,27 +51,8 @@ int file_is_ivf(struct VpxInputContext *input_ctx) {
input_ctx
->
height
=
mem_get_le16
(
raw_hdr
+
14
);
input_ctx
->
height
=
mem_get_le16
(
raw_hdr
+
14
);
input_ctx
->
framerate
.
numerator
=
mem_get_le32
(
raw_hdr
+
16
);
input_ctx
->
framerate
.
numerator
=
mem_get_le32
(
raw_hdr
+
16
);
input_ctx
->
framerate
.
denominator
=
mem_get_le32
(
raw_hdr
+
20
);
input_ctx
->
framerate
.
denominator
=
mem_get_le32
(
raw_hdr
+
20
);
fix_framerate
(
&
input_ctx
->
framerate
.
numerator
,
/* Some versions of vpxenc used 1/(2*fps) for the timebase, so
&
input_ctx
->
framerate
.
denominator
);
* we can guess the framerate using only the timebase in this
* case. Other files would require reading ahead to guess the
* timebase, like we do for webm.
*/
if
(
input_ctx
->
framerate
.
numerator
<
1000
)
{
/* Correct for the factor of 2 applied to the timebase in the
* encoder.
*/
if
(
input_ctx
->
framerate
.
numerator
&
1
)
input_ctx
->
framerate
.
denominator
<<=
1
;
else
input_ctx
->
framerate
.
numerator
>>=
1
;
}
else
{
/* Don't know FPS for sure, and don't have readahead code
* (yet?), so just default to 30fps.
*/
input_ctx
->
framerate
.
numerator
=
30
;
input_ctx
->
framerate
.
denominator
=
1
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ivfenc.c
+
0
−
3
View file @
c1bce6b0
...
@@ -41,9 +41,6 @@ void ivf_write_frame_header(FILE *outfile, const struct vpx_codec_cx_pkt *pkt) {
...
@@ -41,9 +41,6 @@ void ivf_write_frame_header(FILE *outfile, const struct vpx_codec_cx_pkt *pkt) {
char
header
[
12
];
char
header
[
12
];
vpx_codec_pts_t
pts
;
vpx_codec_pts_t
pts
;
if
(
pkt
->
kind
!=
VPX_CODEC_CX_FRAME_PKT
)
return
;
pts
=
pkt
->
data
.
frame
.
pts
;
pts
=
pkt
->
data
.
frame
.
pts
;
mem_put_le32
(
header
,
(
int
)
pkt
->
data
.
frame
.
sz
);
mem_put_le32
(
header
,
(
int
)
pkt
->
data
.
frame
.
sz
);
mem_put_le32
(
header
+
4
,
pts
&
0xFFFFFFFF
);
mem_put_le32
(
header
+
4
,
pts
&
0xFFFFFFFF
);
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets