TUT HEVC Encoder
Data Fields
kvz_api Struct Reference

#include <kvazaar.h>

Collaboration diagram for kvz_api:

Data Fields

kvz_config *(* config_alloc )(void)
 Allocate a kvz_config structure. More...
 
int(* config_destroy )(kvz_config *cfg)
 Deallocate a kvz_config structure. More...
 
int(* config_init )(kvz_config *cfg)
 Initialize a config structure. More...
 
int(* config_parse )(kvz_config *cfg, const char *name, const char *value)
 Set an option. More...
 
kvz_picture *(* picture_alloc )(int32_t width, int32_t height)
 Allocate a kvz_picture. More...
 
void(* picture_free )(kvz_picture *pic)
 Deallocate a kvz_picture. More...
 
void(* chunk_free )(kvz_data_chunk *chunk)
 Deallocate a list of data chunks. More...
 
kvz_encoder *(* encoder_open )(const kvz_config *cfg)
 Create an encoder. More...
 
void(* encoder_close )(kvz_encoder *encoder)
 Deallocate an encoder. More...
 
int(* encoder_headers )(kvz_encoder *encoder, kvz_data_chunk **data_out, uint32_t *len_out)
 Get parameter sets. More...
 
int(* encoder_encode )(kvz_encoder *encoder, kvz_picture *pic_in, kvz_data_chunk **data_out, uint32_t *len_out, kvz_picture **pic_out, kvz_picture **src_out, kvz_frame_info *info_out)
 Encode one frame. More...
 
kvz_picture *(* picture_alloc_csp )(enum kvz_chroma_format chroma_fomat, int32_t width, int32_t height)
 Allocate a kvz_picture. More...
 

Field Documentation

◆ chunk_free

void(* kvz_api::chunk_free) (kvz_data_chunk *chunk)

Deallocates the given chunk and all chunks that follow it in the linked list.

◆ config_alloc

kvz_config *(* kvz_api::config_alloc) (void)

The returned structure should be deallocated by calling config_destroy.

Returns
allocated config, or NULL if allocation failed.

◆ config_destroy

int(* kvz_api::config_destroy) (kvz_config *cfg)

If cfg is NULL, do nothing. Otherwise, the given structure must have been returned from config_alloc.

Parameters
cfgconfiguration
Returns
1 on success, 0 on failure

◆ config_init

int(* kvz_api::config_init) (kvz_config *cfg)

Set all fields in the given config to default values.

Parameters
cfgconfiguration
Returns
1 on success, 0 on failure

◆ config_parse

int(* kvz_api::config_parse) (kvz_config *cfg, const char *name, const char *value)
Parameters
cfgconfiguration
namename of the option to set
valuevalue to set
Returns
1 on success, 0 on failure

◆ encoder_close

void(* kvz_api::encoder_close) (kvz_encoder *encoder)

If encoder is NULL, do nothing. Otherwise, the encoder must have been returned from encoder_open.

◆ encoder_encode

int(* kvz_api::encoder_encode) (kvz_encoder *encoder, kvz_picture *pic_in, kvz_data_chunk **data_out, uint32_t *len_out, kvz_picture **pic_out, kvz_picture **src_out, kvz_frame_info *info_out)

Add pic_in to the encoding pipeline. If an encoded frame is ready, return the bitstream, length of the bitstream, the reconstructed frame, the original frame and frame info in data_out, len_out, pic_out, src_out and info_out, respectively. Otherwise, set the output parameters to NULL.

Region of interest (ROI) / delta QP map can be specified in the input picture's ROI field but only when a ROI file is not used.

After passing all of the input frames, the caller should keep calling this function with pic_in set to NULL, until no more data is returned in the output parameters.

The caller must not modify pic_in after passing it to this function.

If data_out, pic_out and src_out are set to non-NULL values, the caller is responsible for calling chunk_free and picture_free on them.

A null pointer may be passed in place of any of the parameters data_out, len_out, pic_out, src_out or info_out to skip returning the corresponding value.

Parameters
encoderencoder
pic_ininput frame or NULL
data_outReturns the encoded data.
len_outReturns number of bytes in the encoded data.
pic_outReturns the reconstructed picture.
src_outReturns the original picture.
info_outReturns information about the encoded picture.
Returns
1 on success, 0 on error.

◆ encoder_headers

int(* kvz_api::encoder_headers) (kvz_encoder *encoder, kvz_data_chunk **data_out, uint32_t *len_out)

Encode the VPS, SPS and PPS.

If data_out is set to non-NULL values, the caller is responsible for calling chunk_free on it.

A null pointer may be passed in place of the parameter data_out or len_out to skip returning the corresponding value.

Parameters
encoderencoder
data_outReturns the encoded parameter sets.
len_outReturns number of bytes in the encoded data.
Returns
1 on success, 0 on error.

◆ encoder_open

kvz_encoder *(* kvz_api::encoder_open) (const kvz_config *cfg)

The returned encoder should be closed by calling encoder_close.

Only one encoder may be open at a time.

Parameters
cfgencoder configuration
Returns
created encoder, or NULL if creation failed.

◆ picture_alloc

kvz_picture *(* kvz_api::picture_alloc) (int32_t width, int32_t height)

The returned kvz_picture should be deallocated by calling picture_free.

Parameters
widthwidth of luma pixel array to allocate
heightheight of luma pixel array to allocate
Returns
allocated picture, or NULL if allocation failed.

◆ picture_alloc_csp

kvz_picture *(* kvz_api::picture_alloc_csp) (enum kvz_chroma_format chroma_fomat, int32_t width, int32_t height)

The returned kvz_picture should be deallocated by calling picture_free.

Since
3.12.0
Parameters
chroma_fomatChroma subsampling to use.
widthwidth of luma pixel array to allocate
heightheight of luma pixel array to allocate
Returns
allocated picture, or NULL if allocation failed.

◆ picture_free

void(* kvz_api::picture_free) (kvz_picture *pic)

If pic is NULL, do nothing. Otherwise, the picture must have been returned from picture_alloc.


The documentation for this struct was generated from the following file: