FFmpeg
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cbs_apv.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 "libavutil/mem.h"
20 #include "cbs.h"
21 #include "cbs_internal.h"
22 #include "cbs_apv.h"
23 
24 
26 {
27  switch (fh->frame_info.chroma_format_idc) {
29  return 1;
32  return 3;
34  return 4;
35  default:
36  av_assert0(0 && "Invalid chroma_format_idc");
37  }
38 }
39 
41  const APVRawFrameHeader *fh)
42 {
43  int frame_width_in_mbs = (fh->frame_info.frame_width + 15) / 16;
44  int frame_height_in_mbs = (fh->frame_info.frame_height + 15) / 16;
45  int start_mb, i;
46 
47  start_mb = 0;
48  for (i = 0; start_mb < frame_width_in_mbs; i++) {
49  ti->col_starts[i] = start_mb * APV_MB_WIDTH;
50  start_mb += fh->tile_info.tile_width_in_mbs;
51  }
53  ti->col_starts[i] = frame_width_in_mbs * APV_MB_WIDTH;
54  ti->tile_cols = i;
55 
56  start_mb = 0;
57  for (i = 0; start_mb < frame_height_in_mbs; i++) {
59  ti->row_starts[i] = start_mb * APV_MB_HEIGHT;
60  start_mb += fh->tile_info.tile_height_in_mbs;
61  }
63  ti->row_starts[i] = frame_height_in_mbs * APV_MB_HEIGHT;
64  ti->tile_rows = i;
65 
66  ti->num_tiles = ti->tile_cols * ti->tile_rows;
67 }
68 
69 
70 #define HEADER(name) do { \
71  CBS_FUNC(trace_header)(ctx, name); \
72  } while (0)
73 
74 #define CHECK(call) do { \
75  err = (call); \
76  if (err < 0) \
77  return err; \
78  } while (0)
79 
80 #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
81 
82 
83 #define u(width, name, range_min, range_max) \
84  xu(width, name, current->name, range_min, range_max, 0, )
85 #define ub(width, name) \
86  xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0, )
87 #define us(width, name, range_min, range_max, subs, ...) \
88  xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
89 #define ubs(width, name, subs, ...) \
90  xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
91 
92 #define fixed(width, name, value) do { \
93  av_unused uint32_t fixed_value = value; \
94  xu(width, name, fixed_value, value, value, 0, ); \
95  } while (0)
96 
97 
98 #if CBS_READ
99 #define READ
100 #define READWRITE read
101 #define RWContext GetBitContext
102 #define FUNC(name) cbs_apv_read_ ## name
103 
104 #define xu(width, name, var, range_min, range_max, subs, ...) do { \
105  uint32_t value; \
106  CHECK(CBS_FUNC(read_unsigned)(ctx, rw, width, #name, \
107  SUBSCRIPTS(subs, __VA_ARGS__), \
108  &value, range_min, range_max)); \
109  var = value; \
110  } while (0)
111 
112 #define infer(name, value) do { \
113  current->name = value; \
114  } while (0)
115 
116 #define byte_alignment(rw) (get_bits_count(rw) % 8)
117 
118 #include "cbs_apv_syntax_template.c"
119 
120 #undef READ
121 #undef READWRITE
122 #undef RWContext
123 #undef FUNC
124 #undef xu
125 #undef infer
126 #undef byte_alignment
127 #endif // CBS_READ
128 
129 #if CBS_WRITE
130 #define WRITE
131 #define READWRITE write
132 #define RWContext PutBitContext
133 #define FUNC(name) cbs_apv_write_ ## name
134 
135 #define xu(width, name, var, range_min, range_max, subs, ...) do { \
136  uint32_t value = var; \
137  CHECK(CBS_FUNC(write_unsigned)(ctx, rw, width, #name, \
138  SUBSCRIPTS(subs, __VA_ARGS__), \
139  value, range_min, range_max)); \
140  } while (0)
141 
142 #define infer(name, value) do { \
143  if (current->name != (value)) { \
144  av_log(ctx->log_ctx, AV_LOG_ERROR, \
145  "%s does not match inferred value: " \
146  "%"PRId64", but should be %"PRId64".\n", \
147  #name, (int64_t)current->name, (int64_t)(value)); \
148  return AVERROR_INVALIDDATA; \
149  } \
150  } while (0)
151 
152 #define byte_alignment(rw) (put_bits_count(rw) % 8)
153 
154 #include "cbs_apv_syntax_template.c"
155 
156 #undef WRITE
157 #undef READWRITE
158 #undef RWContext
159 #undef FUNC
160 #undef xu
161 #undef infer
162 #undef byte_alignment
163 #endif // CBS_WRITE
164 
165 
168  int header)
169 {
170 #if CBS_READ
171  uint8_t *data = frag->data;
172  size_t size = frag->data_size;
173  uint32_t signature;
174  int err, trace;
175 
176  if (header || !frag->data_size) {
177  // Ignore empty or extradata fragments.
178  return 0;
179  }
180 
181  if (frag->data_size < 4) {
182  // Too small to be a valid fragment.
183  return AVERROR_INVALIDDATA;
184  }
185 
186  // Don't include parsing here in trace output.
187  trace = ctx->trace_enable;
188  ctx->trace_enable = 0;
189 
191  if (signature != APV_SIGNATURE) {
192  av_log(ctx->log_ctx, AV_LOG_ERROR,
193  "Invalid APV access unit: bad signature %08x.\n",
194  signature);
195  err = AVERROR_INVALIDDATA;
196  goto fail;
197  }
198  data += 4;
199  size -= 4;
200 
201  while (size > 0) {
202  GetBitContext gbc;
203  uint32_t pbu_size;
205 
206  if (size < 8) {
207  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid PBU: "
208  "fragment too short (%"SIZE_SPECIFIER" bytes).\n",
209  size);
210  err = AVERROR_INVALIDDATA;
211  goto fail;
212  }
213 
214  pbu_size = AV_RB32(data);
215  if (pbu_size < 8) {
216  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid PBU: "
217  "pbu_size too small (%"PRIu32" bytes).\n",
218  pbu_size);
219  err = AVERROR_INVALIDDATA;
220  goto fail;
221  }
222 
223  data += 4;
224  size -= 4;
225 
226  if (pbu_size > size) {
227  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid PBU: "
228  "pbu_size too large (%"PRIu32" bytes).\n",
229  pbu_size);
230  err = AVERROR_INVALIDDATA;
231  goto fail;
232  }
233 
234  init_get_bits(&gbc, data, 8 * pbu_size);
235 
236  err = cbs_apv_read_pbu_header(ctx, &gbc, &pbu_header);
237  if (err < 0)
238  goto fail;
239 
240  // Could select/skip frames based on type/group_id here.
241 
242  err = CBS_FUNC(append_unit_data)(frag, pbu_header.pbu_type,
243  data, pbu_size, frag->data_ref);
244  if (err < 0)
245  goto fail;
246 
247  data += pbu_size;
248  size -= pbu_size;
249  }
250 
251  err = 0;
252 fail:
253  ctx->trace_enable = trace;
254  return err;
255 #else
256  return AVERROR(ENOSYS);
257 #endif
258 }
259 
261  CodedBitstreamUnit *unit)
262 {
263 #if CBS_READ
264  GetBitContext gbc;
265  int err;
266 
267  err = init_get_bits(&gbc, unit->data, 8 * unit->data_size);
268  if (err < 0)
269  return err;
270 
271  err = CBS_FUNC(alloc_unit_content)(ctx, unit);
272  if (err < 0)
273  return err;
274 
275  switch (unit->type) {
279  case APV_PBU_DEPTH_FRAME:
280  case APV_PBU_ALPHA_FRAME:
281  {
282  APVRawFrame *frame = unit->content;
283 
284  err = cbs_apv_read_frame(ctx, &gbc, frame);
285  if (err < 0)
286  return err;
287 
288  // Each tile inside the frame has pointers into the unit
289  // data buffer; make a single reference here for all of
290  // them together.
291  frame->tile_data_ref = av_buffer_ref(unit->data_ref);
292  if (!frame->tile_data_ref)
293  return AVERROR(ENOMEM);
294  }
295  break;
297  {
298  err = cbs_apv_read_au_info(ctx, &gbc, unit->content);
299  if (err < 0)
300  return err;
301  }
302  break;
303  case APV_PBU_METADATA:
304  {
305  err = cbs_apv_read_metadata(ctx, &gbc, unit->content);
306  if (err < 0)
307  return err;
308  }
309  break;
310  case APV_PBU_FILLER:
311  {
312  err = cbs_apv_read_filler(ctx, &gbc, unit->content);
313  if (err < 0)
314  return err;
315  }
316  break;
317  default:
318  return AVERROR(ENOSYS);
319  }
320 
321  return 0;
322 #else
323  return AVERROR(ENOSYS);
324 #endif
325 }
326 
328  CodedBitstreamUnit *unit,
329  PutBitContext *pbc)
330 {
331 #if CBS_WRITE
332  int err;
333 
334  switch (unit->type) {
338  case APV_PBU_DEPTH_FRAME:
339  case APV_PBU_ALPHA_FRAME:
340  {
341  APVRawFrame *frame = unit->content;
342 
343  err = cbs_apv_write_frame(ctx, pbc, frame);
344  if (err < 0)
345  return err;
346  }
347  break;
349  {
350  err = cbs_apv_write_au_info(ctx, pbc, unit->content);
351  if (err < 0)
352  return err;
353  }
354  break;
355  case APV_PBU_METADATA:
356  {
357  err = cbs_apv_write_metadata(ctx, pbc, unit->content);
358  if (err < 0)
359  return err;
360  }
361  break;
362  case APV_PBU_FILLER:
363  {
364  err = cbs_apv_write_filler(ctx, pbc, unit->content);
365  if (err < 0)
366  return err;
367  }
368  break;
369  default:
370  return AVERROR(ENOSYS);
371  }
372 
373  return 0;
374 #else
375  return AVERROR(ENOSYS);
376 #endif
377 }
378 
381 {
382 #if CBS_WRITE
383  size_t size = 4, pos;
384 
385  for (int i = 0; i < frag->nb_units; i++)
386  size += frag->units[i].data_size + 4;
387 
389  if (!frag->data_ref)
390  return AVERROR(ENOMEM);
391  frag->data = frag->data_ref->data;
392  memset(frag->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
393 
394  AV_WB32(frag->data, APV_SIGNATURE);
395  pos = 4;
396  for (int i = 0; i < frag->nb_units; i++) {
397  AV_WB32(frag->data + pos, frag->units[i].data_size);
398  pos += 4;
399 
400  memcpy(frag->data + pos, frag->units[i].data,
401  frag->units[i].data_size);
402  pos += frag->units[i].data_size;
403  }
404  av_assert0(pos == size);
405  frag->data_size = size;
406 
407  return 0;
408 #else
409  return AVERROR(ENOSYS);
410 #endif
411 }
412 
413 
414 static void cbs_apv_free_metadata(AVRefStructOpaque unused, void *content)
415 {
416  APVRawMetadata *md = content;
417  av_assert0(md->pbu_header.pbu_type == APV_PBU_METADATA);
418 
419  for (int i = 0; i < md->metadata_count; i++) {
420  APVRawMetadataPayload *pl = &md->payloads[i];
421 
422  switch (pl->payload_type) {
423  case APV_METADATA_MDCV:
424  case APV_METADATA_CLL:
425  case APV_METADATA_FILLER:
426  break;
429  break;
432  break;
433  default:
435  }
436  }
437 }
438 
440  {
442  .unit_type.range = {
443  .start = APV_PBU_PRIMARY_FRAME,
444  .end = APV_PBU_ALPHA_FRAME,
445  },
446  .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS,
447  .content_size = sizeof(APVRawFrame),
448  .type.ref = {
449  .nb_offsets = 1,
450  .offsets = { offsetof(APVRawFrame, tile_data_ref) -
451  sizeof(void*) },
452  },
453  },
454 
457 
460 
462 };
463 
464 const CodedBitstreamType CBS_FUNC(type_apv) = {
466 
467  .priv_data_size = sizeof(CodedBitstreamAPVContext),
468 
469  .unit_types = cbs_apv_unit_types,
470 
471  .split_fragment = &cbs_apv_split_fragment,
472  .read_unit = &cbs_apv_read_unit,
473  .write_unit = &cbs_apv_write_unit,
474  .assemble_fragment = &cbs_apv_assemble_fragment,
475 };
cbs.h
CBS_UNIT_TYPE_RANGE
@ CBS_UNIT_TYPE_RANGE
Definition: cbs_internal.h:92
CBS_UNIT_TYPE_COMPLEX
#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func)
Definition: cbs_internal.h:383
APVDerivedTileInfo::tile_cols
uint8_t tile_cols
Definition: cbs_apv.h:191
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
APV_PBU_NON_PRIMARY_FRAME
@ APV_PBU_NON_PRIMARY_FRAME
Definition: apv.h:28
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:90
cbs_apv_read_unit
static int cbs_apv_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_apv.c:260
APV_MB_WIDTH
@ APV_MB_WIDTH
Definition: apv.h:40
AVRefStructOpaque
RefStruct is an API for creating reference-counted objects with minimal overhead.
Definition: refstruct.h:58
CodedBitstreamUnit::content
void * content
Pointer to the decomposed form of this unit.
Definition: cbs.h:114
APV_MB_HEIGHT
@ APV_MB_HEIGHT
Definition: apv.h:41
md
#define md
Definition: vf_colormatrix.c:101
append_unit_data
int CBS_FUNC() append_unit_data(CodedBitstreamFragment *frag, CodedBitstreamUnitType type, uint8_t *data, size_t data_size, AVBufferRef *data_buf)
Add a new unit to a fragment with the given data bitstream.
Definition: cbs.c:865
cbs_apv_free_metadata
static void cbs_apv_free_metadata(AVRefStructOpaque unused, void *content)
Definition: cbs_apv.c:414
APV_CHROMA_FORMAT_4444
@ APV_CHROMA_FORMAT_4444
Definition: apv.h:50
APVRawAUInfo
Definition: cbs_apv.h:111
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:226
APVRawFrameInfo::frame_width
uint32_t frame_width
Definition: cbs_apv.h:48
data
const char data[16]
Definition: mxf.c:149
CodedBitstreamUnit::type
CodedBitstreamUnitType type
Codec-specific type of this unit.
Definition: cbs.h:81
av_buffer_ref
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:103
APVRawTileInfo::tile_width_in_mbs
uint32_t tile_width_in_mbs
Definition: cbs_apv.h:61
APV_MAX_TILE_COLS
@ APV_MAX_TILE_COLS
Definition: apv.h:75
APV_SIGNATURE
#define APV_SIGNATURE
Definition: apv.h:23
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:512
CodedBitstreamUnit
Coded bitstream unit structure.
Definition: cbs.h:77
CBS_FUNC
const CodedBitstreamType CBS_FUNC(type_apv)
fail
#define fail()
Definition: checkasm.h:199
GetBitContext
Definition: get_bits.h:109
APVRawMetadataUndefined::data_ref
AVBufferRef * data_ref
Definition: cbs_apv.h:161
CBS_CONTENT_TYPE_INTERNAL_REFS
@ CBS_CONTENT_TYPE_INTERNAL_REFS
Definition: cbs_internal.h:77
cbs_apv_syntax_template.c
APV_METADATA_FILLER
@ APV_METADATA_FILLER
Definition: apv.h:85
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
alloc_unit_content
int CBS_FUNC() alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
Definition: cbs.c:938
CodedBitstreamUnit::data
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
Definition: cbs.h:88
APVRawFrameHeader::frame_info
APVRawFrameInfo frame_info
Definition: cbs_apv.h:68
signature
static const char signature[]
Definition: ipmovie.c:592
CodedBitstreamFragment::units
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
Definition: cbs.h:175
CodedBitstreamUnitTypeDescriptor
Definition: cbs_internal.h:95
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
CodedBitstreamFragment
Coded bitstream fragment structure, combining one or more units.
Definition: cbs.h:129
CodedBitstreamUnitTypeDescriptor::nb_unit_types
int nb_unit_types
Definition: cbs_internal.h:99
APV_PBU_ACCESS_UNIT_INFORMATION
@ APV_PBU_ACCESS_UNIT_INFORMATION
Definition: apv.h:32
CodedBitstreamFragment::data_size
size_t data_size
The number of bytes in the bitstream.
Definition: cbs.h:142
cbs_apv_unit_types
static const CodedBitstreamUnitTypeDescriptor cbs_apv_unit_types[]
Definition: cbs_apv.c:439
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:41
APVRawTileInfo::tile_height_in_mbs
uint32_t tile_height_in_mbs
Definition: cbs_apv.h:62
APVRawPBUHeader
Definition: cbs_apv.h:33
APV_METADATA_ITU_T_T35
@ APV_METADATA_ITU_T_T35
Definition: apv.h:82
ctx
AVFormatContext * ctx
Definition: movenc.c:49
cbs_internal.h
CodedBitstreamType::codec_id
enum AVCodecID codec_id
Definition: cbs_internal.h:142
PutBitContext
Definition: put_bits.h:50
APV_CHROMA_FORMAT_444
@ APV_CHROMA_FORMAT_444
Definition: apv.h:49
APV_PBU_DEPTH_FRAME
@ APV_PBU_DEPTH_FRAME
Definition: apv.h:30
APVRawMetadata
Definition: cbs_apv.h:178
av_buffer_unref
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
Definition: buffer.c:139
cbs_apv_derive_tile_info
static void cbs_apv_derive_tile_info(APVDerivedTileInfo *ti, const APVRawFrameHeader *fh)
Definition: cbs_apv.c:40
CodedBitstreamUnit::data_size
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
Definition: cbs.h:93
cbs_apv_split_fragment
static int cbs_apv_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_apv.c:166
APV_METADATA_CLL
@ APV_METADATA_CLL
Definition: apv.h:84
APVRawFrame
Definition: cbs_apv.h:101
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:415
APV_PBU_PRIMARY_FRAME
@ APV_PBU_PRIMARY_FRAME
Definition: apv.h:27
APVRawMetadataPayload
Definition: cbs_apv.h:165
APVRawFrameInfo::frame_height
uint32_t frame_height
Definition: cbs_apv.h:49
APV_PBU_FILLER
@ APV_PBU_FILLER
Definition: apv.h:34
pbu_header
static int FUNC() pbu_header(CodedBitstreamContext *ctx, RWContext *rw, APVRawPBUHeader *current)
Definition: cbs_apv_syntax_template.c:19
APVRawFrameHeader
Definition: cbs_apv.h:67
size
int size
Definition: twinvq_data.h:10344
CodedBitstreamFragment::data
uint8_t * data
Pointer to the bitstream form of this fragment.
Definition: cbs.h:135
AV_RB32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
Definition: bytestream.h:96
APVRawMetadataPayload::user_defined
APVRawMetadataUserDefined user_defined
Definition: cbs_apv.h:173
APVRawMetadataPayload::payload_type
uint32_t payload_type
Definition: cbs_apv.h:166
APVRawFrameInfo::chroma_format_idc
uint8_t chroma_format_idc
Definition: cbs_apv.h:50
header
static const uint8_t header[24]
Definition: sdr2.c:68
CodedBitstreamAPVContext
Definition: cbs_apv.h:200
APVRawMetadataUserDefined::data_ref
AVBufferRef * data_ref
Definition: cbs_apv.h:155
APVRawMetadataPayload::itu_t_t35
APVRawMetadataITUTT35 itu_t_t35
Definition: cbs_apv.h:169
CBS_UNIT_TYPE_POD
#define CBS_UNIT_TYPE_POD(type_, structure)
Definition: cbs_internal.h:339
APVRawFrameHeader::tile_info
APVRawTileInfo tile_info
Definition: cbs_apv.h:80
CodedBitstreamType
Definition: cbs_internal.h:141
av_buffer_alloc
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:77
APV_PBU_METADATA
@ APV_PBU_METADATA
Definition: apv.h:33
APVDerivedTileInfo::row_starts
uint16_t row_starts[APV_MAX_TILE_ROWS+1]
Definition: cbs_apv.h:197
CodedBitstreamUnit::data_ref
AVBufferRef * data_ref
A reference to the buffer containing data.
Definition: cbs.h:105
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
cbs_apv_get_num_comp
static int cbs_apv_get_num_comp(const APVRawFrameHeader *fh)
Definition: cbs_apv.c:25
cbs_apv_assemble_fragment
static int cbs_apv_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_apv.c:379
APVDerivedTileInfo
Definition: cbs_apv.h:190
CBS_UNIT_TYPE_END_OF_LIST
#define CBS_UNIT_TYPE_END_OF_LIST
Definition: cbs_internal.h:386
AV_CODEC_ID_APV
@ AV_CODEC_ID_APV
Definition: codec_id.h:332
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
pos
unsigned int pos
Definition: spdifenc.c:414
APVDerivedTileInfo::tile_rows
uint8_t tile_rows
Definition: cbs_apv.h:192
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
SIZE_SPECIFIER
#define SIZE_SPECIFIER
Definition: internal.h:129
APV_MAX_TILE_ROWS
@ APV_MAX_TILE_ROWS
Definition: apv.h:76
APV_CHROMA_FORMAT_422
@ APV_CHROMA_FORMAT_422
Definition: apv.h:48
APVDerivedTileInfo::col_starts
uint16_t col_starts[APV_MAX_TILE_COLS+1]
Definition: cbs_apv.h:196
APV_METADATA_USER_DEFINED
@ APV_METADATA_USER_DEFINED
Definition: apv.h:86
mem.h
APV_PBU_ALPHA_FRAME
@ APV_PBU_ALPHA_FRAME
Definition: apv.h:31
APVRawMetadataITUTT35::data_ref
AVBufferRef * data_ref
Definition: cbs_apv.h:129
APV_CHROMA_FORMAT_400
@ APV_CHROMA_FORMAT_400
Definition: apv.h:47
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
APV_PBU_PREVIEW_FRAME
@ APV_PBU_PREVIEW_FRAME
Definition: apv.h:29
CodedBitstreamFragment::data_ref
AVBufferRef * data_ref
A reference to the buffer containing data.
Definition: cbs.h:152
APVDerivedTileInfo::num_tiles
uint16_t num_tiles
Definition: cbs_apv.h:193
APVRawFiller
Definition: cbs_apv.h:39
cbs_apv.h
APVRawMetadataPayload::undefined
APVRawMetadataUndefined undefined
Definition: cbs_apv.h:174
CodedBitstreamFragment::nb_units
int nb_units
Number of units in this fragment.
Definition: cbs.h:160
APV_METADATA_MDCV
@ APV_METADATA_MDCV
Definition: apv.h:83
cbs_apv_write_unit
static int cbs_apv_write_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_apv.c:327