FFmpeg
av1.c
Go to the documentation of this file.
1 /*
2  * AV1 helper functions for muxers
3  * Copyright (c) 2018 James Almer <jamrial@gmail.com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/avassert.h"
23 #include "libavutil/mem.h"
24 #include "libavutil/pixfmt.h"
25 #include "libavcodec/av1.h"
26 #include "libavcodec/av1_parse.h"
27 #include "libavcodec/defs.h"
28 #include "libavcodec/put_bits.h"
29 #include "av1.h"
30 #include "avio.h"
31 #include "avio_internal.h"
32 
33 static int av1_filter_obus(AVIOContext *pb, const uint8_t *buf,
34  int size, int *offset)
35 {
36  const uint8_t *start = buf, *end = buf + size;
37  int off;
38  enum {
39  START_NOT_FOUND,
40  START_FOUND,
41  END_FOUND,
42  OFFSET_IMPOSSIBLE,
43  } state = START_NOT_FOUND;
44 
45  off = size = 0;
46  while (buf < end) {
47  int64_t obu_size;
48  int start_pos, type, temporal_id, spatial_id;
49  int len = parse_obu_header(buf, end - buf, &obu_size, &start_pos,
50  &type, &temporal_id, &spatial_id);
51  if (len < 0)
52  return len;
53 
54  switch (type) {
57  case AV1_OBU_TILE_LIST:
58  case AV1_OBU_PADDING:
59  if (state == START_FOUND)
60  state = END_FOUND;
61  break;
62  default:
63  if (state == START_NOT_FOUND) {
64  off = buf - start;
65  state = START_FOUND;
66  } else if (state == END_FOUND) {
67  state = OFFSET_IMPOSSIBLE;
68  }
69  if (pb)
70  avio_write(pb, buf, len);
71  size += len;
72  break;
73  }
74  buf += len;
75  }
76 
77  if (offset)
78  *offset = state != OFFSET_IMPOSSIBLE ? off : -1;
79 
80  return size;
81 }
82 
83 int ff_av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size)
84 {
85  return av1_filter_obus(pb, buf, size, NULL);
86 }
87 
88 int ff_av1_filter_obus_buf(const uint8_t *in, uint8_t **out,
89  int *size, int *offset)
90 {
91  FFIOContext pb;
92  uint8_t *buf;
93  int len, off, ret;
94 
95  len = ret = av1_filter_obus(NULL, in, *size, &off);
96  if (ret < 0) {
97  return ret;
98  }
99  if (off >= 0) {
100  *out = (uint8_t *)in;
101  *size = len;
102  *offset = off;
103 
104  return 0;
105  }
106 
108  if (!buf)
109  return AVERROR(ENOMEM);
110 
111  ffio_init_write_context(&pb, buf, len);
112 
113  ret = av1_filter_obus(&pb.pub, in, *size, NULL);
114  av_assert1(ret == len);
115 
116  memset(buf + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
117 
118  *out = buf;
119  *size = len;
120  *offset = 0;
121 
122  return 0;
123 }
124 
125 static inline void uvlc(GetBitContext *gb)
126 {
127  int leading_zeros = 0;
128 
129  while (get_bits_left(gb)) {
130  if (get_bits1(gb))
131  break;
132  leading_zeros++;
133  }
134 
135  if (leading_zeros >= 32)
136  return;
137 
138  skip_bits_long(gb, leading_zeros);
139 }
140 
142 {
143  int twelve_bit = 0;
144  int high_bitdepth = get_bits1(gb);
145  if (seq_params->profile == AV_PROFILE_AV1_PROFESSIONAL && high_bitdepth)
146  twelve_bit = get_bits1(gb);
147 
148  seq_params->bitdepth = 8 + (high_bitdepth * 2) + (twelve_bit * 2);
149 
150  if (seq_params->profile == AV_PROFILE_AV1_HIGH)
151  seq_params->monochrome = 0;
152  else
153  seq_params->monochrome = get_bits1(gb);
154 
155  seq_params->color_description_present_flag = get_bits1(gb);
156  if (seq_params->color_description_present_flag) {
157  seq_params->color_primaries = get_bits(gb, 8);
158  seq_params->transfer_characteristics = get_bits(gb, 8);
159  seq_params->matrix_coefficients = get_bits(gb, 8);
160  } else {
164  }
165 
166  if (seq_params->monochrome) {
167  seq_params->color_range = get_bits1(gb);
168  seq_params->chroma_subsampling_x = 1;
169  seq_params->chroma_subsampling_y = 1;
170  seq_params->chroma_sample_position = 0;
171  return 0;
172  } else if (seq_params->color_primaries == AVCOL_PRI_BT709 &&
174  seq_params->matrix_coefficients == AVCOL_SPC_RGB) {
175  seq_params->chroma_subsampling_x = 0;
176  seq_params->chroma_subsampling_y = 0;
177  } else {
178  seq_params->color_range = get_bits1(gb);
179 
180  if (seq_params->profile == AV_PROFILE_AV1_MAIN) {
181  seq_params->chroma_subsampling_x = 1;
182  seq_params->chroma_subsampling_y = 1;
183  } else if (seq_params->profile == AV_PROFILE_AV1_HIGH) {
184  seq_params->chroma_subsampling_x = 0;
185  seq_params->chroma_subsampling_y = 0;
186  } else {
187  if (twelve_bit) {
188  seq_params->chroma_subsampling_x = get_bits1(gb);
189  if (seq_params->chroma_subsampling_x)
190  seq_params->chroma_subsampling_y = get_bits1(gb);
191  else
192  seq_params->chroma_subsampling_y = 0;
193  } else {
194  seq_params->chroma_subsampling_x = 1;
195  seq_params->chroma_subsampling_y = 0;
196  }
197  }
198  if (seq_params->chroma_subsampling_x && seq_params->chroma_subsampling_y)
199  seq_params->chroma_sample_position = get_bits(gb, 2);
200  }
201 
202  skip_bits1(gb); // separate_uv_delta_q
203 
204  return 0;
205 }
206 
207 static int parse_sequence_header(AV1SequenceParameters *seq_params, const uint8_t *buf, int size)
208 {
209  GetBitContext gb;
210  int reduced_still_picture_header;
211  int frame_width_bits_minus_1, frame_height_bits_minus_1;
212  int size_bits, ret;
213 
215  if (size_bits < 0)
216  return size_bits;
217 
218  ret = init_get_bits(&gb, buf, size_bits);
219  if (ret < 0)
220  return ret;
221 
222  memset(seq_params, 0, sizeof(*seq_params));
223 
224  seq_params->profile = get_bits(&gb, 3);
225 
226  skip_bits1(&gb); // still_picture
227  reduced_still_picture_header = get_bits1(&gb);
228 
229  if (reduced_still_picture_header) {
230  seq_params->level = get_bits(&gb, 5);
231  seq_params->tier = 0;
232  } else {
233  int initial_display_delay_present_flag, operating_points_cnt_minus_1;
234  int decoder_model_info_present_flag, buffer_delay_length_minus_1;
235 
236  if (get_bits1(&gb)) { // timing_info_present_flag
237  skip_bits_long(&gb, 32); // num_units_in_display_tick
238  skip_bits_long(&gb, 32); // time_scale
239 
240  if (get_bits1(&gb)) // equal_picture_interval
241  uvlc(&gb); // num_ticks_per_picture_minus_1
242 
243  decoder_model_info_present_flag = get_bits1(&gb);
244  if (decoder_model_info_present_flag) {
245  buffer_delay_length_minus_1 = get_bits(&gb, 5);
246  skip_bits_long(&gb, 32); // num_units_in_decoding_tick
247  skip_bits(&gb, 10); // buffer_removal_time_length_minus_1 (5)
248  // frame_presentation_time_length_minus_1 (5)
249  }
250  } else
251  decoder_model_info_present_flag = 0;
252 
253  initial_display_delay_present_flag = get_bits1(&gb);
254 
255  operating_points_cnt_minus_1 = get_bits(&gb, 5);
256  for (int i = 0; i <= operating_points_cnt_minus_1; i++) {
257  int seq_level_idx, seq_tier;
258 
259  skip_bits(&gb, 12); // operating_point_idc
260  seq_level_idx = get_bits(&gb, 5);
261 
262  if (seq_level_idx > 7)
263  seq_tier = get_bits1(&gb);
264  else
265  seq_tier = 0;
266 
267  if (decoder_model_info_present_flag) {
268  if (get_bits1(&gb)) { // decoder_model_present_for_this_op
269  skip_bits_long(&gb, buffer_delay_length_minus_1 + 1); // decoder_buffer_delay
270  skip_bits_long(&gb, buffer_delay_length_minus_1 + 1); // encoder_buffer_delay
271  skip_bits1(&gb); // low_delay_mode_flag
272  }
273  }
274 
275  if (initial_display_delay_present_flag) {
276  if (get_bits1(&gb)) // initial_display_delay_present_for_this_op
277  skip_bits(&gb, 4); // initial_display_delay_minus_1
278  }
279 
280  if (i == 0) {
281  seq_params->level = seq_level_idx;
282  seq_params->tier = seq_tier;
283  }
284  }
285  }
286 
287  frame_width_bits_minus_1 = get_bits(&gb, 4);
288  frame_height_bits_minus_1 = get_bits(&gb, 4);
289 
290  skip_bits(&gb, frame_width_bits_minus_1 + 1); // max_frame_width_minus_1
291  skip_bits(&gb, frame_height_bits_minus_1 + 1); // max_frame_height_minus_1
292 
293  if (!reduced_still_picture_header) {
294  if (get_bits1(&gb)) // frame_id_numbers_present_flag
295  skip_bits(&gb, 7); // delta_frame_id_length_minus_2 (4), additional_frame_id_length_minus_1 (3)
296  }
297 
298  skip_bits(&gb, 3); // use_128x128_superblock (1), enable_filter_intra (1), enable_intra_edge_filter (1)
299 
300  if (!reduced_still_picture_header) {
301  int enable_order_hint, seq_force_screen_content_tools;
302 
303  skip_bits(&gb, 4); // enable_interintra_compound (1), enable_masked_compound (1)
304  // enable_warped_motion (1), enable_dual_filter (1)
305 
306  enable_order_hint = get_bits1(&gb);
307  if (enable_order_hint)
308  skip_bits(&gb, 2); // enable_jnt_comp (1), enable_ref_frame_mvs (1)
309 
310  if (get_bits1(&gb)) // seq_choose_screen_content_tools
311  seq_force_screen_content_tools = 2;
312  else
313  seq_force_screen_content_tools = get_bits1(&gb);
314 
315  if (seq_force_screen_content_tools) {
316  if (!get_bits1(&gb)) // seq_choose_integer_mv
317  skip_bits1(&gb); // seq_force_integer_mv
318  }
319 
320  if (enable_order_hint)
321  skip_bits(&gb, 3); // order_hint_bits_minus_1
322  }
323 
324  skip_bits(&gb, 3); // enable_superres (1), enable_cdef (1), enable_restoration (1)
325 
326  parse_color_config(seq_params, &gb);
327 
328  skip_bits1(&gb); // film_grain_params_present
329 
330  if (get_bits_left(&gb))
331  return AVERROR_INVALIDDATA;
332 
333  return 0;
334 }
335 
336 int ff_av1_parse_seq_header(AV1SequenceParameters *seq, const uint8_t *buf, int size)
337 {
338  int is_av1c;
339 
340  if (size <= 0)
341  return AVERROR_INVALIDDATA;
342 
343  is_av1c = !!(buf[0] & 0x80);
344  if (is_av1c) {
345  GetBitContext gb;
346  int ret, version = buf[0] & 0x7F;
347 
348  if (version != 1 || size < 4)
349  return AVERROR_INVALIDDATA;
350 
351  ret = init_get_bits8(&gb, buf, 4);
352  if (ret < 0)
353  return ret;
354 
355  memset(seq, 0, sizeof(*seq));
356 
357  skip_bits(&gb, 8);
358  seq->profile = get_bits(&gb, 3);
359  seq->level = get_bits(&gb, 5);
360  seq->tier = get_bits(&gb, 1);
361  seq->bitdepth = get_bits(&gb, 1) * 2 + 8;
362  seq->bitdepth += get_bits(&gb, 1) * 2;
363  seq->monochrome = get_bits(&gb, 1);
364  seq->chroma_subsampling_x = get_bits(&gb, 1);
365  seq->chroma_subsampling_y = get_bits(&gb, 1);
366  seq->chroma_sample_position = get_bits(&gb, 2);
370 
371  size -= 4;
372  buf += 4;
373  }
374 
375  while (size > 0) {
376  int64_t obu_size;
377  int start_pos, type, temporal_id, spatial_id;
378  int len = parse_obu_header(buf, size, &obu_size, &start_pos,
379  &type, &temporal_id, &spatial_id);
380  if (len < 0)
381  return len;
382 
383  switch (type) {
385  if (!obu_size)
386  return AVERROR_INVALIDDATA;
387 
388  return parse_sequence_header(seq, buf + start_pos, obu_size);
389  default:
390  break;
391  }
392  size -= len;
393  buf += len;
394  }
395 
396  return is_av1c ? 0 : AVERROR_INVALIDDATA;
397 }
398 
399 int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
400  int write_seq_header)
401 {
402  AVIOContext *meta_pb;
403  AV1SequenceParameters seq_params;
404  PutBitContext pbc;
405  uint8_t header[4], *meta;
406  const uint8_t *seq;
407  int ret, nb_seq = 0, seq_size, meta_size;
408 
409  if (size <= 0)
410  return AVERROR_INVALIDDATA;
411 
412  if (buf[0] & 0x80) {
413  // first bit is nonzero, the passed data does not consist purely of
414  // OBUs. Expect that the data is already in AV1CodecConfigurationRecord
415  // format.
416  int config_record_version = buf[0] & 0x7f;
417  if (config_record_version != 1 || size < 4) {
418  return AVERROR_INVALIDDATA;
419  }
420 
421  avio_write(pb, buf, size);
422 
423  return 0;
424  }
425 
426  ret = avio_open_dyn_buf(&meta_pb);
427  if (ret < 0)
428  return ret;
429 
430  while (size > 0) {
431  int64_t obu_size;
432  int start_pos, type, temporal_id, spatial_id;
433  int len = parse_obu_header(buf, size, &obu_size, &start_pos,
434  &type, &temporal_id, &spatial_id);
435  if (len < 0) {
436  ret = len;
437  goto fail;
438  }
439 
440  switch (type) {
442  nb_seq++;
443  if (!obu_size || nb_seq > 1) {
445  goto fail;
446  }
447  ret = parse_sequence_header(&seq_params, buf + start_pos, obu_size);
448  if (ret < 0)
449  goto fail;
450 
451  seq = buf;
452  seq_size = len;
453  break;
454  case AV1_OBU_METADATA:
455  if (!obu_size) {
457  goto fail;
458  }
459  avio_write(meta_pb, buf, len);
460  break;
461  default:
462  break;
463  }
464  size -= len;
465  buf += len;
466  }
467 
468  if (!nb_seq) {
470  goto fail;
471  }
472 
473  init_put_bits(&pbc, header, sizeof(header));
474 
475  put_bits(&pbc, 1, 1); // marker
476  put_bits(&pbc, 7, 1); // version
477  put_bits(&pbc, 3, seq_params.profile);
478  put_bits(&pbc, 5, seq_params.level);
479  put_bits(&pbc, 1, seq_params.tier);
480  put_bits(&pbc, 1, seq_params.bitdepth > 8);
481  put_bits(&pbc, 1, seq_params.bitdepth == 12);
482  put_bits(&pbc, 1, seq_params.monochrome);
483  put_bits(&pbc, 1, seq_params.chroma_subsampling_x);
484  put_bits(&pbc, 1, seq_params.chroma_subsampling_y);
485  put_bits(&pbc, 2, seq_params.chroma_sample_position);
486  put_bits(&pbc, 8, 0); // padding
487  flush_put_bits(&pbc);
488 
489  avio_write(pb, header, sizeof(header));
490  if (write_seq_header) {
491  avio_write(pb, seq, seq_size);
492  }
493 
494  meta_size = avio_get_dyn_buf(meta_pb, &meta);
495  if (meta_size)
496  avio_write(pb, meta, meta_size);
497 
498 fail:
499  ffio_free_dyn_buf(&meta_pb);
500 
501  return ret;
502 }
parse_sequence_header
static int parse_sequence_header(AV1SequenceParameters *seq_params, const uint8_t *buf, int size)
Definition: av1.c:207
skip_bits_long
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
Definition: get_bits.h:278
AV1_OBU_REDUNDANT_FRAME_HEADER
@ AV1_OBU_REDUNDANT_FRAME_HEADER
Definition: av1.h:36
get_bits_left
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:695
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
out
FILE * out
Definition: movenc.c:55
int64_t
long long int64_t
Definition: coverity.c:34
init_put_bits
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
Definition: put_bits.h:62
put_bits
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:223
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:614
AVCOL_SPC_RGB
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition: pixfmt.h:641
AV1_OBU_TEMPORAL_DELIMITER
@ AV1_OBU_TEMPORAL_DELIMITER
Definition: av1.h:31
AV_PROFILE_AV1_PROFESSIONAL
#define AV_PROFILE_AV1_PROFESSIONAL
Definition: defs.h:171
avio_get_dyn_buf
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
Definition: aviobuf.c:1374
FFIOContext
Definition: avio_internal.h:28
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:514
AV1SequenceParameters::chroma_subsampling_y
uint8_t chroma_subsampling_y
Definition: av1.h:35
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
state
static struct @464 state
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:381
av1_filter_obus
static int av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size, int *offset)
Definition: av1.c:33
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:335
av1_parse.h
AVCOL_TRC_IEC61966_2_1
@ AVCOL_TRC_IEC61966_2_1
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:625
fail
#define fail()
Definition: checkasm.h:188
GetBitContext
Definition: get_bits.h:108
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
AV1SequenceParameters::color_description_present_flag
uint8_t color_description_present_flag
Definition: av1.h:37
avassert.h
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:545
avio_open_dyn_buf
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
Definition: aviobuf.c:1362
parse_obu_header
static int parse_obu_header(const uint8_t *buf, int buf_size, int64_t *obu_size, int *start_pos, int *type, int *temporal_id, int *spatial_id)
Definition: av1_parse.h:92
ff_av1_filter_obus_buf
int ff_av1_filter_obus_buf(const uint8_t *in, uint8_t **out, int *size, int *offset)
Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and return the result in a data bu...
Definition: av1.c:88
AV1SequenceParameters::color_range
uint8_t color_range
Definition: av1.h:41
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:589
PutBitContext
Definition: put_bits.h:50
AV1SequenceParameters::chroma_sample_position
uint8_t chroma_sample_position
Definition: av1.h:36
uvlc
static void uvlc(GetBitContext *gb)
Definition: av1.c:125
NULL
#define NULL
Definition: coverity.c:32
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:588
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:388
AV1SequenceParameters::transfer_characteristics
uint8_t transfer_characteristics
Definition: av1.h:39
AV1SequenceParameters::tier
uint8_t tier
Definition: av1.h:31
AV1SequenceParameters::monochrome
uint8_t monochrome
Definition: av1.h:33
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
AV1SequenceParameters::matrix_coefficients
uint8_t matrix_coefficients
Definition: av1.h:40
get_obu_bit_length
static int get_obu_bit_length(const uint8_t *buf, int size, int type)
Definition: av1_parse.h:136
FFIOContext::pub
AVIOContext pub
Definition: avio_internal.h:29
size
int size
Definition: twinvq_data.h:10344
avio.h
AV1_OBU_SEQUENCE_HEADER
@ AV1_OBU_SEQUENCE_HEADER
Definition: av1.h:30
av1.h
header
static const uint8_t header[24]
Definition: sdr2.c:68
ff_isom_write_av1c
int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size, int write_seq_header)
Writes AV1 extradata (Sequence Header and Metadata OBUs) to the provided AVIOContext.
Definition: av1.c:399
avio_write
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:201
parse_color_config
static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *gb)
Definition: av1.c:141
offset
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 offset
Definition: writing_filters.txt:86
AV_PROFILE_AV1_HIGH
#define AV_PROFILE_AV1_HIGH
Definition: defs.h:170
skip_bits1
static void skip_bits1(GetBitContext *s)
Definition: get_bits.h:413
version
version
Definition: libkvazaar.c:321
AV1SequenceParameters::profile
uint8_t profile
Definition: av1.h:29
AV1SequenceParameters::color_primaries
uint8_t color_primaries
Definition: av1.h:38
AV1_OBU_PADDING
@ AV1_OBU_PADDING
Definition: av1.h:39
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
avio_internal.h
av_assert1
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
Definition: avassert.h:56
AV1SequenceParameters::level
uint8_t level
Definition: av1.h:30
len
int len
Definition: vorbis_enc_data.h:426
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:643
ff_av1_parse_seq_header
int ff_av1_parse_seq_header(AV1SequenceParameters *seq, const uint8_t *buf, int size)
Parses a Sequence Header from the the provided buffer.
Definition: av1.c:336
ffio_free_dyn_buf
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
Definition: aviobuf.c:1435
ret
ret
Definition: filter_design.txt:187
pixfmt.h
AV1_OBU_TILE_LIST
@ AV1_OBU_TILE_LIST
Definition: av1.h:37
ff_av1_filter_obus
int ff_av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size)
Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and write the resulting bitstream ...
Definition: av1.c:83
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
ffio_init_write_context
void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for writing.
Definition: aviobuf.c:104
defs.h
AV1SequenceParameters::chroma_subsampling_x
uint8_t chroma_subsampling_x
Definition: av1.h:34
mem.h
flush_put_bits
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
Definition: put_bits.h:143
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
AV1SequenceParameters::bitdepth
uint8_t bitdepth
Definition: av1.h:32
AV1SequenceParameters
Definition: av1.h:28
AV_PROFILE_AV1_MAIN
#define AV_PROFILE_AV1_MAIN
Definition: defs.h:169
put_bits.h
AV1_OBU_METADATA
@ AV1_OBU_METADATA
Definition: av1.h:34