From e36f481bda1cf22846e9c9a65a48b6dd8e6664aa Mon Sep 17 00:00:00 2001 From: Joose Sainio Date: Fri, 27 Sep 2019 09:05:40 +0300 Subject: [PATCH] qp calculation for frame --- src/rate_control.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rate_control.c b/src/rate_control.c index 256ab2b1..d1e79147 100644 --- a/src/rate_control.c +++ b/src/rate_control.c @@ -266,7 +266,7 @@ static INLINE double calculate_weights(encoder_state_t* const state, const int l return total_weight; } -// TODO: Missing QP calculation + void estimatePicLambda(encoder_state_t * const state) { double bits = pic_allocate_bits(state); const int layer = state->frame->gop_offset - (state->frame->is_irap ? 1 : 0); @@ -341,6 +341,7 @@ void estimatePicLambda(encoder_state_t * const state) { } state->frame->lambda = estLambda; + state->frame->QP = lambda_to_qp(estLambda); }