FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vaapi_encode_h265.c File Reference
#include <string.h>
#include <va/va.h>
#include <va/va_enc_hevc.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "libavutil/mastering_display_metadata.h"
#include "avcodec.h"
#include "cbs.h"
#include "cbs_h265.h"
#include "h265_profile_level.h"
#include "hevc.h"
#include "hevc_sei.h"
#include "internal.h"
#include "put_bits.h"
#include "vaapi_encode.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeH265Context
 

Macros

#define OFFSET(x)   offsetof(VAAPIEncodeH265Context, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
 
#define PROFILE(name, value)
 
#define LEVEL(name, value)
 

Enumerations

enum  { SEI_MASTERING_DISPLAY = 0x08, SEI_CONTENT_LIGHT_LEVEL = 0x10 }
 

Functions

static int vaapi_encode_h265_write_access_unit (AVCodecContext *avctx, char *data, size_t *data_len, CodedBitstreamFragment *au)
 
static int vaapi_encode_h265_add_nal (AVCodecContext *avctx, CodedBitstreamFragment *au, void *nal_unit)
 
static int vaapi_encode_h265_write_sequence_header (AVCodecContext *avctx, char *data, size_t *data_len)
 
static int vaapi_encode_h265_write_slice_header (AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
 
static int vaapi_encode_h265_write_extra_header (AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
 
static int vaapi_encode_h265_init_sequence_params (AVCodecContext *avctx)
 
static int vaapi_encode_h265_init_picture_params (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_h265_init_slice_params (AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
 
static av_cold int vaapi_encode_h265_configure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_h265_init (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_h265_close (AVCodecContext *avctx)
 

Variables

static const VAAPIEncodeProfile vaapi_encode_h265_profiles []
 
static const VAAPIEncodeType vaapi_encode_type_h265
 
static const AVOption vaapi_encode_h265_options []
 
static const AVCodecDefault vaapi_encode_h265_defaults []
 
static const AVClass vaapi_encode_h265_class
 
AVCodec ff_hevc_vaapi_encoder
 

Macro Definition Documentation

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

Definition at line 1146 of file vaapi_encode_h265.c.

Definition at line 1147 of file vaapi_encode_h265.c.

#define PROFILE (   name,
  value 
)
Value:
{ .i64 = value }, 0, 0, FLAGS, "profile"
#define NULL
Definition: coverity.c:32
#define FLAGS
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
const char * name
Definition: opengl_enc.c:103
#define LEVEL (   name,
  value 
)
Value:
{ .i64 = value }, 0, 0, FLAGS, "level"
#define NULL
Definition: coverity.c:32
#define FLAGS
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
const char * name
Definition: opengl_enc.c:103

Enumeration Type Documentation

anonymous enum
Enumerator
SEI_MASTERING_DISPLAY 
SEI_CONTENT_LIGHT_LEVEL 

Definition at line 40 of file vaapi_encode_h265.c.

Function Documentation

static int vaapi_encode_h265_write_access_unit ( AVCodecContext avctx,
char *  data,
size_t *  data_len,
CodedBitstreamFragment au 
)
static
static int vaapi_encode_h265_add_nal ( AVCodecContext avctx,
CodedBitstreamFragment au,
void nal_unit 
)
static
static int vaapi_encode_h265_write_sequence_header ( AVCodecContext avctx,
char *  data,
size_t *  data_len 
)
static

Definition at line 132 of file vaapi_encode_h265.c.

static int vaapi_encode_h265_write_slice_header ( AVCodecContext avctx,
VAAPIEncodePicture pic,
VAAPIEncodeSlice slice,
char *  data,
size_t *  data_len 
)
static

Definition at line 164 of file vaapi_encode_h265.c.

static int vaapi_encode_h265_write_extra_header ( AVCodecContext avctx,
VAAPIEncodePicture pic,
int  index,
int type,
char *  data,
size_t *  data_len 
)
static

Definition at line 190 of file vaapi_encode_h265.c.

static int vaapi_encode_h265_init_sequence_params ( AVCodecContext avctx)
static

Definition at line 256 of file vaapi_encode_h265.c.

static int vaapi_encode_h265_init_picture_params ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 671 of file vaapi_encode_h265.c.

static int vaapi_encode_h265_init_slice_params ( AVCodecContext avctx,
VAAPIEncodePicture pic,
VAAPIEncodeSlice slice 
)
static

Definition at line 854 of file vaapi_encode_h265.c.

static av_cold int vaapi_encode_h265_configure ( AVCodecContext avctx)
static

Definition at line 1029 of file vaapi_encode_h265.c.

static av_cold int vaapi_encode_h265_init ( AVCodecContext avctx)
static

Definition at line 1105 of file vaapi_encode_h265.c.

static av_cold int vaapi_encode_h265_close ( AVCodecContext avctx)
static

Definition at line 1137 of file vaapi_encode_h265.c.

Variable Documentation

const VAAPIEncodeProfile vaapi_encode_h265_profiles[]
static
Initial value:
= {
{ FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain },
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain },
}
#define FF_PROFILE_HEVC_MAIN
Definition: avcodec.h:2947
#define FF_PROFILE_UNKNOWN
Definition: avcodec.h:2860
#define FF_PROFILE_HEVC_REXT
Definition: avcodec.h:2950

Definition at line 1070 of file vaapi_encode_h265.c.

const VAAPIEncodeType vaapi_encode_type_h265
static
Initial value:
= {
.sequence_params_size = sizeof(VAEncSequenceParameterBufferHEVC),
.init_sequence_params = &vaapi_encode_h265_init_sequence_params,
.picture_params_size = sizeof(VAEncPictureParameterBufferHEVC),
.init_picture_params = &vaapi_encode_h265_init_picture_params,
.slice_params_size = sizeof(VAEncSliceParameterBufferHEVC),
.init_slice_params = &vaapi_encode_h265_init_slice_params,
.sequence_header_type = VAEncPackedHeaderSequence,
.write_sequence_header = &vaapi_encode_h265_write_sequence_header,
.slice_header_type = VAEncPackedHeaderHEVC_Slice,
.write_slice_header = &vaapi_encode_h265_write_slice_header,
.write_extra_header = &vaapi_encode_h265_write_extra_header,
}
static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
static int vaapi_encode_h265_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
static int vaapi_encode_h265_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
static int vaapi_encode_h265_write_slice_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
static int vaapi_encode_h265_write_extra_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
static int vaapi_encode_h265_write_sequence_header(AVCodecContext *avctx, char *data, size_t *data_len)
static const VAAPIEncodeProfile vaapi_encode_h265_profiles[]
static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)

Definition at line 1080 of file vaapi_encode_h265.c.

Referenced by vaapi_encode_h265_init().

const AVOption vaapi_encode_h265_options[]
static

Definition at line 1148 of file vaapi_encode_h265.c.

const AVCodecDefault vaapi_encode_h265_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "bf", "2" },
{ "g", "120" },
{ "i_qfactor", "1" },
{ "i_qoffset", "0" },
{ "b_qfactor", "6/5" },
{ "b_qoffset", "0" },
{ "qmin", "-1" },
{ "qmax", "-1" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 1211 of file vaapi_encode_h265.c.

const AVClass vaapi_encode_h265_class
static
Initial value:
= {
.class_name = "h265_vaapi",
.item_name = av_default_item_name,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption vaapi_encode_h265_options[]

Definition at line 1224 of file vaapi_encode_h265.c.

AVCodec ff_hevc_vaapi_encoder
Initial value:
= {
.name = "hevc_vaapi",
.long_name = NULL_IF_CONFIG_SMALL("H.265/HEVC (VAAPI)"),
.priv_data_size = sizeof(VAAPIEncodeH265Context),
.encode2 = &ff_vaapi_encode2,
.priv_class = &vaapi_encode_h265_class,
.pix_fmts = (const enum AVPixelFormat[]) {
},
.wrapper_name = "vaapi",
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: avcodec.h:1065
static const AVClass vaapi_encode_h265_class
static av_cold int vaapi_encode_h265_close(AVCodecContext *avctx)
static const AVCodecDefault vaapi_encode_h265_defaults[]
#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: avcodec.h:993
static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *input_image, int *got_packet)
Definition: vaapi_encode.c:895
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64

Definition at line 1231 of file vaapi_encode_h265.c.