vp9: Compute source sad for every superblock when partition copy is on.
The source sad could be used to copy the partition without going into choose_partitioning function to speed up vp9 encoding. Computing source sad takes little time. Speed test on Android and Linux shows little encoding time gain (less than 1.4%). Turned off for now since partition copy is turned off. Change-Id: I61c9d5b8f22329760cb29a4ee30a7f9c232ce8d3
This commit is contained in:
parent
72746c079d
commit
afc8c4836f
@ -3133,7 +3133,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
|
|||||||
if (cpi->oxcf.pass == 0 && cpi->oxcf.mode == REALTIME &&
|
if (cpi->oxcf.pass == 0 && cpi->oxcf.mode == REALTIME &&
|
||||||
cpi->oxcf.speed >= 5 && cpi->resize_state == 0 &&
|
cpi->oxcf.speed >= 5 && cpi->resize_state == 0 &&
|
||||||
(cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
|
(cpi->oxcf.content == VP9E_CONTENT_SCREEN ||
|
||||||
cpi->oxcf.rc_mode == VPX_VBR) &&
|
cpi->oxcf.rc_mode == VPX_VBR || cpi->sf.copy_partition_flag) &&
|
||||||
cm->show_frame)
|
cm->show_frame)
|
||||||
vp9_avg_source_sad(cpi);
|
vp9_avg_source_sad(cpi);
|
||||||
|
|
||||||
|
@ -2251,10 +2251,12 @@ void vp9_avg_source_sad(VP9_COMP *cpi) {
|
|||||||
for (sbi_row = 0; sbi_row < sb_rows; ++sbi_row) {
|
for (sbi_row = 0; sbi_row < sb_rows; ++sbi_row) {
|
||||||
for (sbi_col = 0; sbi_col < sb_cols; ++sbi_col) {
|
for (sbi_col = 0; sbi_col < sb_cols; ++sbi_col) {
|
||||||
// Checker-board pattern, ignore boundary.
|
// Checker-board pattern, ignore boundary.
|
||||||
if ((sbi_row > 0 && sbi_col > 0) &&
|
// If the partition copy is on, compute for every superblock.
|
||||||
(sbi_row < sb_rows - 1 && sbi_col < sb_cols - 1) &&
|
if (cpi->sf.copy_partition_flag ||
|
||||||
((sbi_row % 2 == 0 && sbi_col % 2 == 0) ||
|
((sbi_row > 0 && sbi_col > 0) &&
|
||||||
(sbi_row % 2 != 0 && sbi_col % 2 != 0))) {
|
(sbi_row < sb_rows - 1 && sbi_col < sb_cols - 1) &&
|
||||||
|
((sbi_row % 2 == 0 && sbi_col % 2 == 0) ||
|
||||||
|
(sbi_row % 2 != 0 && sbi_col % 2 != 0)))) {
|
||||||
num_samples++;
|
num_samples++;
|
||||||
avg_sad += cpi->fn_ptr[bsize].sdf(src_y, src_ystride, last_src_y,
|
avg_sad += cpi->fn_ptr[bsize].sdf(src_y, src_ystride, last_src_y,
|
||||||
last_src_ystride);
|
last_src_ystride);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user