20 #include <va/va_dec_jpeg.h>
32 VAPictureParameterBufferJPEGBaseline pp;
37 pp = (VAPictureParameterBufferJPEGBaseline) {
38 .picture_width = avctx->
width,
39 .picture_height = avctx->
height,
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++)
88 for (j = 0; j < 12; j++)
90 for (j = 0; j < 16; j++)
92 for (j = 0; j < 162; j++)
97 VAHuffmanTableBufferType,
102 memset(&quant, 0,
sizeof(quant));
103 for (i = 0; i < 4; i++) {
104 quant.load_quantiser_table[i] = 1;
105 for (j = 0; j < 64; j++)
110 VAIQMatrixBufferType,
111 &quant,
sizeof(quant));
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,
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",
int v_count[MAX_COMPONENTS]
static int vaapi_mjpeg_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
static int vaapi_mjpeg_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
static av_cold int init(AVCodecContext *avctx)
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
int dc_index[MAX_COMPONENTS]
int comp_index[MAX_COMPONENTS]
int ff_vaapi_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
static av_cold int uninit(AVCodecContext *avctx)
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
int h_count[MAX_COMPONENTS]
const char * name
Name of the hardware accelerated codec.
int ff_vaapi_decode_init(AVCodecContext *avctx)
int component_id[MAX_COMPONENTS]
int width
picture width / height.
uint8_t raw_huffman_lengths[2][4][16]
VASurfaceID output_surface
main external API structure.
const AVHWAccel ff_mjpeg_vaapi_hwaccel
int ac_index[MAX_COMPONENTS]
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
uint8_t raw_huffman_values[2][4][256]
static int vaapi_mjpeg_end_frame(AVCodecContext *avctx)
#define HWACCEL_CAP_ASYNC_SAFE
void * hwaccel_picture_private
uint16_t quant_matrixes[4][64]
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)