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 #include "libavutil/opt.h"
24 
25 #include "avcodec.h"
26 #include "cbs.h"
27 #include "cbs_mpeg2.h"
28 #include "codec_internal.h"
29 #include "mpeg12.h"
30 #include "vaapi_encode.h"
31 
32 typedef struct VAAPIEncodeMPEG2Context {
34 
35  // User options.
36  int profile;
37  int level;
38 
39  // Derived settings.
40  int quant_i;
41  int quant_p;
42  int quant_b;
43 
44  unsigned int bit_rate;
45  unsigned int vbv_buffer_size;
46 
48 
49  unsigned int f_code_horizontal;
50  unsigned int f_code_vertical;
51 
52  // Stream state.
53  int64_t last_i_frame;
54 
55  // Writer structures.
62 
66 
67 
69  char *data, size_t *data_len,
71 {
72  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
73  int err;
74 
75  err = ff_cbs_write_fragment_data(priv->cbc, frag);
76  if (err < 0) {
77  av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n");
78  return err;
79  }
80 
81  if (*data_len < 8 * frag->data_size - frag->data_bit_padding) {
82  av_log(avctx, AV_LOG_ERROR, "Access unit too large: "
83  "%zu < %zu.\n", *data_len,
84  8 * frag->data_size - frag->data_bit_padding);
85  return AVERROR(ENOSPC);
86  }
87 
88  memcpy(data, frag->data, frag->data_size);
89  *data_len = 8 * frag->data_size - frag->data_bit_padding;
90 
91  return 0;
92 }
93 
96  int type, void *header)
97 {
98  int err;
99 
100  err = ff_cbs_insert_unit_content(frag, -1, type, header, NULL);
101  if (err < 0) {
102  av_log(avctx, AV_LOG_ERROR, "Failed to add header: "
103  "type = %d.\n", type);
104  return err;
105  }
106 
107  return 0;
108 }
109 
111  char *data, size_t *data_len)
112 {
113  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
115  int err;
116 
118  &priv->sequence_header);
119  if (err < 0)
120  goto fail;
121 
123  &priv->sequence_extension);
124  if (err < 0)
125  goto fail;
126 
129  if (err < 0)
130  goto fail;
131 
133  &priv->gop_header);
134  if (err < 0)
135  goto fail;
136 
137  err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
138 fail:
139  ff_cbs_fragment_reset(frag);
140  return 0;
141 }
142 
144  VAAPIEncodePicture *pic,
145  char *data, size_t *data_len)
146 {
147  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
149  int err;
150 
152  &priv->picture_header);
153  if (err < 0)
154  goto fail;
155 
157  &priv->picture_coding_extension);
158  if (err < 0)
159  goto fail;
160 
161  err = vaapi_encode_mpeg2_write_fragment(avctx, data, data_len, frag);
162 fail:
163  ff_cbs_fragment_reset(frag);
164  return 0;
165 }
166 
168 {
169  VAAPIEncodeContext *ctx = avctx->priv_data;
170  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
177  VAEncSequenceParameterBufferMPEG2 *vseq = ctx->codec_sequence_params;
178  VAEncPictureParameterBufferMPEG2 *vpic = ctx->codec_picture_params;
179  int code, ext_n, ext_d;
180 
181  memset(sh, 0, sizeof(*sh));
182  memset(se, 0, sizeof(*se));
183  memset(sde, 0, sizeof(*sde));
184  memset(goph, 0, sizeof(*goph));
185  memset(ph, 0, sizeof(*ph));
186  memset(pce, 0, sizeof(*pce));
187 
188 
189  if (ctx->va_bit_rate > 0) {
190  priv->bit_rate = (ctx->va_bit_rate + 399) / 400;
191  } else {
192  // Unknown (not a bitrate-targetting mode), so just use the
193  // highest value.
194  priv->bit_rate = 0x3fffffff;
195  }
196  if (avctx->rc_buffer_size > 0) {
197  priv->vbv_buffer_size = (avctx->rc_buffer_size + (1 << 14) - 1) >> 14;
198  } else {
199  // Unknown, so guess a value from the bitrate.
200  priv->vbv_buffer_size = priv->bit_rate >> 14;
201  }
202 
203  switch (avctx->level) {
204  case 4: // High.
205  case 6: // High 1440.
206  priv->f_code_horizontal = 9;
207  priv->f_code_vertical = 5;
208  break;
209  case 8: // Main.
210  priv->f_code_horizontal = 8;
211  priv->f_code_vertical = 5;
212  break;
213  case 10: // Low.
214  default:
215  priv->f_code_horizontal = 7;
216  priv->f_code_vertical = 4;
217  break;
218  }
219 
220 
221  // Sequence header
222 
224 
225  sh->horizontal_size_value = avctx->width & 0xfff;
226  sh->vertical_size_value = avctx->height & 0xfff;
227 
228  if (avctx->sample_aspect_ratio.num != 0 &&
229  avctx->sample_aspect_ratio.den != 0) {
231  (AVRational) { avctx->width, avctx->height });
232 
233  if (av_cmp_q(avctx->sample_aspect_ratio, (AVRational) { 1, 1 }) == 0) {
234  sh->aspect_ratio_information = 1;
235  } else if (av_cmp_q(dar, (AVRational) { 3, 4 }) == 0) {
236  sh->aspect_ratio_information = 2;
237  } else if (av_cmp_q(dar, (AVRational) { 9, 16 }) == 0) {
238  sh->aspect_ratio_information = 3;
239  } else if (av_cmp_q(dar, (AVRational) { 100, 221 }) == 0) {
240  sh->aspect_ratio_information = 4;
241  } else {
242  av_log(avctx, AV_LOG_WARNING, "Sample aspect ratio %d:%d is not "
243  "representable, signalling square pixels instead.\n",
244  avctx->sample_aspect_ratio.num,
245  avctx->sample_aspect_ratio.den);
246  sh->aspect_ratio_information = 1;
247  }
248  } else {
249  // Unknown - assume square pixels.
250  sh->aspect_ratio_information = 1;
251  }
252 
253  if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
254  priv->frame_rate = avctx->framerate;
255  else
256  priv->frame_rate = av_inv_q(avctx->time_base);
258  &code, &ext_n, &ext_d, 0);
259  sh->frame_rate_code = code;
260 
261  sh->bit_rate_value = priv->bit_rate & 0x3ffff;
262  sh->vbv_buffer_size_value = priv->vbv_buffer_size & 0x3ff;
263 
267 
268 
269  // Sequence extension
270 
274 
275  se->profile_and_level_indication = avctx->profile << 4 | avctx->level;
276  se->progressive_sequence = 1;
277  se->chroma_format = 1;
278 
279  se->horizontal_size_extension = avctx->width >> 12;
280  se->vertical_size_extension = avctx->height >> 12;
281 
282  se->bit_rate_extension = priv->bit_rate >> 18;
283  se->vbv_buffer_size_extension = priv->vbv_buffer_size >> 10;
284  se->low_delay = ctx->b_per_p == 0;
285 
286  se->frame_rate_extension_n = ext_n;
287  se->frame_rate_extension_d = ext_d;
288 
289 
290  // Sequence display extension
291 
296 
297  // Unspecified video format, from table 6-6.
298  sde->video_format = 5;
299 
300  sde->colour_primaries = avctx->color_primaries;
301  sde->transfer_characteristics = avctx->color_trc;
302  sde->matrix_coefficients = avctx->colorspace;
303  sde->colour_description =
305  avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
307 
308  sde->display_horizontal_size = avctx->width;
309  sde->display_vertical_size = avctx->height;
310 
311 
312  // GOP header
313 
315 
316  // Marker bit in the middle of time_code.
317  goph->time_code = 1 << 12;
318  goph->closed_gop = 1;
319  goph->broken_link = 0;
320 
321 
322  // Defaults for picture header
323 
324  ph->picture_start_code = MPEG2_START_PICTURE;
325 
326  ph->vbv_delay = 0xffff; // Not currently calculated.
327 
328  ph->full_pel_forward_vector = 0;
329  ph->forward_f_code = 7;
330  ph->full_pel_backward_vector = 0;
331  ph->forward_f_code = 7;
332 
333 
334  // Defaults for picture coding extension
335 
340 
341  pce->intra_dc_precision = 0;
342  pce->picture_structure = 3;
343  pce->top_field_first = 0;
344  pce->frame_pred_frame_dct = 1;
346  pce->q_scale_type = 0;
347  pce->intra_vlc_format = 0;
348  pce->alternate_scan = 0;
349  pce->repeat_first_field = 0;
350  pce->progressive_frame = 1;
351  pce->composite_display_flag = 0;
352 
353 
354 
355  *vseq = (VAEncSequenceParameterBufferMPEG2) {
356  .intra_period = ctx->gop_size,
357  .ip_period = ctx->b_per_p + 1,
358 
359  .picture_width = avctx->width,
360  .picture_height = avctx->height,
361 
362  .bits_per_second = ctx->va_bit_rate,
363  .frame_rate = av_q2d(priv->frame_rate),
364  .aspect_ratio_information = sh->aspect_ratio_information,
365  .vbv_buffer_size = priv->vbv_buffer_size,
366 
367  .sequence_extension.bits = {
368  .profile_and_level_indication = se->profile_and_level_indication,
369  .progressive_sequence = se->progressive_sequence,
370  .chroma_format = se->chroma_format,
371  .low_delay = se->low_delay,
372  .frame_rate_extension_n = se->frame_rate_extension_n,
373  .frame_rate_extension_d = se->frame_rate_extension_d,
374  },
375 
376  .new_gop_header = 1,
377  .gop_header.bits = {
378  .time_code = goph->time_code,
379  .closed_gop = goph->closed_gop,
380  .broken_link = goph->broken_link,
381  },
382  };
383 
384  *vpic = (VAEncPictureParameterBufferMPEG2) {
385  .forward_reference_picture = VA_INVALID_ID,
386  .backward_reference_picture = VA_INVALID_ID,
387  .reconstructed_picture = VA_INVALID_ID,
388  .coded_buf = VA_INVALID_ID,
389 
390  .vbv_delay = 0xffff,
391  .f_code = { { 15, 15 }, { 15, 15 } },
392 
393  .picture_coding_extension.bits = {
394  .intra_dc_precision = pce->intra_dc_precision,
395  .picture_structure = pce->picture_structure,
396  .top_field_first = pce->top_field_first,
397  .frame_pred_frame_dct = pce->frame_pred_frame_dct,
398  .concealment_motion_vectors = pce->concealment_motion_vectors,
399  .q_scale_type = pce->q_scale_type,
400  .intra_vlc_format = pce->intra_vlc_format,
401  .alternate_scan = pce->alternate_scan,
402  .repeat_first_field = pce->repeat_first_field,
403  .progressive_frame = pce->progressive_frame,
404  .composite_display_flag = pce->composite_display_flag,
405  },
406 
407  .composite_display.bits = {
408  .v_axis = pce->v_axis,
409  .field_sequence = pce->field_sequence,
410  .sub_carrier = pce->sub_carrier,
411  .burst_amplitude = pce->burst_amplitude,
412  .sub_carrier_phase = pce->sub_carrier_phase,
413  },
414  };
415 
416  return 0;
417 }
418 
420  VAAPIEncodePicture *pic)
421 {
422  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
425  VAEncPictureParameterBufferMPEG2 *vpic = pic->codec_picture_params;
426 
427  if (pic->type == PICTURE_TYPE_IDR || pic->type == PICTURE_TYPE_I) {
428  ph->temporal_reference = 0;
429  ph->picture_coding_type = 1;
430  priv->last_i_frame = pic->display_order;
431  } else {
432  ph->temporal_reference = pic->display_order - priv->last_i_frame;
433  ph->picture_coding_type = pic->type == PICTURE_TYPE_B ? 3 : 2;
434  }
435 
436  if (pic->type == PICTURE_TYPE_P || pic->type == PICTURE_TYPE_B) {
437  pce->f_code[0][0] = priv->f_code_horizontal;
438  pce->f_code[0][1] = priv->f_code_vertical;
439  } else {
440  pce->f_code[0][0] = 15;
441  pce->f_code[0][1] = 15;
442  }
443  if (pic->type == PICTURE_TYPE_B) {
444  pce->f_code[1][0] = priv->f_code_horizontal;
445  pce->f_code[1][1] = priv->f_code_vertical;
446  } else {
447  pce->f_code[1][0] = 15;
448  pce->f_code[1][1] = 15;
449  }
450 
451  vpic->reconstructed_picture = pic->recon_surface;
452  vpic->coded_buf = pic->output_buffer;
453 
454  switch (pic->type) {
455  case PICTURE_TYPE_IDR:
456  case PICTURE_TYPE_I:
457  vpic->picture_type = VAEncPictureTypeIntra;
458  break;
459  case PICTURE_TYPE_P:
460  vpic->picture_type = VAEncPictureTypePredictive;
461  vpic->forward_reference_picture = pic->refs[0][0]->recon_surface;
462  break;
463  case PICTURE_TYPE_B:
464  vpic->picture_type = VAEncPictureTypeBidirectional;
465  vpic->forward_reference_picture = pic->refs[0][0]->recon_surface;
466  vpic->backward_reference_picture = pic->refs[1][0]->recon_surface;
467  break;
468  default:
469  av_assert0(0 && "invalid picture type");
470  }
471 
472  vpic->temporal_reference = ph->temporal_reference;
473  vpic->f_code[0][0] = pce->f_code[0][0];
474  vpic->f_code[0][1] = pce->f_code[0][1];
475  vpic->f_code[1][0] = pce->f_code[1][0];
476  vpic->f_code[1][1] = pce->f_code[1][1];
477 
478  return 0;
479 }
480 
482  VAAPIEncodePicture *pic,
483  VAAPIEncodeSlice *slice)
484 {
485  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
486  VAEncSliceParameterBufferMPEG2 *vslice = slice->codec_slice_params;
487  int qp;
488 
489  vslice->macroblock_address = slice->block_start;
490  vslice->num_macroblocks = slice->block_size;
491 
492  switch (pic->type) {
493  case PICTURE_TYPE_IDR:
494  case PICTURE_TYPE_I:
495  qp = priv->quant_i;
496  break;
497  case PICTURE_TYPE_P:
498  qp = priv->quant_p;
499  break;
500  case PICTURE_TYPE_B:
501  qp = priv->quant_b;
502  break;
503  default:
504  av_assert0(0 && "invalid picture type");
505  }
506 
507  vslice->quantiser_scale_code = qp;
508  vslice->is_intra_slice = (pic->type == PICTURE_TYPE_IDR ||
509  pic->type == PICTURE_TYPE_I);
510 
511  return 0;
512 }
513 
515 {
516  VAAPIEncodeContext *ctx = avctx->priv_data;
517  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
518  int err;
519 
520  err = ff_cbs_init(&priv->cbc, AV_CODEC_ID_MPEG2VIDEO, avctx);
521  if (err < 0)
522  return err;
523 
524  if (ctx->va_rc_mode == VA_RC_CQP) {
525  priv->quant_p = av_clip(ctx->rc_quality, 1, 31);
526  if (avctx->i_quant_factor > 0.0)
527  priv->quant_i =
528  av_clip((avctx->i_quant_factor * priv->quant_p +
529  avctx->i_quant_offset) + 0.5, 1, 31);
530  else
531  priv->quant_i = priv->quant_p;
532  if (avctx->b_quant_factor > 0.0)
533  priv->quant_b =
534  av_clip((avctx->b_quant_factor * priv->quant_p +
535  avctx->b_quant_offset) + 0.5, 1, 31);
536  else
537  priv->quant_b = priv->quant_p;
538 
539  av_log(avctx, AV_LOG_DEBUG, "Using fixed quantiser "
540  "%d / %d / %d for I- / P- / B-frames.\n",
541  priv->quant_i, priv->quant_p, priv->quant_b);
542 
543  } else {
544  priv->quant_i = 16;
545  priv->quant_p = 16;
546  priv->quant_b = 16;
547  }
548 
549  ctx->slice_block_rows = FFALIGN(avctx->height, 16) / 16;
550  ctx->slice_block_cols = FFALIGN(avctx->width, 16) / 16;
551 
552  ctx->nb_slices = ctx->slice_block_rows;
553  ctx->slice_size = 1;
554 
555  ctx->roi_quant_range = 31;
556 
557  return 0;
558 }
559 
561  { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main },
562  { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
564 };
565 
568 
569  .flags = FLAG_B_PICTURES,
570 
571  .configure = &vaapi_encode_mpeg2_configure,
572 
573  .default_quality = 10,
574 
575  .sequence_params_size = sizeof(VAEncSequenceParameterBufferMPEG2),
576  .init_sequence_params = &vaapi_encode_mpeg2_init_sequence_params,
577 
578  .picture_params_size = sizeof(VAEncPictureParameterBufferMPEG2),
579  .init_picture_params = &vaapi_encode_mpeg2_init_picture_params,
580 
581  .slice_params_size = sizeof(VAEncSliceParameterBufferMPEG2),
582  .init_slice_params = &vaapi_encode_mpeg2_init_slice_params,
583 
584  .sequence_header_type = VAEncPackedHeaderSequence,
585  .write_sequence_header = &vaapi_encode_mpeg2_write_sequence_header,
586 
587  .picture_header_type = VAEncPackedHeaderPicture,
588  .write_picture_header = &vaapi_encode_mpeg2_write_picture_header,
589 };
590 
592 {
593  VAAPIEncodeContext *ctx = avctx->priv_data;
594  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
595 
596  ctx->codec = &vaapi_encode_type_mpeg2;
597 
598  if (avctx->profile == AV_PROFILE_UNKNOWN)
599  avctx->profile = priv->profile;
600  if (avctx->level == AV_LEVEL_UNKNOWN)
601  avctx->level = priv->level;
602 
603  // Reject unknown levels (these are required to set f_code for
604  // motion vector encoding).
605  switch (avctx->level) {
606  case 4: // High
607  case 6: // High 1440
608  case 8: // Main
609  case 10: // Low
610  break;
611  default:
612  av_log(avctx, AV_LOG_ERROR, "Unknown MPEG-2 level %d.\n",
613  avctx->level);
614  return AVERROR(EINVAL);
615  }
616 
617  if (avctx->height % 4096 == 0 || avctx->width % 4096 == 0) {
618  av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support picture "
619  "height or width divisible by 4096.\n");
620  return AVERROR(EINVAL);
621  }
622 
623  ctx->desired_packed_headers = VA_ENC_PACKED_HEADER_SEQUENCE |
624  VA_ENC_PACKED_HEADER_PICTURE;
625 
626  return ff_vaapi_encode_init(avctx);
627 }
628 
630 {
631  VAAPIEncodeMPEG2Context *priv = avctx->priv_data;
632 
634  ff_cbs_close(&priv->cbc);
635 
636  return ff_vaapi_encode_close(avctx);
637 }
638 
639 #define OFFSET(x) offsetof(VAAPIEncodeMPEG2Context, x)
640 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
644 
645  { "profile", "Set profile (in profile_and_level_indication)",
647  { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, .unit = "profile" },
648 
649 #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
650  { .i64 = value }, 0, 0, FLAGS, .unit = "profile"
651  { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) },
652  { PROFILE("main", AV_PROFILE_MPEG2_MAIN) },
653 #undef PROFILE
654 
655  { "level", "Set level (in profile_and_level_indication)",
657  { .i64 = 4 }, 0, 15, FLAGS, .unit = "level" },
658 
659 #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
660  { .i64 = value }, 0, 0, FLAGS, .unit = "level"
661  { LEVEL("low", 10) },
662  { LEVEL("main", 8) },
663  { LEVEL("high_1440", 6) },
664  { LEVEL("high", 4) },
665 #undef LEVEL
666 
667  { NULL },
668 };
669 
671  { "b", "0" },
672  { "bf", "1" },
673  { "g", "120" },
674  { "i_qfactor", "1" },
675  { "i_qoffset", "0" },
676  { "b_qfactor", "6/5" },
677  { "b_qoffset", "0" },
678  { "qmin", "-1" },
679  { "qmax", "-1" },
680  { NULL },
681 };
682 
684  .class_name = "mpeg2_vaapi",
685  .item_name = av_default_item_name,
686  .option = vaapi_encode_mpeg2_options,
687  .version = LIBAVUTIL_VERSION_INT,
688 };
689 
691  .p.name = "mpeg2_vaapi",
692  CODEC_LONG_NAME("MPEG-2 (VAAPI)"),
693  .p.type = AVMEDIA_TYPE_VIDEO,
694  .p.id = AV_CODEC_ID_MPEG2VIDEO,
695  .priv_data_size = sizeof(VAAPIEncodeMPEG2Context),
698  .close = &vaapi_encode_mpeg2_close,
699  .p.priv_class = &vaapi_encode_mpeg2_class,
700  .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
702  .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
704  .defaults = vaapi_encode_mpeg2_defaults,
705  .p.pix_fmts = (const enum AVPixelFormat[]) {
708  },
709  .hw_configs = ff_vaapi_encode_hw_configs,
710  .p.wrapper_name = "vaapi",
711 };
VAAPIEncodeMPEG2Context::cbc
CodedBitstreamContext * cbc
Definition: vaapi_encode_mpeg2.c:63
VAAPIEncodeMPEG2Context::picture_header
MPEG2RawPictureHeader picture_header
Definition: vaapi_encode_mpeg2.c:60
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:68
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:70
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
MPEG2RawPictureCodingExtension
Definition: cbs_mpeg2.h:138
MPEG2_EXTENSION_SEQUENCE
@ MPEG2_EXTENSION_SEQUENCE
Definition: cbs_mpeg2.h:45
level
uint8_t level
Definition: svq3.c:204
av_clip
#define av_clip
Definition: common.h:98
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: codec_internal.h:42
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
opt.h
AVCodecContext::colorspace
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:685
VAAPIEncodeMPEG2Context::gop_header
MPEG2RawGroupOfPicturesHeader gop_header
Definition: vaapi_encode_mpeg2.c:59
VAAPIEncodeMPEG2Context::vbv_buffer_size
unsigned int vbv_buffer_size
Definition: vaapi_encode_mpeg2.c:45
AV_PROFILE_MPEG2_SIMPLE
#define AV_PROFILE_MPEG2_SIMPLE
Definition: defs.h:104
ff_cbs_fragment_free
av_cold 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:185
AV_CODEC_CAP_HARDWARE
#define AV_CODEC_CAP_HARDWARE
Codec is backed by a hardware implementation.
Definition: codec.h:145
av_div_q
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
Definition: rational.c:88
ff_cbs_insert_unit_content
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, void *content_ref)
Insert a new unit into a fragment with the given content.
Definition: cbs.c:782
se
#define se(name, range_min, range_max)
Definition: cbs_h2645.c:259
MPEG2RawPictureHeader
Definition: cbs_mpeg2.h:123
FLAG_B_PICTURES
@ FLAG_B_PICTURES
Definition: vaapi_encode.h:408
VAAPIEncodeMPEG2Context::f_code_horizontal
unsigned int f_code_horizontal
Definition: vaapi_encode_mpeg2.c:49
ph
static int FUNC() ph(CodedBitstreamContext *ctx, RWContext *rw, H266RawPH *current)
Definition: cbs_h266_syntax_template.c:2998
MPEG2RawExtensionData::sequence_display
MPEG2RawSequenceDisplayExtension sequence_display
Definition: cbs_mpeg2.h:183
AVCodecContext::color_trc
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:678
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:171
MPEG2RawPictureCodingExtension::alternate_scan
uint8_t alternate_scan
Definition: cbs_mpeg2.h:148
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:219
VAAPIEncodeSlice
Definition: vaapi_encode.h:64
AVOption
AVOption.
Definition: opt.h:346
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:583
data
const char data[16]
Definition: mxf.c:148
AVCodecContext::b_quant_offset
float b_quant_offset
qscale offset between IP and B-frames
Definition: avcodec.h:811
VAAPIEncodeSlice::block_start
int block_start
Definition: vaapi_encode.h:68
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
FFCodec
Definition: codec_internal.h:127
ff_vaapi_encode_close
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx)
Definition: vaapi_encode.c:2965
cbs.h
MPEG2_START_EXTENSION
@ MPEG2_START_EXTENSION
Definition: cbs_mpeg2.h:35
MPEG2RawExtensionData
Definition: cbs_mpeg2.h:177
PICTURE_TYPE_IDR
@ PICTURE_TYPE_IDR
Definition: vaapi_encode.h:58
MPEG2RawSequenceDisplayExtension::display_horizontal_size
uint16_t display_horizontal_size
Definition: cbs_mpeg2.h:105
VAAPIEncodeMPEG2Context::profile
int profile
Definition: vaapi_encode_mpeg2.c:36
vaapi_encode_mpeg2_close
static av_cold int vaapi_encode_mpeg2_close(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:629
MPEG2RawSequenceHeader::load_intra_quantiser_matrix
uint8_t load_intra_quantiser_matrix
Definition: cbs_mpeg2.h:70
MPEG2RawSequenceHeader::frame_rate_code
uint8_t frame_rate_code
Definition: cbs_mpeg2.h:65
VAAPIEncodeMPEG2Context
Definition: vaapi_encode_mpeg2.c:32
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
ff_cbs_close
av_cold void ff_cbs_close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
Definition: cbs.c:141
VAAPIEncodePicture::refs
struct VAAPIEncodePicture * refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]
Definition: vaapi_encode.h:125
AVCodecContext::framerate
AVRational framerate
Definition: avcodec.h:560
vaapi_encode_mpeg2_configure
static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
Definition: vaapi_encode_mpeg2.c:514
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:820
FFCodecDefault
Definition: codec_internal.h:97
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
FLAGS
#define FLAGS
Definition: vaapi_encode_mpeg2.c:640
vaapi_encode.h
fail
#define fail()
Definition: checkasm.h:179
VAAPIEncodePicture
Definition: vaapi_encode.h:73
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
vaapi_encode_mpeg2_options
static const AVOption vaapi_encode_mpeg2_options[]
Definition: vaapi_encode_mpeg2.c:641
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
MPEG2_START_GROUP
@ MPEG2_START_GROUP
Definition: cbs_mpeg2.h:37
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:33
VAAPIEncodeMPEG2Context::last_i_frame
int64_t last_i_frame
Definition: vaapi_encode_mpeg2.c:53
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:671
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
AV_PROFILE_UNKNOWN
#define AV_PROFILE_UNKNOWN
Definition: defs.h:65
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:111
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:122
vaapi_encode_mpeg2_init_picture_params
static int vaapi_encode_mpeg2_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic)
Definition: vaapi_encode_mpeg2.c:419
PICTURE_TYPE_I
@ PICTURE_TYPE_I
Definition: vaapi_encode.h:59
CodedBitstreamFragment::data_size
size_t data_size
The number of bytes in the bitstream.
Definition: cbs.h:135
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:40
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
LEVEL
#define LEVEL(name, value)
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:1396
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:139
ff_mpeg2_vaapi_encoder
const FFCodec ff_mpeg2_vaapi_encoder
Definition: vaapi_encode_mpeg2.c:690
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:558
VAAPIEncodeType
Definition: vaapi_encode.h:419
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
VAAPIEncodeContext
Definition: vaapi_encode.h:195
AVCodecContext::rc_buffer_size
int rc_buffer_size
decoder bitstream buffer size
Definition: avcodec.h:1277
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
AV_LEVEL_UNKNOWN
#define AV_LEVEL_UNKNOWN
Definition: defs.h:196
VAAPIEncodeType::profiles
const VAAPIEncodeProfile * profiles
Definition: vaapi_encode.h:422
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
FF_CODEC_RECEIVE_PACKET_CB
#define FF_CODEC_RECEIVE_PACKET_CB(func)
Definition: codec_internal.h:302
MPEG2RawGroupOfPicturesHeader::broken_link
uint8_t broken_link
Definition: cbs_mpeg2.h:114
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
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:61
vaapi_encode_mpeg2_profiles
static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[]
Definition: vaapi_encode_mpeg2.c:560
cbs_mpeg2.h
OFFSET
#define OFFSET(x)
Definition: vaapi_encode_mpeg2.c:639
AVCodecContext::level
int level
Encoding level descriptor.
Definition: avcodec.h:1783
MPEG2_EXTENSION_SEQUENCE_DISPLAY
@ MPEG2_EXTENSION_SEQUENCE_DISPLAY
Definition: cbs_mpeg2.h:46
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:591
MPEG2_START_PICTURE
@ MPEG2_START_PICTURE
Definition: cbs_mpeg2.h:29
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:544
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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:92
codec_internal.h
VAAPI_ENCODE_RC_OPTIONS
#define VAAPI_ENCODE_RC_OPTIONS
Definition: vaapi_encode.h:532
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:683
VAAPIEncodeMPEG2Context::current_fragment
CodedBitstreamFragment current_fragment
Definition: vaapi_encode_mpeg2.c:64
CodedBitstreamFragment::data
uint8_t * data
Pointer to the bitstream form of this fragment.
Definition: cbs.h:128
header
static const uint8_t header[24]
Definition: sdr2.c:68
VAAPI_ENCODE_COMMON_OPTIONS
#define VAAPI_ENCODE_COMMON_OPTIONS
Definition: vaapi_encode.h:505
VAAPIEncodePicture::recon_surface
VASurfaceID recon_surface
Definition: vaapi_encode.h:101
MPEG2RawPictureCodingExtension::sub_carrier
uint8_t sub_carrier
Definition: cbs_mpeg2.h:156
VAAPIEncodePicture::output_buffer
VABufferID output_buffer
Definition: vaapi_encode.h:108
vaapi_encode_mpeg2_defaults
static const FFCodecDefault vaapi_encode_mpeg2_defaults[]
Definition: vaapi_encode_mpeg2.c:670
MPEG2RawSequenceHeader
Definition: cbs_mpeg2.h:59
VAAPIEncodePicture::display_order
int64_t display_order
Definition: vaapi_encode.h:76
AV_PIX_FMT_VAAPI
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
Definition: pixfmt.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:804
vaapi_encode_type_mpeg2
static const VAAPIEncodeType vaapi_encode_type_mpeg2
Definition: vaapi_encode_mpeg2.c:566
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:481
PICTURE_TYPE_B
@ PICTURE_TYPE_B
Definition: vaapi_encode.h:61
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
MPEG2RawSequenceHeader::sequence_header_code
uint8_t sequence_header_code
Definition: cbs_mpeg2.h:60
VAAPIEncodeMPEG2Context::quant_b
int quant_b
Definition: vaapi_encode_mpeg2.c:42
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:44
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:110
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
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:167
profile
int profile
Definition: mxfenc.c:2226
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:612
AVCodecContext::height
int height
Definition: avcodec.h:618
MPEG2_START_SEQUENCE_HEADER
@ MPEG2_START_SEQUENCE_HEADER
Definition: cbs_mpeg2.h:33
MPEG2RawSequenceDisplayExtension::transfer_characteristics
uint8_t transfer_characteristics
Definition: cbs_mpeg2.h:102
VAAPIEncodeMPEG2Context::level
int level
Definition: vaapi_encode_mpeg2.c:37
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:408
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:35
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:2756
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
MPEG2RawExtensionData::picture_coding
MPEG2RawPictureCodingExtension picture_coding
Definition: cbs_mpeg2.h:185
AVCodecContext
main external API structure.
Definition: avcodec.h:445
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1639
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:827
AV_PROFILE_MPEG2_MAIN
#define AV_PROFILE_MPEG2_MAIN
Definition: defs.h:103
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:76
MPEG2RawPictureCodingExtension::picture_structure
uint8_t picture_structure
Definition: cbs_mpeg2.h:142
VAAPIEncodeMPEG2Context::sequence_extension
MPEG2RawExtensionData sequence_extension
Definition: vaapi_encode_mpeg2.c:57
VAAPIEncodeMPEG2Context::f_code_vertical
unsigned int f_code_vertical
Definition: vaapi_encode_mpeg2.c:50
MPEG2RawSequenceDisplayExtension::display_vertical_size
uint16_t display_vertical_size
Definition: cbs_mpeg2.h:106
VAAPIEncodeMPEG2Context::sequence_header
MPEG2RawSequenceHeader sequence_header
Definition: vaapi_encode_mpeg2.c:56
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
VAAPIEncodeSlice::block_size
int block_size
Definition: vaapi_encode.h:69
MPEG2RawExtensionData::data
union MPEG2RawExtensionData::@55 data
MPEG2RawSequenceHeader::vbv_buffer_size_value
uint16_t vbv_buffer_size_value
Definition: cbs_mpeg2.h:67
ff_cbs_init
av_cold 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:89
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:94
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:472
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:618
VAAPIEncodeMPEG2Context::sequence_display_extension
MPEG2RawExtensionData sequence_display_extension
Definition: vaapi_encode_mpeg2.c:58
MPEG2_EXTENSION_PICTURE_CODING
@ MPEG2_EXTENSION_PICTURE_CODING
Definition: cbs_mpeg2.h:51
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
VAAPIEncodeMPEG2Context::quant_p
int quant_p
Definition: vaapi_encode_mpeg2.c:41
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:143
PICTURE_TYPE_P
@ PICTURE_TYPE_P
Definition: vaapi_encode.h:60
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:54
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:642
VAAPIEncodeProfile
Definition: vaapi_encode.h:150
VAAPIEncodeMPEG2Context::frame_rate
AVRational frame_rate
Definition: vaapi_encode_mpeg2.c:47
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