Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
7af927e3
Commit
7af927e3
authored
Dec 01, 2014
by
Yunqing Wang
Committed by
Gerrit Code Review
Dec 01, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "vp9_ethread: calculate and save the tok starting address for tiles"
parents
661802b6
0993bef7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
47 deletions
+45
-47
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_bitstream.c
+7
-15
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+32
-26
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.c
+5
-5
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_encoder.h
+1
-1
No files found.
vp9/encoder/vp9_bitstream.c
View file @
7af927e3
...
...
@@ -934,29 +934,21 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) {
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
vp9_writer
residual_bc
;
int
tile_row
,
tile_col
;
TOKENEXTRA
*
tok
[
4
][
1
<<
6
],
*
tok_end
;
TOKENEXTRA
*
tok_end
;
size_t
total_size
=
0
;
const
int
tile_cols
=
1
<<
cm
->
log2_tile_cols
;
const
int
tile_rows
=
1
<<
cm
->
log2_tile_rows
;
TOKENEXTRA
*
pre_tok
=
cpi
->
tok
;
int
tile_tok
=
0
;
vpx_memset
(
cm
->
above_seg_context
,
0
,
sizeof
(
*
cm
->
above_seg_context
)
*
mi_cols_aligned_to_sb
(
cm
->
mi_cols
));
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
{
int
tile_idx
=
tile_row
*
tile_cols
+
tile_col
;
tok
[
tile_row
][
tile_col
]
=
pre_tok
+
tile_tok
;
pre_tok
=
tok
[
tile_row
][
tile_col
];
tile_tok
=
allocated_tokens
(
cpi
->
tile_data
[
tile_idx
].
tile_info
);
}
}
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
tile_row
++
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
tile_col
++
)
{
int
tile_idx
=
tile_row
*
tile_cols
+
tile_col
;
tok_end
=
tok
[
tile_row
][
tile_col
]
+
cpi
->
tok_count
[
tile_row
][
tile_col
];
TOKENEXTRA
*
tok
=
cpi
->
tile_tok
[
tile_row
][
tile_col
];
tok_end
=
cpi
->
tile_tok
[
tile_row
][
tile_col
]
+
cpi
->
tok_count
[
tile_row
][
tile_col
];
if
(
tile_col
<
tile_cols
-
1
||
tile_row
<
tile_rows
-
1
)
vp9_start_encode
(
&
residual_bc
,
data_ptr
+
total_size
+
4
);
...
...
@@ -964,8 +956,8 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) {
vp9_start_encode
(
&
residual_bc
,
data_ptr
+
total_size
);
write_modes
(
cpi
,
&
cpi
->
tile_data
[
tile_idx
].
tile_info
,
&
residual_bc
,
&
tok
[
tile_row
][
tile_col
]
,
tok_end
);
assert
(
tok
[
tile_row
][
tile_col
]
==
tok_end
);
&
residual_bc
,
&
tok
,
tok_end
);
assert
(
tok
==
tok_end
);
vp9_stop_encode
(
&
residual_bc
);
if
(
tile_col
<
tile_cols
-
1
||
tile_row
<
tile_rows
-
1
)
{
// size of this tile
...
...
vp9/encoder/vp9_encodeframe.c
View file @
7af927e3
...
...
@@ -3422,32 +3422,29 @@ static int get_skip_encode_frame(const VP9_COMMON *cm, ThreadData *const td) {
cm
->
show_frame
;
}
static
void
tile_data_init
(
TileDataEnc
*
tile_data
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
BLOCK_SIZES
;
++
i
)
{
for
(
j
=
0
;
j
<
MAX_MODES
;
++
j
)
{
tile_data
->
thresh_freq_fact
[
i
][
j
]
=
32
;
tile_data
->
mode_map
[
i
][
j
]
=
j
;
}
}
}
static
void
encode_tiles
(
VP9_COMP
*
cpi
)
{
static
void
init_tile_data
(
VP9_COMP
*
cpi
)
{
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
[
4
][
1
<<
6
];
TOKENEXTRA
*
pre_tok
=
cpi
->
tok
;
TOKENEXTRA
*
pre_tok
=
cpi
->
tile_tok
[
0
][
0
];
int
tile_tok
=
0
;
if
(
cpi
->
tile_data
==
NULL
)
{
CHECK_MEM_ERROR
(
cm
,
cpi
->
tile_data
,
vpx_malloc
(
tile_cols
*
tile_rows
*
sizeof
(
*
cpi
->
tile_data
)));
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
tile_data_init
(
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
]);
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
{
TileDataEnc
*
tile_data
=
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
];
int
i
,
j
;
for
(
i
=
0
;
i
<
BLOCK_SIZES
;
++
i
)
{
for
(
j
=
0
;
j
<
MAX_MODES
;
++
j
)
{
tile_data
->
thresh_freq_fact
[
i
][
j
]
=
32
;
tile_data
->
mode_map
[
i
][
j
]
=
j
;
}
}
}
}
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
{
...
...
@@ -3456,32 +3453,41 @@ static void encode_tiles(VP9_COMP *cpi) {
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
].
tile_info
;
vp9_tile_init
(
tile_info
,
cm
,
tile_row
,
tile_col
);
tok
[
tile_row
][
tile_col
]
=
pre_tok
+
tile_tok
;
pre_tok
=
tok
[
tile_row
][
tile_col
];
cpi
->
tile_
tok
[
tile_row
][
tile_col
]
=
pre_tok
+
tile_tok
;
pre_tok
=
cpi
->
tile_
tok
[
tile_row
][
tile_col
];
tile_tok
=
allocated_tokens
(
*
tile_info
);
}
}
}
static
void
encode_tiles
(
VP9_COMP
*
cpi
)
{
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
;
init_tile_data
(
cpi
);
for
(
tile_row
=
0
;
tile_row
<
tile_rows
;
++
tile_row
)
{
for
(
tile_col
=
0
;
tile_col
<
tile_cols
;
++
tile_col
)
{
const
TileInfo
*
const
tile_info
=
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
].
tile_info
;
TOKENEXTRA
*
const
old_tok
=
tok
[
tile_row
][
tile_col
];
TOKENEXTRA
*
tok
=
cpi
->
tile_
tok
[
tile_row
][
tile_col
];
int
mi_row
;
TileDataEnc
*
this_tile
=
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
];
TileDataEnc
*
this_tile
=
&
cpi
->
tile_data
[
tile_row
*
tile_cols
+
tile_col
];
for
(
mi_row
=
tile_info
->
mi_row_start
;
mi_row
<
tile_info
->
mi_row_end
;
mi_row
+=
MI_BLOCK_SIZE
)
{
if
(
cpi
->
sf
.
use_nonrd_pick_mode
)
encode_nonrd_sb_row
(
cpi
,
&
cpi
->
td
,
this_tile
,
mi_row
,
&
tok
[
tile_row
][
tile_col
]);
encode_nonrd_sb_row
(
cpi
,
&
cpi
->
td
,
this_tile
,
mi_row
,
&
tok
);
else
encode_rd_sb_row
(
cpi
,
&
cpi
->
td
,
this_tile
,
mi_row
,
&
tok
[
tile_row
][
tile_col
]);
encode_rd_sb_row
(
cpi
,
&
cpi
->
td
,
this_tile
,
mi_row
,
&
tok
);
}
cpi
->
tok_count
[
tile_row
][
tile_col
]
=
(
unsigned
int
)(
tok
[
tile_row
][
tile_col
]
-
old_tok
);
assert
(
tok
[
tile_row
][
tile_col
]
-
old_tok
<=
allocated_tokens
(
*
tile_info
));
(
unsigned
int
)(
tok
-
cpi
->
tile_tok
[
tile_row
][
tile_col
]);
assert
(
tok
-
cpi
->
tile_tok
[
tile_row
][
tile_col
]
<=
allocated_tokens
(
*
tile_info
));
}
}
}
...
...
vp9/encoder/vp9_encoder.c
View file @
7af927e3
...
...
@@ -247,8 +247,8 @@ static void dealloc_compressor_data(VP9_COMP *cpi) {
vp9_free_frame_buffer
(
&
cpi
->
alt_ref_buffer
);
vp9_lookahead_destroy
(
cpi
->
lookahead
);
vpx_free
(
cpi
->
t
ok
);
cpi
->
t
ok
=
0
;
vpx_free
(
cpi
->
t
ile_tok
[
0
][
0
]
);
cpi
->
t
ile_tok
[
0
][
0
]
=
0
;
vp9_free_pc_tree
(
&
cpi
->
td
);
...
...
@@ -543,11 +543,12 @@ void vp9_alloc_compressor_data(VP9_COMP *cpi) {
vp9_alloc_context_buffers
(
cm
,
cm
->
width
,
cm
->
height
);
vpx_free
(
cpi
->
t
ok
);
vpx_free
(
cpi
->
t
ile_tok
[
0
][
0
]
);
{
unsigned
int
tokens
=
get_token_alloc
(
cm
->
mb_rows
,
cm
->
mb_cols
);
CHECK_MEM_ERROR
(
cm
,
cpi
->
tok
,
vpx_calloc
(
tokens
,
sizeof
(
*
cpi
->
tok
)));
CHECK_MEM_ERROR
(
cm
,
cpi
->
tile_tok
[
0
][
0
],
vpx_calloc
(
tokens
,
sizeof
(
*
cpi
->
tile_tok
[
0
][
0
])));
}
vp9_setup_pc_tree
(
&
cpi
->
common
,
&
cpi
->
td
);
...
...
@@ -1800,7 +1801,6 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
#endif
dealloc_compressor_data
(
cpi
);
vpx_free
(
cpi
->
tok
);
for
(
i
=
0
;
i
<
sizeof
(
cpi
->
mbgraph_stats
)
/
sizeof
(
cpi
->
mbgraph_stats
[
0
]);
++
i
)
{
...
...
vp9/encoder/vp9_encoder.h
View file @
7af927e3
...
...
@@ -297,7 +297,7 @@ typedef struct VP9_COMP {
YV12_BUFFER_CONFIG
last_frame_uf
;
TOKENEXTRA
*
t
ok
;
TOKENEXTRA
*
t
ile_tok
[
4
][
1
<<
6
]
;
unsigned
int
tok_count
[
4
][
1
<<
6
];
// Ambient reconstruction err target for force key frames
...
...
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