FFmpeg
vaapi_encode_mpeg2.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <va/va.h>
20 #include <va/va_enc_mpeg2.h>
21 
22 #include "libavutil/avassert.h"
23 
24 #include "avcodec.h"
25 #include "cbs.h"
26 #include "cbs_mpeg2.h"
27 #include "mpeg12.h"
28 #include "vaapi_encode.h"
29 
30 typedef struct VAAPIEncodeMPEG2Context {
32 
33  // User options.
34  int profile;
35  int level;
36 
37  // Derived settings.
38  int quant_i;
39  int quant_p;
40  int quant_b;
41 
42  unsigned int bit_rate;
43  unsigned int vbv_buffer_size;
44 
46 
47  unsigned int f_code_horizontal;
48  unsigned int f_code_vertical;
49 
50  // Stream state.
51  int64_t last_i_frame;
52 
53  // Writer structures.
60 
64 
65 
67  char *data, size_t *data_len,
69 {
70  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
71  int err;
72 
73  err = ff_cbs_write_fragment_data(priv->cbc, frag);
74  if (err < 0) {
75  av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n");
76  return err;
77  }
78 
79  if (*data_len < 8 * frag->data_size - frag->data_bit_padding) {
80  av_log(avctx, AV_LOG_ERROR, "Access unit too large: "
81  "%zu < %zu.\n", *data_len,
82  8 * frag->data_size - frag->data_bit_padding);
83  return AVERROR(ENOSPC);
84  }
85 
86  memcpy(data, frag->data, frag->data_size);
87  *data_len = 8 * frag->data_size - frag->data_bit_padding;
88 
89  return 0;
90 }
91 
94  int type, void *header)
95 {
96  int err;
97 
98  err = ff_cbs_insert_unit_content(frag, -1, type, header, NULL);
99  if (err < 0) {
100  av_log(avctx, AV_LOG_ERROR, "Failed to add header: "
101  "type = %d.\n", type);
102  return err;
103  }
104 
105  return 0;
106 }
107 
109  char *data, size_t *data_len)
110 {
111  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
113  int err;
114 
116  &priv->sequence_header);
117  if (err < 0)
118  goto fail;
119 
121  &priv->sequence_extension);
122  if (err < 0)
123  goto fail;
124 
127  if (err < 0)
128  goto fail;
129 
131  &priv->gop_header);
132  if (err < 0)
133  goto fail;
134 
135  err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
136 fail:
137  ff_cbs_fragment_reset(frag);
138  return 0;
139 }
140 
142  VAAPIEncodePicture *pic,
143  char *data, size_t *data_len)
144 {
145  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
147  int err;
148 
150  &priv->picture_header);
151  if (err < 0)
152  goto fail;
153 
155  &priv->picture_coding_extension);
156  if (err < 0)
157  goto fail;
158 
159  err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
160 fail:
161  ff_cbs_fragment_reset(frag);
162  return 0;
163 }
164 
166 {
167  VAAPIEncodeContext *ctx = avctx->priv_data;
168  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
175  VAEncSequenceParameterBufferMPEG2 *vseq = ctx->codec_sequence_params;
176  VAEncPictureParameterBufferMPEG2 *vpic = ctx->codec_picture_params;
177  int code, ext_n, ext_d;
178 
179  memset(sh, 0, sizeof(*sh));
180  memset(se, 0, sizeof(*se));
181  memset(sde, 0, sizeof(*sde));
182  memset(goph, 0, sizeof(*goph));
183  memset(ph, 0, sizeof(*ph));
184  memset(pce, 0, sizeof(*pce));
185 
186 
187  if (ctx->va_bit_rate > 0) {
188  priv->bit_rate = (ctx->va_bit_rate + 399) / 400;
189  } else {
190  // Unknown (not a bitrate-targetting mode), so just use the
191  // highest value.
192  priv->bit_rate = 0x3fffffff;
193  }
194  if (avctx->rc_buffer_size > 0) {
195  priv->vbv_buffer_size = (avctx->rc_buffer_size + (1 << 14) - 1) >> 14;
196  } else {
197  // Unknown, so guess a value from the bitrate.
198  priv->vbv_buffer_size = priv->bit_rate >> 14;
199  }
200 
201  switch (avctx->level) {
202  case 4: // High.
203  case 6: // High 1440.
204  priv->f_code_horizontal = 9;
205  priv->f_code_vertical = 5;
206  break;
207  case 8: // Main.
208  priv->f_code_horizontal = 8;
209  priv->f_code_vertical = 5;
210  break;
211  case 10: // Low.
212  default:
213  priv->f_code_horizontal = 7;
214  priv->f_code_vertical = 4;
215  break;
216  }
217 
218 
219  // Sequence header
220 
222 
223  sh->horizontal_size_value = avctx->width & 0xfff;
224  sh->vertical_size_value = avctx->height & 0xfff;
225 
226  if (avctx->sample_aspect_ratio.num != 0 &&
227  avctx->sample_aspect_ratio.den != 0) {
229  (AVRational) { avctx->width, avctx->height });
230 
231  if (av_cmp_q(avctx->sample_aspect_ratio, (AVRational) { 1, 1 }) == 0) {
232  sh->aspect_ratio_information = 1;
233  } else if (av_cmp_q(dar, (AVRational) { 3, 4 }) == 0) {
234  sh->aspect_ratio_information = 2;
235  } else if (av_cmp_q(dar, (AVRational) { 9, 16 }) == 0) {
236  sh->aspect_ratio_information = 3;
237  } else if (av_cmp_q(dar, (AVRational) { 100, 221 }) == 0) {
238  sh->aspect_ratio_information = 4;
239  } else {
240  av_log(avctx, AV_LOG_WARNING, "Sample aspect ratio %d:%d is not "
241  "representable, signalling square pixels instead.\n",
242  avctx->sample_aspect_ratio.num,
243  avctx->sample_aspect_ratio.den);
244  sh->aspect_ratio_information = 1;
245  }
246  } else {
247  // Unknown - assume square pixels.
248  sh->aspect_ratio_information = 1;
249  }
250 
251  if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
252  priv->frame_rate = avctx->framerate;
253  else
254  priv->frame_rate = av_inv_q(avctx->time_base);
256  &code, &ext_n, &ext_d, 0);
257  sh->frame_rate_code = code;
258 
259  sh->bit_rate_value = priv->bit_rate & 0x3ffff;
260  sh->vbv_buffer_size_value = priv->vbv_buffer_size & 0x3ff;
261 
265 
266 
267  // Sequence extension
268 
272 
273  se->profile_and_level_indication = avctx->profile << 4 | avctx->level;
274  se->progressive_sequence = 1;
275  se->chroma_format = 1;
276 
277  se->horizontal_size_extension = avctx->width >> 12;
278  se->vertical_size_extension = avctx->height >> 12;
279 
280  se->bit_rate_extension = priv->bit_rate >> 18;
281  se->vbv_buffer_size_extension = priv->vbv_buffer_size >> 10;
282  se->low_delay = ctx->b_per_p == 0;
283 
284  se->frame_rate_extension_n = ext_n;
285  se->frame_rate_extension_d = ext_d;
286 
287 
288  // Sequence display extension
289 
294 
295  // Unspecified video format, from table 6-6.
296  sde->video_format = 5;
297 
298  sde->colour_primaries = avctx->color_primaries;
299  sde->transfer_characteristics = avctx->color_trc;
300  sde->matrix_coefficients = avctx->colorspace;
301  sde->colour_description =
303  avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
305 
306  sde->display_horizontal_size = avctx->width;
307  sde->display_vertical_size = avctx->height;
308 
309 
310  // GOP header
311 
313 
314  // Marker bit in the middle of time_code.
315  goph->time_code = 1 << 12;
316  goph->closed_gop = 1;
317  goph->broken_link = 0;
318 
319 
320  // Defaults for picture header
321 
323 
324  ph->vbv_delay = 0xffff; // Not currently calculated.
325 
326  ph->full_pel_forward_vector = 0;
327  ph->forward_f_code = 7;
328  ph->full_pel_backward_vector = 0;
329  ph->forward_f_code = 7;
330 
331 
332  // Defaults for picture coding extension
333 
338 
339  pce->intra_dc_precision = 0;
340  pce->picture_structure = 3;
341  pce->top_field_first = 0;
342  pce->frame_pred_frame_dct = 1;
344  pce->q_scale_type = 0;
345  pce->intra_vlc_format = 0;
346  pce->alternate_scan = 0;
347  pce->repeat_first_field = 0;
348  pce->progressive_frame = 1;
349  pce->composite_display_flag = 0;
350 
351 
352 
353  *vseq = (VAEncSequenceParameterBufferMPEG2) {
354  .intra_period = ctx->gop_size,
355  .ip_period = ctx->b_per_p + 1,
356 
357  .picture_width = avctx->width,
358  .picture_height = avctx->height,
359 
360  .bits_per_second = ctx->va_bit_rate,
361  .frame_rate = av_q2d(priv->frame_rate),
362  .aspect_ratio_information = sh->aspect_ratio_information,
363  .vbv_buffer_size = priv->vbv_buffer_size,
364 
365  .sequence_extension.bits = {
366  .profile_and_level_indication = se->profile_and_level_indication,
367  .progressive_sequence = se->progressive_sequence,
368  .chroma_format = se->chroma_format,
369  .low_delay = se->low_delay,
370  .frame_rate_extension_n = se->frame_rate_extension_n,
371  .frame_rate_extension_d = se->frame_rate_extension_d,
372  },
373 
374  .new_gop_header = 1,
375  .gop_header.bits = {
376  .time_code = goph->time_code,
377  .closed_gop = goph->closed_gop,
378  .broken_link = goph->broken_link,
379  },
380  };
381 
382  *vpic = (VAEncPictureParameterBufferMPEG2) {
383  .forward_reference_picture = VA_INVALID_ID,
384  .backward_reference_picture = VA_INVALID_ID,
385  .reconstructed_picture = VA_INVALID_ID,
386  .coded_buf = VA_INVALID_ID,
387 
388  .vbv_delay = 0xffff,
389  .f_code = { { 15, 15 }, { 15, 15 } },
390 
391  .picture_coding_extension.bits = {
392  .intra_dc_precision = pce->intra_dc_precision,
393  .picture_structure = pce->picture_structure,
394  .top_field_first = pce->top_field_first,
395  .frame_pred_frame_dct = pce->frame_pred_frame_dct,
396  .concealment_motion_vectors = pce->concealment_motion_vectors,
397  .q_scale_type = pce->q_scale_type,
398  .intra_vlc_format = pce->intra_vlc_format,
399  .alternate_scan = pce->alternate_scan,
400  .repeat_first_field = pce->repeat_first_field,
401  .progressive_frame = pce->progressive_frame,
402  .composite_display_flag = pce->composite_display_flag,
403  },
404 
405  .composite_display.bits = {
406  .v_axis = pce->v_axis,
407  .field_sequence = pce->field_sequence,
408  .sub_carrier = pce->sub_carrier,
409  .burst_amplitude = pce->burst_amplitude,
410  .sub_carrier_phase = pce->sub_carrier_phase,
411  },
412  };
413 
414  return 0;
415 }
416 
418  VAAPIEncodePicture *pic)
419 {
420  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
423  VAEncPictureParameterBufferMPEG2 *vpic = pic->codec_picture_params;
424 
425  if (pic->type == PICTURE_TYPE_IDR || pic->type == PICTURE_TYPE_I) {
426  ph->temporal_reference = 0;
427  ph->picture_coding_type = 1;
428  priv->last_i_frame = pic->display_order;
429  } else {
430  ph->temporal_reference = pic->display_order - priv->last_i_frame;
431  ph->picture_coding_type = pic->type == PICTURE_TYPE_B ? 3 : 2;
432  }
433 
434  if (pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B) {
435  pce->f_code[0][0] = priv->f_code_horizontal;
436  pce->f_code[0][1] = priv->f_code_vertical;
437  } else {
438  pce->f_code[0][0] = 15;
439  pce->f_code[0][1] = 15;
440  }
441  if (pic->type == PICTURE_TYPE_B) {
442  pce->f_code[1][0] = priv->f_code_horizontal;
443  pce->f_code[1][1] = priv->f_code_vertical;
444  } else {
445  pce->f_code[1][0] = 15;
446  pce->f_code[1][1] = 15;
447  }
448 
449  vpic->reconstructed_picture = pic->recon_surface;
450  vpic->coded_buf = pic->output_buffer;
451 
452  switch (pic->type) {
453  case PICTURE_TYPE_IDR:
454  case PICTURE_TYPE_I:
455  vpic->picture_type = VAEncPictureTypeIntra;
456  break;
457  case PICTURE_TYPE_P:
458  vpic->picture_type = VAEncPictureTypePredictive;
459  vpic->forward_reference_picture = pic->refs[0]->recon_surface;
460  break;
461  case PICTURE_TYPE_B:
462  vpic->picture_type = VAEncPictureTypeBidirectional;
463  vpic->forward_reference_picture = pic->refs[0]->recon_surface;
464  vpic->backward_reference_picture = pic->refs[1]->recon_surface;
465  break;
466  default:
467  av_assert0(0 && "invalid picture type");
468  }
469 
470  vpic->temporal_reference = ph->temporal_reference;
471  vpic->f_code[0][0] = pce->f_code[0][0];
472  vpic->f_code[0][1] = pce->f_code[0][1];
473  vpic->f_code[1][0] = pce->f_code[1][0];
474  vpic->f_code[1][1] = pce->f_code[1][1];
475 
476  return 0;
477 }
478 
480  VAAPIEncodePicture *pic,
481  VAAPIEncodeSlice *slice)
482 {
483  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
484  VAEncSliceParameterBufferMPEG2 *vslice = slice->codec_slice_params;
485  int qp;
486 
487  vslice->macroblock_address = slice->block_start;
488  vslice->num_macroblocks = slice->block_size;
489 
490  switch (pic->type) {
491  case PICTURE_TYPE_IDR:
492  case PICTURE_TYPE_I:
493  qp = priv->quant_i;
494  break;
495  case PICTURE_TYPE_P:
496  qp = priv->quant_p;
497  break;
498  case PICTURE_TYPE_B:
499  qp = priv->quant_b;
500  break;
501  default:
502  av_assert0(0 && "invalid picture type");
503  }
504 
505  vslice->quantiser_scale_code = qp;
506  vslice->is_intra_slice = (pic->type == PICTURE_TYPE_IDR ||
507  pic->type == PICTURE_TYPE_I);
508 
509  return 0;
510 }
511 
513 {
514  VAAPIEncodeContext *ctx = avctx->priv_data;
515  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
516  int err;
517 
518  err = ff_cbs_init(&priv->cbc, AV_CODEC_ID_MPEG2VIDEO, avctx);
519  if (err < 0)
520  return err;
521 
522  if (ctx->va_rc_mode == VA_RC_CQP) {
523  priv->quant_p = av_clip(ctx->rc_quality, 1, 31);
524  if (avctx->i_quant_factor > 0.0)
525  priv->quant_i =
526  av_clip((avctx->i_quant_factor * priv->quant_p +
527  avctx->i_quant_offset) + 0.5, 1, 31);
528  else
529  priv->quant_i = priv->quant_p;
530  if (avctx->b_quant_factor > 0.0)
531  priv->quant_b =
532  av_clip((avctx->b_quant_factor * priv->quant_p +
533  avctx->b_quant_offset) + 0.5, 1, 31);
534  else
535  priv->quant_b = priv->quant_p;
536 
537  av_log(avctx, AV_LOG_DEBUG, "Using fixed quantiser "
538  "%d / %d / %d for I- / P- / B-frames.\n",
539  priv->quant_i, priv->quant_p, priv->quant_b);
540 
541  } else {
542  priv->quant_i = 16;
543  priv->quant_p = 16;
544  priv->quant_b = 16;
545  }
546 
547  ctx->slice_block_rows = FFALIGN(avctx->height, 16) / 16;
548  ctx->slice_block_cols = FFALIGN(avctx->width, 16) / 16;
549 
550  ctx->nb_slices = ctx->slice_block_rows;
551  ctx->slice_size = 1;
552 
553  ctx->roi_quant_range = 31;
554 
555  return 0;
556 }
557 
559  { FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main },
560  { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
562 };
563 
566 
567  .flags = FLAG_B_PICTURES,
568 
569  .configure = &vaapi_encode_mpeg2_configure,
570 
571  .default_quality = 10,
572 
573  .sequence_params_size = sizeof(VAEncSequenceParameterBufferMPEG2),
574  .init_sequence_params = &vaapi_encode_mpeg2_init_sequence_params,
575 
576  .picture_params_size = sizeof(VAEncPictureParameterBufferMPEG2),
577  .init_picture_params = &vaapi_encode_mpeg2_init_picture_params,
578 
579  .slice_params_size = sizeof(VAEncSliceParameterBufferMPEG2),
580  .init_slice_params = &vaapi_encode_mpeg2_init_slice_params,
581 
582  .sequence_header_type = VAEncPackedHeaderSequence,
583  .write_sequence_header = &vaapi_encode_mpeg2_write_sequence_header,
584 
585  .picture_header_type = VAEncPackedHeaderPicture,
586  .write_picture_header = &vaapi_encode_mpeg2_write_picture_header,
587 };
588 
590 {
591  VAAPIEncodeContext *ctx = avctx->priv_data;
592  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
593 
594  ctx->codec = &vaapi_encode_type_mpeg2;
595 
596  if (avctx->profile == FF_PROFILE_UNKNOWN)
597  avctx->profile = priv->profile;
598  if (avctx->level == FF_LEVEL_UNKNOWN)
599  avctx->level = priv->level;
600 
601  // Reject unknown levels (these are required to set f_code for
602  // motion vector encoding).
603  switch (avctx->level) {
604  case 4: // High
605  case 6: // High 1440
606  case 8: // Main
607  case 10: // Low
608  break;
609  default:
610  av_log(avctx, AV_LOG_ERROR, "Unknown MPEG-2 level %d.\n",
611  avctx->level);
612  return AVERROR(EINVAL);
613  }
614 
615  if (avctx->height % 4096 == 0 || avctx->width % 4096 == 0) {
616  av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support picture "
617  "height or width divisible by 4096.\n");
618  return AVERROR(EINVAL);
619  }
620 
621  ctx->desired_packed_headers = VA_ENC_PACKED_HEADER_SEQUENCE |
622  VA_ENC_PACKED_HEADER_PICTURE;
623 
624  ctx->surface_width = FFALIGN(avctx->width, 16);
625  ctx->surface_height = FFALIGN(avctx->height, 16);
626 
627  return ff_vaapi_encode_init(avctx);
628 }
629 
631 {
632  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
633 
635  ff_cbs_close(&priv->cbc);
636 
637  return ff_vaapi_encode_close(avctx);
638 }
639 
640 #define OFFSET(x) offsetof(VAAPIEncodeMPEG2Context, x)
641 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
645 
646  { "profile", "Set profile (in profile_and_level_indication)",
648  { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" },
649 
650 #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
651  { .i64 = value }, 0, 0, FLAGS, "profile"
652  { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) },
653  { PROFILE("main", FF_PROFILE_MPEG2_MAIN) },
654 #undef PROFILE
655 
656  { "level", "Set level (in profile_and_level_indication)",
658  { .i64 = 4 }, 0, 15, FLAGS, "level" },
659 
660 #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
661  { .i64 = value }, 0, 0, FLAGS, "level"
662  { LEVEL("low", 10) },
663  { LEVEL("main", 8) },
664  { LEVEL("high_1440", 6) },
665  { LEVEL("high", 4) },
666 #undef LEVEL
667 
668  { NULL },
669 };
670 
672  { "b", "0" },
673  { "bf", "1" },
674  { "g", "120" },
675  { "i_qfactor", "1" },
676  { "i_qoffset", "0" },
677  { "b_qfactor", "6/5" },
678  { "b_qoffset", "0" },
679  { "qmin", "-1" },
680  { "qmax", "-1" },
681  { NULL },
682 };
683 
685  .class_name = "mpeg2_vaapi",
686  .item_name = av_default_item_name,
687  .option = vaapi_encode_mpeg2_options,
688  .version = LIBAVUTIL_VERSION_INT,
689 };
690 
692  .name = "mpeg2_vaapi",
693  .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 (VAAPI)"),
694  .type = AVMEDIA_TYPE_VIDEO,
696  .priv_data_size = sizeof(VAAPIEncodeMPEG2Context),
698  .receive_packet = &ff_vaapi_encode_receive_packet,
699  .close = &vaapi_encode_mpeg2_close,
700  .priv_class = &vaapi_encode_mpeg2_class,
701  .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
703  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
705  .pix_fmts = (const enum AVPixelFormat[]) {
708  },
709  .hw_configs = ff_vaapi_encode_hw_configs,
710  .wrapper_name = "vaapi",
711 };
VAAPIEncodeMPEG2Context::cbc
CodedBitstreamContext * cbc
Definition: vaapi_encode_mpeg2.c:61
VAAPIEncodeMPEG2Context::picture_header
MPEG2RawPictureHeader picture_header
Definition: vaapi_encode_mpeg2.c:58
AVCodec
AVCodec.
Definition: codec.h:202
PICTURE_TYPE_IDR
@ PICTURE_TYPE_IDR
Definition: vaapi_encode.h:55
vaapi_encode_mpeg2_write_fragment
static int vaapi_encode_mpeg2_write_fragment(AVCodecContext *avctx, char *data, size_t *data_len, CodedBitstreamFragment *frag)
Definition: vaapi_encode_mpeg2.c:66
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
VAAPIEncodeSlice::codec_slice_params
void * codec_slice_params
Definition: vaapi_encode.h:67
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
MPEG2RawPictureCodingExtension
Definition: cbs_mpeg2.h:138
level
uint8_t level
Definition: svq3.c:204
av_clip
#define av_clip
Definition: common.h:96
FF_PROFILE_MPEG2_SIMPLE
#define FF_PROFILE_MPEG2_SIMPLE
Definition: avcodec.h:1559
AVERROR
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
AVCodecContext::colorspace
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:960
FLAG_B_PICTURES
@ FLAG_B_PICTURES
Definition: vaapi_encode.h:358
VAAPIEncodeMPEG2Context::gop_header
MPEG2RawGroupOfPicturesHeader gop_header
Definition: vaapi_encode_mpeg2.c:57
VAAPIEncodeMPEG2Context::vbv_buffer_size
unsigned int vbv_buffer_size
Definition: vaapi_encode_mpeg2.c:43
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:162
av_div_q
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
Definition: rational.c:88
se
#define se(name, range_min, range_max)
Definition: cbs_h2645.c:275
MPEG2RawPictureHeader
Definition: cbs_mpeg2.h:123
VAAPIEncodeMPEG2Context::f_code_horizontal
unsigned int f_code_horizontal
Definition: vaapi_encode_mpeg2.c:47
MPEG2RawExtensionData::sequence_display
MPEG2RawSequenceDisplayExtension sequence_display
Definition: cbs_mpeg2.h:183
AVCodecContext::color_trc
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:953
ff_cbs_fragment_reset
void ff_cbs_fragment_reset(CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
Definition: cbs.c:157
MPEG2RawPictureCodingExtension::alternate_scan
uint8_t alternate_scan
Definition: cbs_mpeg2.h:148
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:173
ff_cbs_close
void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
Definition: cbs.c:127
VAAPIEncodeSlice
Definition: vaapi_encode.h:61
AVOption
AVOption.
Definition: opt.h:247
VAAPIEncodePicture::refs
struct VAAPIEncodePicture * refs[MAX_PICTURE_REFERENCES]
Definition: vaapi_encode.h:116
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:497
data
const char data[16]
Definition: mxf.c:143
AVCodecContext::b_quant_offset
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:671
VAAPIEncodeSlice::block_start
int block_start
Definition: vaapi_encode.h:65
ff_vaapi_encode_close
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
Definition: vaapi_encode.c:2531
cbs.h
FF_LEVEL_UNKNOWN
#define FF_LEVEL_UNKNOWN
Definition: avcodec.h:1652
MPEG2RawExtensionData
Definition: cbs_mpeg2.h:177
MPEG2RawSequenceDisplayExtension::display_horizontal_size
uint16_t display_horizontal_size
Definition: cbs_mpeg2.h:105
VAAPIEncodeMPEG2Context::profile
int profile
Definition: vaapi_encode_mpeg2.c:34
vaapi_encode_mpeg2_close
static av_cold int vaapi_encode_mpeg2_close(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:630
MPEG2RawSequenceHeader::load_intra_quantiser_matrix
uint8_t load_intra_quantiser_matrix
Definition: cbs_mpeg2.h:70
FF_PROFILE_MPEG2_MAIN
#define FF_PROFILE_MPEG2_MAIN
Definition: avcodec.h:1558
MPEG2RawSequenceHeader::frame_rate_code
uint8_t frame_rate_code
Definition: cbs_mpeg2.h:65
VAAPIEncodeMPEG2Context
Definition: vaapi_encode_mpeg2.c:30
ff_cbs_fragment_free
void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
Definition: cbs.c:171
ff_mpeg12_find_best_frame_rate
void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, int *code, int *ext_n, int *ext_d, int nonstandard)
Definition: mpeg12framerate.c:44
MPEG2RawPictureCodingExtension::q_scale_type
uint8_t q_scale_type
Definition: cbs_mpeg2.h:146
init
static int init
Definition: av_tx.c:47
AVCodecContext::framerate
AVRational framerate
Definition: avcodec.h:1710
vaapi_encode_mpeg2_configure
static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:512
AVCodecContext::i_quant_factor
float i_quant_factor
qscale factor between P- and I-frames If > 0 then the last P-frame quantizer will be used (q = lastp_...
Definition: avcodec.h:688
MPEG2_START_GROUP
@ MPEG2_START_GROUP
Definition: cbs_mpeg2.h:37
FLAGS
#define FLAGS
Definition: vaapi_encode_mpeg2.c:641
vaapi_encode.h
fail
#define fail()
Definition: checkasm.h:127
VAAPIEncodePicture
Definition: vaapi_encode.h:70
MPEG2RawGroupOfPicturesHeader
Definition: cbs_mpeg2.h:109
MPEG2RawPictureCodingExtension::frame_pred_frame_dct
uint8_t frame_pred_frame_dct
Definition: cbs_mpeg2.h:144
MPEG2RawExtensionData::extension_start_code
uint8_t extension_start_code
Definition: cbs_mpeg2.h:178
defaults
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
vaapi_encode_mpeg2_options
static const AVOption vaapi_encode_mpeg2_options[]
Definition: vaapi_encode_mpeg2.c:642
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
AVRational::num
int num
Numerator.
Definition: rational.h:59
MPEG2RawPictureCodingExtension::concealment_motion_vectors
uint8_t concealment_motion_vectors
Definition: cbs_mpeg2.h:145
VAAPIEncodeMPEG2Context::common
VAAPIEncodeContext common
Definition: vaapi_encode_mpeg2.c:31
VAAPIEncodeMPEG2Context::last_i_frame
int64_t last_i_frame
Definition: vaapi_encode_mpeg2.c:51
MPEG2RawSequenceDisplayExtension::colour_description
uint8_t colour_description
Definition: cbs_mpeg2.h:100
avassert.h
mpeg12.h
AVCodecContext::color_primaries
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:946
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
MPEG2RawGroupOfPicturesHeader::time_code
uint32_t time_code
Definition: cbs_mpeg2.h:112
MPEG2RawPictureCodingExtension::field_sequence
uint8_t field_sequence
Definition: cbs_mpeg2.h:155
MPEG2RawSequenceExtension
Definition: cbs_mpeg2.h:84
VAAPIEncodePicture::codec_picture_params
void * codec_picture_params
Definition: vaapi_encode.h:103
MPEG2RawPictureCodingExtension::composite_display_flag
uint8_t composite_display_flag
Definition: cbs_mpeg2.h:153
CodedBitstreamFragment
Coded bitstream fragment structure, combining one or more units.
Definition: cbs.h:121
MPEG2_EXTENSION_PICTURE_CODING
@ MPEG2_EXTENSION_PICTURE_CODING
Definition: cbs_mpeg2.h:51
vaapi_encode_mpeg2_init_picture_params
static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
Definition: vaapi_encode_mpeg2.c:417
CodedBitstreamFragment::data_size
size_t data_size
The number of bytes in the bitstream.
Definition: cbs.h:134
MPEG2RawSequenceDisplayExtension
Definition: cbs_mpeg2.h:97
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
MPEG2RawSequenceHeader::constrained_parameters_flag
uint8_t constrained_parameters_flag
Definition: cbs_mpeg2.h:68
VAAPIEncodeMPEG2Context::quant_i
int quant_i
Definition: vaapi_encode_mpeg2.c:38
FF_PROFILE_UNKNOWN
#define FF_PROFILE_UNKNOWN
Definition: avcodec.h:1526
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
LEVEL
#define LEVEL(name, value)
MPEG2RawPictureHeader::forward_f_code
uint8_t forward_f_code
Definition: cbs_mpeg2.h:131
ctx
AVFormatContext * ctx
Definition: movenc.c:48
MPEG2RawSequenceDisplayExtension::video_format
uint8_t video_format
Definition: cbs_mpeg2.h:98
ff_vaapi_encode_receive_packet
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: vaapi_encode.c:1155
MPEG2RawSequenceHeader::vertical_size_value
uint16_t vertical_size_value
Definition: cbs_mpeg2.h:63
CodedBitstreamFragment::data_bit_padding
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
Definition: cbs.h:138
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:472
VAAPIEncodeType
Definition: vaapi_encode.h:366
VAAPIEncodeContext
Definition: vaapi_encode.h:175
AVCodecDefault
Definition: internal.h:215
AVCodecContext::rc_buffer_size
int rc_buffer_size
decoder bitstream buffer size
Definition: avcodec.h:1179
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
MPEG2RawSequenceDisplayExtension::colour_primaries
uint8_t colour_primaries
Definition: cbs_mpeg2.h:101
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
MPEG2RawPictureHeader::full_pel_backward_vector
uint8_t full_pel_backward_vector
Definition: cbs_mpeg2.h:132
ff_cbs_insert_unit_content
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, AVBufferRef *content_buf)
Insert a new unit into a fragment with the given content.
Definition: cbs.c:756
VAAPIEncodeType::profiles
const VAAPIEncodeProfile * profiles
Definition: vaapi_encode.h:369
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
MPEG2RawGroupOfPicturesHeader::broken_link
uint8_t broken_link
Definition: cbs_mpeg2.h:114
PICTURE_TYPE_P
@ PICTURE_TYPE_P
Definition: vaapi_encode.h:57
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
MPEG2RawPictureCodingExtension::repeat_first_field
uint8_t repeat_first_field
Definition: cbs_mpeg2.h:149
PROFILE
#define PROFILE(name, value)
VAAPIEncodeMPEG2Context::picture_coding_extension
MPEG2RawExtensionData picture_coding_extension
Definition: vaapi_encode_mpeg2.c:59
vaapi_encode_mpeg2_profiles
static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[]
Definition: vaapi_encode_mpeg2.c:558
cbs_mpeg2.h
ff_mpeg2_vaapi_encoder
const AVCodec ff_mpeg2_vaapi_encoder
Definition: vaapi_encode_mpeg2.c:691
MPEG2_EXTENSION_SEQUENCE
@ MPEG2_EXTENSION_SEQUENCE
Definition: cbs_mpeg2.h:45
OFFSET
#define OFFSET(x)
Definition: vaapi_encode_mpeg2.c:640
AVCodecContext::level
int level
level
Definition: avcodec.h:1651
MPEG2RawGroupOfPicturesHeader::closed_gop
uint8_t closed_gop
Definition: cbs_mpeg2.h:113
MPEG2RawSequenceDisplayExtension::matrix_coefficients
uint8_t matrix_coefficients
Definition: cbs_mpeg2.h:103
MPEG2RawSequenceHeader::horizontal_size_value
uint16_t horizontal_size_value
Definition: cbs_mpeg2.h:62
vaapi_encode_mpeg2_init
static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:589
MPEG2RawExtensionData::sequence
MPEG2RawSequenceExtension sequence
Definition: cbs_mpeg2.h:182
AVCodecContext::time_base
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Definition: avcodec.h:506
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
VAAPIEncodePicture::type
int type
Definition: vaapi_encode.h:85
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
VAAPI_ENCODE_RC_OPTIONS
#define VAAPI_ENCODE_RC_OPTIONS
Definition: vaapi_encode.h:463
MPEG2RawExtensionData::extension_start_code_identifier
uint8_t extension_start_code_identifier
Definition: cbs_mpeg2.h:179
vaapi_encode_mpeg2_class
static const AVClass vaapi_encode_mpeg2_class
Definition: vaapi_encode_mpeg2.c:684
MPEG2_START_PICTURE
@ MPEG2_START_PICTURE
Definition: cbs_mpeg2.h:29
VAAPIEncodeMPEG2Context::current_fragment
CodedBitstreamFragment current_fragment
Definition: vaapi_encode_mpeg2.c:62
CodedBitstreamFragment::data
uint8_t * data
Pointer to the bitstream form of this fragment.
Definition: cbs.h:127
MPEG2RawExtensionData::data
union MPEG2RawExtensionData::@35 data
PICTURE_TYPE_I
@ PICTURE_TYPE_I
Definition: vaapi_encode.h:56
header
static const uint8_t header[24]
Definition: sdr2.c:67
VAAPI_ENCODE_COMMON_OPTIONS
#define VAAPI_ENCODE_COMMON_OPTIONS
Definition: vaapi_encode.h:445
VAAPIEncodePicture::recon_surface
VASurfaceID recon_surface
Definition: vaapi_encode.h:94
MPEG2RawPictureCodingExtension::sub_carrier
uint8_t sub_carrier
Definition: cbs_mpeg2.h:156
VAAPIEncodePicture::output_buffer
VABufferID output_buffer
Definition: vaapi_encode.h:100
MPEG2RawSequenceHeader
Definition: cbs_mpeg2.h:59
VAAPIEncodePicture::display_order
int64_t display_order
Definition: vaapi_encode.h:73
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.h:119
MPEG2RawPictureHeader::temporal_reference
uint16_t temporal_reference
Definition: cbs_mpeg2.h:126
AVCodecContext::b_quant_factor
float b_quant_factor
qscale factor between IP and B-frames If > 0 then the last P-frame quantizer will be used (q= lastp_q...
Definition: avcodec.h:664
vaapi_encode_type_mpeg2
static const VAAPIEncodeType vaapi_encode_type_mpeg2
Definition: vaapi_encode_mpeg2.c:564
vaapi_encode_mpeg2_init_slice_params
static int vaapi_encode_mpeg2_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice)
Definition: vaapi_encode_mpeg2.c:479
code
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
Definition: filter_design.txt:178
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
MPEG2RawSequenceHeader::sequence_header_code
uint8_t sequence_header_code
Definition: cbs_mpeg2.h:60
PICTURE_TYPE_B
@ PICTURE_TYPE_B
Definition: vaapi_encode.h:58
VAAPIEncodeMPEG2Context::quant_b
int quant_b
Definition: vaapi_encode_mpeg2.c:40
MPEG2RawSequenceHeader::aspect_ratio_information
uint8_t aspect_ratio_information
Definition: cbs_mpeg2.h:64
VAAPIEncodeMPEG2Context::bit_rate
unsigned int bit_rate
Definition: vaapi_encode_mpeg2.c:42
vaapi_encode_mpeg2_write_sequence_header
static int vaapi_encode_mpeg2_write_sequence_header(AVCodecContext *avctx, char *data, size_t *data_len)
Definition: vaapi_encode_mpeg2.c:108
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:209
av_inv_q
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition: rational.h:159
vaapi_encode_mpeg2_init_sequence_params
static int vaapi_encode_mpeg2_init_sequence_params(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:165
profile
int profile
Definition: mxfenc.c:2003
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:526
AVCodecContext::height
int height
Definition: avcodec.h:556
MPEG2RawSequenceDisplayExtension::transfer_characteristics
uint8_t transfer_characteristics
Definition: cbs_mpeg2.h:102
VAAPIEncodeMPEG2Context::level
int level
Definition: vaapi_encode_mpeg2.c:35
ff_cbs_write_fragment_data
int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Write the content of the fragment to its own internal buffer.
Definition: cbs.c:394
avcodec.h
av_cmp_q
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition: rational.h:89
ff_vaapi_encode_hw_configs
const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]
Definition: vaapi_encode.c:32
MPEG2RawPictureCodingExtension::burst_amplitude
uint8_t burst_amplitude
Definition: cbs_mpeg2.h:157
ff_vaapi_encode_init
av_cold int ff_vaapi_encode_init(AVCodecContext *avctx)
Definition: vaapi_encode.c:2362
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
MPEG2_EXTENSION_SEQUENCE_DISPLAY
@ MPEG2_EXTENSION_SEQUENCE_DISPLAY
Definition: cbs_mpeg2.h:46
ff_cbs_init
int ff_cbs_init(CodedBitstreamContext **ctx_ptr, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
Definition: cbs.c:76
vaapi_encode_mpeg2_defaults
static const AVCodecDefault vaapi_encode_mpeg2_defaults[]
Definition: vaapi_encode_mpeg2.c:671
MPEG2RawPictureHeader::full_pel_forward_vector
uint8_t full_pel_forward_vector
Definition: cbs_mpeg2.h:130
MPEG2RawExtensionData::picture_coding
MPEG2RawPictureCodingExtension picture_coding
Definition: cbs_mpeg2.h:185
AVCodecContext
main external API structure.
Definition: avcodec.h:383
MPEG2RawPictureHeader::picture_start_code
uint8_t picture_start_code
Definition: cbs_mpeg2.h:124
MPEG2RawPictureHeader::picture_coding_type
uint8_t picture_coding_type
Definition: cbs_mpeg2.h:127
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1525
MPEG2RawPictureCodingExtension::v_axis
uint8_t v_axis
Definition: cbs_mpeg2.h:154
AVCodecContext::i_quant_offset
float i_quant_offset
qscale offset between P and I-frames
Definition: avcodec.h:695
AV_CODEC_CAP_DELAY
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:82
MPEG2RawPictureCodingExtension::picture_structure
uint8_t picture_structure
Definition: cbs_mpeg2.h:142
VAAPIEncodeMPEG2Context::sequence_extension
MPEG2RawExtensionData sequence_extension
Definition: vaapi_encode_mpeg2.c:55
VAAPIEncodeMPEG2Context::f_code_vertical
unsigned int f_code_vertical
Definition: vaapi_encode_mpeg2.c:48
MPEG2RawSequenceDisplayExtension::display_vertical_size
uint16_t display_vertical_size
Definition: cbs_mpeg2.h:106
MPEG2RawPictureHeader::vbv_delay
uint16_t vbv_delay
Definition: cbs_mpeg2.h:128
VAAPIEncodeMPEG2Context::sequence_header
MPEG2RawSequenceHeader sequence_header
Definition: vaapi_encode_mpeg2.c:54
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
VAAPIEncodeSlice::block_size
int block_size
Definition: vaapi_encode.h:66
MPEG2RawSequenceHeader::vbv_buffer_size_value
uint16_t vbv_buffer_size_value
Definition: cbs_mpeg2.h:67
MPEG2_START_EXTENSION
@ MPEG2_START_EXTENSION
Definition: cbs_mpeg2.h:35
vaapi_encode_mpeg2_add_header
static int vaapi_encode_mpeg2_add_header(AVCodecContext *avctx, CodedBitstreamFragment *frag, int type, void *header)
Definition: vaapi_encode_mpeg2.c:92
MPEG2_START_SEQUENCE_HEADER
@ MPEG2_START_SEQUENCE_HEADER
Definition: cbs_mpeg2.h:33
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
MPEG2RawPictureCodingExtension::intra_dc_precision
uint8_t intra_dc_precision
Definition: cbs_mpeg2.h:141
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:410
MPEG2RawPictureCodingExtension::f_code
uint8_t f_code[2][2]
Definition: cbs_mpeg2.h:139
MPEG2RawPictureCodingExtension::intra_vlc_format
uint8_t intra_vlc_format
Definition: cbs_mpeg2.h:147
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:556
VAAPIEncodeMPEG2Context::sequence_display_extension
MPEG2RawExtensionData sequence_display_extension
Definition: vaapi_encode_mpeg2.c:56
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
VAAPIEncodeMPEG2Context::quant_p
int quant_p
Definition: vaapi_encode_mpeg2.c:39
MPEG2RawGroupOfPicturesHeader::group_start_code
uint8_t group_start_code
Definition: cbs_mpeg2.h:110
vaapi_encode_mpeg2_write_picture_header
static int vaapi_encode_mpeg2_write_picture_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, char *data, size_t *data_len)
Definition: vaapi_encode_mpeg2.c:141
MPEG2RawSequenceHeader::bit_rate_value
uint32_t bit_rate_value
Definition: cbs_mpeg2.h:66
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:52
AVCodecContext::sample_aspect_ratio
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
Definition: avcodec.h:753
VAAPIEncodeProfile
Definition: vaapi_encode.h:130
VAAPIEncodeMPEG2Context::frame_rate
AVRational frame_rate
Definition: vaapi_encode_mpeg2.c:45
MPEG2RawPictureCodingExtension::sub_carrier_phase
uint8_t sub_carrier_phase
Definition: cbs_mpeg2.h:158
MPEG2RawPictureCodingExtension::top_field_first
uint8_t top_field_first
Definition: cbs_mpeg2.h:143
MPEG2RawPictureCodingExtension::progressive_frame
uint8_t progressive_frame
Definition: cbs_mpeg2.h:151
MPEG2RawSequenceHeader::load_non_intra_quantiser_matrix
uint8_t load_non_intra_quantiser_matrix
Definition: cbs_mpeg2.h:72