summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toxav/codec.c6
-rw-r--r--toxav/toxav.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/toxav/codec.c b/toxav/codec.c
index 772b0a9d..f3d24969 100644
--- a/toxav/codec.c
+++ b/toxav/codec.c
@@ -220,6 +220,11 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t
220 cfg.rc_target_bitrate = video_bitrate; 220 cfg.rc_target_bitrate = video_bitrate;
221 cfg.g_w = width; 221 cfg.g_w = width;
222 cfg.g_h = height; 222 cfg.g_h = height;
223 cfg.g_pass = VPX_RC_ONE_PASS;
224 cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS;
225 cfg.g_lag_in_frames = 0;
226 cfg.kf_min_dist = 0;
227 cfg.kf_max_dist = 300;
223 228
224 rc = vpx_codec_enc_init_ver(&cs->v_encoder, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0, VPX_ENCODER_ABI_VERSION); 229 rc = vpx_codec_enc_init_ver(&cs->v_encoder, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0, VPX_ENCODER_ABI_VERSION);
225 230
@@ -228,6 +233,7 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t
228 return -1; 233 return -1;
229 } 234 }
230 235
236 rc = vpx_codec_control(&cs->v_encoder, VP8E_SET_CPUUSED, 7);
231 return 0; 237 return 0;
232} 238}
233 239
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 4afb025d..dcab06d0 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -38,7 +38,7 @@
38#include <string.h> 38#include <string.h>
39 39
40/* Assume 60 fps*/ 40/* Assume 60 fps*/
41#define MAX_ENCODE_TIME_US ((1000 / 60) * 1000) 41#define MAX_ENCODE_TIME_US ((1000 / 24) * 1000)
42 42
43#define MAX_VIDEOFRAME_SIZE 0x40000 /* 256KiB */ 43#define MAX_VIDEOFRAME_SIZE 0x40000 /* 256KiB */
44#define VIDEOFRAME_PIECE_SIZE 0x500 /* 1.25 KiB*/ 44#define VIDEOFRAME_PIECE_SIZE 0x500 /* 1.25 KiB*/
@@ -77,7 +77,7 @@ struct _ToxAv {
77}; 77};
78 78
79const ToxAvCodecSettings av_DefaultSettings = { 79const ToxAvCodecSettings av_DefaultSettings = {
80 1000, 80 2000,
81 800, 81 800,
82 600, 82 600,
83 83