FFmpeg
Loading...
Searching...
No Matches
dxva2_vc1.c
Go to the documentation of this file.
1/*
2 * DXVA2 WMV3/VC-1 HW acceleration.
3 *
4 * copyright (c) 2010 Laurent Aimar
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 "config_components.h"
24
25#include "dxva2_internal.h"
26#include "hwaccel_internal.h"
27#include "mpegutils.h"
28#include "mpegvideodec.h"
29#include "vc1.h"
30#include "vc1data.h"
31
32#define MAX_SLICES 1024
33
35 DXVA_PictureParameters pp;
36 unsigned slice_count;
37 DXVA_SliceInfo slice[MAX_SLICES];
38
39 const uint8_t *bitstream;
40 unsigned bitstream_size;
41};
42
45 DXVA_PictureParameters *pp)
46{
47 const VC1Context *v = avctx->priv_data;
48 const MpegEncContext *s = &v->s;
49 const MPVPicture *current_picture = s->cur_pic.ptr;
50 int intcomp = 0;
51
52 // determine if intensity compensation is needed
53 if (s->pict_type == AV_PICTURE_TYPE_P) {
54 if ((v->fcm == ILACE_FRAME && v->intcomp) || (v->fcm != ILACE_FRAME && v->mv_mode == MV_PMODE_INTENSITY_COMP)) {
55 if (v->lumscale != 32 || v->lumshift != 0 || (s->picture_structure != PICT_FRAME && (v->lumscale2 != 32 || v->lumshift2 != 0)))
56 intcomp = 1;
57 }
58 }
59
60 memset(pp, 0, sizeof(*pp));
61 if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr)
62 pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0);
63 else
64 pp->wForwardRefPictureIndex = 0xffff;
65 if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr)
66 pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0);
67 else
68 pp->wBackwardRefPictureIndex = 0xffff;
69 pp->wDecodedPictureIndex =
70 pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f, 1);
71 if (v->profile == PROFILE_ADVANCED) {
72 /* It is the cropped width/height -1 of the frame */
73 pp->wPicWidthInMBminus1 = avctx->width - 1;
74 pp->wPicHeightInMBminus1= avctx->height - 1;
75 } else {
76 /* It is the coded width/height in macroblock -1 of the frame */
77 pp->wPicWidthInMBminus1 = s->mb_width - 1;
78 pp->wPicHeightInMBminus1= s->mb_height - 1;
79 }
80 pp->bMacroblockWidthMinus1 = 15;
81 pp->bMacroblockHeightMinus1 = 15;
82 pp->bBlockWidthMinus1 = 7;
83 pp->bBlockHeightMinus1 = 7;
84 pp->bBPPminus1 = 7;
85 if (s->picture_structure & PICT_TOP_FIELD)
86 pp->bPicStructure |= 0x01;
87 if (s->picture_structure & PICT_BOTTOM_FIELD)
88 pp->bPicStructure |= 0x02;
89 pp->bSecondField = v->interlace && v->fcm == ILACE_FIELD && v->second_field;
90 pp->bPicIntra = s->pict_type == AV_PICTURE_TYPE_I || v->bi_type;
91 pp->bPicBackwardPrediction = s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
92 pp->bBidirectionalAveragingMode = (1 << 7) |
93 ((DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) != 0) << 6) |
94 ((DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) != 0) << 5) |
95 (intcomp << 4) |
96 ((v->profile == PROFILE_ADVANCED) << 3);
97 pp->bMVprecisionAndChromaRelation = ((v->mv_mode == MV_PMODE_1MV_HPEL_BILIN) << 3) |
98 (1 << 2) |
99 (0 << 1) |
100 (!s->quarter_sample );
101 pp->bChromaFormat = v->chromaformat;
102 DXVA_CONTEXT_REPORT_ID(avctx, ctx)++;
103 if (DXVA_CONTEXT_REPORT_ID(avctx, ctx) >= (1 << 16))
104 DXVA_CONTEXT_REPORT_ID(avctx, ctx) = 1;
105 pp->bPicScanFixed = DXVA_CONTEXT_REPORT_ID(avctx, ctx) >> 8;
106 pp->bPicScanMethod = DXVA_CONTEXT_REPORT_ID(avctx, ctx) & 0xff;
107 pp->bPicReadbackRequests = 0;
108 pp->bRcontrol = v->rnd;
109 pp->bPicSpatialResid8 = (v->panscanflag << 7) |
110 (v->refdist_flag << 6) |
111 (v->loop_filter << 5) |
112 (v->fastuvmc << 4) |
113 (v->extended_mv << 3) |
114 (v->dquant << 1) |
115 (v->vstransform );
116 pp->bPicOverflowBlocks = (v->quantizer_mode << 6) |
117 (v->multires << 5) |
118 (v->resync_marker << 4) |
119 (v->rangered << 3) |
120 (v->max_b_frames );
121 pp->bPicExtrapolation = (!v->interlace || v->fcm == PROGRESSIVE) ? 1 : 2;
122 pp->bPicDeblocked = ((!pp->bPicBackwardPrediction && v->overlap) << 6) |
123 ((v->profile != PROFILE_ADVANCED && v->rangeredfrm) << 5) |
124 (v->loop_filter << 1);
125 pp->bPicDeblockConfined = (v->postprocflag << 7) |
126 (v->broadcast << 6) |
127 (v->interlace << 5) |
128 (v->tfcntrflag << 4) |
129 (v->finterpflag << 3) |
130 ((s->pict_type != AV_PICTURE_TYPE_B) << 2) |
131 (v->psf << 1) |
132 (v->extended_dmv );
133 if (s->pict_type != AV_PICTURE_TYPE_I)
134 pp->bPic4MVallowed = v->mv_mode == MV_PMODE_MIXED_MV ||
137 if (v->profile == PROFILE_ADVANCED)
138 pp->bPicOBMC = (v->range_mapy_flag << 7) |
139 (v->range_mapy << 4) |
140 (v->range_mapuv_flag << 3) |
141 (v->range_mapuv );
142 pp->bPicBinPB = 0;
143 pp->bMV_RPS = (v->fcm == ILACE_FIELD && pp->bPicBackwardPrediction) ? v->refdist + 9 : 0;
144 pp->bReservedBits = v->pq;
145 if (s->picture_structure == PICT_FRAME) {
146 if (intcomp) {
147 pp->wBitstreamFcodes = v->lumscale;
148 pp->wBitstreamPCEelements = v->lumshift;
149 } else {
150 pp->wBitstreamFcodes = 32;
151 pp->wBitstreamPCEelements = 0;
152 }
153 } else {
154 /* Syntax: (top_field_param << 8) | bottom_field_param */
155 if (intcomp) {
156 pp->wBitstreamFcodes = (v->lumscale << 8) | v->lumscale2;
157 pp->wBitstreamPCEelements = (v->lumshift << 8) | v->lumshift2;
158 } else {
159 pp->wBitstreamFcodes = (32 << 8) | 32;
160 pp->wBitstreamPCEelements = 0;
161 }
162 }
163 pp->bBitstreamConcealmentNeed = 0;
164 pp->bBitstreamConcealmentMethod = 0;
165}
166
167void ff_dxva2_vc1_fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice,
168 unsigned position, unsigned size)
169{
170 const VC1Context *v = avctx->priv_data;
171 const MpegEncContext *s = &v->s;
172
173 memset(slice, 0, sizeof(*slice));
174 slice->wHorizontalPosition = 0;
175 slice->wVerticalPosition = s->mb_y;
176 slice->dwSliceBitsInBuffer = 8 * size;
177 slice->dwSliceDataLocation = position;
178 slice->bStartCodeBitOffset = 0;
179 slice->bReservedBits = (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type) ? v->bfraction_lut_index + 9 : 0;
180 slice->wMBbitOffset = v->p_frame_skipped ? 0xffff : get_bits_count(&v->gb) + (avctx->codec_id == AV_CODEC_ID_VC1 ? 32 : 0);
181 /* XXX We store the index of the first MB and it will be fixed later */
182 slice->wNumberMBsInSlice = (s->mb_y >> v->field_mode) * s->mb_width + s->mb_x;
183 slice->wQuantizerScaleCode = v->pq;
184 slice->wBadSliceChopping = 0;
185}
186
190{
191 const VC1Context *v = avctx->priv_data;
193 const MpegEncContext *s = &v->s;
194 struct dxva2_picture_context *ctx_pic = s->cur_pic.ptr->hwaccel_picture_private;
195
196 static const uint8_t start_code[] = { 0, 0, 1, 0x0d };
197 const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0;
198 const unsigned mb_count = s->mb_width * (s->mb_height >> v->field_mode);
199 DXVA_SliceInfo *slice = NULL;
200 void *dxva_data_ptr = NULL;
201 uint8_t *dxva_data, *current, *end;
202 unsigned dxva_size;
203 unsigned padding;
204 unsigned i;
205 unsigned type;
206
207#if CONFIG_D3D11VA
208 if (ff_dxva2_is_d3d11(avctx)) {
209 type = D3D11_VIDEO_DECODER_BUFFER_BITSTREAM;
210 if (FAILED(ID3D11VideoContext_GetDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context,
212 type,
213 &dxva_size, &dxva_data_ptr)))
214 return -1;
215 }
216#endif
217#if CONFIG_DXVA2
218 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) {
219 type = DXVA2_BitStreamDateBufferType;
220 if (FAILED(IDirectXVideoDecoder_GetBuffer(DXVA2_CONTEXT(ctx)->decoder,
221 type,
222 &dxva_data_ptr, &dxva_size)))
223 return -1;
224 }
225#endif
226
227 if (!dxva_data_ptr)
228 return -1;
229
230 dxva_data = dxva_data_ptr;
231 current = dxva_data;
232 end = dxva_data + dxva_size;
233
234 for (i = 0; i < ctx_pic->slice_count; i++) {
235 unsigned position, size;
236 slice = &ctx_pic->slice[i];
237 position = slice->dwSliceDataLocation;
238 size = slice->dwSliceBitsInBuffer / 8;
239 if (start_code_size + size > end - current) {
240 av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream");
241 break;
242 }
243 slice->dwSliceDataLocation = current - dxva_data;
244
246 slice->wNumberMBsInSlice =
247 slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
248 else
249 slice->wNumberMBsInSlice =
250 mb_count - slice[0].wNumberMBsInSlice;
251
252 /* write the appropriate frame, field or slice start code */
253 if (start_code_size) {
254 memcpy(current, start_code, start_code_size);
255 if (i == 0 && v->second_field)
256 current[3] = 0x0c;
257 else if (i > 0)
258 current[3] = 0x0b;
259
260 current += start_code_size;
261 slice->dwSliceBitsInBuffer += start_code_size * 8;
262 }
263
264 memcpy(current, &ctx_pic->bitstream[position], size);
265 current += size;
266 }
267 padding = FFMIN(128 - ((current - dxva_data) & 127), end - current);
268 if (slice && padding > 0) {
269 memset(current, 0, padding);
270 current += padding;
271 slice->dwSliceBitsInBuffer += padding * 8;
272 }
273
274#if CONFIG_D3D11VA
275 if (ff_dxva2_is_d3d11(avctx))
276 if (FAILED(ID3D11VideoContext_ReleaseDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type)))
277 return -1;
278#endif
279#if CONFIG_DXVA2
280 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD)
281 if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(DXVA2_CONTEXT(ctx)->decoder, type)))
282 return -1;
283#endif
285 return -1;
286
287#if CONFIG_D3D11VA
288 if (ff_dxva2_is_d3d11(avctx)) {
289 D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = bs;
290 memset(dsc11, 0, sizeof(*dsc11));
291 dsc11->BufferType = type;
292 dsc11->DataSize = current - dxva_data;
293 dsc11->NumMBsInBuffer = mb_count;
294
295 type = D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL;
296 }
297#endif
298#if CONFIG_DXVA2
299 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) {
300 DXVA2_DecodeBufferDesc *dsc2 = bs;
301 memset(dsc2, 0, sizeof(*dsc2));
302 dsc2->CompressedBufferType = type;
303 dsc2->DataSize = current - dxva_data;
304 dsc2->NumMBsInBuffer = mb_count;
305
306 type = DXVA2_SliceControlBufferType;
307 }
308#endif
309
310 return ff_dxva2_commit_buffer(avctx, ctx, sc,
311 type,
312 ctx_pic->slice,
313 ctx_pic->slice_count * sizeof(*ctx_pic->slice),
314 mb_count);
315}
316
318 av_unused const AVBufferRef *buffer_ref,
319 av_unused const uint8_t *buffer,
320 av_unused uint32_t size)
321{
322 const VC1Context *v = avctx->priv_data;
325
326 if (!DXVA_CONTEXT_VALID(avctx, ctx))
327 return -1;
328 av_assert0(ctx_pic);
329
331
332 ctx_pic->slice_count = 0;
333 ctx_pic->bitstream_size = 0;
334 ctx_pic->bitstream = NULL;
335 return 0;
336}
337
339 const uint8_t *buffer,
340 uint32_t size)
341{
342 const VC1Context *v = avctx->priv_data;
343 const MPVPicture *current_picture = v->s.cur_pic.ptr;
344 struct dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
345 unsigned position;
346
347 if (ctx_pic->slice_count >= MAX_SLICES) {
348 avpriv_request_sample(avctx, "%d slices in dxva2",
349 ctx_pic->slice_count);
350 return -1;
351 }
352
353 if (avctx->codec_id == AV_CODEC_ID_VC1 &&
354 size >= 4 && IS_MARKER(AV_RB32(buffer))) {
355 buffer += 4;
356 size -= 4;
357 }
358
359 if (!ctx_pic->bitstream)
360 ctx_pic->bitstream = buffer;
361 ctx_pic->bitstream_size += size;
362
363 position = buffer - ctx_pic->bitstream;
364 ff_dxva2_vc1_fill_slice(avctx, &ctx_pic->slice[ctx_pic->slice_count++], position, size);
365 return 0;
366}
367
369{
370 VC1Context *v = avctx->priv_data;
372 int ret;
373
374 if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
375 return -1;
376
377 ret = ff_dxva2_common_end_frame(avctx, v->s.cur_pic.ptr->f,
378 &ctx_pic->pp, sizeof(ctx_pic->pp),
379 NULL, 0,
381 return ret;
382}
383
384#if CONFIG_WMV3_DXVA2_HWACCEL
386 .p.name = "wmv3_dxva2",
387 .p.type = AVMEDIA_TYPE_VIDEO,
388 .p.id = AV_CODEC_ID_WMV3,
389 .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD,
390 .init = ff_dxva2_decode_init,
391 .uninit = ff_dxva2_decode_uninit,
392 .start_frame = dxva2_vc1_start_frame,
393 .decode_slice = dxva2_vc1_decode_slice,
394 .end_frame = dxva2_vc1_end_frame,
395 .frame_params = ff_dxva2_common_frame_params,
396 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
397 .priv_data_size = sizeof(FFDXVASharedContext),
398};
399#endif
400
401#if CONFIG_VC1_DXVA2_HWACCEL
403 .p.name = "vc1_dxva2",
404 .p.type = AVMEDIA_TYPE_VIDEO,
405 .p.id = AV_CODEC_ID_VC1,
406 .p.pix_fmt = AV_PIX_FMT_DXVA2_VLD,
407 .init = ff_dxva2_decode_init,
408 .uninit = ff_dxva2_decode_uninit,
409 .start_frame = dxva2_vc1_start_frame,
410 .decode_slice = dxva2_vc1_decode_slice,
411 .end_frame = dxva2_vc1_end_frame,
412 .frame_params = ff_dxva2_common_frame_params,
413 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
414 .priv_data_size = sizeof(FFDXVASharedContext),
415};
416#endif
417
418#if CONFIG_WMV3_D3D11VA_HWACCEL
420 .p.name = "wmv3_d3d11va",
421 .p.type = AVMEDIA_TYPE_VIDEO,
422 .p.id = AV_CODEC_ID_WMV3,
423 .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD,
424 .init = ff_dxva2_decode_init,
425 .uninit = ff_dxva2_decode_uninit,
426 .start_frame = dxva2_vc1_start_frame,
427 .decode_slice = dxva2_vc1_decode_slice,
428 .end_frame = dxva2_vc1_end_frame,
429 .frame_params = ff_dxva2_common_frame_params,
430 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
431 .priv_data_size = sizeof(FFDXVASharedContext),
432};
433#endif
434
435#if CONFIG_WMV3_D3D11VA2_HWACCEL
437 .p.name = "wmv3_d3d11va2",
438 .p.type = AVMEDIA_TYPE_VIDEO,
439 .p.id = AV_CODEC_ID_WMV3,
440 .p.pix_fmt = AV_PIX_FMT_D3D11,
441 .init = ff_dxva2_decode_init,
442 .uninit = ff_dxva2_decode_uninit,
443 .start_frame = dxva2_vc1_start_frame,
444 .decode_slice = dxva2_vc1_decode_slice,
445 .end_frame = dxva2_vc1_end_frame,
446 .frame_params = ff_dxva2_common_frame_params,
447 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
448 .priv_data_size = sizeof(FFDXVASharedContext),
449};
450#endif
451
452#if CONFIG_VC1_D3D11VA_HWACCEL
454 .p.name = "vc1_d3d11va",
455 .p.type = AVMEDIA_TYPE_VIDEO,
456 .p.id = AV_CODEC_ID_VC1,
457 .p.pix_fmt = AV_PIX_FMT_D3D11VA_VLD,
458 .init = ff_dxva2_decode_init,
459 .uninit = ff_dxva2_decode_uninit,
460 .start_frame = dxva2_vc1_start_frame,
461 .decode_slice = dxva2_vc1_decode_slice,
462 .end_frame = dxva2_vc1_end_frame,
463 .frame_params = ff_dxva2_common_frame_params,
464 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
465 .priv_data_size = sizeof(FFDXVASharedContext),
466};
467#endif
468
469#if CONFIG_VC1_D3D11VA2_HWACCEL
471 .p.name = "vc1_d3d11va2",
472 .p.type = AVMEDIA_TYPE_VIDEO,
473 .p.id = AV_CODEC_ID_VC1,
474 .p.pix_fmt = AV_PIX_FMT_D3D11,
475 .init = ff_dxva2_decode_init,
476 .uninit = ff_dxva2_decode_uninit,
477 .start_frame = dxva2_vc1_start_frame,
478 .decode_slice = dxva2_vc1_decode_slice,
479 .end_frame = dxva2_vc1_end_frame,
480 .frame_params = ff_dxva2_common_frame_params,
481 .frame_priv_data_size = sizeof(struct dxva2_picture_context),
482 .priv_data_size = sizeof(FFDXVASharedContext),
483};
484#endif
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define NULL
Definition coverity.c:32
#define MAX_SLICES
#define IS_MARKER(state)
Definition dca_parser.c:52
int ff_dxva2_is_d3d11(const AVCodecContext *avctx)
Definition dxva2.c:1068
unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, AVDXVAContext *ctx, const AVFrame *frame, int curr)
Definition dxva2.c:783
int ff_dxva2_decode_init(AVCodecContext *avctx)
Definition dxva2.c:668
int ff_dxva2_commit_buffer(AVCodecContext *avctx, AVDXVAContext *ctx, DECODER_BUFFER_DESC *dsc, unsigned type, const void *data, unsigned size, unsigned mb_count)
Definition dxva2.c:814
int ff_dxva2_decode_uninit(AVCodecContext *avctx)
Definition dxva2.c:743
int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, const void *pp, unsigned pp_size, const void *qm, unsigned qm_size, int(*commit_bs_si)(AVCodecContext *, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *slice))
Definition dxva2.c:903
int ff_dxva2_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Definition dxva2.c:602
static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *sc)
Definition dxva2_av1.c:351
#define DXVA_CONTEXT(avctx)
#define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx)
#define DXVA2_CONTEXT(ctx)
#define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx)
#define D3D11VA_CONTEXT(ctx)
#define DXVA_CONTEXT_REPORT_ID(avctx, ctx)
#define DXVA_CONTEXT_VALID(avctx, ctx)
void DECODER_BUFFER_DESC
static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *sc)
Definition dxva2_vc1.c:187
static int dxva2_vc1_start_frame(AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition dxva2_vc1.c:317
static int dxva2_vc1_end_frame(AVCodecContext *avctx)
Definition dxva2_vc1.c:368
void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp)
Definition dxva2_vc1.c:43
static int dxva2_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition dxva2_vc1.c:338
void ff_dxva2_vc1_fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, unsigned size)
Definition dxva2_vc1.c:167
static struct @111144215057303131116103221376075045141373005341 current
static int get_bits_count(const GetBitContext *s)
Definition get_bits.h:254
@ AV_CODEC_ID_VC1
Definition codec_id.h:120
@ AV_CODEC_ID_WMV3
Definition codec_id.h:121
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ AV_PICTURE_TYPE_I
Intra.
Definition avutil.h:278
@ AV_PICTURE_TYPE_P
Predicted.
Definition avutil.h:279
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition avutil.h:280
const struct FFHWAccel ff_wmv3_dxva2_hwaccel
const struct FFHWAccel ff_vc1_dxva2_hwaccel
const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel
const struct FFHWAccel ff_wmv3_d3d11va_hwaccel
const struct FFHWAccel ff_vc1_d3d11va_hwaccel
const struct FFHWAccel ff_vc1_d3d11va2_hwaccel
cl_device_type type
#define AV_RB32(p)
static const chunk_decoder decoder[8]
Definition dfa.c:331
#define av_unused
Definition attributes.h:164
#define FFMIN(a, b)
Definition macros.h:49
#define PICT_TOP_FIELD
Definition mpegutils.h:31
#define PICT_BOTTOM_FIELD
Definition mpegutils.h:32
#define PICT_FRAME
Definition mpegutils.h:33
mpegvideo decoder header.
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
Definition pixfmt.h:134
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition pixfmt.h:336
@ AV_PIX_FMT_D3D11VA_VLD
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
Definition pixfmt.h:254
A reference to a data buffer.
Definition buffer.h:82
main external API structure.
Definition avcodec.h:443
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition avcodec.h:643
int width
picture width / height.
Definition avcodec.h:604
enum AVCodecID codec_id
Definition avcodec.h:453
void * priv_data
Definition avcodec.h:470
MPVPicture.
Definition mpegpicture.h:58
struct AVFrame * f
Definition mpegpicture.h:59
void * hwaccel_picture_private
RefStruct reference for hardware accelerator private data.
Definition mpegpicture.h:75
MPVPicture * ptr
RefStruct reference.
Definition mpegpicture.h:99
MpegEncContext.
Definition mpegvideo.h:67
MPVWorkPicture cur_pic
copy of the current picture structure.
Definition mpegvideo.h:132
The VC1 Context.
Definition vc1.h:176
int loop_filter
Definition vc1.h:223
uint8_t lumshift2
Definition vc1.h:343
int tfcntrflag
TFCNTR present.
Definition vc1.h:204
int profile
Sequence header data for all Profiles TODO: choose between ints, uint8_ts and monobit flags.
Definition vc1.h:220
uint8_t bfraction_lut_index
Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
Definition vc1.h:397
uint8_t lumshift
Definition vc1.h:277
int p_frame_skipped
Definition vc1.h:388
int dquant
How qscale varies with MBs, 2 bits (not in Simple)
Definition vc1.h:227
int multires
frame-level RESPIC syntax element present
Definition vc1.h:188
int finterpflag
INTERPFRM present.
Definition vc1.h:232
uint8_t range_mapuv_flag
Definition vc1.h:333
int extended_mv
Ext MV in P/B (not in Simple)
Definition vc1.h:226
uint8_t range_mapy_flag
Definition vc1.h:332
int bi_type
Definition vc1.h:389
int second_field
Definition vc1.h:358
uint8_t range_mapy
Definition vc1.h:334
uint8_t pq
Definition vc1.h:242
int extended_dmv
Additional extended dmv range at P/B-frame-level.
Definition vc1.h:207
int panscanflag
NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present.
Definition vc1.h:205
uint8_t mv_mode2
Secondary MV coding mode (B-frames)
Definition vc1.h:238
int psf
Progressive Segmented Frame.
Definition vc1.h:213
int refdist
distance of the current picture from reference
Definition vc1.h:359
int field_mode
1 for interlaced field pictures
Definition vc1.h:356
uint8_t rangeredfrm
Frame decoding info for S/M profiles only.
Definition vc1.h:312
int quantizer_mode
2 bits, quantizer mode used for sequence, see QUANT_*
Definition vc1.h:231
int broadcast
TFF/RFF present.
Definition vc1.h:202
int refdist_flag
REFDIST syntax element present in II, IP, PI or PP field picture headers.
Definition vc1.h:206
int max_b_frames
max number of B-frames
Definition vc1.h:230
int chromaformat
2 bits, 2=4:2:0, only defined
Definition vc1.h:200
MpegEncContext s
Definition vc1.h:177
int overlap
overlapped transforms in use
Definition vc1.h:229
GetBitContext gb
Definition vc1.h:178
int rnd
rounding control
Definition vc1.h:307
uint8_t range_mapuv
Definition vc1.h:335
uint8_t mv_mode
Frame decoding info for all profiles.
Definition vc1.h:237
int postprocflag
Per-frame processing suggestion flag present.
Definition vc1.h:201
enum FrameCodingMode fcm
Frame decoding info for Advanced profile.
Definition vc1.h:318
int interlace
Progressive/interlaced (RPTFTM syntax element)
Definition vc1.h:203
uint8_t lumscale
Luma compensation parameters.
Definition vc1.h:276
uint8_t lumscale2
for interlaced field P picture
Definition vc1.h:342
int resync_marker
could this stream contain resync markers
Definition vc1.h:404
int fastuvmc
Rounding of qpel vector to hpel ? (not in Simple)
Definition vc1.h:225
int intcomp
Definition vc1.h:341
int rangered
RANGEREDFRM (range reduction) syntax element present at frame level.
Definition vc1.h:191
int vstransform
variable-size [48]x[48] transform type + info
Definition vc1.h:228
DXVA_SliceInfo slice[MAX_SLICES]
Definition dxva2_mpeg2.c:37
DXVA_PicParams_H264 pp
Definition dxva2_h264.c:35
const uint8_t * bitstream
Definition dxva2_h264.c:40
#define avpriv_request_sample(...)
#define av_log(a,...)
static AVFormatContext * ctx
Definition movenc.c:49
static char buffer[20]
Definition seek.c:32
int size
@ PROGRESSIVE
in the bitstream is reported as 00b
Definition vc1.h:152
@ ILACE_FIELD
in the bitstream is reported as 11b
Definition vc1.h:154
@ ILACE_FRAME
in the bitstream is reported as 10b
Definition vc1.h:153
@ MV_PMODE_INTENSITY_COMP
Definition vc1.h:86
@ MV_PMODE_1MV_HPEL_BILIN
Definition vc1.h:82
@ MV_PMODE_MIXED_MV
Definition vc1.h:85
@ PROFILE_ADVANCED
Definition vc1_common.h:52
VC-1 tables.
static const uint8_t start_code[]