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;
321 char *
data,
size_t *data_len);
324 char *
data,
size_t *data_len);
328 char *
data,
size_t *data_len);
337 char *
data,
size_t *data_len);
345 char *
data,
size_t *data_len);
354 #define VAAPI_ENCODE_COMMON_OPTIONS \
356 "Use low-power encoding mode (only available on some platforms; " \
357 "may not support all encoding features)", \
358 OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \
359 { .i64 = 0 }, 0, 1, FLAGS }, \
360 { "max_frame_size", \
361 "Maximum frame size (in bytes)",\
362 OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \
363 { .i64 = 0 }, 0, INT_MAX, FLAGS }
365 #define VAAPI_ENCODE_RC_MODE(name, desc) \
366 { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
367 0, 0, FLAGS, .unit = "rc_mode" }
368 #define VAAPI_ENCODE_RC_OPTIONS \
370 "Set rate control mode", \
371 OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \
372 { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, .unit = "rc_mode" }, \
373 { "auto", "Choose mode automatically based on other parameters", \
374 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, .unit = "rc_mode" }, \
375 VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \
376 VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \
377 VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \
378 VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \
379 VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \
380 VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate"), \
382 "Block level based bitrate control",\
383 OFFSET(common.blbrc), AV_OPT_TYPE_BOOL, \
384 { .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 surface_alignment_width
struct AVRefStructPool * output_buffer_pool
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]
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
VAEntrypoint va_entrypoint
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 surface_alignment_height
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[]