Fix bug in codec initialization

This commit is contained in:
mannol 2015-08-13 00:19:24 +02:00
parent c641b0fceb
commit bf5e9b89d2

View File

@ -324,6 +324,16 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate)
return false;
}
cfg.rc_target_bitrate = bit_rate;
cfg.g_w = 4000;
cfg.g_h = 4000;
cfg.g_pass = VPX_RC_ONE_PASS;
cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS;
cfg.g_lag_in_frames = 0;
cfg.kf_min_dist = 0;
cfg.kf_max_dist = 48;
cfg.kf_mode = VPX_KF_AUTO;
rc = vpx_codec_enc_init_ver(dest, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0,
VPX_ENCODER_ABI_VERSION);
@ -332,16 +342,6 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate)
return false;
}
cfg.rc_target_bitrate = bit_rate;
cfg.g_w = 800;
cfg.g_h = 600;
cfg.g_pass = VPX_RC_ONE_PASS;
cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS;
cfg.g_lag_in_frames = 0;
cfg.kf_min_dist = 0;
cfg.kf_max_dist = 48;
cfg.kf_mode = VPX_KF_AUTO;
rc = vpx_codec_control(dest, VP8E_SET_CPUUSED, 8);
if ( rc != VPX_CODEC_OK) {