ref: 538af7db5ffe2ab560511a3bc0ae74dae9316c14
parent: d009c2360e899c13690dae679787243481d56379
author: Yaowu Xu <[email protected]>
date: Fri May 30 06:15:30 EDT 2014
Fix a problem of using an uninitialized parameter This commit added a call to set speed feature before initializing motion search, fixed the problem where unintialized search method is used before its value being set. Change-Id: I537e4612bf0d00fd6f51396fd222d4b3bd6fde58
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -486,15 +486,11 @@
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to reallocate scaled last source buffer");
- {
- int y_stride = cpi->scaled_source.y_stride;
-
- if (cpi->sf.search_method == NSTEP) {
- vp9_init3smotion_compensation(&cpi->ss_cfg, y_stride);
- } else if (cpi->sf.search_method == DIAMOND) {
- vp9_init_dsmotion_compensation(&cpi->ss_cfg, y_stride);
- }
- }
+ set_speed_features(cpi);
+ if (cpi->sf.search_method == NSTEP)
+ vp9_init3smotion_compensation(&cpi->ss_cfg, cpi->scaled_source.y_stride);
+ else if (cpi->sf.search_method == DIAMOND)
+ vp9_init_dsmotion_compensation(&cpi->ss_cfg, cpi->scaled_source.y_stride);
init_macroblockd(cm, xd);
}