Commit 538af7db authored by Yaowu Xu's avatar Yaowu Xu
Browse files

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
parent d009c236
......@@ -486,15 +486,11 @@ static void update_frame_size(VP9_COMP *cpi) {
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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment