summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorMarco <marpan@chromium.org>2015-09-14 10:13:33 -0700
committerMarco <marpan@chromium.org>2015-09-14 13:13:32 -0700
commit4d1424faf95df177b4815064ac2d1d7f1b75b5e4 (patch)
treeb4ed48ba11b72b393c928d2ef7d08c5d1ed9f581 /vp9
parentfe776ce61ffeda515fa8ba7086009fbfdb477137 (diff)
downloadlibvpx-4d1424faf95df177b4815064ac2d1d7f1b75b5e4.tar
libvpx-4d1424faf95df177b4815064ac2d1d7f1b75b5e4.tar.gz
libvpx-4d1424faf95df177b4815064ac2d1d7f1b75b5e4.tar.bz2
libvpx-4d1424faf95df177b4815064ac2d1d7f1b75b5e4.zip
For 1 pass: always use the normative filter in vp9_scale_if_required()
The normative (convolve8) filter is optimized/faster than the nonnormative one. Pass usage of scaler (normative/nonomorative) to vp9_scale_if_required(), and always use normative one for 1 pass. Change-Id: I2b71d9ff18b3c7499b058d1325a9554de993dd52
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encoder.c23
-rw-r--r--vp9/encoder/vp9_encoder.h3
-rw-r--r--vp9/encoder/vp9_firstpass.c2
-rw-r--r--vp9/encoder/vp9_temporal_filter.c2
4 files changed, 16 insertions, 14 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 7a4cf3cc6..39b4c294c 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3200,7 +3200,8 @@ static void encode_without_recode_loop(VP9_COMP *cpi,
cpi->Source = vp9_scale_if_required(cm,
cpi->un_scaled_source,
- &cpi->scaled_source);
+ &cpi->scaled_source,
+ (cpi->oxcf.pass == 0));
// Avoid scaling last_source unless its needed.
// Last source is currently only used for screen-content mode,
@@ -3210,7 +3211,8 @@ static void encode_without_recode_loop(VP9_COMP *cpi,
cpi->sf.partition_search_type == SOURCE_VAR_BASED_PARTITION))
cpi->Last_Source = vp9_scale_if_required(cm,
cpi->unscaled_last_source,
- &cpi->scaled_last_source);
+ &cpi->scaled_last_source,
+ (cpi->oxcf.pass == 0));
if (cpi->oxcf.pass == 0 &&
cpi->oxcf.rc_mode == VPX_CBR &&
@@ -3342,11 +3344,13 @@ static void encode_with_recode_loop(VP9_COMP *cpi,
}
cpi->Source = vp9_scale_if_required(cm, cpi->un_scaled_source,
- &cpi->scaled_source);
+ &cpi->scaled_source,
+ (cpi->oxcf.pass == 0));
if (cpi->unscaled_last_source != NULL)
cpi->Last_Source = vp9_scale_if_required(cm, cpi->unscaled_last_source,
- &cpi->scaled_last_source);
+ &cpi->scaled_last_source,
+ (cpi->oxcf.pass == 0));
if (frame_is_intra_only(cm) == 0) {
if (loop_count > 0) {
@@ -3597,20 +3601,17 @@ static void set_ext_overrides(VP9_COMP *cpi) {
YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm,
YV12_BUFFER_CONFIG *unscaled,
- YV12_BUFFER_CONFIG *scaled) {
+ YV12_BUFFER_CONFIG *scaled,
+ int use_normative_scaler) {
if (cm->mi_cols * MI_SIZE != unscaled->y_width ||
cm->mi_rows * MI_SIZE != unscaled->y_height) {
#if CONFIG_VP9_HIGHBITDEPTH
- if (unscaled->y_width == (scaled->y_width << 1) &&
- unscaled->y_height == (scaled->y_height << 1))
+ if (use_normative_scaler)
scale_and_extend_frame(unscaled, scaled, (int)cm->bit_depth);
else
scale_and_extend_frame_nonnormative(unscaled, scaled, (int)cm->bit_depth);
#else
- // Use the faster normative (convolve8) scaling filter: for now only for
- // scaling factor of 2.
- if (unscaled->y_width == (scaled->y_width << 1) &&
- unscaled->y_height == (scaled->y_height << 1))
+ if (use_normative_scaler)
scale_and_extend_frame(unscaled, scaled);
else
scale_and_extend_frame_nonnormative(unscaled, scaled);
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 7c2101850..c3a983956 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -613,7 +613,8 @@ void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv);
YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm,
YV12_BUFFER_CONFIG *unscaled,
- YV12_BUFFER_CONFIG *scaled);
+ YV12_BUFFER_CONFIG *scaled,
+ int use_normative_scaler);
void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags);
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 51cc40302..a6b5ebb01 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -597,7 +597,7 @@ void vp9_first_pass(VP9_COMP *cpi, const struct lookahead_entry *source) {
(cpi->ref_frame_flags & VP9_GOLD_FLAG) ? GOLDEN_FRAME : NONE);
cpi->Source = vp9_scale_if_required(cm, cpi->un_scaled_source,
- &cpi->scaled_source);
+ &cpi->scaled_source, 0);
}
vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c
index 6ef3b49d4..16f9c8573 100644
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -721,7 +721,7 @@ void vp9_temporal_filter(VP9_COMP *cpi, int distance) {
"Failed to reallocate alt_ref_buffer");
}
frames[frame] = vp9_scale_if_required(
- cm, frames[frame], &cpi->svc.scaled_frames[frame_used]);
+ cm, frames[frame], &cpi->svc.scaled_frames[frame_used], 0);
++frame_used;
}
}