2015-03-13 12:23:54 +00:00
|
|
|
#ifndef RATE_CONTROL_H_
|
|
|
|
#define RATE_CONTROL_H_
|
|
|
|
/*****************************************************************************
|
|
|
|
* This file is part of Kvazaar HEVC encoder.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2015 Tampere University of Technology and others (see
|
|
|
|
* COPYING file).
|
|
|
|
*
|
|
|
|
* Kvazaar is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-12-17 11:42:57 +00:00
|
|
|
/**
|
|
|
|
* \ingroup Control
|
2015-03-13 12:23:54 +00:00
|
|
|
* \file
|
2015-12-17 11:42:57 +00:00
|
|
|
* \brief Functions related to rate control.
|
2015-03-13 12:23:54 +00:00
|
|
|
*/
|
|
|
|
|
2016-03-30 09:41:37 +00:00
|
|
|
#include "global.h" // IWYU pragma: keep
|
2016-01-22 13:07:49 +00:00
|
|
|
|
2015-03-13 12:23:54 +00:00
|
|
|
#include "encoderstate.h"
|
2019-11-18 07:51:37 +00:00
|
|
|
#include "pthread.h"
|
2015-03-13 12:23:54 +00:00
|
|
|
|
2019-11-13 09:56:25 +00:00
|
|
|
typedef struct kvz_rc_data {
|
|
|
|
double *c_para[KVZ_MAX_GOP_LAYERS];
|
|
|
|
double *k_para[KVZ_MAX_GOP_LAYERS];
|
|
|
|
double pic_c_para[KVZ_MAX_GOP_LAYERS];
|
|
|
|
double pic_k_para[KVZ_MAX_GOP_LAYERS];
|
|
|
|
double previous_lambdas[KVZ_MAX_GOP_LAYERS + 1];
|
|
|
|
double previous_frame_lambda;
|
|
|
|
double *intra_bpp;
|
|
|
|
double *intra_dis;
|
|
|
|
double intra_pic_distortion;
|
|
|
|
double intra_pic_bpp;
|
2019-11-18 07:51:37 +00:00
|
|
|
|
2019-11-18 12:20:43 +00:00
|
|
|
double intra_alpha;
|
|
|
|
double intra_beta;
|
|
|
|
|
2019-11-18 07:51:37 +00:00
|
|
|
pthread_mutex_t ck_frame_lock;
|
2019-11-13 09:56:25 +00:00
|
|
|
} kvz_rc_data;
|
|
|
|
|
|
|
|
kvz_rc_data * kvz_get_rc_data(const encoder_control_t * const encoder);
|
|
|
|
void kvz_free_rc_data();
|
|
|
|
|
2016-08-21 05:03:57 +00:00
|
|
|
void kvz_set_picture_lambda_and_qp(encoder_state_t * const state);
|
2016-04-01 14:14:23 +00:00
|
|
|
|
2016-08-24 01:16:48 +00:00
|
|
|
void kvz_set_lcu_lambda_and_qp(encoder_state_t * const state,
|
|
|
|
vector2d_t pos);
|
2015-05-29 11:00:51 +00:00
|
|
|
|
2019-09-27 07:16:21 +00:00
|
|
|
void kvz_set_ctu_qp_lambda(encoder_state_t * const state, vector2d_t pos);
|
|
|
|
void kvz_update_after_picture(encoder_state_t * const state);
|
|
|
|
void kvz_estimate_pic_lambda(encoder_state_t * const state);
|
|
|
|
|
2015-03-13 12:23:54 +00:00
|
|
|
#endif // RATE_CONTROL_H_
|