Skip to content

Commit 8df1ad0

Browse files
committed
XX DEBUG
1 parent 41ed9ad commit 8df1ad0

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

amalgamation/toxcore_amalgamation.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82734,6 +82734,7 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
8273482734
x265_param_parse(param, "annexb", "1");
8273582735
// x265_param_parse(param, "input-res", "1920x1080");
8273682736
x265_param_parse(param, "input-csp", "i420");
82737+
x265_param_parse(param, "fast-intra", "1");
8273782738

8273882739
// x265_param_parse(param, "rd", "1");
8273982740
// x265_param_parse(param, "pools", "3");
@@ -82750,7 +82751,7 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
8275082751

8275182752

8275282753
// param->bConfigRCFrame = 1; // --frame-rc
82753-
//*2*// x265_param_parse(param, "frame-rc", "1");
82754+
x265_param_parse(param, "frame-rc", "1");
8275482755
/*
8275582756
* This option allows configuring Rate control parameter of the chosen Rate Control mode(CRF or QP or Bitrate) at frame level. This option is recommended to be enabled only when planning to invoke the API function x265_encoder_reconfig() to configure Rate control parameter value for each frame. Default: disabled.
8275682757
*/
@@ -82931,6 +82932,14 @@ int vc_reconfigure_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
8293182932
param->rc.vbvBufferSize = (int)(bit_rate / 1000);
8293282933
param->rc.bitrate = (int)(bit_rate / 1000);
8293382934

82935+
char bit_rate_str[100];
82936+
memset(bit_rate_str, 0, 100);
82937+
snprintf(bit_rate_str, 90, "%d", (int)(bit_rate / 1000));
82938+
x265_param_parse(param, "bitrate", bit_rate_str);
82939+
82940+
param->rc.vbvMaxBitrate = (int)(bit_rate / 1000);
82941+
param->rc.vbvBufferSize = 50 + (int)(bit_rate / 1000);
82942+
8293482943
int res = x265_encoder_reconfig(vc->h265_encoder, param);
8293582944
x265_param_free(param);
8293682945
setvbuf(stdout, NULL, _IOLBF, 0);

toxav/codecs/h264/codec.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,7 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
19691969
x265_param_parse(param, "annexb", "1");
19701970
// x265_param_parse(param, "input-res", "1920x1080");
19711971
x265_param_parse(param, "input-csp", "i420");
1972+
x265_param_parse(param, "fast-intra", "1");
19721973

19731974
// x265_param_parse(param, "rd", "1");
19741975
// x265_param_parse(param, "pools", "3");
@@ -1985,7 +1986,7 @@ static void vc_init_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
19851986

19861987

19871988
// param->bConfigRCFrame = 1; // --frame-rc
1988-
//*2*// x265_param_parse(param, "frame-rc", "1");
1989+
x265_param_parse(param, "frame-rc", "1");
19891990
/*
19901991
* This option allows configuring Rate control parameter of the chosen Rate Control mode(CRF or QP or Bitrate) at frame level. This option is recommended to be enabled only when planning to invoke the API function x265_encoder_reconfig() to configure Rate control parameter value for each frame. Default: disabled.
19911992
*/
@@ -2166,6 +2167,14 @@ int vc_reconfigure_encoder_h265(Logger *log, VCSession *vc, uint32_t bit_rate,
21662167
param->rc.vbvBufferSize = (int)(bit_rate / 1000);
21672168
param->rc.bitrate = (int)(bit_rate / 1000);
21682169

2170+
char bit_rate_str[100];
2171+
memset(bit_rate_str, 0, 100);
2172+
snprintf(bit_rate_str, 90, "%d", (int)(bit_rate / 1000));
2173+
x265_param_parse(param, "bitrate", bit_rate_str);
2174+
2175+
param->rc.vbvMaxBitrate = (int)(bit_rate / 1000);
2176+
param->rc.vbvBufferSize = 50 + (int)(bit_rate / 1000);
2177+
21692178
int res = x265_encoder_reconfig(vc->h265_encoder, param);
21702179
x265_param_free(param);
21712180
setvbuf(stdout, NULL, _IOLBF, 0);

0 commit comments

Comments
 (0)