|
TUT HEVC Encoder
|
#include <kvazaar.h>
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... | |
| void(* kvz_api::chunk_free) (kvz_data_chunk *chunk) |
Deallocates the given chunk and all chunks that follow it in the linked list.
| kvz_config *(* kvz_api::config_alloc) (void) |
The returned structure should be deallocated by calling 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.
| cfg | configuration |
| int(* kvz_api::config_init) (kvz_config *cfg) |
Set all fields in the given config to default values.
| cfg | configuration |
| int(* kvz_api::config_parse) (kvz_config *cfg, const char *name, const char *value) |
| cfg | configuration |
| name | name of the option to set |
| value | value to set |
| void(* kvz_api::encoder_close) (kvz_encoder *encoder) |
If encoder is NULL, do nothing. Otherwise, the encoder must have been returned from encoder_open.
| 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.
| encoder | encoder |
| pic_in | input frame or NULL |
| data_out | Returns the encoded data. |
| len_out | Returns number of bytes in the encoded data. |
| pic_out | Returns the reconstructed picture. |
| src_out | Returns the original picture. |
| info_out | Returns information about the encoded picture. |
| 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.
| encoder | encoder |
| data_out | Returns the encoded parameter sets. |
| len_out | Returns number of bytes in the encoded data. |
| 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.
| cfg | encoder configuration |
| kvz_picture *(* kvz_api::picture_alloc) (int32_t width, int32_t height) |
The returned kvz_picture should be deallocated by calling picture_free.
| width | width of luma pixel array to allocate |
| height | height of luma pixel array to allocate |
| 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.
| chroma_fomat | Chroma subsampling to use. |
| width | width of luma pixel array to allocate |
| height | height of luma pixel array to allocate |
| void(* kvz_api::picture_free) (kvz_picture *pic) |
If pic is NULL, do nothing. Otherwise, the picture must have been returned from picture_alloc.