FFmpeg
Data Structures | Macros | Enumerations | Functions
vaapi_encode.h File Reference
#include <stdint.h>
#include <va/va.h>
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_vaapi.h"
#include "avcodec.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 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_DPB_SIZE = 16, MAX_PICTURE_REFERENCES = 2,
  MAX_REORDER_DELAY = 16, MAX_PARAM_BUFFER_SIZE = 1024
}
 
enum  { PICTURE_TYPE_IDR = 0, PICTURE_TYPE_I = 1, PICTURE_TYPE_P = 2, PICTURE_TYPE_B = 3 }
 
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
}
 
enum  {
  FLAG_SLICE_CONTROL = 1 << 0, FLAG_CONSTANT_QUALITY_ONLY = 1 << 1, FLAG_INTRA_ONLY = 1 << 2, FLAG_B_PICTURES = 1 << 3,
  FLAG_B_PICTURE_REFERENCES = 1 << 4, FLAG_NON_IDR_KEY_PICTURES = 1 << 5
}
 

Functions

int ff_vaapi_encode_send_frame (AVCodecContext *avctx, const AVFrame *frame)
 
int ff_vaapi_encode_receive_packet (AVCodecContext *avctx, AVPacket *pkt)
 
int ff_vaapi_encode_init (AVCodecContext *avctx)
 
int ff_vaapi_encode_close (AVCodecContext *avctx)
 

Macro Definition Documentation

#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 }, \
{ "idr_interval", \
"Distance (in I-frames) between IDR frames", \
OFFSET(common.idr_interval), AV_OPT_TYPE_INT, \
{ .i64 = 0 }, 0, INT_MAX, FLAGS }, \
{ "b_depth", \
"Maximum B-frame reference depth", \
OFFSET(common.desired_b_depth), AV_OPT_TYPE_INT, \
{ .i64 = 1 }, 1, INT_MAX, FLAGS }
#define FLAGS
Definition: cmdutils.c:544
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 keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your local see the OFFSET() macro

Definition at line 426 of file vaapi_encode.h.

#define VAAPI_ENCODE_RC_MODE (   name,
  desc 
)
Value:
{ #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \
0, 0, FLAGS, "rc_mode" }
#define FLAGS
Definition: cmdutils.c:544
const char * desc
Definition: nvenc.c:68
const char * name
Definition: opengl_enc.c:102

Definition at line 441 of file vaapi_encode.h.

#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, "rc_mode" }, \
{ "auto", "Choose mode automatically based on other parameters", \
0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, "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")
#define FLAGS
Definition: cmdutils.c:544
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 keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your local see the OFFSET() macro
#define VAAPI_ENCODE_RC_MODE(name, desc)
Definition: vaapi_encode.h:441
Definition: af_afade.c:54

Definition at line 444 of file vaapi_encode.h.

Enumeration Type Documentation

anonymous enum
Enumerator
MAX_CONFIG_ATTRIBUTES 
MAX_GLOBAL_PARAMS 
MAX_DPB_SIZE 
MAX_PICTURE_REFERENCES 
MAX_REORDER_DELAY 
MAX_PARAM_BUFFER_SIZE 

Definition at line 38 of file vaapi_encode.h.

anonymous enum
Enumerator
PICTURE_TYPE_IDR 
PICTURE_TYPE_I 
PICTURE_TYPE_P 
PICTURE_TYPE_B 

Definition at line 47 of file vaapi_encode.h.

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 139 of file vaapi_encode.h.

anonymous enum
Enumerator
FLAG_SLICE_CONTROL 
FLAG_CONSTANT_QUALITY_ONLY 
FLAG_INTRA_ONLY 
FLAG_B_PICTURES 
FLAG_B_PICTURE_REFERENCES 
FLAG_NON_IDR_KEY_PICTURES 

Definition at line 330 of file vaapi_encode.h.

Function Documentation

int ff_vaapi_encode_send_frame ( AVCodecContext avctx,
const AVFrame frame 
)

Definition at line 1033 of file vaapi_encode.c.

int ff_vaapi_encode_receive_packet ( AVCodecContext avctx,
AVPacket pkt 
)

Definition at line 1099 of file vaapi_encode.c.

int ff_vaapi_encode_init ( AVCodecContext avctx)
int ff_vaapi_encode_close ( AVCodecContext avctx)