FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 "internal.h"
24 #include "vaapi_decode.h"
25 #include "vc1.h"
26 #include "vc1data.h"
27 
28 /** Translate FFmpeg MV modes to VA API */
29 static int get_VAMvModeVC1(enum MVModes mv_mode)
30 {
31  switch (mv_mode) {
32  case MV_PMODE_1MV_HPEL_BILIN: return VAMvMode1MvHalfPelBilinear;
33  case MV_PMODE_1MV: return VAMvMode1Mv;
34  case MV_PMODE_1MV_HPEL: return VAMvMode1MvHalfPel;
35  case MV_PMODE_MIXED_MV: return VAMvModeMixedMv;
36  case MV_PMODE_INTENSITY_COMP: return VAMvModeIntensityCompensation;
37  }
38  return 0;
39 }
40 
41 /** Check whether the MVTYPEMB bitplane is present */
42 static inline int vc1_has_MVTYPEMB_bitplane(const VC1Context *v)
43 {
44  if (v->mv_type_is_raw)
45  return 0;
46  return v->s.pict_type == AV_PICTURE_TYPE_P &&
47  (v->mv_mode == MV_PMODE_MIXED_MV ||
50 }
51 
52 /** Check whether the SKIPMB bitplane is present */
53 static inline int vc1_has_SKIPMB_bitplane(const VC1Context *v)
54 {
55  if (v->skip_is_raw)
56  return 0;
57  return v->s.pict_type == AV_PICTURE_TYPE_P ||
58  (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type);
59 }
60 
61 /** Check whether the DIRECTMB bitplane is present */
62 static inline int vc1_has_DIRECTMB_bitplane(const VC1Context *v)
63 {
64  if (v->dmb_is_raw)
65  return 0;
66  return v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
67 }
68 
69 /** Check whether the ACPRED bitplane is present */
70 static inline int vc1_has_ACPRED_bitplane(const VC1Context *v)
71 {
72  if (v->acpred_is_raw)
73  return 0;
74  return v->profile == PROFILE_ADVANCED &&
75  (v->s.pict_type == AV_PICTURE_TYPE_I ||
76  (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type));
77 }
78 
79 /** Check whether the OVERFLAGS bitplane is present */
80 static inline int vc1_has_OVERFLAGS_bitplane(const VC1Context *v)
81 {
82  if (v->overflg_is_raw)
83  return 0;
84  return v->profile == PROFILE_ADVANCED &&
85  (v->s.pict_type == AV_PICTURE_TYPE_I ||
86  (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)) &&
87  (v->overlap && v->pq <= 8) &&
89 }
90 
91 /** Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35) */
92 static int vc1_get_PTYPE(const VC1Context *v)
93 {
94  const MpegEncContext *s = &v->s;
95  switch (s->pict_type) {
96  case AV_PICTURE_TYPE_I: return 0;
97  case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1;
98  case AV_PICTURE_TYPE_B: return v->bi_type ? 3 : 2;
99  }
100  return 0;
101 }
102 
103 /** Reconstruct bitstream MVMODE (7.1.1.32) */
104 static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v)
105 {
106  if (v->s.pict_type == AV_PICTURE_TYPE_P ||
107  (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type))
108  return get_VAMvModeVC1(v->mv_mode);
109  return 0;
110 }
111 
112 /** Reconstruct bitstream MVMODE2 (7.1.1.33) */
113 static inline VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v)
114 {
116  return get_VAMvModeVC1(v->mv_mode2);
117  return 0;
118 }
119 
120 /** Reconstruct bitstream TTFRM (7.1.1.41, Table-53) */
121 static inline int vc1_get_TTFRM(const VC1Context *v)
122 {
123  switch (v->ttfrm) {
124  case TT_8X8: return 0;
125  case TT_8X4: return 1;
126  case TT_4X8: return 2;
127  case TT_4X4: return 3;
128  }
129  return 0;
130 }
131 
132 /** Pack FFmpeg bitplanes into a VABitPlaneBuffer element */
133 static inline void vc1_pack_bitplanes(uint8_t *bitplane, int n, const uint8_t *ff_bp[3], int x, int y, int stride)
134 {
135  const int bitplane_index = n / 2;
136  const int ff_bp_index = y * stride + x;
137  uint8_t v = 0;
138  if (ff_bp[0])
139  v = ff_bp[0][ff_bp_index];
140  if (ff_bp[1])
141  v |= ff_bp[1][ff_bp_index] << 1;
142  if (ff_bp[2])
143  v |= ff_bp[2][ff_bp_index] << 2;
144  bitplane[bitplane_index] = (bitplane[bitplane_index] << 4) | v;
145 }
146 
148 {
149  const VC1Context *v = avctx->priv_data;
150  const MpegEncContext *s = &v->s;
152  VAPictureParameterBufferVC1 pic_param;
153  int err;
154 
156 
157  pic_param = (VAPictureParameterBufferVC1) {
158  .forward_reference_picture = VA_INVALID_ID,
159  .backward_reference_picture = VA_INVALID_ID,
160  .inloop_decoded_picture = VA_INVALID_ID,
161  .sequence_fields.bits = {
162  .pulldown = v->broadcast,
163  .interlace = v->interlace,
164  .tfcntrflag = v->tfcntrflag,
165  .finterpflag = v->finterpflag,
166  .psf = v->psf,
167  .multires = v->multires,
168  .overlap = v->overlap,
169  .syncmarker = v->resync_marker,
170  .rangered = v->rangered,
171  .max_b_frames = s->avctx->max_b_frames,
172  .profile = v->profile,
173  },
174  .coded_width = s->avctx->coded_width,
175  .coded_height = s->avctx->coded_height,
176  .entrypoint_fields.bits = {
177  .broken_link = v->broken_link,
178  .closed_entry = v->closed_entry,
179  .panscan_flag = v->panscanflag,
180  .loopfilter = s->loop_filter,
181  },
182  .conditional_overlap_flag = v->condover,
183  .fast_uvmc_flag = v->fastuvmc,
184  .range_mapping_fields.bits = {
185  .luma_flag = v->range_mapy_flag,
186  .luma = v->range_mapy,
187  .chroma_flag = v->range_mapuv_flag,
188  .chroma = v->range_mapuv,
189  },
190  .b_picture_fraction = v->bfraction_lut_index,
191  .cbp_table = v->cbpcy_vlc ? v->cbpcy_vlc - ff_vc1_cbpcy_p_vlc : 0,
192  .mb_mode_table = 0, /* XXX: interlaced frame */
193  .range_reduction_frame = v->rangeredfrm,
194  .rounding_control = v->rnd,
195  .post_processing = v->postproc,
196  .picture_resolution_index = v->respic,
197  .luma_scale = v->lumscale,
198  .luma_shift = v->lumshift,
199  .picture_fields.bits = {
200  .picture_type = vc1_get_PTYPE(v),
201  .frame_coding_mode = v->fcm,
202  .top_field_first = v->tff,
203  .is_first_field = v->fcm == 0, /* XXX: interlaced frame */
204  .intensity_compensation = v->mv_mode == MV_PMODE_INTENSITY_COMP,
205  },
206  .raw_coding.flags = {
207  .mv_type_mb = v->mv_type_is_raw,
208  .direct_mb = v->dmb_is_raw,
209  .skip_mb = v->skip_is_raw,
210  .field_tx = 0, /* XXX: interlaced frame */
211  .forward_mb = 0, /* XXX: interlaced frame */
212  .ac_pred = v->acpred_is_raw,
213  .overflags = v->overflg_is_raw,
214  },
215  .bitplane_present.flags = {
216  .bp_mv_type_mb = vc1_has_MVTYPEMB_bitplane(v),
217  .bp_direct_mb = vc1_has_DIRECTMB_bitplane(v),
218  .bp_skip_mb = vc1_has_SKIPMB_bitplane(v),
219  .bp_field_tx = 0, /* XXX: interlaced frame */
220  .bp_forward_mb = 0, /* XXX: interlaced frame */
221  .bp_ac_pred = vc1_has_ACPRED_bitplane(v),
222  .bp_overflags = vc1_has_OVERFLAGS_bitplane(v),
223  },
224  .reference_fields.bits = {
225  .reference_distance_flag = v->refdist_flag,
226  .reference_distance = 0, /* XXX: interlaced frame */
227  .num_reference_pictures = 0, /* XXX: interlaced frame */
228  .reference_field_pic_indicator = 0, /* XXX: interlaced frame */
229  },
230  .mv_fields.bits = {
231  .mv_mode = vc1_get_MVMODE(v),
232  .mv_mode2 = vc1_get_MVMODE2(v),
233  .mv_table = s->mv_table_index,
234  .two_mv_block_pattern_table = 0, /* XXX: interlaced frame */
235  .four_mv_switch = 0, /* XXX: interlaced frame */
236  .four_mv_block_pattern_table = 0, /* XXX: interlaced frame */
237  .extended_mv_flag = v->extended_mv,
238  .extended_mv_range = v->mvrange,
239  .extended_dmv_flag = v->extended_dmv,
240  .extended_dmv_range = 0, /* XXX: interlaced frame */
241  },
242  .pic_quantizer_fields.bits = {
243  .dquant = v->dquant,
244  .quantizer = v->quantizer_mode,
245  .half_qp = v->halfpq,
246  .pic_quantizer_scale = v->pq,
247  .pic_quantizer_type = v->pquantizer,
248  .dq_frame = v->dquantfrm,
249  .dq_profile = v->dqprofile,
250  .dq_sb_edge = v->dqprofile == DQPROFILE_SINGLE_EDGE ? v->dqsbedge : 0,
251  .dq_db_edge = v->dqprofile == DQPROFILE_DOUBLE_EDGES ? v->dqsbedge : 0,
252  .dq_binary_level = v->dqbilevel,
253  .alt_pic_quantizer = v->altpq,
254  },
255  .transform_fields.bits = {
256  .variable_sized_transform_flag = v->vstransform,
257  .mb_level_transform_type_flag = v->ttmbf,
258  .frame_level_transform_type = vc1_get_TTFRM(v),
259  .transform_ac_codingset_idx1 = v->c_ac_table_index,
260  .transform_ac_codingset_idx2 = v->y_ac_table_index,
261  .intra_transform_dc_table = v->s.dc_table_index,
262  },
263  };
264 
265  switch (s->pict_type) {
266  case AV_PICTURE_TYPE_B:
267  pic_param.backward_reference_picture = ff_vaapi_get_surface_id(s->next_picture.f);
268  // fall-through
269  case AV_PICTURE_TYPE_P:
270  pic_param.forward_reference_picture = ff_vaapi_get_surface_id(s->last_picture.f);
271  break;
272  }
273 
274  err = ff_vaapi_decode_make_param_buffer(avctx, pic,
275  VAPictureParameterBufferType,
276  &pic_param, sizeof(pic_param));
277  if (err)
278  goto fail;
279 
280  if (pic_param.bitplane_present.value) {
281  uint8_t *bitplane;
282  const uint8_t *ff_bp[3];
283  int x, y, n;
284  size_t size = (s->mb_width * s->mb_height + 1) / 2;
285 
286  bitplane = av_mallocz(size);
287  if (!bitplane) {
288  err = AVERROR(ENOMEM);
289  goto fail;
290  }
291 
292  switch (s->pict_type) {
293  case AV_PICTURE_TYPE_P:
294  ff_bp[0] = pic_param.bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
295  ff_bp[1] = pic_param.bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL;
296  ff_bp[2] = pic_param.bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane : NULL;
297  break;
298  case AV_PICTURE_TYPE_B:
299  if (!v->bi_type) {
300  ff_bp[0] = pic_param.bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
301  ff_bp[1] = pic_param.bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL;
302  ff_bp[2] = NULL; /* XXX: interlaced frame (FORWARD plane) */
303  break;
304  }
305  /* fall-through (BI-type) */
306  case AV_PICTURE_TYPE_I:
307  ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */
308  ff_bp[1] = pic_param.bitplane_present.flags.bp_ac_pred ? v->acpred_plane : NULL;
309  ff_bp[2] = pic_param.bitplane_present.flags.bp_overflags ? v->over_flags_plane : NULL;
310  break;
311  default:
312  ff_bp[0] = NULL;
313  ff_bp[1] = NULL;
314  ff_bp[2] = NULL;
315  break;
316  }
317 
318  n = 0;
319  for (y = 0; y < s->mb_height; y++)
320  for (x = 0; x < s->mb_width; x++, n++)
321  vc1_pack_bitplanes(bitplane, n, ff_bp, x, y, s->mb_stride);
322  if (n & 1) /* move last nibble to the high order */
323  bitplane[n/2] <<= 4;
324 
325  err = ff_vaapi_decode_make_param_buffer(avctx, pic,
326  VABitPlaneBufferType,
327  bitplane, size);
328  av_free(bitplane);
329  if (err)
330  goto fail;
331  }
332  return 0;
333 
334 fail:
335  ff_vaapi_decode_cancel(avctx, pic);
336  return err;
337 }
338 
340 {
341  VC1Context *v = avctx->priv_data;
342  MpegEncContext *s = &v->s;
344  int ret;
345 
346  ret = ff_vaapi_decode_issue(avctx, pic);
347  if (ret < 0)
348  goto fail;
349 
351 
352 fail:
353  return ret;
354 }
355 
356 static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
357 {
358  const VC1Context *v = avctx->priv_data;
359  const MpegEncContext *s = &v->s;
361  VASliceParameterBufferVC1 slice_param;
362  int err;
363 
364  /* Current bit buffer is beyond any marker for VC-1, so skip it */
365  if (avctx->codec_id == AV_CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {
366  buffer += 4;
367  size -= 4;
368  }
369 
370  slice_param = (VASliceParameterBufferVC1) {
371  .slice_data_size = size,
372  .slice_data_offset = 0,
373  .slice_data_flag = VA_SLICE_DATA_FLAG_ALL,
374  .macroblock_offset = get_bits_count(&s->gb),
375  .slice_vertical_position = s->mb_y,
376  };
377 
378  err = ff_vaapi_decode_make_slice_buffer(avctx, pic,
379  &slice_param, sizeof(slice_param),
380  buffer, size);
381  if (err < 0) {
382  ff_vaapi_decode_cancel(avctx, pic);
383  return err;
384  }
385 
386  return 0;
387 }
388 
389 #if CONFIG_WMV3_VAAPI_HWACCEL
390 AVHWAccel ff_wmv3_vaapi_hwaccel = {
391  .name = "wmv3_vaapi",
392  .type = AVMEDIA_TYPE_VIDEO,
393  .id = AV_CODEC_ID_WMV3,
394  .pix_fmt = AV_PIX_FMT_VAAPI,
395  .start_frame = &vaapi_vc1_start_frame,
396  .end_frame = &vaapi_vc1_end_frame,
397  .decode_slice = &vaapi_vc1_decode_slice,
398  .frame_priv_data_size = sizeof(VAAPIDecodePicture),
401  .priv_data_size = sizeof(VAAPIDecodeContext),
402 };
403 #endif
404 
406  .name = "vc1_vaapi",
407  .type = AVMEDIA_TYPE_VIDEO,
408  .id = AV_CODEC_ID_VC1,
409  .pix_fmt = AV_PIX_FMT_VAAPI,
410  .start_frame = &vaapi_vc1_start_frame,
411  .end_frame = &vaapi_vc1_end_frame,
412  .decode_slice = &vaapi_vc1_decode_slice,
413  .frame_priv_data_size = sizeof(VAAPIDecodePicture),
416  .priv_data_size = sizeof(VAAPIDecodeContext),
417 };
#define NULL
Definition: coverity.c:32
uint8_t bfraction_lut_index
Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
Definition: vc1.h:389
int p_frame_skipped
Definition: vc1.h:380
const char * s
Definition: avisynth_c.h:768
The VC1 Context.
Definition: vc1.h:173
static int vc1_get_PTYPE(const VC1Context *v)
Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35)
Definition: vaapi_vc1.c:92
int coded_width
Bitstream width / height, may be different from width/height e.g.
Definition: avcodec.h:1889
int mv_type_is_raw
mv type mb plane is not coded
Definition: vc1.h:289
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, int type, const void *data, size_t size)
Definition: vaapi_decode.c:27
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...
Definition: avcodec.h:1973
int extended_mv
Ext MV in P/B (not in Simple)
Definition: vc1.h:223
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
Definition: vaapi_decode.h:35
int broadcast
TFF/RFF present.
Definition: vc1.h:200
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
Definition: vc1.h:302
static int vc1_has_SKIPMB_bitplane(const VC1Context *v)
Check whether the SKIPMB bitplane is present.
Definition: vaapi_vc1.c:53
static int vc1_has_DIRECTMB_bitplane(const VC1Context *v)
Check whether the DIRECTMB bitplane is present.
Definition: vaapi_vc1.c:62
uint8_t dqprofile
Definition: vc1.h:246
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:252
MVModes
MV modes for P-frames.
Definition: vc1.h:78
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
Definition: vc1.h:222
uint8_t dqsbedge
Definition: vc1.h:247
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
Definition: mpegvideo.c:2734
uint8_t * acpred_plane
AC prediction flags bitplane.
Definition: vc1.h:321
VC-1 tables.
int bi_type
Definition: vc1.h:381
int ff_vaapi_decode_uninit(AVCodecContext *avctx)
Definition: vaapi_decode.c:517
uint8_t
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:287
static int vc1_has_OVERFLAGS_bitplane(const VC1Context *v)
Check whether the OVERFLAGS bitplane is present.
Definition: vaapi_vc1.c:80
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
Definition: vc1.h:203
int ff_vaapi_decode_issue(AVCodecContext *avctx, VAAPIDecodePicture *pic)
Definition: vaapi_decode.c:148
VLC ff_vc1_cbpcy_p_vlc[4]
Definition: vc1data.c:119
int interlace
Progressive/interlaced (RPTFTM syntax element)
Definition: vc1.h:201
int y_ac_table_index
Luma index from AC2FRM element.
Definition: vc1.h:255
int c_ac_table_index
AC coding set indexes.
Definition: vc1.h:254
int ttfrm
Transform type info present at frame level.
Definition: vc1.h:257
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
Definition: bytestream.h:87
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags...
Definition: vc1.h:218
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:199
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
Definition: vc1.h:204
int mb_height
number of MBs horizontally & vertically
Definition: mpegvideo.h:126
ptrdiff_t size
Definition: opengl_enc.c:101
uint8_t * over_flags_plane
Overflags bitplane.
Definition: vc1.h:323
uint8_t dqbilevel
Definition: vc1.h:248
static int vc1_has_ACPRED_bitplane(const VC1Context *v)
Check whether the ACPRED bitplane is present.
Definition: vaapi_vc1.c:70
int psf
Progressive Segmented Frame.
Definition: vc1.h:211
uint8_t ttmbf
Transform type flag.
Definition: vc1.h:258
Definition: vc1.h:119
static int get_VAMvModeVC1(enum MVModes mv_mode)
Translate FFmpeg MV modes to VA API.
Definition: vaapi_vc1.c:29
int dmb_is_raw
direct mb plane is raw
Definition: vc1.h:290
int overlap
overlapped transforms in use
Definition: vc1.h:226
#define AVERROR(e)
Definition: error.h:43
static int vaapi_vc1_end_frame(AVCodecContext *avctx)
Definition: vaapi_vc1.c:339
#define IS_MARKER(state)
Definition: dca_parser.c:49
GetBitContext gb
Definition: mpegvideo.h:445
int resync_marker
could this stream contain resync markers
Definition: vc1.h:396
uint8_t broken_link
Broken link flag (BROKEN_LINK syntax element)
Definition: vc1.h:390
#define fail()
Definition: checkasm.h:84
static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: vaapi_vc1.c:356
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:3746
int ff_vaapi_decode_init(AVCodecContext *avctx)
Definition: vaapi_decode.c:421
int tfcntrflag
TFCNTR present.
Definition: vc1.h:202
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:193
uint8_t mv_mode
Frame decoding info for all profiles.
Definition: vc1.h:233
Picture * current_picture_ptr
pointer to the current picture
Definition: mpegvideo.h:181
void * hwaccel_picture_private
Hardware accelerator private data.
Definition: mpegpicture.h:77
uint8_t lumscale
Luma compensation parameters.
Definition: vc1.h:269
uint8_t range_mapuv_flag
Definition: vc1.h:329
int n
Definition: avisynth_c.h:684
uint8_t closed_entry
Closed entry point flag (CLOSED_ENTRY syntax element)
Definition: vc1.h:391
static VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v)
Reconstruct bitstream MVMODE (7.1.1.32)
Definition: vaapi_vc1.c:104
VLC * cbpcy_vlc
CBPCY VLC table.
Definition: vc1.h:284
VASurfaceID output_surface
Definition: vaapi_decode.h:45
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
Definition: vc1.h:189
static VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v)
Reconstruct bitstream MVMODE2 (7.1.1.33)
Definition: vaapi_vc1.c:113
int finterpflag
INTERPFRM present.
Definition: vc1.h:228
enum AVCodecID codec_id
Definition: avcodec.h:1704
int multires
frame-level RESPIC syntax element present
Definition: vc1.h:186
main external API structure.
Definition: avcodec.h:1687
uint8_t range_mapy
Definition: vc1.h:330
int extended_dmv
Additional extended dmv range at P/B-frame-level.
Definition: vc1.h:205
int coded_height
Definition: avcodec.h:1889
Definition: vc1.h:115
struct AVFrame * f
Definition: mpegpicture.h:46
uint8_t respic
Frame-level flag for resized images.
Definition: vc1.h:274
int skip_is_raw
skip mb plane is not coded
Definition: vc1.h:292
int quantizer_mode
2 bits, quantizer mode used for sequence, see QUANT_*
Definition: vc1.h:227
static int vc1_has_MVTYPEMB_bitplane(const VC1Context *v)
Check whether the MVTYPEMB bitplane is present.
Definition: vaapi_vc1.c:42
uint8_t * direct_mb_plane
bitplane for "direct" MBs
Definition: vc1.h:287
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:282
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
Definition: mpegvideo.h:209
int ff_vaapi_decode_cancel(AVCodecContext *avctx, VAAPIDecodePicture *pic)
Definition: vaapi_decode.c:220
uint8_t * mv_type_mb_plane
bitplane for mv_type == (4MV)
Definition: vc1.h:286
int vstransform
variable-size [48]x[48] transform type + info
Definition: vc1.h:225
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:133
uint8_t range_mapuv
Definition: vc1.h:331
uint8_t tff
Definition: vc1.h:311
MpegEncContext s
Definition: vc1.h:174
MpegEncContext.
Definition: mpegvideo.h:78
struct AVCodecContext * avctx
Definition: mpegvideo.h:95
uint8_t pq
Definition: vc1.h:238
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:105
common internal api header.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
Definition: mpegvideo.h:127
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
Definition: vc1.h:308
Picture last_picture
copy of the previous picture structure.
Definition: mpegvideo.h:159
uint8_t dquantfrm
pquant parameters
Definition: vc1.h:245
uint8_t lumshift
Definition: vc1.h:270
Bi-dir predicted.
Definition: avutil.h:276
uint8_t postproc
Definition: vc1.h:317
uint8_t condover
Definition: vc1.h:325
void * priv_data
Definition: avcodec.h:1729
uint8_t pquantizer
Uniform (over sequence) quantizer in use.
Definition: vc1.h:283
#define av_free(p)
int rnd
rounding control
Definition: vc1.h:298
Definition: vc1.h:118
int acpred_is_raw
Definition: vc1.h:322
Picture next_picture
copy of the next picture structure.
Definition: mpegvideo.h:165
int overflg_is_raw
Definition: vc1.h:324
AVHWAccel ff_vc1_vaapi_hwaccel
Definition: vaapi_vc1.c:405
Definition: vc1.h:112
static int vc1_get_TTFRM(const VC1Context *v)
Reconstruct bitstream TTFRM (7.1.1.41, Table-53)
Definition: vaapi_vc1.c:121
uint8_t range_mapy_flag
Definition: vc1.h:328
int dquant
How qscale varies with MBs, 2 bits (not in Simple)
Definition: vc1.h:224
uint8_t mv_mode2
Secondary MV coding mode (B-frames)
Definition: vc1.h:234
static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: vaapi_vc1.c:147
int mv_table_index
Definition: mpegvideo.h:427
int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, VAAPIDecodePicture *pic, const void *params_data, size_t params_size, const void *slice_data, size_t slice_size)
Definition: vaapi_decode.c:56
int dc_table_index
Definition: mpegvideo.h:430
uint8_t halfpq
Uniform quant over image and qp+.5.
Definition: vc1.h:273
Predicted.
Definition: avutil.h:275
GLuint buffer
Definition: opengl_enc.c:102
#define av_unused
Definition: attributes.h:126
uint8_t altpq
Current/alternate frame quantizer scale.
Definition: vc1.h:238