mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix bug in codec initialization
This commit is contained in:
parent
c641b0fceb
commit
bf5e9b89d2
|
@ -324,6 +324,16 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate)
|
||||||
return false;
|
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,
|
rc = vpx_codec_enc_init_ver(dest, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0,
|
||||||
VPX_ENCODER_ABI_VERSION);
|
VPX_ENCODER_ABI_VERSION);
|
||||||
|
|
||||||
|
@ -332,16 +342,6 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate)
|
||||||
return false;
|
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);
|
rc = vpx_codec_control(dest, VP8E_SET_CPUUSED, 8);
|
||||||
|
|
||||||
if ( rc != VPX_CODEC_OK) {
|
if ( rc != VPX_CODEC_OK) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user