FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vaapi_encode_mpeg2.c File Reference
#include <va/va.h>
#include <va/va_enc_mpeg2.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 "internal.h"
#include "mpegvideo.h"
#include "put_bits.h"
#include "vaapi_encode.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeMPEG2Context
 

Macros

#define vseq_var(name)   vseq->name, name
 
#define vseqext_field(name)   vseq->sequence_extension.bits.name, name
 
#define vgop_field(name)   vseq->gop_header.bits.name, name
 
#define vpic_var(name)   vpic->name, name
 
#define vpcext_field(name)   vpic->picture_coding_extension.bits.name, name
 
#define vcomp_field(name)   vpic->composite_display.bits.name, name
 
#define u2(width, value, name)   put_bits(&pbc, width, value)
 
#define u(width,...)   u2(width, __VA_ARGS__)
 

Functions

static int vaapi_encode_mpeg2_write_sequence_header (AVCodecContext *avctx, char *data, size_t *data_len)
 
static int vaapi_encode_mpeg2_write_picture_header (AVCodecContext *avctx, VAAPIEncodePicture *pic, char *data, size_t *data_len)
 
static int vaapi_encode_mpeg2_init_sequence_params (AVCodecContext *avctx)
 
static int vaapi_encode_mpeg2_init_picture_params (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_mpeg2_init_slice_params (AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
 
static av_cold int vaapi_encode_mpeg2_configure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_mpeg2_init (AVCodecContext *avctx)
 

Variables

static const VAAPIEncodeType vaapi_encode_type_mpeg2
 
static const AVCodecDefault vaapi_encode_mpeg2_defaults []
 
AVCodec ff_mpeg2_vaapi_encoder
 

Macro Definition Documentation

#define vseq_var (   name)    vseq->name, name

Definition at line 49 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_sequence_header().

#define vseqext_field (   name)    vseq->sequence_extension.bits.name, name

Definition at line 50 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_sequence_header().

#define vgop_field (   name)    vseq->gop_header.bits.name, name

Definition at line 51 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_sequence_header().

#define vpic_var (   name)    vpic->name, name

Definition at line 52 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_picture_header().

#define vpcext_field (   name)    vpic->picture_coding_extension.bits.name, name

Definition at line 53 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_picture_header().

#define vcomp_field (   name)    vpic->composite_display.bits.name, name

Definition at line 54 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_write_picture_header().

#define u2 (   width,
  value,
  name 
)    put_bits(&pbc, width, value)

Definition at line 56 of file vaapi_encode_mpeg2.c.

Referenced by mode23(), mode24(), and svq3_decode_init().

#define u (   width,
  ... 
)    u2(width, __VA_ARGS__)

Function Documentation

static int vaapi_encode_mpeg2_write_sequence_header ( AVCodecContext avctx,
char *  data,
size_t *  data_len 
)
static

Definition at line 59 of file vaapi_encode_mpeg2.c.

static int vaapi_encode_mpeg2_write_picture_header ( AVCodecContext avctx,
VAAPIEncodePicture pic,
char *  data,
size_t *  data_len 
)
static

Definition at line 118 of file vaapi_encode_mpeg2.c.

static int vaapi_encode_mpeg2_init_sequence_params ( AVCodecContext avctx)
static

Definition at line 194 of file vaapi_encode_mpeg2.c.

static int vaapi_encode_mpeg2_init_picture_params ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 259 of file vaapi_encode_mpeg2.c.

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

Definition at line 319 of file vaapi_encode_mpeg2.c.

static av_cold int vaapi_encode_mpeg2_configure ( AVCodecContext avctx)
static

Definition at line 353 of file vaapi_encode_mpeg2.c.

static av_cold int vaapi_encode_mpeg2_init ( AVCodecContext avctx)
static

Definition at line 410 of file vaapi_encode_mpeg2.c.

Variable Documentation

const VAAPIEncodeType vaapi_encode_type_mpeg2
static
Initial value:
= {
.priv_data_size = sizeof(VAAPIEncodeMPEG2Context),
.sequence_params_size = sizeof(VAEncSequenceParameterBufferMPEG2),
.init_sequence_params = &vaapi_encode_mpeg2_init_sequence_params,
.picture_params_size = sizeof(VAEncPictureParameterBufferMPEG2),
.init_picture_params = &vaapi_encode_mpeg2_init_picture_params,
.slice_params_size = sizeof(VAEncSliceParameterBufferMPEG2),
.init_slice_params = &vaapi_encode_mpeg2_init_slice_params,
.sequence_header_type = VAEncPackedHeaderSequence,
.write_sequence_header = &vaapi_encode_mpeg2_write_sequence_header,
.picture_header_type = VAEncPackedHeaderPicture,
.write_picture_header = &vaapi_encode_mpeg2_write_picture_header,
}
static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
static int vaapi_encode_mpeg2_write_picture_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, char *data, size_t *data_len)
static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
static int vaapi_encode_mpeg2_init_sequence_params(AVCodecContext *avctx)
static int vaapi_encode_mpeg2_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
static int vaapi_encode_mpeg2_write_sequence_header(AVCodecContext *avctx, char *data, size_t *data_len)

Definition at line 389 of file vaapi_encode_mpeg2.c.

Referenced by vaapi_encode_mpeg2_init().

const AVCodecDefault vaapi_encode_mpeg2_defaults[]
static
Initial value:
= {
{ "profile", "4" },
{ "level", "4" },
{ "bf", "1" },
{ "g", "120" },
{ "i_qfactor", "1" },
{ "i_qoffset", "0" },
{ "b_qfactor", "6/5" },
{ "b_qoffset", "0" },
{ "global_quality", "10" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 442 of file vaapi_encode_mpeg2.c.

AVCodec ff_mpeg2_vaapi_encoder
Initial value:
= {
.name = "mpeg2_vaapi",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 (VAAPI)"),
.priv_data_size = sizeof(VAAPIEncodeContext),
.encode2 = &ff_vaapi_encode2,
.capabilities = AV_CODEC_CAP_DELAY,
.pix_fmts = (const enum AVPixelFormat[]) {
},
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx)
#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:1027
int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *input_image, int *got_packet)
Definition: vaapi_encode.c:851
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
static const AVCodecDefault vaapi_encode_mpeg2_defaults[]
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:219
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
static const AVCodecDefault defaults[]
Definition: dcaenc.c:1275
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 455 of file vaapi_encode_mpeg2.c.