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
Xiph.Org
aom-rav1e
Commits
5f72de91
Commit
5f72de91
authored
Jun 06, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Jun 06, 2014
Browse files
Merge "Adding encode_tiles() function."
parents
944e3e71
31403fd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_encodeframe.c
View file @
5f72de91
...
...
@@ -2977,6 +2977,33 @@ static int get_skip_encode_frame(const VP9_COMMON *cm) {
cm
->
show_frame
;
}
static
void
encode_tiles
(
VP9_COMP
*
cpi
)
{
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
int
tile_cols
=
1
<<
cm
->
log2_tile_cols
;
const
int
tile_rows
=
1
<<
cm
->
log2_tile_rows
;
int
tile_col
,
tile_row
;
TOKENEXTRA
*
tok
=
cpi
->
tok
;
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
{
TileInfo
tile
;
TOKENEXTRA
*
old_tok
=
tok
;
int
mi_row
;
vp9_tile_init
(
&
tile
,
cm
,
tile_row
,
tile_col
);
for
(
mi_row
=
tile
.
mi_row_start
;
mi_row
<
tile
.
mi_row_end
;
mi_row
+=
MI_BLOCK_SIZE
)
{
if
(
cpi
->
sf
.
use_nonrd_pick_mode
&&
cm
->
frame_type
!=
KEY_FRAME
)
encode_nonrd_sb_row
(
cpi
,
&
tile
,
mi_row
,
&
tok
);
else
encode_rd_sb_row
(
cpi
,
&
tile
,
mi_row
,
&
tok
);
}
cpi
->
tok_count
[
tile_row
][
tile_col
]
=
(
unsigned
int
)(
tok
-
old_tok
);
assert
(
tok
-
cpi
->
tok
<=
get_token_alloc
(
cm
->
mb_rows
,
cm
->
mb_cols
));
}
}
}
static
void
encode_frame_internal
(
VP9_COMP
*
cpi
)
{
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
RD_OPT
*
const
rd_opt
=
&
cpi
->
rd
;
...
...
@@ -3062,33 +3089,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
struct
vpx_usec_timer
emr_timer
;
vpx_usec_timer_start
(
&
emr_timer
);
{
// Take tiles into account and give start/end MB
int
tile_col
,
tile_row
;
TOKENEXTRA
*
tp
=
cpi
->
tok
;
const
int
tile_cols
=
1
<<
cm
->
log2_tile_cols
;
const
int
tile_rows
=
1
<<
cm
->
log2_tile_rows
;
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
tile_row
++
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
tile_col
++
)
{
TileInfo
tile
;
TOKENEXTRA
*
tp_old
=
tp
;
int
mi_row
;
// For each row of SBs in the frame
vp9_tile_init
(
&
tile
,
cm
,
tile_row
,
tile_col
);
for
(
mi_row
=
tile
.
mi_row_start
;
mi_row
<
tile
.
mi_row_end
;
mi_row
+=
MI_BLOCK_SIZE
)
{
if
(
sf
->
use_nonrd_pick_mode
&&
cm
->
frame_type
!=
KEY_FRAME
)
encode_nonrd_sb_row
(
cpi
,
&
tile
,
mi_row
,
&
tp
);
else
encode_rd_sb_row
(
cpi
,
&
tile
,
mi_row
,
&
tp
);
}
cpi
->
tok_count
[
tile_row
][
tile_col
]
=
(
unsigned
int
)(
tp
-
tp_old
);
assert
(
tp
-
cpi
->
tok
<=
get_token_alloc
(
cm
->
mb_rows
,
cm
->
mb_cols
));
}
}
}
encode_tiles
(
cpi
);
vpx_usec_timer_mark
(
&
emr_timer
);
cpi
->
time_encode_sb_row
+=
vpx_usec_timer_elapsed
(
&
emr_timer
);
...
...
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