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
1b735da7
Commit
1b735da7
authored
Jun 15, 2016
by
Debargha Mukherjee
Committed by
Gerrit Code Review
Jun 15, 2016
Browse files
Merge "Refactor variance aq." into nextgenv2
parents
46f048e3
d60523bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp10/encoder/aq_variance.c
View file @
1b735da7
...
...
@@ -52,6 +52,8 @@ void vp10_vaq_frame_setup(VP10_COMP *cpi) {
if
(
frame_is_intra_only
(
cm
)
||
cm
->
error_resilient_mode
||
cpi
->
refresh_alt_ref_frame
||
(
cpi
->
refresh_golden_frame
&&
!
cpi
->
rc
.
is_src_frame_alt_ref
))
{
cpi
->
vaq_refresh
=
1
;
vp10_enable_segmentation
(
seg
);
vp10_clearall_segfeatures
(
seg
);
...
...
vp10/encoder/encodeframe.c
View file @
1b735da7
...
...
@@ -313,7 +313,7 @@ static void set_offsets(VP10_COMP *cpi, const TileInfo *const tile,
// Setup segment ID.
if
(
seg
->
enabled
)
{
if
(
cpi
->
oxcf
.
aq_mode
!=
VARIANCE_AQ
)
{
if
(
!
cpi
->
vaq_refresh
)
{
const
uint8_t
*
const
map
=
seg
->
update_map
?
cpi
->
segmentation_map
:
cm
->
last_frame_seg_map
;
mbmi
->
segment_id
=
get_segment_id
(
cm
,
map
,
bsize
,
mi_row
,
mi_col
);
...
...
@@ -388,7 +388,7 @@ static void set_offsets_extend(VP10_COMP *cpi, ThreadData *td,
// Setup segment ID.
if
(
seg
->
enabled
)
{
if
(
cpi
->
oxcf
.
aq_mode
!=
VARIANCE_AQ
)
{
if
(
!
cpi
->
vaq_refresh
)
{
const
uint8_t
*
const
map
=
seg
->
update_map
?
cpi
->
segmentation_map
:
cm
->
last_frame_seg_map
;
mbmi
->
segment_id
=
get_segment_id
(
cm
,
map
,
bsize_ori
,
...
...
@@ -1727,26 +1727,17 @@ static void rd_pick_sb_modes(VP10_COMP *cpi,
orig_rdmult
=
x
->
rdmult
;
if
(
aq_mode
==
VARIANCE_AQ
)
{
const
int
energy
=
bsize
<=
BLOCK_16X16
?
x
->
mb_energy
:
vp10_block_energy
(
cpi
,
x
,
bsize
);
if
(
cm
->
frame_type
==
KEY_FRAME
||
cpi
->
refresh_alt_ref_frame
||
(
cpi
->
refresh_golden_frame
&&
!
cpi
->
rc
.
is_src_frame_alt_ref
))
{
if
(
cpi
->
vaq_refresh
)
{
const
int
energy
=
bsize
<=
BLOCK_16X16
?
x
->
mb_energy
:
vp10_block_energy
(
cpi
,
x
,
bsize
);
mbmi
->
segment_id
=
vp10_vaq_segment_id
(
energy
);
}
else
{
const
uint8_t
*
const
map
=
cm
->
seg
.
update_map
?
cpi
->
segmentation_map
:
cm
->
last_frame_seg_map
;
mbmi
->
segment_id
=
get_segment_id
(
cm
,
map
,
bsize
,
mi_row
,
mi_col
);
}
x
->
rdmult
=
set_segment_rdmult
(
cpi
,
x
,
mbmi
->
segment_id
);
}
else
if
(
aq_mode
==
COMPLEXITY_AQ
)
{
x
->
rdmult
=
set_segment_rdmult
(
cpi
,
x
,
mbmi
->
segment_id
);
}
else
if
(
aq_mode
==
CYCLIC_REFRESH_AQ
)
{
const
uint8_t
*
const
map
=
cm
->
seg
.
update_map
?
cpi
->
segmentation_map
:
cm
->
last_frame_seg_map
;
// If segment is boosted, use rdmult for that segment.
if
(
cyclic_refresh_segment_id_boosted
(
get_segment_id
(
cm
,
map
,
bsize
,
mi_row
,
mi_col
)))
if
(
cyclic_refresh_segment_id_boosted
(
mbmi
->
segment_id
))
x
->
rdmult
=
vp10_cyclic_refresh_get_rdmult
(
cpi
->
cyclic_refresh
);
}
...
...
@@ -2556,7 +2547,7 @@ static void rd_use_partition(VP10_COMP *cpi,
save_context
(
x
,
&
x_ctx
,
mi_row
,
mi_col
,
bsize
);
if
(
bsize
==
BLOCK_16X16
&&
cpi
->
oxcf
.
aq_mode
)
{
if
(
bsize
==
BLOCK_16X16
&&
cpi
->
vaq_refresh
)
{
set_offsets
(
cpi
,
tile_info
,
x
,
mi_row
,
mi_col
,
bsize
);
x
->
mb_energy
=
vp10_block_energy
(
cpi
,
x
,
bsize
);
}
...
...
@@ -3440,7 +3431,7 @@ static void rd_pick_partition(VP10_COMP *cpi, ThreadData *td,
set_offsets
(
cpi
,
tile_info
,
x
,
mi_row
,
mi_col
,
bsize
);
if
(
bsize
==
BLOCK_16X16
&&
cpi
->
oxcf
.
aq_mode
)
if
(
bsize
==
BLOCK_16X16
&&
cpi
->
vaq_refresh
)
x
->
mb_energy
=
vp10_block_energy
(
cpi
,
x
,
bsize
);
if
(
cpi
->
sf
.
cb_partition_search
&&
bsize
==
BLOCK_16X16
)
{
...
...
vp10/encoder/encoder.c
View file @
1b735da7
...
...
@@ -296,6 +296,8 @@ static void setup_frame(VP10_COMP *cpi) {
vp10_zero
(
cpi
->
interp_filter_selected
[
0
]);
}
cpi
->
vaq_refresh
=
0
;
set_sb_size
(
cm
,
select_sb_size
(
cpi
));
}
...
...
vp10/encoder/encoder.h
View file @
1b735da7
...
...
@@ -598,6 +598,9 @@ typedef struct VP10_COMP {
int64_t
vbp_threshold_sad
;
BLOCK_SIZE
vbp_bsize_min
;
// VARIANCE_AQ segment map refresh
int
vaq_refresh
;
// Multi-threading
int
num_workers
;
VPxWorker
*
workers
;
...
...
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