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
98fde546
Commit
98fde546
authored
11 years ago
by
Alex Converse
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Deduplicate and rename mode info step."
parents
79c51573
f16f507c
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
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/encoder/vp9_encodeframe.c
+27
-25
vp9/encoder/vp9_encodeframe.c
with
27 additions
and
25 deletions
vp9/encoder/vp9_encodeframe.c
+
27
−
25
View file @
98fde546
...
@@ -1598,10 +1598,7 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1598,10 +1598,7 @@ static void rd_use_partition(VP9_COMP *cpi,
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
const
int
mis
=
cm
->
mode_info_stride
;
const
int
mis
=
cm
->
mode_info_stride
;
const
int
bsl
=
b_width_log2
(
bsize
);
const
int
bsl
=
b_width_log2
(
bsize
);
const
int
num_4x4_blocks_wide
=
num_4x4_blocks_wide_lookup
[
bsize
];
const
int
mi_step
=
num_4x4_blocks_wide_lookup
[
bsize
]
/
2
;
const
int
num_4x4_blocks_high
=
num_4x4_blocks_high_lookup
[
bsize
];
const
int
ms
=
num_4x4_blocks_wide
/
2
;
const
int
mh
=
num_4x4_blocks_high
/
2
;
const
int
bss
=
(
1
<<
bsl
)
/
4
;
const
int
bss
=
(
1
<<
bsl
)
/
4
;
int
i
,
pl
;
int
i
,
pl
;
PARTITION_TYPE
partition
=
PARTITION_NONE
;
PARTITION_TYPE
partition
=
PARTITION_NONE
;
...
@@ -1624,6 +1621,9 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1624,6 +1621,9 @@ static void rd_use_partition(VP9_COMP *cpi,
if
(
mi_row
>=
cm
->
mi_rows
||
mi_col
>=
cm
->
mi_cols
)
if
(
mi_row
>=
cm
->
mi_rows
||
mi_col
>=
cm
->
mi_cols
)
return
;
return
;
assert
(
num_4x4_blocks_wide_lookup
[
bsize
]
==
num_4x4_blocks_high_lookup
[
bsize
]);
partition
=
partition_lookup
[
bsl
][
bs_type
];
partition
=
partition_lookup
[
bsl
][
bs_type
];
subsize
=
get_subsize
(
bsize
,
partition
);
subsize
=
get_subsize
(
bsize
,
partition
);
...
@@ -1663,8 +1663,8 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1663,8 +1663,8 @@ static void rd_use_partition(VP9_COMP *cpi,
// If partition is not none try none unless each of the 4 splits are split
// If partition is not none try none unless each of the 4 splits are split
// even further..
// even further..
if
(
partition
!=
PARTITION_NONE
&&
!
splits_below
&&
if
(
partition
!=
PARTITION_NONE
&&
!
splits_below
&&
mi_row
+
(
m
s
>>
1
)
<
cm
->
mi_rows
&&
mi_row
+
(
m
i_step
>>
1
)
<
cm
->
mi_rows
&&
mi_col
+
(
m
s
>>
1
)
<
cm
->
mi_cols
)
{
mi_col
+
(
m
i_step
>>
1
)
<
cm
->
mi_cols
)
{
*
(
get_sb_partitioning
(
x
,
bsize
))
=
bsize
;
*
(
get_sb_partitioning
(
x
,
bsize
))
=
bsize
;
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
,
&
none_rate
,
&
none_dist
,
bsize
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
,
&
none_rate
,
&
none_dist
,
bsize
,
get_block_context
(
x
,
bsize
),
INT64_MAX
);
get_block_context
(
x
,
bsize
),
INT64_MAX
);
...
@@ -1694,14 +1694,14 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1694,14 +1694,14 @@ static void rd_use_partition(VP9_COMP *cpi,
&
last_part_dist
,
subsize
,
&
last_part_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
get_block_context
(
x
,
subsize
),
INT64_MAX
);
if
(
last_part_rate
!=
INT_MAX
&&
if
(
last_part_rate
!=
INT_MAX
&&
bsize
>=
BLOCK_8X8
&&
mi_row
+
(
m
h
>>
1
)
<
cm
->
mi_rows
)
{
bsize
>=
BLOCK_8X8
&&
mi_row
+
(
m
i_step
>>
1
)
<
cm
->
mi_rows
)
{
int
rt
=
0
;
int
rt
=
0
;
int64_t
dt
=
0
;
int64_t
dt
=
0
;
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
subsize
,
0
);
subsize
,
0
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
*
get_sb_index
(
x
,
subsize
)
=
1
;
*
get_sb_index
(
x
,
subsize
)
=
1
;
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
+
(
m
s
>>
1
),
mi_col
,
&
rt
,
&
dt
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
+
(
m
i_step
>>
1
),
mi_col
,
&
rt
,
&
dt
,
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
if
(
rt
==
INT_MAX
||
dt
==
INT64_MAX
)
{
if
(
rt
==
INT_MAX
||
dt
==
INT64_MAX
)
{
last_part_rate
=
INT_MAX
;
last_part_rate
=
INT_MAX
;
...
@@ -1719,14 +1719,14 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1719,14 +1719,14 @@ static void rd_use_partition(VP9_COMP *cpi,
&
last_part_dist
,
subsize
,
&
last_part_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
get_block_context
(
x
,
subsize
),
INT64_MAX
);
if
(
last_part_rate
!=
INT_MAX
&&
if
(
last_part_rate
!=
INT_MAX
&&
bsize
>=
BLOCK_8X8
&&
mi_col
+
(
m
s
>>
1
)
<
cm
->
mi_cols
)
{
bsize
>=
BLOCK_8X8
&&
mi_col
+
(
m
i_step
>>
1
)
<
cm
->
mi_cols
)
{
int
rt
=
0
;
int
rt
=
0
;
int64_t
dt
=
0
;
int64_t
dt
=
0
;
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
subsize
,
0
);
subsize
,
0
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
*
get_sb_index
(
x
,
subsize
)
=
1
;
*
get_sb_index
(
x
,
subsize
)
=
1
;
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
+
(
m
s
>>
1
),
&
rt
,
&
dt
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
+
(
m
i_step
>>
1
),
&
rt
,
&
dt
,
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
subsize
,
get_block_context
(
x
,
subsize
),
INT64_MAX
);
if
(
rt
==
INT_MAX
||
dt
==
INT64_MAX
)
{
if
(
rt
==
INT_MAX
||
dt
==
INT64_MAX
)
{
last_part_rate
=
INT_MAX
;
last_part_rate
=
INT_MAX
;
...
@@ -1742,8 +1742,8 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1742,8 +1742,8 @@ static void rd_use_partition(VP9_COMP *cpi,
last_part_rate
=
0
;
last_part_rate
=
0
;
last_part_dist
=
0
;
last_part_dist
=
0
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
int
x_idx
=
(
i
&
1
)
*
(
m
s
>>
1
);
int
x_idx
=
(
i
&
1
)
*
(
m
i_step
>>
1
);
int
y_idx
=
(
i
>>
1
)
*
(
m
s
>>
1
);
int
y_idx
=
(
i
>>
1
)
*
(
m
i_step
>>
1
);
int
jj
=
i
>>
1
,
ii
=
i
&
0x01
;
int
jj
=
i
>>
1
,
ii
=
i
&
0x01
;
int
rt
;
int
rt
;
int64_t
dt
;
int64_t
dt
;
...
@@ -1778,8 +1778,10 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1778,8 +1778,10 @@ static void rd_use_partition(VP9_COMP *cpi,
if
(
cpi
->
sf
.
adjust_partitioning_from_last_frame
if
(
cpi
->
sf
.
adjust_partitioning_from_last_frame
&&
cpi
->
sf
.
partition_search_type
==
SEARCH_PARTITION
&&
cpi
->
sf
.
partition_search_type
==
SEARCH_PARTITION
&&
partition
!=
PARTITION_SPLIT
&&
bsize
>
BLOCK_8X8
&&
partition
!=
PARTITION_SPLIT
&&
bsize
>
BLOCK_8X8
&&
(
mi_row
+
ms
<
cm
->
mi_rows
||
mi_row
+
(
ms
>>
1
)
==
cm
->
mi_rows
)
&&
(
mi_row
+
mi_step
<
cm
->
mi_rows
||
&&
(
mi_col
+
ms
<
cm
->
mi_cols
||
mi_col
+
(
ms
>>
1
)
==
cm
->
mi_cols
))
{
mi_row
+
(
mi_step
>>
1
)
==
cm
->
mi_rows
)
&&
(
mi_col
+
mi_step
<
cm
->
mi_cols
||
mi_col
+
(
mi_step
>>
1
)
==
cm
->
mi_cols
))
{
BLOCK_SIZE
split_subsize
=
get_subsize
(
bsize
,
PARTITION_SPLIT
);
BLOCK_SIZE
split_subsize
=
get_subsize
(
bsize
,
PARTITION_SPLIT
);
chosen_rate
=
0
;
chosen_rate
=
0
;
chosen_dist
=
0
;
chosen_dist
=
0
;
...
@@ -1787,8 +1789,8 @@ static void rd_use_partition(VP9_COMP *cpi,
...
@@ -1787,8 +1789,8 @@ static void rd_use_partition(VP9_COMP *cpi,
// Split partition.
// Split partition.
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
int
x_idx
=
(
i
&
1
)
*
(
num_4x4_blocks_wide
>>
2
);
int
x_idx
=
(
i
&
1
)
*
(
mi_step
>>
1
);
int
y_idx
=
(
i
>>
1
)
*
(
num_4x4_blocks_wide
>>
2
);
int
y_idx
=
(
i
>>
1
)
*
(
mi_step
>>
1
);
int
rt
=
0
;
int
rt
=
0
;
int64_t
dt
=
0
;
int64_t
dt
=
0
;
ENTROPY_CONTEXT
l
[
16
*
MAX_MB_PLANE
],
a
[
16
*
MAX_MB_PLANE
];
ENTROPY_CONTEXT
l
[
16
*
MAX_MB_PLANE
],
a
[
16
*
MAX_MB_PLANE
];
...
@@ -2020,7 +2022,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2020,7 +2022,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
MACROBLOCK
*
const
x
=
&
cpi
->
mb
;
MACROBLOCK
*
const
x
=
&
cpi
->
mb
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
MACROBLOCKD
*
const
xd
=
&
x
->
e_mbd
;
const
int
m
s
=
num_8x8_blocks_wide_lookup
[
bsize
]
/
2
;
const
int
m
i_step
=
num_8x8_blocks_wide_lookup
[
bsize
]
/
2
;
ENTROPY_CONTEXT
l
[
16
*
MAX_MB_PLANE
],
a
[
16
*
MAX_MB_PLANE
];
ENTROPY_CONTEXT
l
[
16
*
MAX_MB_PLANE
],
a
[
16
*
MAX_MB_PLANE
];
PARTITION_CONTEXT
sl
[
8
],
sa
[
8
];
PARTITION_CONTEXT
sl
[
8
],
sa
[
8
];
TOKENEXTRA
*
tp_orig
=
*
tp
;
TOKENEXTRA
*
tp_orig
=
*
tp
;
...
@@ -2033,8 +2035,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2033,8 +2035,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
int
do_split
=
bsize
>=
BLOCK_8X8
;
int
do_split
=
bsize
>=
BLOCK_8X8
;
int
do_rect
=
1
;
int
do_rect
=
1
;
// Override skipping rectangular partition operations for edge blocks
// Override skipping rectangular partition operations for edge blocks
const
int
force_horz_split
=
(
mi_row
+
m
s
>=
cm
->
mi_rows
);
const
int
force_horz_split
=
(
mi_row
+
m
i_step
>=
cm
->
mi_rows
);
const
int
force_vert_split
=
(
mi_col
+
m
s
>=
cm
->
mi_cols
);
const
int
force_vert_split
=
(
mi_col
+
m
i_step
>=
cm
->
mi_cols
);
const
int
xss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_x
;
const
int
xss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_x
;
const
int
yss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_y
;
const
int
yss
=
x
->
e_mbd
.
plane
[
1
].
subsampling_y
;
...
@@ -2146,8 +2148,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2146,8 +2148,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
if
(
do_split
)
{
if
(
do_split
)
{
subsize
=
get_subsize
(
bsize
,
PARTITION_SPLIT
);
subsize
=
get_subsize
(
bsize
,
PARTITION_SPLIT
);
for
(
i
=
0
;
i
<
4
&&
sum_rd
<
best_rd
;
++
i
)
{
for
(
i
=
0
;
i
<
4
&&
sum_rd
<
best_rd
;
++
i
)
{
const
int
x_idx
=
(
i
&
1
)
*
m
s
;
const
int
x_idx
=
(
i
&
1
)
*
m
i_step
;
const
int
y_idx
=
(
i
>>
1
)
*
m
s
;
const
int
y_idx
=
(
i
>>
1
)
*
m
i_step
;
if
(
mi_row
+
y_idx
>=
cm
->
mi_rows
||
mi_col
+
x_idx
>=
cm
->
mi_cols
)
if
(
mi_row
+
y_idx
>=
cm
->
mi_rows
||
mi_col
+
x_idx
>=
cm
->
mi_cols
)
continue
;
continue
;
...
@@ -2203,7 +2205,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2203,7 +2205,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
get_block_context
(
x
,
subsize
),
best_rd
);
get_block_context
(
x
,
subsize
),
best_rd
);
sum_rd
=
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
sum_rate
,
sum_dist
);
sum_rd
=
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
sum_rate
,
sum_dist
);
if
(
sum_rd
<
best_rd
&&
mi_row
+
m
s
<
cm
->
mi_rows
)
{
if
(
sum_rd
<
best_rd
&&
mi_row
+
m
i_step
<
cm
->
mi_rows
)
{
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
subsize
,
0
);
subsize
,
0
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
...
@@ -2215,7 +2217,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2215,7 +2217,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
partition_none_allowed
)
partition_none_allowed
)
get_block_context
(
x
,
subsize
)
->
pred_interp_filter
=
get_block_context
(
x
,
subsize
)
->
pred_interp_filter
=
ctx
->
mic
.
mbmi
.
interp_filter
;
ctx
->
mic
.
mbmi
.
interp_filter
;
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
+
m
s
,
mi_col
,
&
this_rate
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
+
m
i_step
,
mi_col
,
&
this_rate
,
&
this_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
&
this_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
best_rd
-
sum_rd
);
best_rd
-
sum_rd
);
if
(
this_rate
==
INT_MAX
)
{
if
(
this_rate
==
INT_MAX
)
{
...
@@ -2254,7 +2256,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2254,7 +2256,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
,
&
sum_rate
,
&
sum_dist
,
subsize
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
,
&
sum_rate
,
&
sum_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
best_rd
);
get_block_context
(
x
,
subsize
),
best_rd
);
sum_rd
=
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
sum_rate
,
sum_dist
);
sum_rd
=
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
sum_rate
,
sum_dist
);
if
(
sum_rd
<
best_rd
&&
mi_col
+
m
s
<
cm
->
mi_cols
)
{
if
(
sum_rd
<
best_rd
&&
mi_col
+
m
i_step
<
cm
->
mi_cols
)
{
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
update_state
(
cpi
,
get_block_context
(
x
,
subsize
),
mi_row
,
mi_col
,
subsize
,
0
);
subsize
,
0
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
encode_superblock
(
cpi
,
tp
,
0
,
mi_row
,
mi_col
,
subsize
);
...
@@ -2266,7 +2268,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
...
@@ -2266,7 +2268,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
partition_none_allowed
)
partition_none_allowed
)
get_block_context
(
x
,
subsize
)
->
pred_interp_filter
=
get_block_context
(
x
,
subsize
)
->
pred_interp_filter
=
ctx
->
mic
.
mbmi
.
interp_filter
;
ctx
->
mic
.
mbmi
.
interp_filter
;
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
+
m
s
,
&
this_rate
,
rd_pick_sb_modes
(
cpi
,
tile
,
mi_row
,
mi_col
+
m
i_step
,
&
this_rate
,
&
this_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
&
this_dist
,
subsize
,
get_block_context
(
x
,
subsize
),
best_rd
-
sum_rd
);
best_rd
-
sum_rd
);
if
(
this_rate
==
INT_MAX
)
{
if
(
this_rate
==
INT_MAX
)
{
...
...
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