Go to the documentation of this file.
23 #include "config_components.h"
35 switch (
s->intra_dc_threshold) {
53 VAPictureParameterBufferMPEG4 pic_param;
58 pic_param = (VAPictureParameterBufferMPEG4) {
59 .vop_width =
s->width,
60 .vop_height =
s->height,
61 .forward_reference_picture = VA_INVALID_ID,
62 .backward_reference_picture = VA_INVALID_ID,
66 .interlaced = !
s->progressive_sequence,
68 .sprite_enable =
ctx->vol_sprite_usage,
69 .sprite_warping_accuracy =
ctx->sprite_warping_accuracy,
70 .quant_type =
s->mpeg_quant,
71 .quarter_sample =
s->quarter_sample,
72 .data_partitioned =
s->data_partitioning,
73 .reversible_vlc =
ctx->rvlc,
74 .resync_marker_disable = !
ctx->resync_marker,
76 .no_of_sprite_warping_points =
ctx->num_sprite_warping_points,
77 .quant_precision =
ctx->quant_precision,
80 .backward_reference_vop_coding_type =
82 .vop_rounding_type =
s->no_rounding,
84 .top_field_first =
s->top_field_first,
85 .alternate_vertical_scan_flag =
s->alternate_scan,
87 .vop_fcode_forward =
s->f_code,
88 .vop_fcode_backward =
s->b_code,
97 for (
i = 0;
i <
ctx->num_sprite_warping_points &&
i < 3;
i++) {
98 pic_param.sprite_trajectory_du[
i] =
ctx->sprite_traj[
i][0];
99 pic_param.sprite_trajectory_dv[
i] =
ctx->sprite_traj[
i][1];
108 VAPictureParameterBufferType,
109 &pic_param,
sizeof(pic_param));
114 if (pic_param.vol_fields.bits.quant_type) {
115 VAIQMatrixBufferMPEG4 iq_matrix;
117 iq_matrix.load_intra_quant_mat = 1;
118 iq_matrix.load_non_intra_quant_mat = 1;
120 for (
i = 0;
i < 64;
i++) {
122 iq_matrix.intra_quant_mat[
i] =
s->intra_matrix[n];
123 iq_matrix.non_intra_quant_mat[
i] =
s->inter_matrix[n];
127 VAIQMatrixBufferType,
128 &iq_matrix,
sizeof(iq_matrix));
159 VASliceParameterBufferMPEG4 slice_param;
162 slice_param = (VASliceParameterBufferMPEG4) {
163 .slice_data_size =
size,
164 .slice_data_offset = 0,
165 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
167 .macroblock_number = 0,
168 .quant_scale =
s->qscale,
172 &slice_param, 1,
sizeof(slice_param),
182 #if CONFIG_MPEG4_VAAPI_HWACCEL
184 .
p.
name =
"mpeg4_vaapi",
200 #if CONFIG_H263_VAAPI_HWACCEL
202 .
p.
name =
"h263_vaapi",
static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
#define H263_GOB_HEIGHT(h)
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
static int vaapi_mpeg4_end_frame(AVCodecContext *avctx)
static int get_bits_count(const GetBitContext *s)
AVHWAccel p
The public AVHWAccel.
const struct FFHWAccel ff_h263_vaapi_hwaccel
static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
const struct AVCodec * codec
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)
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
const struct FFHWAccel ff_mpeg4_vaapi_hwaccel
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
@ AV_PICTURE_TYPE_I
Intra.
static int mpeg4_get_intra_dc_vlc_thr(Mpeg4DecContext *s)
Reconstruct bitstream intra_dc_vlc_thr.
int(* init)(AVBSFContext *ctx)
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
const char * name
Name of the hardware accelerated codec.
static void uninit(AVBSFContext *ctx)
#define i(width, name, range_min, range_max)
const uint8_t ff_zigzag_direct[64]
main external API structure.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
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 ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, const void *params_data, int nb_params, size_t params_size, const void *slice_data, size_t slice_size)