FFmpeg
Data Structures | Macros | Functions | Variables
vaapi_encode_mjpeg.c File Reference
#include <va/va.h>
#include <va/va_enc_jpeg.h>
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "bytestream.h"
#include "cbs.h"
#include "cbs_jpeg.h"
#include "internal.h"
#include "jpegtables.h"
#include "mjpeg.h"
#include "put_bits.h"
#include "vaapi_encode.h"

Go to the source code of this file.

Data Structures

struct  VAAPIEncodeMJPEGContext
 

Macros

#define OFFSET(x)   offsetof(VAAPIEncodeMJPEGContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
 

Functions

static int vaapi_encode_mjpeg_write_image_header (AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
 
static int vaapi_encode_mjpeg_write_extra_buffer (AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
 
static int vaapi_encode_mjpeg_init_picture_params (AVCodecContext *avctx, VAAPIEncodePicture *pic)
 
static int vaapi_encode_mjpeg_init_slice_params (AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
 
static av_cold int vaapi_encode_mjpeg_configure (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_mjpeg_init (AVCodecContext *avctx)
 
static av_cold int vaapi_encode_mjpeg_close (AVCodecContext *avctx)
 

Variables

static const unsigned char vaapi_encode_mjpeg_quant_luminance [64]
 
static const unsigned char vaapi_encode_mjpeg_quant_chrominance [64]
 
static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles []
 
static const VAAPIEncodeType vaapi_encode_type_mjpeg
 
static const AVOption vaapi_encode_mjpeg_options []
 
static const AVCodecDefault vaapi_encode_mjpeg_defaults []
 
static const AVClass vaapi_encode_mjpeg_class
 
AVCodec ff_mjpeg_vaapi_encoder
 

Macro Definition Documentation

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

Definition at line 528 of file vaapi_encode_mjpeg.c.

Definition at line 529 of file vaapi_encode_mjpeg.c.

Function Documentation

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

Definition at line 83 of file vaapi_encode_mjpeg.c.

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

Definition at line 149 of file vaapi_encode_mjpeg.c.

static int vaapi_encode_mjpeg_init_picture_params ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 222 of file vaapi_encode_mjpeg.c.

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

Definition at line 414 of file vaapi_encode_mjpeg.c.

static av_cold int vaapi_encode_mjpeg_configure ( AVCodecContext avctx)
static

Definition at line 437 of file vaapi_encode_mjpeg.c.

static av_cold int vaapi_encode_mjpeg_init ( AVCodecContext avctx)
static

Definition at line 502 of file vaapi_encode_mjpeg.c.

static av_cold int vaapi_encode_mjpeg_close ( AVCodecContext avctx)
static

Definition at line 518 of file vaapi_encode_mjpeg.c.

Variable Documentation

const unsigned char vaapi_encode_mjpeg_quant_luminance[64]
static
Initial value:
= {
16, 11, 12, 14, 12, 10, 16, 14,
13, 14, 18, 17, 16, 19, 24, 40,
26, 24, 22, 22, 24, 49, 35, 37,
29, 40, 58, 51, 61, 60, 57, 51,
56, 55, 64, 72, 92, 78, 64, 68,
87, 69, 55, 56, 80, 109, 81, 87,
95, 98, 103, 104, 103, 62, 77, 113,
121, 112, 100, 120, 92, 101, 103, 99,
}

Definition at line 40 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init_picture_params().

const unsigned char vaapi_encode_mjpeg_quant_chrominance[64]
static
Initial value:
= {
17, 18, 18, 24, 21, 24, 47, 26,
26, 47, 99, 66, 56, 66, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
}

Definition at line 50 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init_picture_params().

const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[]
static
Initial value:
= {
8, 1, 0, 0, VAProfileJPEGBaseline },
8, 3, 1, 1, VAProfileJPEGBaseline },
8, 3, 1, 0, VAProfileJPEGBaseline },
8, 3, 0, 0, VAProfileJPEGBaseline },
}
#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT
Definition: avcodec.h:1956
#define FF_PROFILE_UNKNOWN
Definition: avcodec.h:1860

Definition at line 468 of file vaapi_encode_mjpeg.c.

const VAAPIEncodeType vaapi_encode_type_mjpeg
static
Initial value:
= {
.default_quality = 80,
.picture_params_size = sizeof(VAEncPictureParameterBufferJPEG),
.init_picture_params = &vaapi_encode_mjpeg_init_picture_params,
.slice_params_size = sizeof(VAEncSliceParameterBufferJPEG),
.init_slice_params = &vaapi_encode_mjpeg_init_slice_params,
.slice_header_type = VAEncPackedHeaderRawData,
.write_slice_header = &vaapi_encode_mjpeg_write_image_header,
.write_extra_buffer = &vaapi_encode_mjpeg_write_extra_buffer,
}
static int vaapi_encode_mjpeg_write_extra_buffer(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len)
static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
static int vaapi_encode_mjpeg_write_image_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice, char *data, size_t *data_len)
static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[]
static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
static int vaapi_encode_mjpeg_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)

Definition at line 480 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init().

const AVOption vaapi_encode_mjpeg_options[]
static
Initial value:
= {
{ "jfif", "Include JFIF header",
{ .i64 = 0 }, 0, 1, FLAGS },
{ "huffman", "Include huffman tables",
{ .i64 = 1 }, 0, 1, FLAGS },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
#define VAAPI_ENCODE_COMMON_OPTIONS
Definition: vaapi_encode.h:445
#define FLAGS

Definition at line 530 of file vaapi_encode_mjpeg.c.

const AVCodecDefault vaapi_encode_mjpeg_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 543 of file vaapi_encode_mjpeg.c.

const AVClass vaapi_encode_mjpeg_class
static
Initial value:
= {
.class_name = "mjpeg_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:235
static const AVOption vaapi_encode_mjpeg_options[]

Definition at line 548 of file vaapi_encode_mjpeg.c.

AVCodec ff_mjpeg_vaapi_encoder
Initial value:
= {
.name = "mjpeg_vaapi",
.long_name = NULL_IF_CONFIG_SMALL("MJPEG (VAAPI)"),
.priv_data_size = sizeof(VAAPIEncodeMJPEGContext),
.receive_packet = &ff_vaapi_encode_receive_packet,
.priv_class = &vaapi_encode_mjpeg_class,
.capabilities = AV_CODEC_CAP_HARDWARE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.pix_fmts = (const enum AVPixelFormat[]) {
},
.wrapper_name = "vaapi",
}
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:150
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
const AVCodecHWConfigInternal * ff_vaapi_encode_hw_configs[]
Definition: vaapi_encode.c:31
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
static const AVCodecDefault vaapi_encode_mjpeg_defaults[]
static const AVClass vaapi_encode_mjpeg_class
static av_cold int vaapi_encode_mjpeg_close(AVCodecContext *avctx)
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:270
static av_cold int vaapi_encode_mjpeg_init(AVCodecContext *avctx)
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64

Definition at line 555 of file vaapi_encode_mjpeg.c.