Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
b528d492
Commit
b528d492
authored
Mar 10, 2014
by
Alex Converse
Browse files
Make vp8_set_maps more flexible.
Change-Id: I754a5c5e342cfa7c52c1a75424f18aea8b7657d2
parent
1f08824d
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/vp8_set_maps.c
View file @
b528d492
...
@@ -65,8 +65,8 @@ static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
...
@@ -65,8 +65,8 @@ static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
unsigned
int
i
;
unsigned
int
i
;
vpx_roi_map_t
roi
=
{
0
};
vpx_roi_map_t
roi
=
{
0
};
roi
.
rows
=
cfg
->
g_h
/
16
;
roi
.
rows
=
(
cfg
->
g_h
+
15
)
/
16
;
roi
.
cols
=
cfg
->
g_w
/
16
;
roi
.
cols
=
(
cfg
->
g_w
+
15
)
/
16
;
roi
.
delta_q
[
0
]
=
0
;
roi
.
delta_q
[
0
]
=
0
;
roi
.
delta_q
[
1
]
=
-
2
;
roi
.
delta_q
[
1
]
=
-
2
;
...
@@ -98,8 +98,8 @@ static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
...
@@ -98,8 +98,8 @@ static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
unsigned
int
i
;
unsigned
int
i
;
vpx_active_map_t
map
=
{
0
};
vpx_active_map_t
map
=
{
0
};
map
.
rows
=
cfg
->
g_h
/
16
;
map
.
rows
=
(
cfg
->
g_h
+
15
)
/
16
;
map
.
cols
=
cfg
->
g_w
/
16
;
map
.
cols
=
(
cfg
->
g_w
+
15
)
/
16
;
map
.
active_map
=
(
uint8_t
*
)
malloc
(
map
.
rows
*
map
.
cols
);
map
.
active_map
=
(
uint8_t
*
)
malloc
(
map
.
rows
*
map
.
cols
);
for
(
i
=
0
;
i
<
map
.
rows
*
map
.
cols
;
++
i
)
for
(
i
=
0
;
i
<
map
.
rows
*
map
.
cols
;
++
i
)
...
@@ -115,8 +115,8 @@ static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
...
@@ -115,8 +115,8 @@ static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
vpx_codec_ctx_t
*
codec
)
{
vpx_codec_ctx_t
*
codec
)
{
vpx_active_map_t
map
=
{
0
};
vpx_active_map_t
map
=
{
0
};
map
.
rows
=
cfg
->
g_h
/
16
;
map
.
rows
=
(
cfg
->
g_h
+
15
)
/
16
;
map
.
cols
=
cfg
->
g_w
/
16
;
map
.
cols
=
(
cfg
->
g_w
+
15
)
/
16
;
map
.
active_map
=
NULL
;
map
.
active_map
=
NULL
;
if
(
vpx_codec_control
(
codec
,
VP8E_SET_ACTIVEMAP
,
&
map
))
if
(
vpx_codec_control
(
codec
,
VP8E_SET_ACTIVEMAP
,
&
map
))
...
@@ -161,7 +161,7 @@ int main(int argc, char **argv) {
...
@@ -161,7 +161,7 @@ int main(int argc, char **argv) {
VpxVideoWriter
*
writer
=
NULL
;
VpxVideoWriter
*
writer
=
NULL
;
const
VpxInterface
*
encoder
=
NULL
;
const
VpxInterface
*
encoder
=
NULL
;
const
int
fps
=
2
;
// TODO(dkovalev) add command line argument
const
int
fps
=
2
;
// TODO(dkovalev) add command line argument
const
int
bit
ra
t
e
=
200
;
// kbit/s TODO(dkovalev) add command line argument
const
double
bits_per_pixel_per_f
ra
m
e
=
0
.
067
;
exec_name
=
argv
[
0
];
exec_name
=
argv
[
0
];
...
@@ -200,7 +200,8 @@ int main(int argc, char **argv) {
...
@@ -200,7 +200,8 @@ int main(int argc, char **argv) {
cfg
.
g_h
=
info
.
frame_height
;
cfg
.
g_h
=
info
.
frame_height
;
cfg
.
g_timebase
.
num
=
info
.
time_base
.
numerator
;
cfg
.
g_timebase
.
num
=
info
.
time_base
.
numerator
;
cfg
.
g_timebase
.
den
=
info
.
time_base
.
denominator
;
cfg
.
g_timebase
.
den
=
info
.
time_base
.
denominator
;
cfg
.
rc_target_bitrate
=
bitrate
;
cfg
.
rc_target_bitrate
=
(
unsigned
int
)(
bits_per_pixel_per_frame
*
cfg
.
g_w
*
cfg
.
g_h
*
fps
/
1000
);
writer
=
vpx_video_writer_open
(
argv
[
4
],
kContainerIVF
,
&
info
);
writer
=
vpx_video_writer_open
(
argv
[
4
],
kContainerIVF
,
&
info
);
if
(
!
writer
)
if
(
!
writer
)
...
...
Write
Preview
Supports
Markdown
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