ref: ac54d233b6d7ba5674996353a86bae42417022ee
parent: 534e9af53be7624c2b6df9462e6f791c0e7bb0d7
parent: 519fed01c2846ab9294543a3d2d65efaa51ec85b
author: Jerome Jiang <jianj@google.com>
date: Fri Feb 2 00:32:55 EST 2018
Merge "Fix issue for 0 target bitrate in multi-res build."
--- a/vp8/vp8_cx_iface.c
+++ b/vp8/vp8_cx_iface.c
@@ -804,11 +804,15 @@
if (!ctx->cfg.rc_target_bitrate) {
#if CONFIG_MULTI_RES_ENCODING
- LOWER_RES_FRAME_INFO *low_res_frame_info =
- (LOWER_RES_FRAME_INFO *)ctx->cpi->oxcf.mr_low_res_mode_info;
- low_res_frame_info->skip_encoding_prev_stream = 1;
- if (ctx->cpi->oxcf.mr_encoder_id == 0)
- low_res_frame_info->skip_encoding_base_stream = 1;
+ if (!ctx->cpi) return VPX_CODEC_ERROR;
+ if (ctx->cpi->oxcf.mr_total_resolutions > 1) {
+ LOWER_RES_FRAME_INFO *low_res_frame_info =
+ (LOWER_RES_FRAME_INFO *)ctx->cpi->oxcf.mr_low_res_mode_info;
+ if (!low_res_frame_info) return VPX_CODEC_ERROR;
+ low_res_frame_info->skip_encoding_prev_stream = 1;
+ if (ctx->cpi->oxcf.mr_encoder_id == 0)
+ low_res_frame_info->skip_encoding_base_stream = 1;
+ }
#endif
return res;
}