summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_onyx_if.c
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2013-04-03 12:22:50 -0700
committerYunqing Wang <yunqingwang@google.com>2013-04-03 13:49:55 -0700
commit4ca882f32fb7f45044ccf01db0f4a40c52e5fcca (patch)
tree352ec0b87e2c3bf91466a1a99835793d0c8ef5a7 /vp9/encoder/vp9_onyx_if.c
parent8b71b8a6de7a5e9537556f0424f76d41e8a4236d (diff)
downloadlibvpx-4ca882f32fb7f45044ccf01db0f4a40c52e5fcca.tar
libvpx-4ca882f32fb7f45044ccf01db0f4a40c52e5fcca.tar.gz
libvpx-4ca882f32fb7f45044ccf01db0f4a40c52e5fcca.tar.bz2
libvpx-4ca882f32fb7f45044ccf01db0f4a40c52e5fcca.zip
Modify vp9_setup_interp_filters function
Took vp9_setup_scale_factors_for_frame() out from vp9_setup_interp_filters(), so that it is only called once per frame instead of per macroblock. Decoder tests showed a 1.5% performance gain. Change-Id: I770cb09eb2140ab85132f82aed388ac0bdd3a0aa
Diffstat (limited to 'vp9/encoder/vp9_onyx_if.c')
-rw-r--r--vp9/encoder/vp9_onyx_if.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 7052c0e87..f74273086 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -3640,6 +3640,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
VP9_COMMON *cm = &cpi->common;
struct vpx_usec_timer cmptimer;
YV12_BUFFER_CONFIG *force_src_buffer = NULL;
+ int i;
if (!cpi)
return -1;
@@ -3784,7 +3785,20 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
cm->width, cm->height,
VP9BORDERINPIXELS);
+ /* Calculate scaling factors for each of the 3 available references */
+ for (i = 0; i < 3; ++i) {
+ if (cm->active_ref_idx[i] >= NUM_YV12_BUFFERS) {
+ memset(&cm->active_ref_scale[i], 0, sizeof(cm->active_ref_scale[i]));
+ continue;
+ }
+
+ vp9_setup_scale_factors_for_frame(&cm->active_ref_scale[i],
+ &cm->yv12_fb[cm->active_ref_idx[i]],
+ cm->width, cm->height);
+ }
+
vp9_setup_interp_filters(&cpi->mb.e_mbd, DEFAULT_INTERP_FILTER, cm);
+
if (cpi->pass == 1) {
Pass1Encode(cpi, size, dest, frame_flags);
} else if (cpi->pass == 2) {