50 VAPictureParameterBufferMPEG4 *pic_param;
51 VAIQMatrixBufferMPEG4 *iq_matrix;
60 pic_param->vop_width = s->
width;
61 pic_param->vop_height = s->
height;
62 pic_param->forward_reference_picture = VA_INVALID_ID;
63 pic_param->backward_reference_picture = VA_INVALID_ID;
64 pic_param->vol_fields.value = 0;
66 pic_param->vol_fields.bits.chroma_format =
CHROMA_420;
68 pic_param->vol_fields.bits.obmc_disable = 1;
71 pic_param->vol_fields.bits.quant_type = s->
mpeg_quant;
74 pic_param->vol_fields.bits.reversible_vlc = ctx->
rvlc;
75 pic_param->vol_fields.bits.resync_marker_disable = !ctx->
resync_marker;
78 pic_param->sprite_trajectory_du[i] = ctx->
sprite_traj[i][0];
79 pic_param->sprite_trajectory_dv[i] = ctx->
sprite_traj[i][1];
82 pic_param->vop_fields.value = 0;
85 pic_param->vop_fields.bits.vop_rounding_type = s->
no_rounding;
88 pic_param->vop_fields.bits.alternate_vertical_scan_flag = s->
alternate_scan;
89 pic_param->vop_fcode_forward = s->
f_code;
90 pic_param->vop_fcode_backward = s->
b_code;
91 pic_param->vop_time_increment_resolution = avctx->
framerate.
num;
93 pic_param->num_gobs_in_vop = (s->
mb_width * s->
mb_height) / pic_param->num_macroblocks_in_gob;
104 if (pic_param->vol_fields.bits.quant_type) {
108 iq_matrix->load_intra_quant_mat = 1;
109 iq_matrix->load_non_intra_quant_mat = 1;
111 for (i = 0; i < 64; i++) {
124 VASliceParameterBufferMPEG4 *slice_param;
131 slice_param->macroblock_number = 0;
132 slice_param->quant_scale = s->
qscale;
137 #if CONFIG_MPEG4_VAAPI_HWACCEL
139 .
name =
"mpeg4_vaapi",
152 #if CONFIG_H263_VAAPI_HWACCEL
154 .
name =
"h263_vaapi",
VASliceParameterBufferBase * ff_vaapi_alloc_slice(FFVAContext *vactx, const uint8_t *buffer, uint32_t size)
Allocate a new slice descriptor for the input slice.
uint16_t sprite_traj[4][2]
sprite trajectory points
const struct AVCodec * codec
int ff_vaapi_context_fini(AVCodecContext *avctx)
Common AVHWAccel.uninit() implementation.
int sprite_warping_accuracy
int resync_marker
could this stream contain resync markers
unsigned int slice_param_size
Size of a slice parameter element.
int no_rounding
apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) for B-frames rounding mode is always ...
static int get_bits_count(const GetBitContext *s)
uint16_t pp_time
time distance between the last 2 p,s,i frames
void * ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size)
Allocate a new IQ matrix buffer.
static FFVAContext * ff_vaapi_get_context(AVCodecContext *avctx)
Extract vaapi_context from an AVCodecContext.
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)
int ff_vaapi_context_init(AVCodecContext *avctx)
Common AVHWAccel.init() implementation.
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.
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
int data_partitioning
data partitioning flag from header
const uint8_t ff_zigzag_direct[64]
int f_code
forward MV resolution
void * ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size)
Allocate a new picture parameter buffer.
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.
struct AVCodecContext * avctx
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.
#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 (MPEG-4)
uint16_t pb_time
time distance between the last b and p,s,i frame