FFmpeg
Data Structures | Macros | Functions | Variables
vaapi_encode_vp9.c File Reference
#include <va/va.h>
#include <va/va_enc_vp9.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "vaapi_encode.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeVP9Picture
 
struct  VAAPIEncodeVP9Context
 

Macros

#define VP9_MAX_QUANT   255
 
#define VP9_MAX_TILE_WIDTH   4096
 
#define OFFSET(x)   offsetof(VAAPIEncodeVP9Context, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
 

Functions

static int vaapi_encode_vp9_init_sequence_params (AVCodecContext *avctx)
 
static int vaapi_encode_vp9_init_picture_params (AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
 
static av_cold int vaapi_encode_vp9_get_encoder_caps (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_vp9_configure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_vp9_init (AVCodecContext *avctx)
 

Variables

static const VAAPIEncodeProfile vaapi_encode_vp9_profiles []
 
static const VAAPIEncodeType vaapi_encode_type_vp9
 
static const AVOption vaapi_encode_vp9_options []
 
static const FFCodecDefault vaapi_encode_vp9_defaults []
 
static const AVClass vaapi_encode_vp9_class
 
const FFCodec ff_vp9_vaapi_encoder
 

Macro Definition Documentation

◆ VP9_MAX_QUANT

#define VP9_MAX_QUANT   255

Definition at line 32 of file vaapi_encode_vp9.c.

◆ VP9_MAX_TILE_WIDTH

#define VP9_MAX_TILE_WIDTH   4096

Definition at line 34 of file vaapi_encode_vp9.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(VAAPIEncodeVP9Context, x)

Definition at line 275 of file vaapi_encode_vp9.c.

◆ FLAGS

Definition at line 276 of file vaapi_encode_vp9.c.

Function Documentation

◆ vaapi_encode_vp9_init_sequence_params()

static int vaapi_encode_vp9_init_sequence_params ( AVCodecContext avctx)
static

Definition at line 54 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_init_picture_params()

static int vaapi_encode_vp9_init_picture_params ( AVCodecContext avctx,
FFHWBaseEncodePicture pic 
)
static

Definition at line 79 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_get_encoder_caps()

static av_cold int vaapi_encode_vp9_get_encoder_caps ( AVCodecContext avctx)
static

Definition at line 191 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_configure()

static av_cold int vaapi_encode_vp9_configure ( AVCodecContext avctx)
static

Definition at line 202 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_init()

static av_cold int vaapi_encode_vp9_init ( AVCodecContext avctx)
static

Definition at line 261 of file vaapi_encode_vp9.c.

Variable Documentation

◆ vaapi_encode_vp9_profiles

const VAAPIEncodeProfile vaapi_encode_vp9_profiles[]
static
Initial value:
= {
{ AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
{ AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
{ AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
}

Definition at line 233 of file vaapi_encode_vp9.c.

◆ vaapi_encode_type_vp9

const VAAPIEncodeType vaapi_encode_type_vp9
static
Initial value:
= {
.default_quality = 100,
.picture_priv_data_size = sizeof(VAAPIEncodeVP9Picture),
.get_encoder_caps = &vaapi_encode_vp9_get_encoder_caps,
.sequence_params_size = sizeof(VAEncSequenceParameterBufferVP9),
.init_sequence_params = &vaapi_encode_vp9_init_sequence_params,
.picture_params_size = sizeof(VAEncPictureParameterBufferVP9),
.init_picture_params = &vaapi_encode_vp9_init_picture_params,
}

Definition at line 241 of file vaapi_encode_vp9.c.

Referenced by vaapi_encode_vp9_init().

◆ vaapi_encode_vp9_options

const AVOption vaapi_encode_vp9_options[]
static
Initial value:
= {
{ "loop_filter_level", "Loop filter level",
OFFSET(loop_filter_level), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 63, FLAGS },
{ "loop_filter_sharpness", "Loop filter sharpness",
OFFSET(loop_filter_sharpness), AV_OPT_TYPE_INT, { .i64 = 4 }, 0, 15, FLAGS },
{ NULL },
}

Definition at line 277 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_defaults

const FFCodecDefault vaapi_encode_vp9_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "bf", "0" },
{ "g", "250" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ NULL },
}

Definition at line 289 of file vaapi_encode_vp9.c.

◆ vaapi_encode_vp9_class

const AVClass vaapi_encode_vp9_class
static
Initial value:
= {
.class_name = "vp9_vaapi",
.item_name = av_default_item_name,
}

Definition at line 298 of file vaapi_encode_vp9.c.

◆ ff_vp9_vaapi_encoder

const FFCodec ff_vp9_vaapi_encoder
Initial value:
= {
.p.name = "vp9_vaapi",
CODEC_LONG_NAME("VP9 (VAAPI)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_VP9,
.priv_data_size = sizeof(VAAPIEncodeVP9Context),
.p.priv_class = &vaapi_encode_vp9_class,
.color_ranges = AVCOL_RANGE_MPEG,
.p.pix_fmts = (const enum AVPixelFormat[]) {
},
.p.wrapper_name = "vaapi",
}

Definition at line 305 of file vaapi_encode_vp9.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
FF_HW_FLAG_B_PICTURE_REFERENCES
@ FF_HW_FLAG_B_PICTURE_REFERENCES
Definition: hw_base_encode.h:55
vaapi_encode_vp9_init_picture_params
static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, FFHWBaseEncodePicture *pic)
Definition: vaapi_encode_vp9.c:79
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:145
vaapi_encode_vp9_configure
static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:202
FF_HW_FLAG_B_PICTURES
@ FF_HW_FLAG_B_PICTURES
Definition: hw_base_encode.h:53
AV_PROFILE_VP9_1
#define AV_PROFILE_VP9_1
Definition: defs.h:155
VAAPIEncodeVP9Context
Definition: vaapi_encode_vp9.c:40
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:35
ff_vaapi_encode_close
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
Definition: vaapi_encode.c:2275
VAAPIEncodeVP9Picture
Definition: vaapi_encode_vp9.c:36
AV_PROFILE_VP9_3
#define AV_PROFILE_VP9_3
Definition: defs.h:157
vaapi_encode_vp9_init
static av_cold int vaapi_encode_vp9_init(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:261
AV_PROFILE_UNKNOWN
#define AV_PROFILE_UNKNOWN
Definition: defs.h:65
AV_CODEC_ID_VP9
@ AV_CODEC_ID_VP9
Definition: codec_id.h:222
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
OFFSET
#define OFFSET(x)
Definition: vaapi_encode_vp9.c:275
ff_vaapi_encode_receive_packet
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: vaapi_encode.c:2086
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
FLAGS
#define FLAGS
Definition: vaapi_encode_vp9.c:276
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
vaapi_encode_vp9_profiles
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[]
Definition: vaapi_encode_vp9.c:233
FF_CODEC_RECEIVE_PACKET_CB
#define FF_CODEC_RECEIVE_PACKET_CB(func)
Definition: codec_internal.h:326
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
vaapi_encode_vp9_init_sequence_params
static int vaapi_encode_vp9_init_sequence_params(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:54
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
VAAPI_ENCODE_RC_OPTIONS
#define VAAPI_ENCODE_RC_OPTIONS
Definition: vaapi_encode.h:364
VAAPI_ENCODE_COMMON_OPTIONS
#define VAAPI_ENCODE_COMMON_OPTIONS
Definition: vaapi_encode.h:350
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.h:126
vaapi_encode_vp9_get_encoder_caps
static av_cold int vaapi_encode_vp9_get_encoder_caps(AVCodecContext *avctx)
Definition: vaapi_encode_vp9.c:191
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
ff_vaapi_encode_hw_configs
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
Definition: vaapi_encode.c:36
AV_PROFILE_VP9_2
#define AV_PROFILE_VP9_2
Definition: defs.h:156
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:76
AV_PROFILE_VP9_0
#define AV_PROFILE_VP9_0
Definition: defs.h:154
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
vaapi_encode_vp9_class
static const AVClass vaapi_encode_vp9_class
Definition: vaapi_encode_vp9.c:298
HW_BASE_ENCODE_COMMON_OPTIONS
#define HW_BASE_ENCODE_COMMON_OPTIONS
Definition: hw_base_encode.h:239
vaapi_encode_vp9_defaults
static const FFCodecDefault vaapi_encode_vp9_defaults[]
Definition: vaapi_encode_vp9.c:289
vaapi_encode_vp9_options
static const AVOption vaapi_encode_vp9_options[]
Definition: vaapi_encode_vp9.c:277