TUT HEVC Encoder
Loading...
Searching...
No Matches
encoder.h
Go to the documentation of this file.
1#ifndef ENCODER_H_
2#define ENCODER_H_
3/*****************************************************************************
4 * This file is part of Kvazaar HEVC encoder.
5 *
6 * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without modification,
10 * are permitted provided that the following conditions are met:
11 *
12 * * Redistributions of source code must retain the above copyright notice, this
13 * list of conditions and the following disclaimer.
14 *
15 * * Redistributions in binary form must reproduce the above copyright notice, this
16 * list of conditions and the following disclaimer in the documentation and/or
17 * other materials provided with the distribution.
18 *
19 * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
30 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
33 ****************************************************************************/
34
41#include "global.h" // IWYU pragma: keep
42#include "kvazaar.h"
43#include "scalinglist.h"
44#include "threadqueue.h"
45#include "fast_coeff_cost.h"
46
47struct rc_data;
48
49/* Encoder control options, the main struct */
50typedef struct encoder_control_t
51{
64
65 /* Input */
66 struct {
75 } in;
76
77 /* TODO: add ME data */
78 struct {
79 void(*IME)();
80 void(*FME)();
81 int range;
82 } me;
83
86
87 /* VUI */
88 struct
89 {
90 /* Timing info */
96
98 } vui;
99
100 //scaling list
102
103 //spec: references to variables defined in Rec. ITU-T H.265 (04/2013)
114 //PicSizeInCtbsY = height_in_lcu * width_in_lcu
120 //Slices
123
125
128
131
134
136
138
140 struct {
143
145 struct {
146 int right;
147 int down;
149
151
153
155
157
160
162#endif
void kvz_encoder_control_free(encoder_control_t *encoder)
Free an encoder control structure.
Definition encoder.c:625
void kvz_encoder_control_input_init(encoder_control_t *encoder, int32_t width, int32_t height)
Definition encoder.c:663
encoder_control_t * kvz_encoder_control_init(const kvz_config *cfg)
Allocate and initialize an encoder control structure.
Definition encoder.c:135
Header that is included in every other header.
#define MAX_GOP_LAYERS
Maximum number of layers in GOP structure (for allocating structures)
Definition global.h:130
#define MAX_TILES_PER_DIM
Definition global.h:232
This file defines the public API of Kvazaar when used as a library.
kvz_chroma_format
Chroma subsampling format used for encoding.
Definition kvazaar.h:209
Scaling list initialization.
Definition encoder.h:51
int tr_depth_inter
Definition encoder.h:137
int32_t width_in_lcu
Definition encoder.h:69
const int32_t * tiles_tile_id
Definition encoder.h:118
int8_t timing_info_present_flag
Definition encoder.h:97
const int32_t * tiles_ctb_addr_rs_to_ts
Definition encoder.h:115
struct encoder_control_t::@7 vui
int8_t frame_field_info_present_flag
Definition encoder.h:95
int8_t tiles_enable
Definition encoder.h:104
int8_t source_scan_type
Definition encoder.h:74
const int32_t * tiles_col_bd
Definition encoder.h:111
int32_t num_units_in_tick
Timing scale numerator.
Definition encoder.h:91
int8_t tiles_uniform_spacing_flag
Definition encoder.h:106
int32_t height_in_lcu
Definition encoder.h:70
fast_coeff_table_t fast_coeff_table
Definition encoder.h:152
struct encoder_control_t::@5 in
int down
Definition encoder.h:147
int32_t real_width
real input picture width
Definition encoder.h:71
const int32_t * tiles_row_height
Definition encoder.h:109
struct encoder_control_t::@8 pps
pic_parameter_set
double gop_layer_weights[6]
Picture weights when GOP is used.
Definition encoder.h:133
kvz_config cfg
Configuration.
Definition encoder.h:63
struct encoder_control_t::@6 me
double target_avg_bpp
Target average bits per pixel.
Definition encoder.h:130
int right
Definition encoder.h:146
int32_t height
Definition encoder.h:68
enum kvz_chroma_format chroma_format
Definition encoder.h:85
int64_t pixels_per_pic
Definition encoder.h:73
void(* IME)()
Definition encoder.h:79
int32_t width
Definition encoder.h:67
const int * slice_addresses_in_ts
Definition encoder.h:122
const int32_t * tiles_row_bd
Definition encoder.h:112
const int32_t * tiles_col_width
Definition encoder.h:108
int8_t bitdepth
Definition encoder.h:84
double target_avg_bppic
Target average bits per picture.
Definition encoder.h:127
int32_t poc_lsb_bits
Definition encoder.h:150
const int32_t * tiles_ctb_addr_ts_to_rs
Definition encoder.h:116
struct encoder_control_t::@9 max_inter_ref_lcu
Maximum motion vector distance as number of LCUs.
uint8_t dependent_slice_segments_enabled_flag
Definition encoder.h:141
void(* FME)()
Definition encoder.h:80
scaling_list_t scaling_list
Definition encoder.h:101
int slice_count
Definition encoder.h:121
int8_t field_seq_flag
Definition encoder.h:94
int32_t time_scale
Timing scale denominator.
Definition encoder.h:92
struct kvz_rc_data * rc_data
Definition encoder.h:154
int range
Definition encoder.h:81
int32_t real_height
real input picture height
Definition encoder.h:72
FILE * roi_file
Definition encoder.h:135
threadqueue_queue_t * threadqueue
Definition encoder.h:124
Definition fast_coeff_cost.h:42
Struct which contains all configuration data.
Definition kvazaar.h:287
Definition rate_control.h:46
Definition scalinglist.h:46
Definition threadqueue.c:178
Container for worker tasks.