mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-30 12:44:07 +00:00
Enable experimental rate control for GOP 16
This commit is contained in:
parent
a0a22dec8a
commit
9849fb7c77
|
@ -732,7 +732,8 @@ void kvz_encoder_control_input_init(encoder_control_t * const encoder,
|
||||||
* \return 1 on success, 0 on failure.
|
* \return 1 on success, 0 on failure.
|
||||||
*
|
*
|
||||||
* Selects appropriate weights for layers according to the target bpp.
|
* Selects appropriate weights for layers according to the target bpp.
|
||||||
* Only GOP structures with exactly four layers are supported.
|
* Only GOP structures with exactly four layers are supported with the.
|
||||||
|
* exception of experimental GOP 16.
|
||||||
*/
|
*/
|
||||||
static int encoder_control_init_gop_layer_weights(encoder_control_t * const encoder)
|
static int encoder_control_init_gop_layer_weights(encoder_control_t * const encoder)
|
||||||
{
|
{
|
||||||
|
@ -807,9 +808,18 @@ static int encoder_control_init_gop_layer_weights(encoder_control_t * const enco
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
if (!encoder->cfg.gop_lowdelay && encoder->cfg.gop_len == 16) {
|
||||||
|
fprintf(stdout,
|
||||||
|
"Rate control: Using experimental weights for GOP layers (%d)\n",
|
||||||
|
num_layers);
|
||||||
|
for (int i = 0; i < MAX_GOP_LAYERS; ++i) {
|
||||||
|
encoder->gop_layer_weights[i] = (i == 0) ? 10 : 2;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
fprintf(stderr, "Unsupported number of GOP layers (%d)\n", num_layers);
|
fprintf(stderr, "Unsupported number of GOP layers (%d)\n", num_layers);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Normalize weights so that the sum of weights in a GOP is one.
|
// Normalize weights so that the sum of weights in a GOP is one.
|
||||||
double sum_weights = 0;
|
double sum_weights = 0;
|
||||||
|
|
Loading…
Reference in a new issue