FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
vaapi_encode.c File Reference
#include <inttypes.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/log.h"
#include "libavutil/pixdesc.h"
#include "vaapi_encode.h"
#include "avcodec.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeRTFormat
 

Functions

static int vaapi_encode_make_packed_header (AVCodecContext *avctx, VAAPIEncodePicture *pic, int type, char *data, size_t bit_len)
 
static int vaapi_encode_make_param_buffer (AVCodecContext *avctx, VAAPIEncodePicture *pic, int type, char *data, size_t len)
 
static int vaapi_encode_wait (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_issue (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_output (AVCodecContext *avctx, VAAPIEncodePicture *pic, AVPacket *pkt)
 
static int vaapi_encode_discard (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static VAAPIEncodePicturevaapi_encode_alloc (void)
 
static int vaapi_encode_free (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_step (AVCodecContext *avctx, VAAPIEncodePicture *target)
 
static int vaapi_encode_get_next (AVCodecContext *avctx, VAAPIEncodePicture **pic_out)
 
static int vaapi_encode_truncate_gop (AVCodecContext *avctx)
 
static int vaapi_encode_clear_old (AVCodecContext *avctx)
 
int ff_vaapi_encode2 (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *input_image, int *got_packet)
 
static av_cold void vaapi_encode_add_global_param (AVCodecContext *avctx, VAEncMiscParameterBuffer *buffer, size_t size)
 
static av_cold int vaapi_encode_profile_entrypoint (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_init_rate_control (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_init_gop_structure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_init_slice_structure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_init_packed_headers (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_init_quality (AVCodecContext *avctx)
 
static void vaapi_encode_free_output_buffer (void *opaque, uint8_t *data)
 
static AVBufferRefvaapi_encode_alloc_output_buffer (void *opaque, int size)
 
static av_cold int vaapi_encode_create_recon_frames (AVCodecContext *avctx)
 
av_cold int ff_vaapi_encode_init (AVCodecContext *avctx)
 
av_cold int ff_vaapi_encode_close (AVCodecContext *avctx)
 

Variables

static const char *const picture_type_name [] = { "IDR", "I", "P", "B" }
 
static const VAAPIEncodeRTFormat vaapi_encode_rt_formats []
 
static const VAEntrypoint vaapi_encode_entrypoints_normal []
 

Function Documentation

static int vaapi_encode_make_packed_header ( AVCodecContext avctx,
VAAPIEncodePicture pic,
int  type,
char *  data,
size_t  bit_len 
)
static

Definition at line 32 of file vaapi_encode.c.

Referenced by vaapi_encode_issue().

static int vaapi_encode_make_param_buffer ( AVCodecContext avctx,
VAAPIEncodePicture pic,
int  type,
char *  data,
size_t  len 
)
static

Definition at line 78 of file vaapi_encode.c.

Referenced by vaapi_encode_issue().

static int vaapi_encode_wait ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 106 of file vaapi_encode.c.

Referenced by vaapi_encode_discard(), vaapi_encode_issue(), and vaapi_encode_output().

static int vaapi_encode_issue ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 137 of file vaapi_encode.c.

Referenced by vaapi_encode_step().

static int vaapi_encode_output ( AVCodecContext avctx,
VAAPIEncodePicture pic,
AVPacket pkt 
)
static

Definition at line 495 of file vaapi_encode.c.

Referenced by ff_vaapi_encode2().

static int vaapi_encode_discard ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 556 of file vaapi_encode.c.

Referenced by vaapi_encode_free().

static VAAPIEncodePicture* vaapi_encode_alloc ( void  )
static

Definition at line 573 of file vaapi_encode.c.

Referenced by vaapi_encode_get_next().

static int vaapi_encode_free ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static
static int vaapi_encode_step ( AVCodecContext avctx,
VAAPIEncodePicture target 
)
static

Definition at line 620 of file vaapi_encode.c.

Referenced by ff_vaapi_encode2().

static int vaapi_encode_get_next ( AVCodecContext avctx,
VAAPIEncodePicture **  pic_out 
)
static

Definition at line 697 of file vaapi_encode.c.

Referenced by ff_vaapi_encode2().

static int vaapi_encode_truncate_gop ( AVCodecContext avctx)
static

Definition at line 802 of file vaapi_encode.c.

Referenced by ff_vaapi_encode2().

static int vaapi_encode_clear_old ( AVCodecContext avctx)
static

Definition at line 863 of file vaapi_encode.c.

Referenced by ff_vaapi_encode2().

int ff_vaapi_encode2 ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame input_image,
int got_packet 
)

Definition at line 895 of file vaapi_encode.c.

static av_cold void vaapi_encode_add_global_param ( AVCodecContext avctx,
VAEncMiscParameterBuffer *  buffer,
size_t  size 
)
static

Definition at line 1005 of file vaapi_encode.c.

Referenced by vaapi_encode_init_quality(), and vaapi_encode_init_rate_control().

static av_cold int vaapi_encode_profile_entrypoint ( AVCodecContext avctx)
static

Definition at line 1054 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_init_rate_control ( AVCodecContext avctx)
static

Definition at line 1253 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_init_gop_structure ( AVCodecContext avctx)
static

Definition at line 1444 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_init_slice_structure ( AVCodecContext avctx)
static

Definition at line 1492 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_init_packed_headers ( AVCodecContext avctx)
static

Definition at line 1592 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_init_quality ( AVCodecContext avctx)
static

Definition at line 1652 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static void vaapi_encode_free_output_buffer ( void opaque,
uint8_t data 
)
static

Definition at line 1697 of file vaapi_encode.c.

Referenced by vaapi_encode_alloc_output_buffer().

static AVBufferRef* vaapi_encode_alloc_output_buffer ( void opaque,
int  size 
)
static

Definition at line 1711 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

static av_cold int vaapi_encode_create_recon_frames ( AVCodecContext avctx)
static

Definition at line 1748 of file vaapi_encode.c.

Referenced by ff_vaapi_encode_init().

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

Variable Documentation

const char* const picture_type_name[] = { "IDR", "I", "P", "B" }
static
const VAAPIEncodeRTFormat vaapi_encode_rt_formats[]
static
Initial value:
= {
{ "YUV400", VA_RT_FORMAT_YUV400, 8, 1, },
{ "YUV420", VA_RT_FORMAT_YUV420, 8, 3, 1, 1 },
{ "YUV422", VA_RT_FORMAT_YUV422, 8, 3, 1, 0 },
{ "YUV444", VA_RT_FORMAT_YUV444, 8, 3, 0, 0 },
{ "YUV411", VA_RT_FORMAT_YUV411, 8, 3, 2, 0 },
}

Definition at line 1028 of file vaapi_encode.c.

const VAEntrypoint vaapi_encode_entrypoints_normal[]
static
Initial value:
= {
VAEntrypointEncSlice,
VAEntrypointEncPicture,
0
}

Definition at line 1039 of file vaapi_encode.c.

Referenced by vaapi_encode_profile_entrypoint().