vaapi_vc1.c
Go to the documentation of this file.
1 /*
2  * VC-1 HW decode acceleration through VA API
3  *
4  * Copyright (C) 2008-2009 Splitted-Desktop Systems
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include "vaapi_internal.h"
24 #include "vc1.h"
25 #include "vc1data.h"
26 
27 /** Translate FFmpeg MV modes to VA API */
28 static int get_VAMvModeVC1(enum MVModes mv_mode)
29 {
30  switch (mv_mode) {
31  case MV_PMODE_1MV_HPEL_BILIN: return VAMvMode1MvHalfPelBilinear;
32  case MV_PMODE_1MV: return VAMvMode1Mv;
33  case MV_PMODE_1MV_HPEL: return VAMvMode1MvHalfPel;
34  case MV_PMODE_MIXED_MV: return VAMvModeMixedMv;
35  case MV_PMODE_INTENSITY_COMP: return VAMvModeIntensityCompensation;
36  }
37  return 0;
38 }
39 
40 /** Check whether the MVTYPEMB bitplane is present */
42 {
43  if (v->mv_type_is_raw)
44  return 0;
45  return v->s.pict_type == AV_PICTURE_TYPE_P &&
46  (v->mv_mode == MV_PMODE_MIXED_MV ||
49 }
50 
51 /** Check whether the SKIPMB bitplane is present */
53 {
54  if (v->skip_is_raw)
55  return 0;
56  return v->s.pict_type == AV_PICTURE_TYPE_P ||
57  (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type);
58 }
59 
60 /** Check whether the DIRECTMB bitplane is present */
62 {
63  if (v->dmb_is_raw)
64  return 0;
65  return v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
66 }
67 
68 /** Check whether the ACPRED bitplane is present */
70 {
71  if (v->acpred_is_raw)
72  return 0;
73  return v->profile == PROFILE_ADVANCED &&
74  (v->s.pict_type == AV_PICTURE_TYPE_I ||
75  (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type));
76 }
77 
78 /** Check whether the OVERFLAGS bitplane is present */
80 {
81  if (v->overflg_is_raw)
82  return 0;
83  return v->profile == PROFILE_ADVANCED &&
84  (v->s.pict_type == AV_PICTURE_TYPE_I ||
85  (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)) &&
86  (v->overlap && v->pq <= 8) &&
88 }
89 
90 /** Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35) */
92 {
93  MpegEncContext * const s = &v->s;
94  switch (s->pict_type) {
95  case AV_PICTURE_TYPE_I: return 0;
96  case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1;
97  case AV_PICTURE_TYPE_B: return v->bi_type ? 3 : 2;
98  }
99  return 0;
100 }
101 
102 /** Reconstruct bitstream MVMODE (7.1.1.32) */
103 static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v)
104 {
105  if (v->s.pict_type == AV_PICTURE_TYPE_P ||
106  (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type))
107  return get_VAMvModeVC1(v->mv_mode);
108  return 0;
109 }
110 
111 /** Reconstruct bitstream MVMODE2 (7.1.1.33) */
112 static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v)
113 {
115  return get_VAMvModeVC1(v->mv_mode2);
116  return 0;
117 }
118 
119 /** Reconstruct bitstream TTFRM (7.1.1.41, Table-53) */
120 static inline int vc1_get_TTFRM(VC1Context *v)
121 {
122  switch (v->ttfrm) {
123  case TT_8X8: return 0;
124  case TT_8X4: return 1;
125  case TT_4X8: return 2;
126  case TT_4X4: return 3;
127  }
128  return 0;
129 }
130 
131 /** Pack FFmpeg bitplanes into a VABitPlaneBuffer element */
132 static inline void vc1_pack_bitplanes(uint8_t *bitplane, int n, const uint8_t *ff_bp[3], int x, int y, int stride)
133 {
134  const int bitplane_index = n / 2;
135  const int ff_bp_index = y * stride + x;
136  uint8_t v = 0;
137  if (ff_bp[0])
138  v = ff_bp[0][ff_bp_index];
139  if (ff_bp[1])
140  v |= ff_bp[1][ff_bp_index] << 1;
141  if (ff_bp[2])
142  v |= ff_bp[2][ff_bp_index] << 2;
143  bitplane[bitplane_index] = (bitplane[bitplane_index] << 4) | v;
144 }
145 
147 {
148  VC1Context * const v = avctx->priv_data;
149  MpegEncContext * const s = &v->s;
150  struct vaapi_context * const vactx = avctx->hwaccel_context;
151  VAPictureParameterBufferVC1 *pic_param;
152 
153  av_dlog(avctx, "vaapi_vc1_start_frame()\n");
154 
155  vactx->slice_param_size = sizeof(VASliceParameterBufferVC1);
156 
157  /* Fill in VAPictureParameterBufferVC1 */
158  pic_param = ff_vaapi_alloc_pic_param(vactx, sizeof(VAPictureParameterBufferVC1));
159  if (!pic_param)
160  return -1;
161  pic_param->forward_reference_picture = VA_INVALID_ID;
162  pic_param->backward_reference_picture = VA_INVALID_ID;
163  pic_param->inloop_decoded_picture = VA_INVALID_ID;
164  pic_param->sequence_fields.value = 0; /* reset all bits */
165  pic_param->sequence_fields.bits.pulldown = v->broadcast;
166  pic_param->sequence_fields.bits.interlace = v->interlace;
167  pic_param->sequence_fields.bits.tfcntrflag = v->tfcntrflag;
168  pic_param->sequence_fields.bits.finterpflag = v->finterpflag;
169  pic_param->sequence_fields.bits.psf = v->psf;
170  pic_param->sequence_fields.bits.multires = v->multires;
171  pic_param->sequence_fields.bits.overlap = v->overlap;
172  pic_param->sequence_fields.bits.syncmarker = s->resync_marker;
173  pic_param->sequence_fields.bits.rangered = v->rangered;
174  pic_param->sequence_fields.bits.max_b_frames = s->avctx->max_b_frames;
175 #if VA_CHECK_VERSION(0,32,0)
176  pic_param->sequence_fields.bits.profile = v->profile;
177 #endif
178  pic_param->coded_width = s->avctx->coded_width;
179  pic_param->coded_height = s->avctx->coded_height;
180  pic_param->entrypoint_fields.value = 0; /* reset all bits */
181  pic_param->entrypoint_fields.bits.broken_link = v->broken_link;
182  pic_param->entrypoint_fields.bits.closed_entry = v->closed_entry;
183  pic_param->entrypoint_fields.bits.panscan_flag = v->panscanflag;
184  pic_param->entrypoint_fields.bits.loopfilter = s->loop_filter;
185  pic_param->conditional_overlap_flag = v->condover;
186  pic_param->fast_uvmc_flag = v->fastuvmc;
187  pic_param->range_mapping_fields.value = 0; /* reset all bits */
188  pic_param->range_mapping_fields.bits.luma_flag = v->range_mapy_flag;
189  pic_param->range_mapping_fields.bits.luma = v->range_mapy;
190  pic_param->range_mapping_fields.bits.chroma_flag = v->range_mapuv_flag;
191  pic_param->range_mapping_fields.bits.chroma = v->range_mapuv;
192  pic_param->b_picture_fraction = v->bfraction_lut_index;
193  pic_param->cbp_table = v->cbpcy_vlc ? v->cbpcy_vlc - ff_vc1_cbpcy_p_vlc : 0;
194  pic_param->mb_mode_table = 0; /* XXX: interlaced frame */
195  pic_param->range_reduction_frame = v->rangeredfrm;
196  pic_param->rounding_control = v->rnd;
197  pic_param->post_processing = v->postproc;
198  pic_param->picture_resolution_index = v->respic;
199  pic_param->luma_scale = v->lumscale;
200  pic_param->luma_shift = v->lumshift;
201  pic_param->picture_fields.value = 0; /* reset all bits */
202  pic_param->picture_fields.bits.picture_type = vc1_get_PTYPE(v);
203  pic_param->picture_fields.bits.frame_coding_mode = v->fcm;
204  pic_param->picture_fields.bits.top_field_first = v->tff;
205  pic_param->picture_fields.bits.is_first_field = v->fcm == 0; /* XXX: interlaced frame */
206  pic_param->picture_fields.bits.intensity_compensation = v->mv_mode == MV_PMODE_INTENSITY_COMP;
207  pic_param->raw_coding.value = 0; /* reset all bits */
208  pic_param->raw_coding.flags.mv_type_mb = v->mv_type_is_raw;
209  pic_param->raw_coding.flags.direct_mb = v->dmb_is_raw;
210  pic_param->raw_coding.flags.skip_mb = v->skip_is_raw;
211  pic_param->raw_coding.flags.field_tx = 0; /* XXX: interlaced frame */
212  pic_param->raw_coding.flags.forward_mb = 0; /* XXX: interlaced frame */
213  pic_param->raw_coding.flags.ac_pred = v->acpred_is_raw;
214  pic_param->raw_coding.flags.overflags = v->overflg_is_raw;
215  pic_param->bitplane_present.value = 0; /* reset all bits */
216  pic_param->bitplane_present.flags.bp_mv_type_mb = vc1_has_MVTYPEMB_bitplane(v);
217  pic_param->bitplane_present.flags.bp_direct_mb = vc1_has_DIRECTMB_bitplane(v);
218  pic_param->bitplane_present.flags.bp_skip_mb = vc1_has_SKIPMB_bitplane(v);
219  pic_param->bitplane_present.flags.bp_field_tx = 0; /* XXX: interlaced frame */
220  pic_param->bitplane_present.flags.bp_forward_mb = 0; /* XXX: interlaced frame */
221  pic_param->bitplane_present.flags.bp_ac_pred = vc1_has_ACPRED_bitplane(v);
222  pic_param->bitplane_present.flags.bp_overflags = vc1_has_OVERFLAGS_bitplane(v);
223  pic_param->reference_fields.value = 0; /* reset all bits */
224  pic_param->reference_fields.bits.reference_distance_flag = v->refdist_flag;
225  pic_param->reference_fields.bits.reference_distance = 0; /* XXX: interlaced frame */
226  pic_param->reference_fields.bits.num_reference_pictures = 0; /* XXX: interlaced frame */
227  pic_param->reference_fields.bits.reference_field_pic_indicator = 0; /* XXX: interlaced frame */
228  pic_param->mv_fields.value = 0; /* reset all bits */
229  pic_param->mv_fields.bits.mv_mode = vc1_get_MVMODE(v);
230  pic_param->mv_fields.bits.mv_mode2 = vc1_get_MVMODE2(v);
231  pic_param->mv_fields.bits.mv_table = s->mv_table_index;
232  pic_param->mv_fields.bits.two_mv_block_pattern_table = 0; /* XXX: interlaced frame */
233  pic_param->mv_fields.bits.four_mv_switch = 0; /* XXX: interlaced frame */
234  pic_param->mv_fields.bits.four_mv_block_pattern_table = 0; /* XXX: interlaced frame */
235  pic_param->mv_fields.bits.extended_mv_flag = v->extended_mv;
236  pic_param->mv_fields.bits.extended_mv_range = v->mvrange;
237  pic_param->mv_fields.bits.extended_dmv_flag = v->extended_dmv;
238  pic_param->mv_fields.bits.extended_dmv_range = 0; /* XXX: interlaced frame */
239  pic_param->pic_quantizer_fields.value = 0; /* reset all bits */
240  pic_param->pic_quantizer_fields.bits.dquant = v->dquant;
241  pic_param->pic_quantizer_fields.bits.quantizer = v->quantizer_mode;
242  pic_param->pic_quantizer_fields.bits.half_qp = v->halfpq;
243  pic_param->pic_quantizer_fields.bits.pic_quantizer_scale = v->pq;
244  pic_param->pic_quantizer_fields.bits.pic_quantizer_type = v->pquantizer;
245  pic_param->pic_quantizer_fields.bits.dq_frame = v->dquantfrm;
246  pic_param->pic_quantizer_fields.bits.dq_profile = v->dqprofile;
247  pic_param->pic_quantizer_fields.bits.dq_sb_edge = v->dqprofile == DQPROFILE_SINGLE_EDGE ? v->dqsbedge : 0;
248  pic_param->pic_quantizer_fields.bits.dq_db_edge = v->dqprofile == DQPROFILE_DOUBLE_EDGES ? v->dqsbedge : 0;
249  pic_param->pic_quantizer_fields.bits.dq_binary_level = v->dqbilevel;
250  pic_param->pic_quantizer_fields.bits.alt_pic_quantizer = v->altpq;
251  pic_param->transform_fields.value = 0; /* reset all bits */
252  pic_param->transform_fields.bits.variable_sized_transform_flag = v->vstransform;
253  pic_param->transform_fields.bits.mb_level_transform_type_flag = v->ttmbf;
254  pic_param->transform_fields.bits.frame_level_transform_type = vc1_get_TTFRM(v);
255  pic_param->transform_fields.bits.transform_ac_codingset_idx1 = v->c_ac_table_index;
256  pic_param->transform_fields.bits.transform_ac_codingset_idx2 = v->y_ac_table_index;
257  pic_param->transform_fields.bits.intra_transform_dc_table = v->s.dc_table_index;
258 
259  switch (s->pict_type) {
260  case AV_PICTURE_TYPE_B:
261  pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
262  // fall-through
263  case AV_PICTURE_TYPE_P:
264  pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
265  break;
266  }
267 
268  if (pic_param->bitplane_present.value) {
269  uint8_t *bitplane;
270  const uint8_t *ff_bp[3];
271  int x, y, n;
272 
273  switch (s->pict_type) {
274  case AV_PICTURE_TYPE_P:
275  ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
276  ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL;
277  ff_bp[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane : NULL;
278  break;
279  case AV_PICTURE_TYPE_B:
280  if (!v->bi_type) {
281  ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
282  ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL;
283  ff_bp[2] = NULL; /* XXX: interlaced frame (FORWARD plane) */
284  break;
285  }
286  /* fall-through (BI-type) */
287  case AV_PICTURE_TYPE_I:
288  ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */
289  ff_bp[1] = pic_param->bitplane_present.flags.bp_ac_pred ? v->acpred_plane : NULL;
290  ff_bp[2] = pic_param->bitplane_present.flags.bp_overflags ? v->over_flags_plane : NULL;
291  break;
292  default:
293  ff_bp[0] = NULL;
294  ff_bp[1] = NULL;
295  ff_bp[2] = NULL;
296  break;
297  }
298 
299  bitplane = ff_vaapi_alloc_bitplane(vactx, (s->mb_width * s->mb_height + 1) / 2);
300  if (!bitplane)
301  return -1;
302 
303  n = 0;
304  for (y = 0; y < s->mb_height; y++)
305  for (x = 0; x < s->mb_width; x++, n++)
306  vc1_pack_bitplanes(bitplane, n, ff_bp, x, y, s->mb_stride);
307  if (n & 1) /* move last nibble to the high order */
308  bitplane[n/2] <<= 4;
309  }
310  return 0;
311 }
312 
313 static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
314 {
315  VC1Context * const v = avctx->priv_data;
316  MpegEncContext * const s = &v->s;
317  VASliceParameterBufferVC1 *slice_param;
318 
319  av_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
320 
321  /* Current bit buffer is beyond any marker for VC-1, so skip it */
322  if (avctx->codec_id == AV_CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {
323  buffer += 4;
324  size -= 4;
325  }
326 
327  /* Fill in VASliceParameterBufferVC1 */
328  slice_param = (VASliceParameterBufferVC1 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);
329  if (!slice_param)
330  return -1;
331  slice_param->macroblock_offset = get_bits_count(&s->gb);
332  slice_param->slice_vertical_position = s->mb_y;
333  return 0;
334 }
335 
336 #if CONFIG_WMV3_VAAPI_HWACCEL
337 AVHWAccel ff_wmv3_vaapi_hwaccel = {
338  .name = "wmv3_vaapi",
339  .type = AVMEDIA_TYPE_VIDEO,
340  .id = AV_CODEC_ID_WMV3,
341  .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
342  .start_frame = vaapi_vc1_start_frame,
343  .end_frame = ff_vaapi_mpeg_end_frame,
344  .decode_slice = vaapi_vc1_decode_slice,
345 };
346 #endif
347 
349  .name = "vc1_vaapi",
350  .type = AVMEDIA_TYPE_VIDEO,
351  .id = AV_CODEC_ID_VC1,
352  .pix_fmt = AV_PIX_FMT_VAAPI_VLD,
353  .start_frame = vaapi_vc1_start_frame,
354  .end_frame = ff_vaapi_mpeg_end_frame,
355  .decode_slice = vaapi_vc1_decode_slice,
356 };
float v
uint8_t bfraction_lut_index
Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
Definition: vc1.h:394
int p_frame_skipped
Definition: vc1.h:385
const char * s
Definition: avisynth_c.h:668
The VC1 Context.
Definition: vc1.h:182
int coded_width
Bitstream width / height, may be different from width/height e.g.
int mv_type_is_raw
mv type mb plane is not coded
Definition: vc1.h:295
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
int extended_mv
Ext MV in P/B (not in Simple)
Definition: vc1.h:229
int broadcast
TFF/RFF present.
Definition: vc1.h:209
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
Definition: vc1.h:305
HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the b...
Definition: pixfmt.h:126
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
uint8_t dqprofile
Definition: vc1.h:252
This structure is used to share data between the FFmpeg library and the client video application...
Definition: vaapi.h:50
static int vc1_has_ACPRED_bitplane(VC1Context *v)
Check whether the ACPRED bitplane is present.
Definition: vaapi_vc1.c:69
MVModes
MV modes for P frames.
Definition: vc1.h:102
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
Definition: vc1.h:228
int stride
Definition: mace.c:144
uint8_t dqsbedge
Definition: vc1.h:253
static int vc1_get_PTYPE(VC1Context *v)
Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35)
Definition: vaapi_vc1.c:91
uint8_t * acpred_plane
AC prediction flags bitplane.
Definition: vc1.h:324
VC-1 tables.
int bi_type
Definition: vc1.h:386
uint8_t
void * hwaccel_context
Hardware accelerator context.
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
Definition: vc1.h:212
VLC ff_vc1_cbpcy_p_vlc[4]
Definition: vc1data.c:119
#define AV_RB32
int interlace
Progressive/interlaced (RPTFTM syntax element)
Definition: vc1.h:210
int y_ac_table_index
Luma index from AC2FRM element.
Definition: vc1.h:261
int c_ac_table_index
AC coding set indexes.
Definition: vc1.h:260
int ttfrm
Transform type info present at frame level.
Definition: vc1.h:263
int resync_marker
could this stream contain resync markers
Definition: mpegvideo.h:591
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags...
Definition: vc1.h:224
static int vc1_has_DIRECTMB_bitplane(VC1Context *v)
Check whether the DIRECTMB bitplane is present.
Definition: vaapi_vc1.c:61
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:193
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
Definition: vc1.h:213
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:277
uint8_t * over_flags_plane
Overflags bitplane.
Definition: vc1.h:326
uint8_t dqbilevel
Definition: vc1.h:254
int psf
Progressive Segmented Frame.
Definition: vc1.h:217
uint8_t ttmbf
Transform type flag.
Definition: vc1.h:264
Definition: vc1.h:143
static int get_VAMvModeVC1(enum MVModes mv_mode)
Translate FFmpeg MV modes to VA API.
Definition: vaapi_vc1.c:28
Discrete Time axis x
int dmb_is_raw
direct mb plane is raw
Definition: vc1.h:296
int overlap
overlapped transforms in use
Definition: vc1.h:232
void * ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
Allocate a new picture parameter buffer.
Definition: vaapi.c:133
static int vc1_has_OVERFLAGS_bitplane(VC1Context *v)
Check whether the OVERFLAGS bitplane is present.
Definition: vaapi_vc1.c:79
#define IS_MARKER(state, i, buf, buf_size)
Definition: dca_parser.c:37
GetBitContext gb
Definition: mpegvideo.h:649
uint8_t broken_link
Broken link flag (BROKEN_LINK syntax element)
Definition: vc1.h:395
int size
static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vaapi_vc1.c:313
const char * name
Name of the hardware accelerated codec.
static int vc1_has_SKIPMB_bitplane(VC1Context *v)
Check whether the SKIPMB bitplane is present.
Definition: vaapi_vc1.c:52
int tfcntrflag
TFCNTR present.
Definition: vc1.h:211
uint8_t * mbskip_table
used to avoid copy if macroblock skipped (for black regions for example) and used for b-frame encodin...
Definition: mpegvideo.h:359
uint8_t mv_mode
Frame decoding info for all profiles.
Definition: vc1.h:239
static int vc1_get_TTFRM(VC1Context *v)
Reconstruct bitstream TTFRM (7.1.1.41, Table-53)
Definition: vaapi_vc1.c:120
unsigned int slice_param_size
Size of a VASliceParameterBuffer element.
Definition: vaapi.h:137
uint8_t lumscale
Luma compensation parameters.
Definition: vc1.h:275
static VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v)
Reconstruct bitstream MVMODE2 (7.1.1.33)
Definition: vaapi_vc1.c:112
uint8_t range_mapuv_flag
Definition: vc1.h:332
uint8_t closed_entry
Closed entry point flag (CLOSED_ENTRY syntax element)
Definition: vc1.h:396
static VAMvModeVC1 vc1_get_MVMODE(VC1Context *v)
Reconstruct bitstream MVMODE (7.1.1.32)
Definition: vaapi_vc1.c:103
VLC * cbpcy_vlc
CBPCY VLC table.
Definition: vc1.h:290
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
Definition: vc1.h:198
int finterpflag
INTERPFRM present.
Definition: vc1.h:234
NULL
Definition: eval.c:55
enum AVCodecID codec_id
AVHWAccel.
static int vc1_has_MVTYPEMB_bitplane(VC1Context *v)
Check whether the MVTYPEMB bitplane is present.
Definition: vaapi_vc1.c:41
int multires
frame-level RESPIC syntax element present
Definition: vc1.h:195
main external API structure.
uint8_t range_mapy
Definition: vc1.h:333
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.
Definition: vaapi.c:148
int extended_dmv
Additional extended dmv range at P/B frame-level.
Definition: vc1.h:214
Definition: vc1.h:139
uint8_t respic
Frame-level flag for resized images.
Definition: vc1.h:280
int skip_is_raw
skip mb plane is not coded
Definition: vc1.h:298
int quantizer_mode
2bits, quantizer mode used for sequence, see QUANT_*
Definition: vc1.h:233
uint8_t * direct_mb_plane
bitplane for "direct" MBs
Definition: vc1.h:293
uint8_t mvrange
Ranges:0 -> [-64n 63.f] x [-32, 31.f]1 -> [-128, 127.f] x [-64, 63.f]2 -> [-512, 511.f] x [-128, 127.f]3 -> [-1024, 1023.f] x [-256, 255.f].
Definition: vc1.h:288
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:377
uint8_t * mv_type_mb_plane
bitplane for mv_type == (4MV)
Definition: vc1.h:292
int vstransform
variable-size [48]x[48] transform type + info
Definition: vc1.h:231
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.
Definition: vaapi_vc1.c:132
uint8_t range_mapuv
Definition: vc1.h:334
uint8_t tff
Definition: vc1.h:314
MpegEncContext s
Definition: vc1.h:183
MpegEncContext.
Definition: mpegvideo.h:241
struct AVCodecContext * avctx
Definition: mpegvideo.h:243
uint8_t pq
Definition: vc1.h:244
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
Definition: mpegvideo.h:278
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
Definition: vc1.h:311
Picture last_picture
copy of the previous picture structure.
Definition: mpegvideo.h:325
uint8_t dquantfrm
pquant parameters
Definition: vc1.h:251
uint8_t lumshift
Definition: vc1.h:276
Bi-dir predicted.
Definition: avutil.h:218
the buffer and buffer 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 AVFilterBuffer structures They must not be accessed but through references stored in AVFilterBufferRef structures Several references can point to the same buffer
function y
Definition: D.m:1
static VASurfaceID ff_vaapi_get_surface_id(Picture *pic)
Extract VASurfaceID from a Picture.
uint8_t postproc
Definition: vc1.h:320
uint8_t condover
Definition: vc1.h:328
uint8_t pquantizer
Uniform (over sequence) quantizer in use.
Definition: vc1.h:289
int rnd
rounding control
Definition: vc1.h:301
Definition: vc1.h:142
int acpred_is_raw
Definition: vc1.h:325
Picture next_picture
copy of the next picture structure.
Definition: mpegvideo.h:331
uint8_t * ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
Allocate a new bit-plane buffer.
Definition: vaapi.c:143
int overflg_is_raw
Definition: vc1.h:327
AVHWAccel ff_vc1_vaapi_hwaccel
Definition: vaapi_vc1.c:348
Definition: vc1.h:136
uint8_t range_mapy_flag
Definition: vc1.h:331
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
Definition: vaapi.c:197
int dquant
How qscale varies with MBs, 2bits (not in Simple)
Definition: vc1.h:230
uint8_t mv_mode2
Secondary MV coding mode (B frames)
Definition: vc1.h:240
static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vaapi_vc1.c:146
int mv_table_index
Definition: mpegvideo.h:631
int dc_table_index
Definition: mpegvideo.h:634
uint8_t halfpq
Uniform quant over image and qp+.5.
Definition: vc1.h:279
Predicted.
Definition: avutil.h:217
#define av_unused
Definition: attributes.h:114
uint8_t altpq
Current/alternate frame quantizer scale.
Definition: vc1.h:244