Go to the documentation of this file.
23 #include "config_components.h"
35 switch (
s->intra_dc_threshold) {
56 VAPictureParameterBufferMPEG4 pic_param;
61 pic_param = (VAPictureParameterBufferMPEG4) {
62 .vop_width =
s->width,
63 .vop_height =
s->height,
64 .forward_reference_picture = VA_INVALID_ID,
65 .backward_reference_picture = VA_INVALID_ID,
69 .interlaced = !
s->progressive_sequence,
71 .sprite_enable =
ctx->vol_sprite_usage,
72 .sprite_warping_accuracy =
ctx->sprite_warping_accuracy,
73 .quant_type =
s->mpeg_quant,
74 .quarter_sample =
s->quarter_sample,
75 .data_partitioned =
s->data_partitioning,
76 .reversible_vlc =
ctx->rvlc,
77 .resync_marker_disable = !
ctx->resync_marker,
79 .no_of_sprite_warping_points =
ctx->num_sprite_warping_points,
80 .quant_precision =
ctx->quant_precision,
83 .backward_reference_vop_coding_type =
85 .vop_rounding_type =
s->no_rounding,
87 .top_field_first =
s->top_field_first,
88 .alternate_vertical_scan_flag =
s->alternate_scan,
90 .vop_fcode_forward =
s->f_code,
91 .vop_fcode_backward =
s->b_code,
100 for (
i = 0;
i <
ctx->num_sprite_warping_points &&
i < 3;
i++) {
101 pic_param.sprite_trajectory_du[
i] =
ctx->sprite_traj[
i][0];
102 pic_param.sprite_trajectory_dv[
i] =
ctx->sprite_traj[
i][1];
111 VAPictureParameterBufferType,
112 &pic_param,
sizeof(pic_param));
117 if (pic_param.vol_fields.bits.quant_type) {
118 VAIQMatrixBufferMPEG4 iq_matrix;
120 iq_matrix.load_intra_quant_mat = 1;
121 iq_matrix.load_non_intra_quant_mat = 1;
123 for (
i = 0;
i < 64;
i++) {
125 iq_matrix.intra_quant_mat[
i] =
s->intra_matrix[n];
126 iq_matrix.non_intra_quant_mat[
i] =
s->inter_matrix[n];
130 VAIQMatrixBufferType,
131 &iq_matrix,
sizeof(iq_matrix));
162 VASliceParameterBufferMPEG4 slice_param;
165 slice_param = (VASliceParameterBufferMPEG4) {
166 .slice_data_size =
size,
167 .slice_data_offset = 0,
168 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
170 .macroblock_number = 0,
171 .quant_scale =
s->qscale,
175 &slice_param, 1,
sizeof(slice_param),
185 #if CONFIG_MPEG4_VAAPI_HWACCEL
187 .
p.
name =
"mpeg4_vaapi",
203 #if CONFIG_H263_VAAPI_HWACCEL
205 .
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
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 vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
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)
A reference to a data buffer.