49 VAPictureParameterBufferMPEG4 *pic_param;
50 VAIQMatrixBufferMPEG4 *iq_matrix;
53 ff_dlog(avctx,
"vaapi_mpeg4_start_frame()\n");
61 pic_param->vop_width = s->
width;
62 pic_param->vop_height = s->
height;
63 pic_param->forward_reference_picture = VA_INVALID_ID;
64 pic_param->backward_reference_picture = VA_INVALID_ID;
65 pic_param->vol_fields.value = 0;
67 pic_param->vol_fields.bits.chroma_format =
CHROMA_420;
69 pic_param->vol_fields.bits.obmc_disable = 1;
72 pic_param->vol_fields.bits.quant_type = s->
mpeg_quant;
75 pic_param->vol_fields.bits.reversible_vlc = ctx->
rvlc;
76 pic_param->vol_fields.bits.resync_marker_disable = !ctx->
resync_marker;
79 pic_param->sprite_trajectory_du[i] = ctx->
sprite_traj[i][0];
80 pic_param->sprite_trajectory_dv[i] = ctx->
sprite_traj[i][1];
83 pic_param->vop_fields.value = 0;
86 pic_param->vop_fields.bits.vop_rounding_type = s->
no_rounding;
89 pic_param->vop_fields.bits.alternate_vertical_scan_flag = s->
alternate_scan;
90 pic_param->vop_fcode_forward = s->
f_code;
91 pic_param->vop_fcode_backward = s->
b_code;
92 pic_param->vop_time_increment_resolution = avctx->
framerate.
num;
94 pic_param->num_gobs_in_vop = (s->
mb_width * s->
mb_height) / pic_param->num_macroblocks_in_gob;
105 if (pic_param->vol_fields.bits.quant_type) {
109 iq_matrix->load_intra_quant_mat = 1;
110 iq_matrix->load_non_intra_quant_mat = 1;
112 for (i = 0; i < 64; i++) {
124 VASliceParameterBufferMPEG4 *slice_param;
126 ff_dlog(avctx,
"vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
133 slice_param->macroblock_number = 0;
134 slice_param->quant_scale = s->
qscale;
139 #if CONFIG_MPEG4_VAAPI_HWACCEL
141 .
name =
"mpeg4_vaapi",
151 #if CONFIG_H263_VAAPI_HWACCEL
153 .
name =
"h263_vaapi",
uint16_t sprite_traj[4][2]
sprite trajectory points
const struct AVCodec * codec
int sprite_warping_accuracy
int resync_marker
could this stream contain resync markers
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
This structure is used to share data between the FFmpeg library and the client video application...
void * hwaccel_context
Hardware accelerator context.
int no_rounding
apply no rounding to motion compensation (MPEG4, msmpeg4, ...) for b-frames rounding mode is always 0...
static int get_bits_count(const GetBitContext *s)
uint16_t pp_time
time distance between the last 2 p,s,i frames
int mb_height
number of MBs horizontally & vertically
int intra_dc_threshold
QP above which the ac VLC should be used for intra dc.
static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
void * ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
Allocate a new picture parameter buffer.
int quarter_sample
1->qpel, 0->half pel ME/MC
enum AVPictureType pict_type
Picture type of the frame.
const char * name
Name of the hardware accelerated codec.
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
Extract VASurfaceID from an AVFrame.
unsigned int slice_param_size
Size of a VASliceParameterBuffer element.
uint8_t idct_permutation[64]
IDCT input permutation.
uint16_t inter_matrix[64]
main external API structure.
int height
picture size. must be a multiple of 16
VASliceParameterBufferBase * ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size)
Allocate a new slice descriptor for the input slice.
int data_partitioning
data partitioning flag from header
const uint8_t ff_zigzag_direct[64]
int f_code
forward MV resolution
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
static int mpeg4_get_intra_dc_vlc_thr(Mpeg4DecContext *s)
Reconstruct bitstream intra_dc_vlc_thr.
static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
common internal api header.
Picture last_picture
copy of the previous picture structure.
void * ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
Allocate a new IQ matrix buffer.
#define H263_GOB_HEIGHT(h)
Picture next_picture
copy of the next picture structure.
uint16_t intra_matrix[64]
matrix transmitted in the bitstream
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
int num_sprite_warping_points
int b_code
backward MV resolution for B Frames (mpeg4)
uint16_t pb_time
time distance between the last b and p,s,i frame