Skip to content
GitLab
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
54ba65a6
Commit
54ba65a6
authored
Nov 20, 2014
by
Yunqing Wang
Committed by
Gerrit Code Review
Nov 20, 2014
Browse files
Merge "vp9_ethread: move max/min partition size to mb struct"
parents
0b71fdbf
ad7586a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_block.h
View file @
54ba65a6
...
...
@@ -67,6 +67,11 @@ struct macroblock {
int
rdmult
;
int
mb_energy
;
// These are set to their default values at the beginning, and then adjusted
// further in the encoding process.
BLOCK_SIZE
min_partition_size
;
BLOCK_SIZE
max_partition_size
;
int
mv_best_ref_index
[
MAX_REF_FRAMES
];
unsigned
int
max_mv_context
[
MAX_REF_FRAMES
];
unsigned
int
source_variance
;
...
...
vp9/encoder/vp9_encodeframe.c
View file @
54ba65a6
...
...
@@ -2058,8 +2058,8 @@ static void rd_pick_partition(VP9_COMP *cpi,
const
int
xss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_x
;
const
int
yss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_y
;
BLOCK_SIZE
min_size
=
cpi
->
sf
.
min_partition_size
;
BLOCK_SIZE
max_size
=
cpi
->
sf
.
max_partition_size
;
BLOCK_SIZE
min_size
=
x
->
min_partition_size
;
BLOCK_SIZE
max_size
=
x
->
max_partition_size
;
#if CONFIG_FP_MB_STATS
unsigned
int
src_diff_var
=
UINT_MAX
;
...
...
@@ -2456,7 +2456,8 @@ static void encode_rd_sb_row(VP9_COMP *cpi,
TOKENEXTRA
**
tp
)
{
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
TileInfo
*
const
tile_info
=
&
tile_data
->
tile_info
;
MACROBLOCKD
*
const
xd
=
&
cpi
->
mb
.
e_mbd
;
MACROBLOCK
*
const
x
=
&
cpi
->
mb
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
int
mi_col
;
...
...
@@ -2514,8 +2515,8 @@ static void encode_rd_sb_row(VP9_COMP *cpi,
if
(
sf
->
auto_min_max_partition_size
)
{
set_offsets
(
cpi
,
tile_info
,
mi_row
,
mi_col
,
BLOCK_64X64
);
rd_auto_partition_range
(
cpi
,
tile_info
,
mi_row
,
mi_col
,
&
sf
->
min_partition_size
,
&
sf
->
max_partition_size
);
&
x
->
min_partition_size
,
&
x
->
max_partition_size
);
}
rd_pick_partition
(
cpi
,
tile_data
,
tp
,
mi_row
,
mi_col
,
BLOCK_64X64
,
&
dummy_rdc
,
INT64_MAX
,
cpi
->
pc_root
);
...
...
@@ -2738,15 +2739,15 @@ static void nonrd_pick_partition(VP9_COMP *cpi,
// Determine partition types in search according to the speed features.
// The threshold set here has to be of square block size.
if
(
sf
->
auto_min_max_partition_size
)
{
partition_none_allowed
&=
(
bsize
<=
sf
->
max_partition_size
&&
bsize
>=
sf
->
min_partition_size
);
partition_horz_allowed
&=
((
bsize
<=
sf
->
max_partition_size
&&
bsize
>
sf
->
min_partition_size
)
||
partition_none_allowed
&=
(
bsize
<=
x
->
max_partition_size
&&
bsize
>=
x
->
min_partition_size
);
partition_horz_allowed
&=
((
bsize
<=
x
->
max_partition_size
&&
bsize
>
x
->
min_partition_size
)
||
force_horz_split
);
partition_vert_allowed
&=
((
bsize
<=
sf
->
max_partition_size
&&
bsize
>
sf
->
min_partition_size
)
||
partition_vert_allowed
&=
((
bsize
<=
x
->
max_partition_size
&&
bsize
>
x
->
min_partition_size
)
||
force_vert_split
);
do_split
&=
bsize
>
sf
->
min_partition_size
;
do_split
&=
bsize
>
x
->
min_partition_size
;
}
if
(
sf
->
use_square_partition_only
)
{
partition_horz_allowed
&=
force_horz_split
;
...
...
@@ -2981,13 +2982,13 @@ static void nonrd_select_partition(VP9_COMP *cpi,
if
(
bsize
==
BLOCK_32X32
&&
partition
!=
PARTITION_NONE
&&
subsize
>=
BLOCK_16X16
)
{
cpi
->
sf
.
max_partition_size
=
BLOCK_32X32
;
cpi
->
sf
.
min_partition_size
=
BLOCK_8X8
;
x
->
max_partition_size
=
BLOCK_32X32
;
x
->
min_partition_size
=
BLOCK_8X8
;
nonrd_pick_partition
(
cpi
,
tile_data
,
tp
,
mi_row
,
mi_col
,
bsize
,
rd_cost
,
0
,
INT64_MAX
,
pc_tree
);
}
else
if
(
bsize
==
BLOCK_16X16
&&
partition
!=
PARTITION_NONE
)
{
cpi
->
sf
.
max_partition_size
=
BLOCK_16X16
;
cpi
->
sf
.
min_partition_size
=
BLOCK_8X8
;
x
->
max_partition_size
=
BLOCK_16X16
;
x
->
min_partition_size
=
BLOCK_8X8
;
nonrd_pick_partition
(
cpi
,
tile_data
,
tp
,
mi_row
,
mi_col
,
bsize
,
rd_cost
,
0
,
INT64_MAX
,
pc_tree
);
}
else
{
...
...
@@ -3266,8 +3267,8 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi,
if
(
cpi
->
oxcf
.
aq_mode
==
CYCLIC_REFRESH_AQ
&&
cm
->
seg
.
enabled
&&
xd
->
mi
[
0
].
src_mi
->
mbmi
.
segment_id
)
{
auto_partition_range
(
cpi
,
tile_info
,
mi_row
,
mi_col
,
&
sf
->
min_partition_size
,
&
sf
->
max_partition_size
);
&
x
->
min_partition_size
,
&
x
->
max_partition_size
);
nonrd_pick_partition
(
cpi
,
tile_data
,
tp
,
mi_row
,
mi_col
,
BLOCK_64X64
,
&
dummy_rdc
,
1
,
INT64_MAX
,
cpi
->
pc_root
);
...
...
vp9/encoder/vp9_rd.c
View file @
54ba65a6
...
...
@@ -458,7 +458,7 @@ void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
uint8_t
*
ref_y_ptr
;
const
int
num_mv_refs
=
MAX_MV_REF_CANDIDATES
+
(
cpi
->
sf
.
adaptive_motion_search
&&
block_size
<
cpi
->
sf
.
max_partition_size
);
block_size
<
x
->
max_partition_size
);
MV
pred_mv
[
3
];
pred_mv
[
0
]
=
mbmi
->
ref_mvs
[
ref_frame
][
0
].
as_mv
;
...
...
vp9/encoder/vp9_speed_features.c
View file @
54ba65a6
...
...
@@ -288,8 +288,8 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf,
sf
->
use_quant_fp
=
!
is_keyframe
;
sf
->
auto_min_max_partition_size
=
is_keyframe
?
RELAXED_NEIGHBORING_MIN_MAX
:
STRICT_NEIGHBORING_MIN_MAX
;
sf
->
max_partition_size
=
BLOCK_32X32
;
sf
->
min_partition_size
=
BLOCK_8X8
;
sf
->
default_
max_partition_size
=
BLOCK_32X32
;
sf
->
default_
min_partition_size
=
BLOCK_8X8
;
sf
->
force_frame_boost
=
is_keyframe
||
(
frames_since_key
%
(
sf
->
last_partitioning_redo_frequency
<<
1
)
==
1
);
sf
->
max_delta_qindex
=
is_keyframe
?
20
:
15
;
...
...
@@ -376,6 +376,7 @@ void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi) {
void
vp9_set_speed_features_framesize_independent
(
VP9_COMP
*
cpi
)
{
SPEED_FEATURES
*
const
sf
=
&
cpi
->
sf
;
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCK
*
const
x
=
&
cpi
->
mb
;
const
VP9EncoderConfig
*
const
oxcf
=
&
cpi
->
oxcf
;
int
i
;
...
...
@@ -407,8 +408,8 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
sf
->
less_rectangular_check
=
0
;
sf
->
use_square_partition_only
=
0
;
sf
->
auto_min_max_partition_size
=
NOT_IN_USE
;
sf
->
max_partition_size
=
BLOCK_64X64
;
sf
->
min_partition_size
=
BLOCK_4X4
;
sf
->
default_
max_partition_size
=
BLOCK_64X64
;
sf
->
default_
min_partition_size
=
BLOCK_4X4
;
sf
->
adjust_partitioning_from_last_frame
=
0
;
sf
->
last_partitioning_redo_frequency
=
4
;
sf
->
disable_split_mask
=
0
;
...
...
@@ -480,7 +481,10 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
cpi
->
find_fractional_mv_step
=
vp9_find_best_sub_pixel_tree_pruned_evenmore
;
}
cpi
->
mb
.
optimize
=
sf
->
optimize_coefficients
==
1
&&
oxcf
->
pass
!=
1
;
x
->
optimize
=
sf
->
optimize_coefficients
==
1
&&
oxcf
->
pass
!=
1
;
x
->
min_partition_size
=
sf
->
default_min_partition_size
;
x
->
max_partition_size
=
sf
->
default_max_partition_size
;
if
(
!
cpi
->
oxcf
.
frame_periodic_boost
)
{
sf
->
max_delta_qindex
=
0
;
...
...
vp9/encoder/vp9_speed_features.h
View file @
54ba65a6
...
...
@@ -275,8 +275,8 @@ typedef struct SPEED_FEATURES {
// Min and max partition size we enable (block_size) as per auto
// min max, but also used by adjust partitioning, and pick_partitioning.
BLOCK_SIZE
min_partition_size
;
BLOCK_SIZE
max_partition_size
;
BLOCK_SIZE
default_
min_partition_size
;
BLOCK_SIZE
default_
max_partition_size
;
// Whether or not we allow partitions one smaller or one greater than the last
// frame's partitioning. Only used if use_lastframe_partitioning is set.
...
...
Write
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!
Cancel
Please
register
or
sign in
to comment