Go to the documentation of this file.
19 #ifndef AVCODEC_VAAPI_ENCODE_H
20 #define AVCODEC_VAAPI_ENCODE_H
26 #if VA_CHECK_VERSION(1, 0, 0)
27 #include <va/va_str.h>
42 #define FLAG_TIMESTAMP_NO_DELAY 1 << 6
66 #if VA_CHECK_VERSION(1, 0, 0)
219 #if VA_CHECK_VERSION(0, 36, 0)
220 VAEncMiscParameterBufferQualityLevel quality_params;
317 char *
data,
size_t *data_len);
320 char *
data,
size_t *data_len);
324 char *
data,
size_t *data_len);
333 char *
data,
size_t *data_len);
341 char *
data,
size_t *data_len);
350 #define VAAPI_ENCODE_COMMON_OPTIONS \
352 "Use low-power encoding mode (only available on some platforms; " \
353 "may not support all encoding features)", \
354 OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \
355 { .i64 = 0 }, 0, 1, FLAGS }, \
356 { "max_frame_size", \
357 "Maximum frame size (in bytes)",\
358 OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \
359 { .i64 = 0 }, 0, INT_MAX, FLAGS }
361 #define VAAPI_ENCODE_RC_MODE(name, desc) \
362 { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
363 0, 0, FLAGS, .unit = "rc_mode" }
364 #define VAAPI_ENCODE_RC_OPTIONS \
366 "Set rate control mode", \
367 OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \
368 { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, .unit = "rc_mode" }, \
369 { "auto", "Choose mode automatically based on other parameters", \
370 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, .unit = "rc_mode" }, \
371 VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \
372 VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \
373 VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \
374 VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \
375 VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \
376 VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate"), \
378 "Block level based bitrate control",\
379 OFFSET(common.blbrc), AV_OPT_TYPE_BOOL, \
380 { .i64 = 0 }, 0, 1, FLAGS }
void * codec_slice_params
unsigned int va_packed_headers
unsigned int desired_packed_headers
int(* init_picture_params)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
size_t tail_size
Byte length of tail_data.
FFHWBaseEncodeContext base
size_t global_params_size[MAX_GLOBAL_PARAMS]
int(* write_sequence_header)(AVCodecContext *avctx, char *data, size_t *data_len)
int ff_vaapi_encode_init(AVCodecContext *avctx)
VAEncMiscParameterRateControl rc_params
int(* configure)(AVCodecContext *avctx)
int row_height[MAX_TILE_ROWS]
int non_independent_frame
indicate if current frame is an independent frame that the coded data can be pushed to downstream dir...
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
VAEncMiscParameterBufferMaxFrameSize mfs_params
const VAAPIEncodeProfile * profile
const VAAPIEncodeRCMode * rc_mode
void * codec_picture_params
size_t picture_params_size
int global_params_type[MAX_GLOBAL_PARAMS]
const void * global_params[MAX_GLOBAL_PARAMS]
struct FFRefStructPool * output_buffer_pool
VAEntrypoint va_entrypoint
FFRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
int(* write_picture_header)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, char *data, size_t *data_len)
const VAAPIEncodeProfile * profiles
int ff_vaapi_encode_close(AVCodecContext *avctx)
int(* init_sequence_params)(AVCodecContext *avctx)
void * codec_sequence_params
VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]
VAAPIEncodeSlice * slices
VASurfaceID input_surface
VASurfaceID recon_surface
VAEncMiscParameterHRD hrd_params
int col_width[MAX_TILE_COLS]
const struct VAAPIEncodeType * codec
int row_bd[MAX_TILE_ROWS+1]
void * codec_picture_params
char tail_data[MAX_PARAM_BUFFER_SIZE]
Tail data of current pic, used only for repeat header of AV1.
AVVAAPIDeviceContext * hwctx
VABufferID * param_buffers
int(* write_extra_buffer)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
main external API structure.
VAEncMiscParameterFrameRate fr_params
int(* write_slice_header)(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
VABufferID * coded_buffer_ref
Head data for current output pkt, used only for AV1.
VABufferID * output_buffer_ref
size_t sequence_params_size
This structure stores compressed data.
int(* init_slice_params)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, VAAPIEncodeSlice *slice)
int col_bd[MAX_TILE_COLS+1]
int(* write_extra_header)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
size_t picture_priv_data_size
int(* get_encoder_caps)(AVCodecContext *avctx)
VAAPI connection details.
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]