Go to the documentation of this file.
20 #include <va/va_dec_jpeg.h>
32 VAPictureParameterBufferJPEGBaseline pp;
37 pp = (VAPictureParameterBufferJPEGBaseline) {
38 .picture_width = avctx->
width,
39 .picture_height = avctx->
height,
41 .num_components =
s->nb_components,
44 for (
i = 0;
i <
s->nb_components;
i++) {
45 pp.components[
i].component_id =
s->component_id[
i];
46 pp.components[
i].h_sampling_factor =
s->h_count[
i];
47 pp.components[
i].v_sampling_factor =
s->v_count[
i];
48 pp.components[
i].quantiser_table_selector =
s->quant_index[
i];
52 VAPictureParameterBufferType,
78 VAHuffmanTableBufferJPEGBaseline huff;
79 VAIQMatrixBufferJPEGBaseline
quant;
80 VASliceParameterBufferJPEGBaseline
sp;
83 memset(&huff, 0,
sizeof(huff));
84 for (
i = 0;
i < 2;
i++) {
85 huff.load_huffman_table[
i] = 1;
86 for (j = 0; j < 16; j++)
87 huff.huffman_table[
i].num_dc_codes[j] =
s->raw_huffman_lengths[0][
i][j];
88 for (j = 0; j < 12; j++)
89 huff.huffman_table[
i].dc_values[j] =
s->raw_huffman_values[0][
i][j];
90 for (j = 0; j < 16; j++)
91 huff.huffman_table[
i].num_ac_codes[j] =
s->raw_huffman_lengths[1][
i][j];
92 for (j = 0; j < 162; j++)
93 huff.huffman_table[
i].ac_values[j] =
s->raw_huffman_values[1][
i][j];
97 VAHuffmanTableBufferType,
103 for (
i = 0;
i < 4;
i++) {
104 quant.load_quantiser_table[
i] = 1;
105 for (j = 0; j < 64; j++)
106 quant.quantiser_table[
i][j] =
s->quant_matrixes[
i][j];
110 VAIQMatrixBufferType,
115 sp = (VASliceParameterBufferJPEGBaseline) {
116 .slice_data_size =
size,
117 .slice_data_offset = 0,
118 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
120 .slice_horizontal_position = 0,
121 .slice_vertical_position = 0,
123 .restart_interval =
s->restart_interval,
124 .num_mcus =
s->mb_width *
s->mb_height,
127 sp.num_components =
s->nb_components;
128 for (
i = 0;
i <
s->nb_components;
i++) {
129 sp.components[
i].component_selector =
s->component_id[
s->comp_index[
i]];
130 sp.components[
i].dc_table_selector =
s->dc_index[
i];
131 sp.components[
i].ac_table_selector =
s->ac_index[
i];
146 .
name =
"mjpeg_vaapi",
#define HWACCEL_CAP_ASYNC_SAFE
static av_cold int init(AVCodecContext *avctx)
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, const void *params_data, size_t params_size, const void *slice_data, size_t slice_size)
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
VASurfaceID output_surface
int ff_vaapi_decode_init(AVCodecContext *avctx)
int ff_vaapi_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
static int vaapi_mjpeg_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
const char * name
Name of the hardware accelerated codec.
static int vaapi_mjpeg_end_frame(AVCodecContext *avctx)
#define i(width, name, range_min, range_max)
static int vaapi_mjpeg_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
const AVHWAccel ff_mjpeg_vaapi_hwaccel
main external API structure.
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
int width
picture width / height.
static av_cold int uninit(AVCodecContext *avctx)