TUT HEVC Encoder
Loading...
Searching...
No Matches
encoderstate.h File Reference

Top level of the encoder implementation.

#include "bitstream.h"
#include "cabac.h"
#include "cu.h"
#include "encoder.h"
#include "global.h"
#include "image.h"
#include "imagelist.h"
#include "kvazaar.h"
#include "tables.h"
#include "threadqueue.h"
#include "videoframe.h"
#include "extras/crypto.h"
Include dependency graph for encoderstate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lcu_stats_t
 
struct  encoder_state_config_frame_t
 
struct  encoder_state_config_tile_t
 
struct  encoder_state_config_slice_t
 
struct  encoder_state_config_wfrow_t
 
struct  lcu_order_element
 
struct  encoder_state_t
 

Macros

#define C1FLAG_NUMBER   8
 
#define C2FLAG_NUMBER   1
 
#define OFFSET_VER_BUF(position_x, position_y, cur_pic, i)
 
#define OFFSET_VER_BUF_C(position_x, position_y, cur_pic, i)
 
#define OFFSET_HOR_BUF(position_x, position_y, cur_pic, i)
 
#define OFFSET_HOR_BUF_C(position_x, position_y, cur_pic, i)
 

Typedefs

typedef struct lcu_stats_t lcu_stats_t
 
typedef struct encoder_state_config_frame_t encoder_state_config_frame_t
 
typedef struct encoder_state_config_tile_t encoder_state_config_tile_t
 
typedef struct encoder_state_config_slice_t encoder_state_config_slice_t
 
typedef struct encoder_state_config_wfrow_t encoder_state_config_wfrow_t
 
typedef struct lcu_order_element lcu_order_element_t
 
typedef struct encoder_state_t encoder_state_t
 

Enumerations

enum  encoder_state_type {
  ENCODER_STATE_TYPE_INVALID = 'i' , ENCODER_STATE_TYPE_MAIN = 'M' , ENCODER_STATE_TYPE_SLICE = 'S' , ENCODER_STATE_TYPE_TILE = 'T' ,
  ENCODER_STATE_TYPE_WAVEFRONT_ROW = 'W'
}
 

Functions

void kvz_encode_one_frame (encoder_state_t *const state, kvz_picture *frame)
 
void kvz_encoder_prepare (encoder_state_t *state)
 Prepare the encoder state for encoding the next frame.
 
int kvz_encoder_state_match_children_of_previous_frame (encoder_state_t *const state)
 
coeff_scan_order_t kvz_get_scan_order (int8_t cu_type, int intra_mode, int depth)
 
void kvz_encoder_create_ref_lists (const encoder_state_t *const state)
 Generate reference picture lists.
 
lcu_stats_tkvz_get_lcu_stats (encoder_state_t *state, int lcu_x, int lcu_y)
 
int kvz_get_cu_ref_qp (const encoder_state_t *state, int x, int y, int last_qp)
 
static bool encoder_state_must_write_vps (const encoder_state_t *state)
 Whether the parameter sets should be written with the current frame.
 
static bool is_last_cu_in_qg (const encoder_state_t *state, int x, int y, int depth)
 Returns true if the CU is the last CU in its containing quantization group.
 

Variables

static const uint8_t g_group_idx [32]
 
static const uint8_t g_min_in_group [10]
 

Macro Definition Documentation

◆ C1FLAG_NUMBER

#define C1FLAG_NUMBER   8

◆ C2FLAG_NUMBER

#define C2FLAG_NUMBER   1

◆ OFFSET_HOR_BUF

#define OFFSET_HOR_BUF ( position_x,
position_y,
cur_pic,
i )
Value:
((position_x) + i + ((position_y)/LCU_WIDTH - 1) * (cur_pic)->width)
#define LCU_WIDTH
spec: CtbSizeY
Definition global.h:153

◆ OFFSET_HOR_BUF_C

#define OFFSET_HOR_BUF_C ( position_x,
position_y,
cur_pic,
i )
Value:
((position_x/2) + i + ((position_y)/LCU_WIDTH - 1) * (cur_pic)->width / 2)

◆ OFFSET_VER_BUF

#define OFFSET_VER_BUF ( position_x,
position_y,
cur_pic,
i )
Value:
((position_y) + i + ((position_x)/LCU_WIDTH - 1) * (cur_pic)->height)

◆ OFFSET_VER_BUF_C

#define OFFSET_VER_BUF_C ( position_x,
position_y,
cur_pic,
i )
Value:
((position_y/2) + i + ((position_x)/LCU_WIDTH - 1) * (cur_pic)->height / 2)

Typedef Documentation

◆ encoder_state_config_frame_t

typedef struct encoder_state_config_frame_t encoder_state_config_frame_t

◆ encoder_state_config_slice_t

typedef struct encoder_state_config_slice_t encoder_state_config_slice_t

◆ encoder_state_config_tile_t

typedef struct encoder_state_config_tile_t encoder_state_config_tile_t

◆ encoder_state_config_wfrow_t

typedef struct encoder_state_config_wfrow_t encoder_state_config_wfrow_t

◆ encoder_state_t

typedef struct encoder_state_t encoder_state_t

◆ lcu_order_element_t

◆ lcu_stats_t

typedef struct lcu_stats_t lcu_stats_t

Enumeration Type Documentation

◆ encoder_state_type

Enumerator
ENCODER_STATE_TYPE_INVALID 
ENCODER_STATE_TYPE_MAIN 
ENCODER_STATE_TYPE_SLICE 
ENCODER_STATE_TYPE_TILE 
ENCODER_STATE_TYPE_WAVEFRONT_ROW 

Function Documentation

◆ encoder_state_must_write_vps()

static bool encoder_state_must_write_vps ( const encoder_state_t * state)
inlinestatic
Here is the caller graph for this function:

◆ is_last_cu_in_qg()

static bool is_last_cu_in_qg ( const encoder_state_t * state,
int x,
int y,
int depth )
inlinestatic
Parameters
stateencoder state
xx-coordinate of the left edge of the CU
yy-cooradinate of the top edge of the CU
depthdepth in the CU tree
Returns
true, if it's the last CU in its QG, otherwise false
Here is the caller graph for this function:

◆ kvz_encode_one_frame()

void kvz_encode_one_frame ( encoder_state_t *const state,
kvz_picture * frame )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_encoder_create_ref_lists()

void kvz_encoder_create_ref_lists ( const encoder_state_t *const state)
Parameters
statemain encoder state
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_encoder_prepare()

void kvz_encoder_prepare ( encoder_state_t * state)
  • Add the previous reconstructed picture as a reference, if needed.
  • Free the previous reconstructed and source pictures.
  • Create a new cu array, if needed.
  • Update frame count and POC.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_encoder_state_match_children_of_previous_frame()

int kvz_encoder_state_match_children_of_previous_frame ( encoder_state_t *const state)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_get_cu_ref_qp()

int kvz_get_cu_ref_qp ( const encoder_state_t * state,
int x,
int y,
int last_qp )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kvz_get_lcu_stats()

lcu_stats_t * kvz_get_lcu_stats ( encoder_state_t * state,
int lcu_x,
int lcu_y )
Here is the caller graph for this function:

◆ kvz_get_scan_order()

coeff_scan_order_t kvz_get_scan_order ( int8_t cu_type,
int intra_mode,
int depth )
Here is the caller graph for this function:

Variable Documentation

◆ g_group_idx

const uint8_t g_group_idx[32]
static
Initial value:
= {
0, 1, 2, 3, 4, 4, 5, 5, 6, 6,
6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 8, 8, 9, 9, 9, 9, 9, 9,
9, 9 }

◆ g_min_in_group

const uint8_t g_min_in_group[10]
static
Initial value:
= {
0, 1, 2, 3, 4, 6, 8, 12, 16, 24 }