FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | 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/pixfmt.h"
#include "avcodec.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
 

Functions

static av_cold void vaapi_encode_mjpeg_copy_huffman (unsigned char *dst_lengths, unsigned char *dst_values, const unsigned char *src_lengths, const unsigned char *src_values)
 
static av_cold void vaapi_encode_mjpeg_init_tables (AVCodecContext *avctx)
 
static void vaapi_encode_mjpeg_write_marker (PutBitContext *pbc, int marker)
 
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)
 

Variables

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

Function Documentation

static av_cold void vaapi_encode_mjpeg_copy_huffman ( unsigned char *  dst_lengths,
unsigned char *  dst_values,
const unsigned char *  src_lengths,
const unsigned char *  src_values 
)
static

Definition at line 67 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init_tables().

static av_cold void vaapi_encode_mjpeg_init_tables ( AVCodecContext avctx)
static

Definition at line 84 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_configure().

static void vaapi_encode_mjpeg_write_marker ( PutBitContext pbc,
int  marker 
)
static

Definition at line 125 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_write_image_header().

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

Definition at line 131 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 240 of file vaapi_encode_mjpeg.c.

static int vaapi_encode_mjpeg_init_picture_params ( AVCodecContext avctx,
VAAPIEncodePicture pic 
)
static

Definition at line 270 of file vaapi_encode_mjpeg.c.

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

Definition at line 316 of file vaapi_encode_mjpeg.c.

static av_cold int vaapi_encode_mjpeg_configure ( AVCodecContext avctx)
static

Definition at line 336 of file vaapi_encode_mjpeg.c.

static av_cold int vaapi_encode_mjpeg_init ( AVCodecContext avctx)
static

Definition at line 381 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 37 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init_tables().

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 47 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init_tables().

const VAAPIEncodeType vaapi_encode_type_mjpeg
static
Initial value:
= {
.priv_data_size = sizeof(VAAPIEncodeMJPEGContext),
.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 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 364 of file vaapi_encode_mjpeg.c.

Referenced by vaapi_encode_mjpeg_init().

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

Definition at line 404 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:86
av_default_item_name

Definition at line 409 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(VAAPIEncodeContext),
.encode2 = &ff_vaapi_encode2,
.priv_class = &vaapi_encode_mjpeg_class,
.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)
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_mjpeg_defaults[]
static const AVClass vaapi_encode_mjpeg_class
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
static av_cold int vaapi_encode_mjpeg_init(AVCodecContext *avctx)
static const AVCodecDefault defaults[]
Definition: dcaenc.c:1275
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 415 of file vaapi_encode_mjpeg.c.