Go to the documentation of this file.
23 #include "config_components.h"
119 switch (
s->pict_type) {
131 switch (
s->pict_type) {
239 const int bitplane_index = n / 2;
240 const int ff_bp_index = y *
stride + x;
243 v = ff_bp[0][ff_bp_index];
245 v |= ff_bp[1][ff_bp_index] << 1;
247 v |= ff_bp[2][ff_bp_index] << 2;
248 bitplane[bitplane_index] = (bitplane[bitplane_index] << 4) | v;
256 VAPictureParameterBufferVC1 pic_param;
261 pic_param = (VAPictureParameterBufferVC1) {
262 .forward_reference_picture = VA_INVALID_ID,
263 .backward_reference_picture = VA_INVALID_ID,
264 .inloop_decoded_picture = VA_INVALID_ID,
265 .sequence_fields.bits = {
275 .max_b_frames =
s->avctx->max_b_frames,
278 .coded_width =
s->avctx->coded_width,
279 .coded_height =
s->avctx->coded_height,
280 .entrypoint_fields.bits = {
284 .loopfilter =
s->loop_filter,
286 .conditional_overlap_flag = v->
condover,
288 .range_mapping_fields.bits = {
298 .rounding_control = v->
rnd,
300 .picture_resolution_index = v->
respic,
301 .picture_fields.bits = {
303 .frame_coding_mode = v->
fcm,
304 .top_field_first = v->
tff,
306 .intensity_compensation = v->
intcomp,
310 #if VA_CHECK_VERSION(1, 1, 0)
315 .raw_coding.flags = {
324 .bitplane_present.flags = {
333 .reference_fields.bits = {
335 .reference_distance = v->
refdist,
336 .num_reference_pictures = v->
numref,
337 .reference_field_pic_indicator = v->
reffield,
347 .extended_mv_range = v->
mvrange,
351 .pic_quantizer_fields.bits = {
355 .pic_quantizer_scale = v->
pq,
362 .alt_pic_quantizer = v->
altpq,
364 .transform_fields.bits = {
366 .mb_level_transform_type_flag = v->
ttmbf,
374 switch (
s->pict_type) {
384 VAPictureParameterBufferType,
385 &pic_param,
sizeof(pic_param));
389 if (pic_param.bitplane_present.value & 0x7f) {
391 const uint8_t *ff_bp[3];
393 size_t size = (
s->mb_width *
s->mb_height + 1) / 2;
401 switch (
s->pict_type) {
403 ff_bp[0] = pic_param.bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane :
NULL;
404 ff_bp[1] = pic_param.bitplane_present.flags.bp_skip_mb ?
s->mbskip_table :
NULL;
405 ff_bp[2] = pic_param.bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane :
NULL;
409 ff_bp[0] = pic_param.bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane :
NULL;
410 ff_bp[1] = pic_param.bitplane_present.flags.bp_skip_mb ?
s->mbskip_table :
NULL;
411 ff_bp[2] = pic_param.bitplane_present.flags.bp_forward_mb ? v->forward_mb_plane :
NULL;
416 ff_bp[0] = pic_param.bitplane_present.flags.bp_field_tx ? v->fieldtx_plane :
NULL;
417 ff_bp[1] = pic_param.bitplane_present.flags.bp_ac_pred ? v->acpred_plane :
NULL;
418 ff_bp[2] = pic_param.bitplane_present.flags.bp_overflags ? v->over_flags_plane :
NULL;
428 for (y = 0; y <
s->mb_height; y++)
429 for (x = 0; x <
s->mb_width; x++, n++)
435 VABitPlaneBufferType,
468 VASliceParameterBufferVC1 slice_param;
483 slice_param = (VASliceParameterBufferVC1) {
484 .slice_data_size =
size,
485 .slice_data_offset = 0,
486 .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
488 .slice_vertical_position =
s->mb_y % mb_height,
492 &slice_param, 1,
sizeof(slice_param),
502 #if CONFIG_WMV3_VAAPI_HWACCEL
504 .
p.
name =
"wmv3_vaapi",
521 .
p.
name =
"vc1_vaapi",
uint8_t lumscale2
for interlaced field P picture
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
@ PROGRESSIVE
in the bitstream is reported as 00b
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
int overlap
overlapped transforms in use
int interlace
Progressive/interlaced (RPTFTM syntax element)
uint8_t altpq
Current/alternate frame quantizer scale.
@ ILACE_FRAME
in the bitstream is reported as 10b
static int vc1_has_MVTYPEMB_bitplane(const VC1Context *v)
Check whether the MVTYPEMB bitplane is present.
static int get_bits_count(const GetBitContext *s)
AVHWAccel p
The public AVHWAccel.
@ MV_PMODE_1MV_HPEL_BILIN
int reffield
if numref = 0 (1 reference) then reffield decides which
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
@ MV_PMODE_INTENSITY_COMP
uint8_t dmvrange
Frame decoding info for interlaced picture.
uint8_t closed_entry
Closed entry point flag (CLOSED_ENTRY syntax element)
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
@ ILACE_FIELD
in the bitstream is reported as 11b
int multires
frame-level RESPIC syntax element present
static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
static int vc1_get_PTYPE(const VC1Context *v)
Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35)
static VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v)
Reconstruct bitstream MVMODE (7.1.1.32)
int numref
number of past field pictures used as reference
static int vc1_has_FIELDTX_bitplane(const VC1Context *v)
Check whether the FIELDTX bitplane is present.
int c_ac_table_index
AC coding set indexes.
int dquant
How qscale varies with MBs, 2 bits (not in Simple)
VASurfaceID output_surface
int refdist
distance of the current picture from reference
int ff_vaapi_decode_init(AVCodecContext *avctx)
int ff_vaapi_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
static int vc1_has_SKIPMB_bitplane(const VC1Context *v)
Check whether the SKIPMB bitplane is present.
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
MVModes
MV modes for P-frames.
static int vaapi_vc1_end_frame(AVCodecContext *avctx)
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
uint8_t mv_mode
Frame decoding info for all profiles.
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
int skip_is_raw
skip mb plane is not coded
uint8_t lumscale
Luma compensation parameters.
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
@ AV_PICTURE_TYPE_I
Intra.
int fmb_is_raw
forward mb plane is raw
static void vc1_pack_bitplanes(uint8_t *bitplane, int n, const uint8_t *ff_bp[3], int x, int y, int stride)
Pack FFmpeg bitplanes into a VABitPlaneBuffer element.
int resync_marker
could this stream contain resync markers
static int get_VAMvModeVC1(enum MVModes mv_mode)
Translate FFmpeg MV modes to VA API.
uint8_t halfpq
Uniform quant over image and qp+.5.
uint8_t ttmbf
Transform type flag.
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
static int vc1_has_DIRECTMB_bitplane(const VC1Context *v)
Check whether the DIRECTMB bitplane is present.
int intcompfield
which of the two fields to be intensity compensated
uint8_t mv_mode2
Secondary MV coding mode (B-frames)
int(* init)(AVBSFContext *ctx)
int ttfrm
Transform type info present at frame level.
static av_unused int vc1_get_LUMSHIFT2(const VC1Context *v)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
static av_unused int vc1_get_INTCOMPFIELD(const VC1Context *v)
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
uint8_t respic
Frame-level flag for resized images.
static int vc1_get_FPTYPE(const VC1Context *v)
Reconstruct bitstream FPTYPE (9.1.1.42, index into Table-105)
uint8_t broken_link
Broken link flag (BROKEN_LINK syntax element)
int tfcntrflag
TFCNTR present.
@ 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)
const FFHWAccel ff_vc1_vaapi_hwaccel
static int vc1_get_TTFRM(const VC1Context *v)
Reconstruct bitstream TTFRM (7.1.1.41, Table-53)
static av_unused int vc1_get_LUMSCALE2(const VC1Context *v)
int extended_mv
Ext MV in P/B (not in Simple)
static int vc1_get_LUMSCALE(const VC1Context *v)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int y_ac_table_index
Luma index from AC2FRM element.
uint8_t pquantizer
Uniform (over sequence) quantizer in use.
main external API structure.
uint8_t bfraction_lut_index
Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
static int vc1_has_ACPRED_bitplane(const VC1Context *v)
Check whether the ACPRED bitplane is present.
@ 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)
static int vc1_get_LUMSHIFT(const VC1Context *v)
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags.
int vstransform
variable-size [48]x[48] transform type + info
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
@ AV_PICTURE_TYPE_P
Predicted.
int mv_type_is_raw
mv type mb plane is not coded
int psf
Progressive Segmented Frame.
int broadcast
TFF/RFF present.
int dmb_is_raw
direct mb plane is raw
static int vc1_has_OVERFLAGS_bitplane(const VC1Context *v)
Check whether the OVERFLAGS bitplane is present.
int finterpflag
INTERPFRM present.
static VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v)
Reconstruct bitstream MVMODE2 (7.1.1.33)
uint8_t dquantfrm
pquant parameters
static int vc1_has_FORWARDMB_bitplane(const VC1Context *v)
Check whether the FORWARDMB bitplane is present.
static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
int quantizer_mode
2 bits, quantizer mode used for sequence, see QUANT_*
int extended_dmv
Additional extended dmv range at P/B-frame-level.
const struct FFHWAccel ff_wmv3_vaapi_hwaccel