FFmpeg
dxva2_mpeg2.c
Go to the documentation of this file.
1 /*
2  * MPEG-2 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 "libavutil/log.h"
24 
25 #include "dxva2_internal.h"
26 #include "mpegutils.h"
27 #include "mpegvideo.h"
28 
29 #define MAX_SLICES 1024
30 struct dxva2_picture_context {
31  DXVA_PictureParameters pp;
32  DXVA_QmatrixData qm;
33  unsigned slice_count;
34  DXVA_SliceInfo slice[MAX_SLICES];
35 
36  const uint8_t *bitstream;
37  unsigned bitstream_size;
38 };
39 
42  const struct MpegEncContext *s,
43  DXVA_PictureParameters *pp)
44 {
45  const Picture *current_picture = s->current_picture_ptr;
46  int is_field = s->picture_structure != PICT_FRAME;
47 
48  memset(pp, 0, sizeof(*pp));
49  pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
50  pp->wDeblockedPictureIndex = 0;
51  if (s->pict_type != AV_PICTURE_TYPE_I)
52  pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
53  else
54  pp->wForwardRefPictureIndex = 0xffff;
55  if (s->pict_type == AV_PICTURE_TYPE_B)
56  pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
57  else
58  pp->wBackwardRefPictureIndex = 0xffff;
59  pp->wPicWidthInMBminus1 = s->mb_width - 1;
60  pp->wPicHeightInMBminus1 = (s->mb_height >> is_field) - 1;
61  pp->bMacroblockWidthMinus1 = 15;
62  pp->bMacroblockHeightMinus1 = 15;
63  pp->bBlockWidthMinus1 = 7;
64  pp->bBlockHeightMinus1 = 7;
65  pp->bBPPminus1 = 7;
66  pp->bPicStructure = s->picture_structure;
67  pp->bSecondField = is_field && !s->first_field;
68  pp->bPicIntra = s->pict_type == AV_PICTURE_TYPE_I;
69  pp->bPicBackwardPrediction = s->pict_type == AV_PICTURE_TYPE_B;
70  pp->bBidirectionalAveragingMode = 0;
71  pp->bMVprecisionAndChromaRelation= 0; /* FIXME */
72  pp->bChromaFormat = s->chroma_format;
73  pp->bPicScanFixed = 1;
74  pp->bPicScanMethod = s->alternate_scan ? 1 : 0;
75  pp->bPicReadbackRequests = 0;
76  pp->bRcontrol = 0;
77  pp->bPicSpatialResid8 = 0;
78  pp->bPicOverflowBlocks = 0;
79  pp->bPicExtrapolation = 0;
80  pp->bPicDeblocked = 0;
81  pp->bPicDeblockConfined = 0;
82  pp->bPic4MVallowed = 0;
83  pp->bPicOBMC = 0;
84  pp->bPicBinPB = 0;
85  pp->bMV_RPS = 0;
86  pp->bReservedBits = 0;
87  pp->wBitstreamFcodes = (s->mpeg_f_code[0][0] << 12) |
88  (s->mpeg_f_code[0][1] << 8) |
89  (s->mpeg_f_code[1][0] << 4) |
90  (s->mpeg_f_code[1][1] );
91  pp->wBitstreamPCEelements = (s->intra_dc_precision << 14) |
92  (s->picture_structure << 12) |
93  (s->top_field_first << 11) |
94  (s->frame_pred_frame_dct << 10) |
95  (s->concealment_motion_vectors << 9) |
96  (s->q_scale_type << 8) |
97  (s->intra_vlc_format << 7) |
98  (s->alternate_scan << 6) |
99  (s->repeat_first_field << 5) |
100  (s->chroma_420_type << 4) |
101  (s->progressive_frame << 3);
102  pp->bBitstreamConcealmentNeed = 0;
103  pp->bBitstreamConcealmentMethod = 0;
104 }
105 
108  const struct MpegEncContext *s,
109  DXVA_QmatrixData *qm)
110 {
111  int i;
112  for (i = 0; i < 4; i++)
113  qm->bNewQmatrix[i] = 1;
114  for (i = 0; i < 64; i++) {
115  int n = s->idsp.idct_permutation[ff_zigzag_direct[i]];
116  qm->Qmatrix[0][i] = s->intra_matrix[n];
117  qm->Qmatrix[1][i] = s->inter_matrix[n];
118  qm->Qmatrix[2][i] = s->chroma_intra_matrix[n];
119  qm->Qmatrix[3][i] = s->chroma_inter_matrix[n];
120  }
121 }
122 
123 static void fill_slice(AVCodecContext *avctx,
124  const struct MpegEncContext *s,
125  DXVA_SliceInfo *slice,
126  unsigned position,
127  const uint8_t *buffer, unsigned size)
128 {
129  int is_field = s->picture_structure != PICT_FRAME;
130  GetBitContext gb;
131 
132  memset(slice, 0, sizeof(*slice));
133  slice->wHorizontalPosition = s->mb_x;
134  slice->wVerticalPosition = s->mb_y >> is_field;
135  slice->dwSliceBitsInBuffer = 8 * size;
136  slice->dwSliceDataLocation = position;
137  slice->bStartCodeBitOffset = 0;
138  slice->bReservedBits = 0;
139  /* XXX We store the index of the first MB and it will be fixed later */
140  slice->wNumberMBsInSlice = (s->mb_y >> is_field) * s->mb_width + s->mb_x;
141  slice->wBadSliceChopping = 0;
142 
143  init_get_bits(&gb, &buffer[4], 8 * (size - 4));
144 
145  slice->wQuantizerScaleCode = get_bits(&gb, 5);
147 
148  slice->wMBbitOffset = 4 * 8 + get_bits_count(&gb);
149 }
153 {
154  const struct MpegEncContext *s = avctx->priv_data;
156  struct dxva2_picture_context *ctx_pic =
157  s->current_picture_ptr->hwaccel_picture_private;
158  const int is_field = s->picture_structure != PICT_FRAME;
159  const unsigned mb_count = s->mb_width * (s->mb_height >> is_field);
160  void *dxva_data_ptr;
161  uint8_t *dxva_data, *current, *end;
162  unsigned dxva_size;
163  unsigned i;
164  unsigned type;
165 
166 #if CONFIG_D3D11VA
167  if (ff_dxva2_is_d3d11(avctx)) {
168  type = D3D11_VIDEO_DECODER_BUFFER_BITSTREAM;
169  if (FAILED(ID3D11VideoContext_GetDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context,
171  type,
172  &dxva_size, &dxva_data_ptr)))
173  return -1;
174  }
175 #endif
176 #if CONFIG_DXVA2
177  if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) {
178  type = DXVA2_BitStreamDateBufferType;
179  if (FAILED(IDirectXVideoDecoder_GetBuffer(DXVA2_CONTEXT(ctx)->decoder,
180  type,
181  &dxva_data_ptr, &dxva_size)))
182  return -1;
183  }
184 #endif
185 
186  dxva_data = dxva_data_ptr;
187  current = dxva_data;
188  end = dxva_data + dxva_size;
189 
190  for (i = 0; i < ctx_pic->slice_count; i++) {
191  DXVA_SliceInfo *slice = &ctx_pic->slice[i];
192  unsigned position = slice->dwSliceDataLocation;
193  unsigned size = slice->dwSliceBitsInBuffer / 8;
194  if (size > end - current) {
195  av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream");
196  break;
197  }
198  slice->dwSliceDataLocation = current - dxva_data;
199 
200  if (i < ctx_pic->slice_count - 1)
201  slice->wNumberMBsInSlice =
202  slice[1].wNumberMBsInSlice - slice[0].wNumberMBsInSlice;
203  else
204  slice->wNumberMBsInSlice =
205  mb_count - slice[0].wNumberMBsInSlice;
206 
207  memcpy(current, &ctx_pic->bitstream[position], size);
208  current += size;
209  }
210 #if CONFIG_D3D11VA
211  if (ff_dxva2_is_d3d11(avctx))
212  if (FAILED(ID3D11VideoContext_ReleaseDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type)))
213  return -1;
214 #endif
215 #if CONFIG_DXVA2
216  if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD)
217  if (FAILED(IDirectXVideoDecoder_ReleaseBuffer(DXVA2_CONTEXT(ctx)->decoder, type)))
218  return -1;
219 #endif
220  if (i < ctx_pic->slice_count)
221  return -1;
222 
223 #if CONFIG_D3D11VA
224  if (ff_dxva2_is_d3d11(avctx)) {
225  D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = bs;
226  memset(dsc11, 0, sizeof(*dsc11));
227  dsc11->BufferType = type;
228  dsc11->DataSize = current - dxva_data;
229  dsc11->NumMBsInBuffer = mb_count;
230 
231  type = D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL;
232  }
233 #endif
234 #if CONFIG_DXVA2
235  if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) {
236  DXVA2_DecodeBufferDesc *dsc2 = bs;
237  memset(dsc2, 0, sizeof(*dsc2));
238  dsc2->CompressedBufferType = type;
239  dsc2->DataSize = current - dxva_data;
240  dsc2->NumMBsInBuffer = mb_count;
241 
242  type = DXVA2_SliceControlBufferType;
243  }
244 #endif
245 
246  return ff_dxva2_commit_buffer(avctx, ctx, sc,
247  type,
248  ctx_pic->slice,
249  ctx_pic->slice_count * sizeof(*ctx_pic->slice),
250  mb_count);
251 }
252 
254  av_unused const uint8_t *buffer,
255  av_unused uint32_t size)
256 {
257  const struct MpegEncContext *s = avctx->priv_data;
259  struct dxva2_picture_context *ctx_pic =
260  s->current_picture_ptr->hwaccel_picture_private;
261 
262  if (!DXVA_CONTEXT_VALID(avctx, ctx))
263  return -1;
264  assert(ctx_pic);
265 
266  fill_picture_parameters(avctx, ctx, s, &ctx_pic->pp);
267  fill_quantization_matrices(avctx, ctx, s, &ctx_pic->qm);
268 
269  ctx_pic->slice_count = 0;
270  ctx_pic->bitstream_size = 0;
271  ctx_pic->bitstream = NULL;
272  return 0;
273 }
274 
276  const uint8_t *buffer, uint32_t size)
277 {
278  const struct MpegEncContext *s = avctx->priv_data;
279  struct dxva2_picture_context *ctx_pic =
280  s->current_picture_ptr->hwaccel_picture_private;
281  unsigned position;
282 
283  if (ctx_pic->slice_count >= MAX_SLICES) {
284  avpriv_request_sample(avctx, "%d slices in dxva2",
285  ctx_pic->slice_count);
286  return -1;
287  }
288  if (!ctx_pic->bitstream)
289  ctx_pic->bitstream = buffer;
290  ctx_pic->bitstream_size += size;
291 
292  position = buffer - ctx_pic->bitstream;
293  fill_slice(avctx, s, &ctx_pic->slice[ctx_pic->slice_count++], position,
294  buffer, size);
295  return 0;
296 }
297 
299 {
300  struct MpegEncContext *s = avctx->priv_data;
301  struct dxva2_picture_context *ctx_pic =
302  s->current_picture_ptr->hwaccel_picture_private;
303  int ret;
304 
305  if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
306  return -1;
307  ret = ff_dxva2_common_end_frame(avctx, s->current_picture_ptr->f,
308  &ctx_pic->pp, sizeof(ctx_pic->pp),
309  &ctx_pic->qm, sizeof(ctx_pic->qm),
311  if (!ret)
312  ff_mpeg_draw_horiz_band(s, 0, avctx->height);
313  return ret;
314 }
315 
316 #if CONFIG_MPEG2_DXVA2_HWACCEL
318  .name = "mpeg2_dxva2",
319  .type = AVMEDIA_TYPE_VIDEO,
321  .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
322  .init = ff_dxva2_decode_init,
323  .uninit = ff_dxva2_decode_uninit,
324  .start_frame = dxva2_mpeg2_start_frame,
325  .decode_slice = dxva2_mpeg2_decode_slice,
326  .end_frame = dxva2_mpeg2_end_frame,
327  .frame_params = ff_dxva2_common_frame_params,
328  .frame_priv_data_size = sizeof(struct dxva2_picture_context),
329  .priv_data_size = sizeof(FFDXVASharedContext),
330 };
331 #endif
332 
333 #if CONFIG_MPEG2_D3D11VA_HWACCEL
335  .name = "mpeg2_d3d11va",
336  .type = AVMEDIA_TYPE_VIDEO,
338  .pix_fmt = AV_PIX_FMT_D3D11VA_VLD,
339  .init = ff_dxva2_decode_init,
340  .uninit = ff_dxva2_decode_uninit,
341  .start_frame = dxva2_mpeg2_start_frame,
342  .decode_slice = dxva2_mpeg2_decode_slice,
343  .end_frame = dxva2_mpeg2_end_frame,
344  .frame_params = ff_dxva2_common_frame_params,
345  .frame_priv_data_size = sizeof(struct dxva2_picture_context),
346  .priv_data_size = sizeof(FFDXVASharedContext),
347 };
348 #endif
349 
350 #if CONFIG_MPEG2_D3D11VA2_HWACCEL
352  .name = "mpeg2_d3d11va2",
353  .type = AVMEDIA_TYPE_VIDEO,
355  .pix_fmt = AV_PIX_FMT_D3D11,
356  .init = ff_dxva2_decode_init,
357  .uninit = ff_dxva2_decode_uninit,
358  .start_frame = dxva2_mpeg2_start_frame,
359  .decode_slice = dxva2_mpeg2_decode_slice,
360  .end_frame = dxva2_mpeg2_end_frame,
361  .frame_params = ff_dxva2_common_frame_params,
362  .frame_priv_data_size = sizeof(struct dxva2_picture_context),
363  .priv_data_size = sizeof(FFDXVASharedContext),
364 };
365 #endif
PICT_FRAME
#define PICT_FRAME
Definition: mpegutils.h:39
n
int n
Definition: avisynth_c.h:760
get_bits_count
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:219
fill_picture_parameters
static void fill_picture_parameters(AVCodecContext *avctx, AVDXVAContext *ctx, const struct MpegEncContext *s, DXVA_PictureParameters *pp)
Definition: dxva2_mpeg2.c:40
av_unused
#define av_unused
Definition: attributes.h:125
end
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
ff_dxva2_common_end_frame
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:880
AV_PIX_FMT_D3D11VA_VLD
@ AV_PIX_FMT_D3D11VA_VLD
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
Definition: pixfmt.h:229
dxva2_picture_context::pp
DXVA_PictureParameters pp
Definition: dxva2_mpeg2.c:31
dxva2_picture_context::qm
DXVA_QmatrixData qm
Definition: dxva2_mpeg2.c:32
mpegvideo.h
MpegEncContext::avctx
struct AVCodecContext * avctx
Definition: mpegvideo.h:98
Picture
Picture.
Definition: mpegpicture.h:45
mpegutils.h
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:659
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:379
AVHWAccel
Definition: avcodec.h:3649
decoder
static const chunk_decoder decoder[8]
Definition: dfa.c:330
GetBitContext
Definition: get_bits.h:61
ff_mpeg_draw_horiz_band
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
Definition: mpegvideo.c:2274
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
DXVA2_CONTEXT
#define DXVA2_CONTEXT(ctx)
Definition: dxva2_internal.h:102
AV_PIX_FMT_DXVA2_VLD
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
Definition: pixfmt.h:137
s
#define s(width, name)
Definition: cbs_vp9.c:257
DXVA_CONTEXT
#define DXVA_CONTEXT(avctx)
Definition: dxva2_internal.h:99
ctx
AVFormatContext * ctx
Definition: movenc.c:48
dxva2_mpeg2_start_frame
static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition: dxva2_mpeg2.c:253
dxva2_internal.h
dxva2_mpeg2_decode_slice
static int dxva2_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: dxva2_mpeg2.c:275
NULL
#define NULL
Definition: coverity.c:32
ff_dxva2_decode_init
int ff_dxva2_decode_init(AVCodecContext *avctx)
Definition: dxva2.c:649
dxva2_mpeg2_end_frame
static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
Definition: dxva2_mpeg2.c:298
MAX_SLICES
#define MAX_SLICES
Definition: dxva2_mpeg2.c:29
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:274
FFDXVASharedContext
Definition: dxva2_internal.h:67
dxva2_picture_context
Definition: dxva2_h264.c:31
commit_bitstream_and_slice_buffer
static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, DECODER_BUFFER_DESC *bs, DECODER_BUFFER_DESC *sc)
Definition: dxva2_mpeg2.c:150
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
dxva2_picture_context::slice_count
unsigned slice_count
Definition: dxva2_h264.c:34
ff_mpeg2_dxva2_hwaccel
const AVHWAccel ff_mpeg2_dxva2_hwaccel
size
int size
Definition: twinvq_data.h:11134
AVDXVAContext
Definition: dxva2_internal.h:58
DECODER_BUFFER_DESC
void DECODER_BUFFER_DESC
Definition: dxva2_internal.h:56
fill_quantization_matrices
static void fill_quantization_matrices(AVCodecContext *avctx, AVDXVAContext *ctx, const struct MpegEncContext *s, DXVA_QmatrixData *qm)
Definition: dxva2_mpeg2.c:106
AV_PIX_FMT_D3D11
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition: pixfmt.h:313
fill_slice
static void fill_slice(AVCodecContext *avctx, const struct MpegEncContext *s, DXVA_SliceInfo *slice, unsigned position, const uint8_t *buffer, unsigned size)
Definition: dxva2_mpeg2.c:123
AVHWAccel::name
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:3655
D3D11VA_CONTEXT
#define D3D11VA_CONTEXT(ctx)
Definition: dxva2_internal.h:101
log.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
uint8_t
uint8_t
Definition: audio_convert.c:194
ff_dxva2_commit_buffer
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:791
AVCodecContext::height
int height
Definition: avcodec.h:1738
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1775
ff_dxva2_get_surface_index
unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, const AVDXVAContext *ctx, const AVFrame *frame)
Definition: dxva2.c:764
ff_dxva2_common_frame_params
int ff_dxva2_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Definition: dxva2.c:586
ff_zigzag_direct
const uint8_t ff_zigzag_direct[64]
Definition: mathtables.c:98
ret
ret
Definition: filter_design.txt:187
dxva2_picture_context::slice
DXVA_SliceInfo slice[MAX_SLICES]
Definition: dxva2_mpeg2.c:34
dxva2_picture_context::bitstream
const uint8_t * bitstream
Definition: dxva2_h264.c:37
skip_1stop_8data_bits
static int skip_1stop_8data_bits(GetBitContext *gb)
Definition: get_bits.h:854
AVCodecContext
main external API structure.
Definition: avcodec.h:1565
FAILED
#define FAILED(hr)
Definition: windows2linux.h:48
ff_mpeg2_d3d11va2_hwaccel
const AVHWAccel ff_mpeg2_d3d11va2_hwaccel
AV_PICTURE_TYPE_B
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition: avutil.h:276
buffer
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
Definition: filter_design.txt:49
ff_dxva2_is_d3d11
int ff_dxva2_is_d3d11(const AVCodecContext *avctx)
Definition: dxva2.c:1045
Picture::f
struct AVFrame * f
Definition: mpegpicture.h:46
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ff_dxva2_decode_uninit
int ff_dxva2_decode_uninit(AVCodecContext *avctx)
Definition: dxva2.c:724
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:39
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:1592
ff_mpeg2_d3d11va_hwaccel
const AVHWAccel ff_mpeg2_d3d11va_hwaccel
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
dxva2_picture_context::qm
DXVA_Qmatrix_H264 qm
Definition: dxva2_h264.c:33
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: avcodec.h:220
MpegEncContext
MpegEncContext.
Definition: mpegvideo.h:81
dxva2_picture_context::bitstream_size
unsigned bitstream_size
Definition: dxva2_h264.c:38