FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vaapi_encode.h File Reference
#include <stdint.h>
#include <va/va.h>
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_vaapi.h"
#include "avcodec.h"
#include "hwconfig.h"
#include "hw_base_encode.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeSlice
 
struct  VAAPIEncodePicture
 
struct  VAAPIEncodeProfile
 
struct  VAAPIEncodeRCMode
 
struct  VAAPIEncodeContext
 
struct  VAAPIEncodeType
 

Macros

#define FLAG_TIMESTAMP_NO_DELAY   1 << 6
 
#define VAAPI_ENCODE_COMMON_OPTIONS
 
#define VAAPI_ENCODE_RC_MODE(name, desc)
 
#define VAAPI_ENCODE_RC_OPTIONS
 

Enumerations

enum  {
  MAX_CONFIG_ATTRIBUTES = 4, MAX_GLOBAL_PARAMS = 4, MAX_PARAM_BUFFER_SIZE = 1024, MAX_TILE_ROWS = 22,
  MAX_TILE_COLS = 20
}
 
enum  {
  RC_MODE_AUTO, RC_MODE_CQP, RC_MODE_CBR, RC_MODE_VBR,
  RC_MODE_ICQ, RC_MODE_QVBR, RC_MODE_AVBR, RC_MODE_MAX = RC_MODE_AVBR
}
 

Functions

int ff_vaapi_encode_receive_packet (AVCodecContext *avctx, AVPacket *pkt)
 
int ff_vaapi_encode_init (AVCodecContext *avctx)
 
int ff_vaapi_encode_close (AVCodecContext *avctx)
 

Variables

const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs []
 

Macro Definition Documentation

◆ FLAG_TIMESTAMP_NO_DELAY

#define FLAG_TIMESTAMP_NO_DELAY   1 << 6

Definition at line 42 of file vaapi_encode.h.

◆ VAAPI_ENCODE_COMMON_OPTIONS

#define VAAPI_ENCODE_COMMON_OPTIONS
Value:
{ "low_power", \
"Use low-power encoding mode (only available on some platforms; " \
"may not support all encoding features)", \
OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, FLAGS }, \
{ "max_frame_size", \
"Maximum frame size (in bytes)",\
OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \
{ .i64 = 0 }, 0, INT_MAX, FLAGS }

Definition at line 354 of file vaapi_encode.h.

◆ VAAPI_ENCODE_RC_MODE

#define VAAPI_ENCODE_RC_MODE (   name,
  desc 
)
Value:
{ #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
0, 0, FLAGS, .unit = "rc_mode" }

Definition at line 365 of file vaapi_encode.h.

◆ VAAPI_ENCODE_RC_OPTIONS

#define VAAPI_ENCODE_RC_OPTIONS
Value:
{ "rc_mode",\
"Set rate control mode", \
OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \
{ .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, .unit = "rc_mode" }, \
{ "auto", "Choose mode automatically based on other parameters", \
0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, .unit = "rc_mode" }, \
VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \
VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \
VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \
VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \
VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \
VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate"), \
{ "blbrc", \
"Block level based bitrate control",\
OFFSET(common.blbrc), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, FLAGS }

Definition at line 368 of file vaapi_encode.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_CONFIG_ATTRIBUTES 
MAX_GLOBAL_PARAMS 
MAX_PARAM_BUFFER_SIZE 
MAX_TILE_ROWS 
MAX_TILE_COLS 

Definition at line 44 of file vaapi_encode.h.

◆ anonymous enum

anonymous enum
Enumerator
RC_MODE_AUTO 
RC_MODE_CQP 
RC_MODE_CBR 
RC_MODE_VBR 
RC_MODE_ICQ 
RC_MODE_QVBR 
RC_MODE_AVBR 
RC_MODE_MAX 

Definition at line 115 of file vaapi_encode.h.

Function Documentation

◆ ff_vaapi_encode_receive_packet()

int ff_vaapi_encode_receive_packet ( AVCodecContext avctx,
AVPacket pkt 
)

Definition at line 2148 of file vaapi_encode.c.

◆ ff_vaapi_encode_init()

int ff_vaapi_encode_init ( AVCodecContext avctx)

◆ ff_vaapi_encode_close()

int ff_vaapi_encode_close ( AVCodecContext avctx)

Variable Documentation

◆ ff_vaapi_encode_hw_configs

const AVCodecHWConfigInternal* const ff_vaapi_encode_hw_configs[]

Definition at line 36 of file vaapi_encode.c.

name
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 default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
FLAGS
#define FLAGS
Definition: cmdutils.c:595
RC_MODE_MAX
@ RC_MODE_MAX
Definition: vaapi_encode.h:123
CBR
@ CBR
Definition: af_afade.c:60
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
desc
const char * desc
Definition: libsvtav1.c:79
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
RC_MODE_AUTO
@ RC_MODE_AUTO
Definition: vaapi_encode.h:116