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 typedef struct EVCParserContext {
31 
34 
35 #define NUM_CHROMA_FORMATS 4 // @see ISO_IEC_23094-1 section 6.2 table 2
36 
39 };
40 
43 };
44 
47 };
48 
51 };
52 
55 };
56 
59 };
60 
62  const uint8_t *buf, int buf_size)
63 {
64  EVCParserContext *ctx = s->priv_data;
65  GetBitContext gb;
66  int nalu_type, tid;
67  int ret;
68 
69  if (buf_size <= 0) {
70  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size: (%d)\n", buf_size);
71  return AVERROR_INVALIDDATA;
72  }
73 
74  ret = init_get_bits8(&gb, buf, buf_size);
75  if (ret < 0)
76  return ret;
77 
78  // @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)
79  // @see enum EVCNALUnitType in evc.h
80  if (get_bits1(&gb)) {// forbidden_zero_bit
81  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit header\n");
82  return AVERROR_INVALIDDATA;
83  }
84 
85  nalu_type = get_bits(&gb, 6) - 1;
86  if (nalu_type < EVC_NOIDR_NUT || nalu_type > EVC_UNSPEC_NUT62) {
87  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit type: (%d)\n", nalu_type);
88  return AVERROR_INVALIDDATA;
89  }
90 
91  tid = get_bits(&gb, 3);
92  skip_bits(&gb, 5); // nuh_reserved_zero_5bits
93  skip_bits1(&gb); // nuh_extension_flag
94 
95  switch (nalu_type) {
96  case EVC_SPS_NUT:
97  ret = ff_evc_parse_sps(&gb, &ctx->ps);
98  if (ret < 0) {
99  av_log(avctx, AV_LOG_ERROR, "SPS parsing error\n");
100  return ret;
101  }
102  break;
103  case EVC_PPS_NUT:
104  ret = ff_evc_parse_pps(&gb, &ctx->ps);
105  if (ret < 0) {
106  av_log(avctx, AV_LOG_ERROR, "PPS parsing error\n");
107  return ret;
108  }
109  break;
110  case EVC_IDR_NUT: // Coded slice of a IDR or non-IDR picture
111  case EVC_NOIDR_NUT: {
112  const EVCParserPPS *pps;
113  const EVCParserSPS *sps;
115  int bit_depth;
116 
117  ret = ff_evc_parse_slice_header(&gb, &sh, &ctx->ps, nalu_type);
118  if (ret < 0) {
119  av_log(avctx, AV_LOG_ERROR, "Slice header parsing error\n");
120  return ret;
121  }
122 
123  pps = ctx->ps.pps[sh.slice_pic_parameter_set_id];
124  sps = ctx->ps.sps[pps->pps_seq_parameter_set_id];
125  av_assert0(sps && pps);
126 
127  s->coded_width = sps->pic_width_in_luma_samples;
128  s->coded_height = sps->pic_height_in_luma_samples;
129 
130  if (sps->picture_cropping_flag) {
131  s->width = sps->pic_width_in_luma_samples - sps->picture_crop_left_offset - sps->picture_crop_right_offset;
132  s->height = sps->pic_height_in_luma_samples - sps->picture_crop_top_offset - sps->picture_crop_bottom_offset;
133  } else {
134  s->width = sps->pic_width_in_luma_samples;
135  s->height = sps->pic_height_in_luma_samples;
136  }
137 
138  switch (sh.slice_type) {
139  case EVC_SLICE_TYPE_B: {
140  s->pict_type = AV_PICTURE_TYPE_B;
141  break;
142  }
143  case EVC_SLICE_TYPE_P: {
144  s->pict_type = AV_PICTURE_TYPE_P;
145  break;
146  }
147  case EVC_SLICE_TYPE_I: {
148  s->pict_type = AV_PICTURE_TYPE_I;
149  break;
150  }
151  default: {
152  s->pict_type = AV_PICTURE_TYPE_NONE;
153  }
154  }
155 
156  avctx->profile = sps->profile_idc;
157 
158  if (sps->vui_parameters_present_flag && sps->vui_parameters.timing_info_present_flag) {
159  int64_t num = sps->vui_parameters.num_units_in_tick;
160  int64_t den = sps->vui_parameters.time_scale;
161  if (num != 0 && den != 0)
162  av_reduce(&avctx->framerate.den, &avctx->framerate.num, num, den, 1 << 30);
163  } else
164  avctx->framerate = (AVRational) { 0, 1 };
165 
166  bit_depth = sps->bit_depth_chroma_minus8 + 8;
167  s->format = AV_PIX_FMT_NONE;
168 
169  switch (bit_depth) {
170  case 8:
171  s->format = pix_fmts_8bit[sps->chroma_format_idc];
172  break;
173  case 9:
174  s->format = pix_fmts_9bit[sps->chroma_format_idc];
175  break;
176  case 10:
177  s->format = pix_fmts_10bit[sps->chroma_format_idc];
178  break;
179  case 12:
180  s->format = pix_fmts_12bit[sps->chroma_format_idc];
181  break;
182  case 14:
183  s->format = pix_fmts_14bit[sps->chroma_format_idc];
184  break;
185  case 16:
186  s->format = pix_fmts_16bit[sps->chroma_format_idc];
187  break;
188  }
189 
190  s->key_frame = (nalu_type == EVC_IDR_NUT) ? 1 : 0;
191 
192  // POC (picture order count of the current picture) derivation
193  // @see ISO/IEC 23094-1:2020(E) 8.3.1 Decoding process for picture order count
194  ret = ff_evc_derive_poc(&ctx->ps, &sh, &ctx->poc, nalu_type, tid);
195  if (ret < 0)
196  return ret;
197 
198  s->output_picture_number = ctx->poc.PicOrderCntVal;
199 
200  break;
201  }
202  case EVC_SEI_NUT: // Supplemental Enhancement Information
203  case EVC_APS_NUT: // Adaptation parameter set
204  case EVC_FD_NUT: // Filler data
205  default:
206  break;
207  }
208 
209  return 0;
210 }
211 
212 /**
213  * Parse NAL units of found picture and decode some basic information.
214  *
215  * @param s codec parser context
216  * @param avctx codec context
217  * @param buf buffer with field/frame data
218  * @param buf_size size of the buffer
219  */
220 static int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size)
221 {
222  const uint8_t *data = buf;
223  int data_size = buf_size;
224 
225  while (data_size > 0) {
226  int nalu_size = 0;
227  int ret;
228 
229  // Buffer size is not enough for buffer to store NAL unit 4-bytes prefix (length)
230  if (data_size < EVC_NALU_LENGTH_PREFIX_SIZE)
231  return AVERROR_INVALIDDATA;
232 
233  nalu_size = evc_read_nal_unit_length(data, data_size, avctx);
234 
235 
237  data_size -= EVC_NALU_LENGTH_PREFIX_SIZE;
238 
239  if (data_size < nalu_size)
240  return AVERROR_INVALIDDATA;
241 
242  ret = parse_nal_unit(s, avctx, data, nalu_size);
243  if (ret < 0) {
244  av_log(avctx, AV_LOG_ERROR, "Parsing of NAL unit failed\n");
245  return AVERROR_INVALIDDATA;
246  }
247 
248  data += nalu_size;
249  data_size -= nalu_size;
250  }
251  return 0;
252 }
253 
254 // Decoding nal units from evcC (EVCDecoderConfigurationRecord)
255 // @see @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.2
257 {
258  const uint8_t *data = avctx->extradata;
259  int size = avctx->extradata_size;
260  int ret = 0;
261  GetByteContext gb;
262 
263  bytestream2_init(&gb, data, size);
264 
265  if (!data || size <= 0)
266  return -1;
267 
268  // extradata is encoded as evcC format.
269  if (data[0] == 1) {
270  int num_of_arrays; // indicates the number of arrays of NAL units of the indicated type(s)
271 
272  int nalu_length_field_size; // indicates the length in bytes of the NALUnitLenght field in EVC video stream sample in the stream
273  // 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.
274 
275  if (bytestream2_get_bytes_left(&gb) < 18) {
276  av_log(avctx, AV_LOG_ERROR, "evcC %d too short\n", size);
277  return AVERROR_INVALIDDATA;
278  }
279 
280  bytestream2_skip(&gb, 16);
281 
282  // @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
283  // 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.
284  // 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.
285  nalu_length_field_size = (bytestream2_get_byte(&gb) & 3) + 1;
286  if( nalu_length_field_size != 1 &&
287  nalu_length_field_size != 2 &&
288  nalu_length_field_size != 4 ) {
289  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);
290  return AVERROR_INVALIDDATA;
291  }
292 
293  num_of_arrays = bytestream2_get_byte(&gb);
294 
295  /* Decode nal units from evcC. */
296  for (int i = 0; i < num_of_arrays; i++) {
297 
298  // @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
299  // NAL_unit_type indicates the type of the NAL units in the following array (which shall be all of that type);
300  // - it takes a value as defined in ISO/IEC 23094-1;
301  // - it is restricted to take one of the values indicating a SPS, PPS, APS, or SEI NAL unit.
302  int nal_unit_type = bytestream2_get_byte(&gb) & 0x3f;
303  int num_nalus = bytestream2_get_be16(&gb);
304 
305  for (int j = 0; j < num_nalus; j++) {
306 
307  int nal_unit_length = bytestream2_get_be16(&gb);
308 
309  if (bytestream2_get_bytes_left(&gb) < nal_unit_length) {
310  av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size in extradata.\n");
311  return AVERROR_INVALIDDATA;
312  }
313 
314  if( nal_unit_type == EVC_SPS_NUT ||
315  nal_unit_type == EVC_PPS_NUT ||
316  nal_unit_type == EVC_APS_NUT ||
317  nal_unit_type == EVC_SEI_NUT ) {
318  if (parse_nal_unit(s, avctx, gb.buffer, nal_unit_length) != 0) {
319  av_log(avctx, AV_LOG_ERROR, "Parsing of NAL unit failed\n");
320  return AVERROR_INVALIDDATA;
321  }
322  }
323 
324  bytestream2_skip(&gb, nal_unit_length);
325  }
326  }
327  } else
328  return -1;
329 
330  return ret;
331 }
332 
334  const uint8_t **poutbuf, int *poutbuf_size,
335  const uint8_t *buf, int buf_size)
336 {
337  int next;
338  int ret;
339  EVCParserContext *ctx = s->priv_data;
340 
341  s->picture_structure = AV_PICTURE_STRUCTURE_FRAME;
342  s->key_frame = 0;
343 
344  if (avctx->extradata && !ctx->parsed_extradata) {
345  decode_extradata(s, avctx);
346  ctx->parsed_extradata = 1;
347  }
348 
349  next = buf_size;
350 
351  ret = parse_nal_units(s, avctx, buf, buf_size);
352  if(ret < 0) {
353  *poutbuf = NULL;
354  *poutbuf_size = 0;
355  return buf_size;
356  }
357 
358  // poutbuf contains just one Access Unit
359  *poutbuf = buf;
360  *poutbuf_size = buf_size;
361 
362  return next;
363 }
364 
366 {
367  EVCParserContext *ctx = s->priv_data;
368 
369  ff_evc_ps_free(&ctx->ps);
370 }
371 
373  .codec_ids = { AV_CODEC_ID_EVC },
374  .priv_data_size = sizeof(EVCParserContext),
375  .parser_parse = evc_parse,
376  .parser_close = evc_parser_close,
377 };
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:220
ff_evc_parse_pps
int ff_evc_parse_pps(GetBitContext *gb, EVCParamSets *ps)
Definition: evc_ps.c:352
EVC_APS_NUT
@ EVC_APS_NUT
Definition: evc.h:60
GetByteContext
Definition: bytestream.h:33
evc_parse.h
pix_fmts_10bit
static enum AVPixelFormat pix_fmts_10bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:45
EVCParamSets
Definition: evc_ps.h:211
data
const char data[16]
Definition: mxf.c:148
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:478
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:458
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:61
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:381
AVCodecContext::framerate
AVRational framerate
Definition: avcodec.h:560
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:37
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:335
EVC_NOIDR_NUT
@ EVC_NOIDR_NUT
Definition: evc.h:34
GetBitContext
Definition: get_bits.h:108
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:476
EVC_SEI_NUT
@ EVC_SEI_NUT
Definition: evc.h:62
AV_PIX_FMT_GRAY16
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:462
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
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:481
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:57
AV_PICTURE_STRUCTURE_FRAME
@ AV_PICTURE_STRUCTURE_FRAME
coded as frame
Definition: avcodec.h:2704
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
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:490
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:545
AVCodecContext::extradata_size
int extradata_size
Definition: avcodec.h:524
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:321
AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:491
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:40
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:475
AV_PIX_FMT_YUV420P16
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:489
ctx
AVFormatContext * ctx
Definition: movenc.c:49
NUM_CHROMA_FORMATS
#define NUM_CHROMA_FORMATS
Definition: evc_parser.c:35
AV_PIX_FMT_GRAY14
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:461
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:333
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:459
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:279
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:388
EVCParserSliceHeader::slice_type
uint8_t slice_type
Definition: evc_parse.h:51
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:479
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:372
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:158
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:2867
EVC_SLICE_TYPE_I
@ EVC_SLICE_TYPE_I
Definition: evc.h:105
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:483
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:485
AV_PICTURE_TYPE_NONE
@ AV_PICTURE_TYPE_NONE
Undefined.
Definition: avutil.h:278
skip_bits1
static void skip_bits1(GetBitContext *s)
Definition: get_bits.h:413
EVC_FD_NUT
@ EVC_FD_NUT
Definition: evc.h:61
EVCParserContext::poc
EVCParserPoc poc
Definition: evc_parser.c:30
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
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:523
pix_fmts_12bit
static enum AVPixelFormat pix_fmts_12bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:49
EVC_PPS_NUT
@ EVC_PPS_NUT
Definition: evc.h:59
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:477
avcodec.h
AVCodecParserContext
Definition: avcodec.h:2707
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:41
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:482
AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:487
AVCodecContext
main external API structure.
Definition: avcodec.h:445
AV_PICTURE_TYPE_B
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition: avutil.h:281
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:1639
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:35
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:280
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:29
evc.h
pix_fmts_14bit
static enum AVPixelFormat pix_fmts_14bit[NUM_CHROMA_FORMATS]
Definition: evc_parser.c:53
AVCodecParser
Definition: avcodec.h:2866
EVCParserContext
Definition: evc_parser.c:28
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:488
evc_parser_close
static void evc_parser_close(AVCodecParserContext *s)
Definition: evc_parser.c:365
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:460
decode_extradata
static int decode_extradata(AVCodecParserContext *s, AVCodecContext *avctx)
Definition: evc_parser.c:256
AV_PIX_FMT_YUV420P14
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:486
EVCParserContext::parsed_extradata
int parsed_extradata
Definition: evc_parser.c:32
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