fix intra-bits for lp-gop

This commit is contained in:
Joose Sainio 2020-02-18 10:38:29 +02:00
parent e90d3141a2
commit 2a98f5db1e

View file

@ -316,10 +316,6 @@ static double pic_allocate_bits(encoder_state_t * const state)
state->previous_encoder_state->frame->cur_gop_target_bits;
}
if (encoder->cfg.gop_len <= 0) {
return state->frame->cur_gop_target_bits;
}
if (state->frame->is_irap && encoder->cfg.intra_bit_allocation) {
int total_cost = 0;
for (int y = 0; y < encoder->cfg.height; y += 8) {
@ -343,6 +339,10 @@ static double pic_allocate_bits(encoder_state_t * const state)
return MAX(100, alpha*pow(state->frame->icost * 4 / bits, beta)*bits);
}
if (encoder->cfg.gop_len <= 0) {
return state->frame->cur_gop_target_bits;
}
const double pic_weight = encoder->gop_layer_weights[
encoder->cfg.gop[state->frame->gop_offset].layer - 1];
const double pic_target_bits =