FFmpeg
evc_parser.c
Go to the documentation of this file.
1 /*
2  * EVC format parser
3  *
4  * Copyright (C) 2021 Dawid Kozinski <d.kozinski@samsung.com>
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 "avcodec.h"
24 #include "bytestream.h"
25 #include "evc.h"
26 #include "evc_parse.h"
27 
28 #include "libavutil/attributes.h"
29 
30 typedef struct EVCParserContext {
33 
36 
37 #define NUM_CHROMA_FORMATS 4 // @see ISO_IEC_23094-1 section 6.2 table 2
38 
41 };
42 
45 };
46 
49 };
50 
53 };
54 
57 };
58 
61 };
62 
64  const uint8_t *buf, int buf_size)
65 {
66  EVCParserContext *ctx = s->priv_data;
67  GetBitContext gb;
68  int nalu_type, tid;
69  int ret;
70 
71  if (buf_size <= 0) {
72  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size: (%d)\n", buf_size);
73  return AVERROR_INVALIDDATA;
74  }
75 
76  ret = init_get_bits8(&gb, buf, buf_size);
77  if (ret < 0)
78  return ret;
79 
80  // @see ISO_IEC_23094-1_2020, 7.4.2.2 NAL unit header semantic (Table 4 - NAL unit type codes and NAL unit type classes)
81  // @see enum EVCNALUnitType in evc.h
82  if (get_bits1(&gb)) {// forbidden_zero_bit
83  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit header\n");
84  return AVERROR_INVALIDDATA;
85  }
86 
87  nalu_type = get_bits(&gb, 6) - 1;
88  if (nalu_type < EVC_NOIDR_NUT || nalu_type > EVC_UNSPEC_NUT62) {
89  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit type: (%d)\n", nalu_type);
90  return AVERROR_INVALIDDATA;
91  }
92 
93  tid = get_bits(&gb, 3);
94  skip_bits(&gb, 5); // nuh_reserved_zero_5bits
95  skip_bits1(&gb); // nuh_extension_flag
96 
97  switch (nalu_type) {
98  case EVC_SPS_NUT:
99  ret = ff_evc_parse_sps(&gb, &ctx->ps);
100  if (ret < 0) {
101  av_log(avctx, AV_LOG_ERROR, "SPS parsing error\n");
102  return ret;
103  }
104  break;
105  case EVC_PPS_NUT:
106  ret = ff_evc_parse_pps(&gb, &ctx->ps);
107  if (ret < 0) {
108  av_log(avctx, AV_LOG_ERROR, "PPS parsing error\n");
109  return ret;
110  }
111  break;
112  case EVC_IDR_NUT: // Coded slice of a IDR or non-IDR picture
113  case EVC_NOIDR_NUT: {
114  const EVCParserPPS *pps;
115  const EVCParserSPS *sps;
117  int bit_depth;
118 
119  ret = ff_evc_parse_slice_header(&gb, &sh, &ctx->ps, nalu_type);
120  if (ret < 0) {
121  av_log(avctx, AV_LOG_ERROR, "Slice header parsing error\n");
122  return ret;
123  }
124 
125  pps = ctx->ps.pps[sh.slice_pic_parameter_set_id];
126  sps = ctx->ps.sps[pps->pps_seq_parameter_set_id];
127  av_assert0(sps && pps);
128 
129  s->coded_width = sps->pic_width_in_luma_samples;
130  s->coded_height = sps->pic_height_in_luma_samples;
131 
132  if (sps->picture_cropping_flag) {
133  s->width = sps->pic_width_in_luma_samples - sps->picture_crop_left_offset - sps->picture_crop_right_offset;
134  s->height = sps->pic_height_in_luma_samples - sps->picture_crop_top_offset - sps->picture_crop_bottom_offset;
135  } else {
136  s->width = sps->pic_width_in_luma_samples;
137  s->height = sps->pic_height_in_luma_samples;
138  }
139 
140  switch (sh.slice_type) {
141  case EVC_SLICE_TYPE_B: {
142  s->pict_type = AV_PICTURE_TYPE_B;
143  break;
144  }
145  case EVC_SLICE_TYPE_P: {
146  s->pict_type = AV_PICTURE_TYPE_P;
147  break;
148  }
149  case EVC_SLICE_TYPE_I: {
150  s->pict_type = AV_PICTURE_TYPE_I;
151  break;
152  }
153  default: {
154  s->pict_type = AV_PICTURE_TYPE_NONE;
155  }
156  }
157 
158  avctx->profile = sps->profile_idc;
159 
160  if (sps->vui_parameters_present_flag && sps->vui_parameters.timing_info_present_flag) {
161  int64_t num = sps->vui_parameters.num_units_in_tick;
162  int64_t den = sps->vui_parameters.time_scale;
163  if (num != 0 && den != 0)
164  av_reduce(&avctx->framerate.den, &avctx->framerate.num, num, den, 1 << 30);
165  } else
166  avctx->framerate = (AVRational) { 0, 1 };
167 
168  bit_depth = sps->bit_depth_chroma_minus8 + 8;
169  s->format = AV_PIX_FMT_NONE;
170 
171  switch (bit_depth) {
172  case 8:
173  s->format = pix_fmts_8bit[sps->chroma_format_idc];
174  break;
175  case 9:
176  s->format = pix_fmts_9bit[sps->chroma_format_idc];
177  break;
178  case 10:
179  s->format = pix_fmts_10bit[sps->chroma_format_idc];
180  break;
181  case 12:
182  s->format = pix_fmts_12bit[sps->chroma_format_idc];
183  break;
184  case 14:
185  s->format = pix_fmts_14bit[sps->chroma_format_idc];
186  break;
187  case 16:
188  s->format = pix_fmts_16bit[sps->chroma_format_idc];
189  break;
190  }
191 
192  s->key_frame = (nalu_type == EVC_IDR_NUT) ? 1 : 0;
193 
194  // POC (picture order count of the current picture) derivation
195  // @see ISO/IEC 23094-1:2020(E) 8.3.1 Decoding process for picture order count
196  ret = ff_evc_derive_poc(&ctx->ps, &sh, &ctx->poc, nalu_type, tid);
197  if (ret < 0)
198  return ret;
199 
200  s->output_picture_number = ctx->poc.PicOrderCntVal;
201 
202  break;
203  }
204  case EVC_SEI_NUT: // Supplemental Enhancement Information
205  case EVC_APS_NUT: // Adaptation parameter set
206  case EVC_FD_NUT: // Filler data
207  default:
208  break;
209  }
210 
211  return 0;
212 }
213 
214 /**
215  * Parse NAL units of found picture and decode some basic information.
216  *
217  * @param s codec parser context
218  * @param avctx codec context
219  * @param buf buffer with field/frame data
220  * @param buf_size size of the buffer
221  */
222 static int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
223 {
224  const uint8_t *data = buf;
225  int data_size = buf_size;
226 
227  while (data_size > 0) {
228  int nalu_size = 0;
229  int ret;
230 
231  // Buffer size is not enough for buffer to store NAL unit 4-bytes prefix (length)
232  if (data_size < EVC_NALU_LENGTH_PREFIX_SIZE)
233  return AVERROR_INVALIDDATA;
234 
235  nalu_size = evc_read_nal_unit_length(data, data_size, avctx);
236 
237 
239  data_size -= EVC_NALU_LENGTH_PREFIX_SIZE;
240 
241  if (data_size < nalu_size)
242  return AVERROR_INVALIDDATA;
243 
244  ret = parse_nal_unit(s, avctx, data, nalu_size);
245  if (ret < 0) {
246  av_log(avctx, AV_LOG_ERROR, "Parsing of NAL unit failed\n");
247  return AVERROR_INVALIDDATA;
248  }
249 
250  data += nalu_size;
251  data_size -= nalu_size;
252  }
253  return 0;
254 }
255 
256 // Decoding nal units from evcC (EVCDecoderConfigurationRecord)
257 // @see @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.2
259 {
260  const uint8_t *data = avctx->extradata;
261  int size = avctx->extradata_size;
262  int ret = 0;
263  GetByteContext gb;
264 
265  bytestream2_init(&gb, data, size);
266 
267  if (!data || size <= 0)
268  return -1;
269 
270  // extradata is encoded as evcC format.
271  if (data[0] == 1) {
272  int num_of_arrays; // indicates the number of arrays of NAL units of the indicated type(s)
273 
274  int nalu_length_field_size; // indicates the length in bytes of the NALUnitLenght field in EVC video stream sample in the stream
275  // The value of this field shall be one of 0, 1, or 3 corresponding to a length encoded with 1, 2, or 4 bytes, respectively.
276 
277  if (bytestream2_get_bytes_left(&gb) < 18) {
278  av_log(avctx, AV_LOG_ERROR, "evcC %d too short\n", size);
279  return AVERROR_INVALIDDATA;
280  }
281 
282  bytestream2_skip(&gb, 16);
283 
284  // @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
285  // LengthSizeMinusOne plus 1 indicates the length in bytes of the NALUnitLength field in a EVC video stream sample in the stream to which this configuration record applies. For example, a size of one byte is indicated with a value of 0.
286  // The value of this field shall be one of 0, 1, or 3 corresponding to a length encoded with 1, 2, or 4 bytes, respectively.
287  nalu_length_field_size = (bytestream2_get_byte(&gb) & 3) + 1;
288  if( nalu_length_field_size != 1 &&
289  nalu_length_field_size != 2 &&
290  nalu_length_field_size != 4 ) {
291  av_log(avctx, AV_LOG_ERROR, "The length in bytes of the NALUnitLenght field in a EVC video stream has unsupported value of %d\n", nalu_length_field_size);
292  return AVERROR_INVALIDDATA;
293  }
294 
295  num_of_arrays = bytestream2_get_byte(&gb);
296 
297  /* Decode nal units from evcC. */
298  for (int i = 0; i < num_of_arrays; i++) {
299 
300  // @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
301  // NAL_unit_type indicates the type of the NAL units in the following array (which shall be all of that type);
302  // - it takes a value as defined in ISO/IEC 23094-1;
303  // - it is restricted to take one of the values indicating a SPS, PPS, APS, or SEI NAL unit.
304  int nal_unit_type = bytestream2_get_byte(&gb) & 0x3f;
305  int num_nalus = bytestream2_get_be16(&gb);
306 
307  for (int j = 0; j < num_nalus; j++) {
308 
309  int nal_unit_length = bytestream2_get_be16(&gb);
310 
311  if (bytestream2_get_bytes_left(&gb) < nal_unit_length) {
312  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size in extradata.\n");
313  return AVERROR_INVALIDDATA;
314  }
315 
316  if( nal_unit_type == EVC_SPS_NUT ||
317  nal_unit_type == EVC_PPS_NUT ||
318  nal_unit_type == EVC_APS_NUT ||
319  nal_unit_type == EVC_SEI_NUT ) {
320  if (parse_nal_unit(s, avctx, gb.buffer, nal_unit_length) != 0) {
321  av_log(avctx, AV_LOG_ERROR, "Parsing of NAL unit failed\n");
322  return AVERROR_INVALIDDATA;
323  }
324  }
325 
326  bytestream2_skip(&gb, nal_unit_length);
327  }
328  }
329  } else
330  return -1;
331 
332  return ret;
333 }
334 
336  const uint8_t **poutbuf, int *poutbuf_size,
337  const uint8_t *buf, int buf_size)
338 {
339  int next;
340  int ret;
341  EVCParserContext *ctx = s->priv_data;
342 
343  s->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
344  s->key_frame = 0;
345 
346  if (avctx->extradata && !ctx->parsed_extradata) {
347  decode_extradata(s, avctx);
348  ctx->parsed_extradata = 1;
349  }
350 
351  next = buf_size;
352 
353  ret = parse_nal_units(s, avctx, buf, buf_size);
354  if(ret < 0) {
355  *poutbuf = NULL;
356  *poutbuf_size = 0;
357  return buf_size;
358  }
359 
360  // poutbuf contains just one Access Unit
361  *poutbuf = buf;
362  *poutbuf_size = buf_size;
363 
364  return next;
365 }
366 
368 {
369  EVCParserContext *ctx = s->priv_data;
370 
371  ff_evc_ps_free(&ctx->ps);
372 }
373 
375  .codec_ids = { AV_CODEC_ID_EVC },
376  .priv_data_size = sizeof(EVCParserContext),
377  .parser_parse = evc_parse,
378  .parser_close = evc_parser_close,
379 };
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
parse_nal_units
static int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Parse NAL units of found picture and decode some basic information.
Definition: evc_parser.c:222
ff_evc_parse_pps
int ff_evc_parse_pps(GetBitContext *gb, EVCParamSets *ps)
Definition: evc_ps.c:352
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
Definition: bytestream.h:158
EVC_APS_NUT
@ EVC_APS_NUT
Definition: evc.h:60
GetByteContext
Definition: bytestream.h:33
evc_parse.h
int64_t
long long int64_t
Definition: coverity.c:34
pix_fmts_10bit
static enum AVPixelFormat pix_fmts_10bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:47
EVCParamSets
Definition: evc_ps.h:211
data
const char data[16]
Definition: mxf.c:149
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:539
EVC_SLICE_TYPE_B
@ EVC_SLICE_TYPE_B
Definition: evc.h:103
bit_depth
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition: af_astats.c:246
AV_PIX_FMT_GRAY9
#define AV_PIX_FMT_GRAY9
Definition: pixfmt.h:518
EVC_IDR_NUT
@ EVC_IDR_NUT
Definition: evc.h:35
parse_nal_unit
static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
Definition: evc_parser.c:63
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:379
AVCodecContext::framerate
AVRational framerate
Definition: avcodec.h:551
bytestream2_skip
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:168
pix_fmts_8bit
static enum AVPixelFormat pix_fmts_8bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:39
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:333
EVC_NOIDR_NUT
@ EVC_NOIDR_NUT
Definition: evc.h:34
GetBitContext
Definition: get_bits.h:109
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:537
EVC_SEI_NUT
@ EVC_SEI_NUT
Definition: evc.h:62
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:522
av_reduce
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
AVRational::num
int num
Numerator.
Definition: rational.h:59
evc_parser_close
static av_cold void evc_parser_close(AVCodecParserContext *s)
Definition: evc_parser.c:367
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:542
ff_evc_ps_free
void ff_evc_ps_free(EVCParamSets *ps)
Definition: evc_ps.c:437
pix_fmts_16bit
static enum AVPixelFormat pix_fmts_16bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:59
AV_PICTURE_STRUCTURE_FRAME
@ AV_PICTURE_STRUCTURE_FRAME
coded as frame
Definition: avcodec.h:2572
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
av_cold
#define av_cold
Definition: attributes.h:90
ff_evc_parse_sps
int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps)
Definition: evc_ps.c:152
AV_PIX_FMT_YUV422P16
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:551
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:539
AVCodecContext::extradata_size
int extradata_size
Definition: avcodec.h:515
s
#define s(width, name)
Definition: cbs_vp9.c:198
ff_evc_parse_slice_header
int ff_evc_parse_slice_header(GetBitContext *gb, EVCParserSliceHeader *sh, const EVCParamSets *ps, enum EVCNALUnitType nalu_type)
Definition: evc_parse.c:24
AV_CODEC_ID_EVC
@ AV_CODEC_ID_EVC
Definition: codec_id.h:325
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:552
GetByteContext::buffer
const uint8_t * buffer
Definition: bytestream.h:34
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:41
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:536
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:550
ctx
AVFormatContext * ctx
Definition: movenc.c:49
NUM_CHROMA_FORMATS
#define NUM_CHROMA_FORMATS
Definition: evc_parser.c:37
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:521
evc_parse
static int evc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: evc_parser.c:335
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:519
NULL
#define NULL
Definition: coverity.c:32
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:278
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:386
EVCParserSliceHeader::slice_type
uint8_t slice_type
Definition: evc_parse.h:51
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:540
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
ff_evc_parser
const AVCodecParser ff_evc_parser
Definition: evc_parser.c:374
EVCParserSliceHeader::slice_pic_parameter_set_id
uint8_t slice_pic_parameter_set_id
Definition: evc_parse.h:43
AVCodecParser::codec_ids
int codec_ids[7]
Definition: avcodec.h:2735
EVC_SLICE_TYPE_I
@ EVC_SLICE_TYPE_I
Definition: evc.h:105
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:544
size
int size
Definition: twinvq_data.h:10344
EVCParserSliceHeader
Definition: evc_parse.h:42
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:546
AV_PICTURE_TYPE_NONE
@ AV_PICTURE_TYPE_NONE
Undefined.
Definition: avutil.h:277
attributes.h
skip_bits1
static void skip_bits1(GetBitContext *s)
Definition: get_bits.h:411
EVC_FD_NUT
@ EVC_FD_NUT
Definition: evc.h:61
EVCParserContext::poc
EVCParserPoc poc
Definition: evc_parser.c:32
EVC_NALU_LENGTH_PREFIX_SIZE
#define EVC_NALU_LENGTH_PREFIX_SIZE
Definition: evc.h:26
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVCodecContext::extradata
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
Definition: avcodec.h:514
pix_fmts_12bit
static enum AVPixelFormat pix_fmts_12bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:51
EVC_PPS_NUT
@ EVC_PPS_NUT
Definition: evc.h:59
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:538
avcodec.h
AVCodecParserContext
Definition: avcodec.h:2575
EVC_UNSPEC_NUT62
@ EVC_UNSPEC_NUT62
Definition: evc.h:96
ret
ret
Definition: filter_design.txt:187
sps
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
Definition: cbs_h264_syntax_template.c:260
pix_fmts_9bit
static enum AVPixelFormat pix_fmts_9bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:43
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:543
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:548
AVCodecContext
main external API structure.
Definition: avcodec.h:431
AV_PICTURE_TYPE_B
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition: avutil.h:280
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1618
evc_read_nal_unit_length
static uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_size, void *logctx)
Definition: evc_parse.h:83
EVC_SLICE_TYPE_P
@ EVC_SLICE_TYPE_P
Definition: evc.h:104
pps
uint64_t pps
Definition: dovi_rpuenc.c:36
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
EVC_SPS_NUT
@ EVC_SPS_NUT
Definition: evc.h:58
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:279
EVCParserSPS
Definition: evc_ps.h:111
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
EVCParserPPS
Definition: evc_ps.h:185
EVCParserPoc
Definition: evc_parse.h:77
EVCParserContext::ps
EVCParamSets ps
Definition: evc_parser.c:31
evc.h
pix_fmts_14bit
static enum AVPixelFormat pix_fmts_14bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:55
AVCodecParser
Definition: avcodec.h:2734
EVCParserContext
Definition: evc_parser.c:30
bytestream.h
bytestream2_init
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:137
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:549
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:520
decode_extradata
static int decode_extradata(AVCodecParserContext *s, AVCodecContext *avctx)
Definition: evc_parser.c:258
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:547
EVCParserContext::parsed_extradata
int parsed_extradata
Definition: evc_parser.c:34
ff_evc_derive_poc
int ff_evc_derive_poc(const EVCParamSets *ps, const EVCParserSliceHeader *sh, EVCParserPoc *poc, enum EVCNALUnitType nalu_type, int tid)
Definition: evc_parse.c:140