50 VAPictureParameterBufferMPEG4 *pic_param;
51 VAIQMatrixBufferMPEG4 *iq_matrix;
54 ff_dlog(avctx,
"vaapi_mpeg4_start_frame()\n");
62 pic_param->vop_width = s->
width;
63 pic_param->vop_height = s->
height;
64 pic_param->forward_reference_picture = VA_INVALID_ID;
65 pic_param->backward_reference_picture = VA_INVALID_ID;
66 pic_param->vol_fields.value = 0;
68 pic_param->vol_fields.bits.chroma_format =
CHROMA_420;
70 pic_param->vol_fields.bits.obmc_disable = 1;
73 pic_param->vol_fields.bits.quant_type = s->
mpeg_quant;
76 pic_param->vol_fields.bits.reversible_vlc = ctx->
rvlc;
77 pic_param->vol_fields.bits.resync_marker_disable = !ctx->
resync_marker;
80 pic_param->sprite_trajectory_du[i] = ctx->
sprite_traj[i][0];
81 pic_param->sprite_trajectory_dv[i] = ctx->
sprite_traj[i][1];
84 pic_param->vop_fields.value = 0;
87 pic_param->vop_fields.bits.vop_rounding_type = s->
no_rounding;
90 pic_param->vop_fields.bits.alternate_vertical_scan_flag = s->
alternate_scan;
91 pic_param->vop_fcode_forward = s->
f_code;
92 pic_param->vop_fcode_backward = s->
b_code;
93 pic_param->vop_time_increment_resolution = avctx->
framerate.
num;
95 pic_param->num_gobs_in_vop = (s->
mb_width * s->
mb_height) / pic_param->num_macroblocks_in_gob;
106 if (pic_param->vol_fields.bits.quant_type) {
110 iq_matrix->load_intra_quant_mat = 1;
111 iq_matrix->load_non_intra_quant_mat = 1;
113 for (i = 0; i < 64; i++) {
126 VASliceParameterBufferMPEG4 *slice_param;
128 ff_dlog(avctx,
"vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
135 slice_param->macroblock_number = 0;
136 slice_param->quant_scale = s->
qscale;
141 #if CONFIG_MPEG4_VAAPI_HWACCEL
143 .
name =
"mpeg4_vaapi",
156 #if CONFIG_H263_VAAPI_HWACCEL
158 .
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 (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
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 (mpeg4)
uint16_t pb_time
time distance between the last b and p,s,i frame