mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-30 12:44:07 +00:00
fix intra-bits for lp-gop
This commit is contained in:
parent
e90d3141a2
commit
2a98f5db1e
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue