FFmpeg
cbs_jpeg.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 "cbs.h"
20 #include "cbs_internal.h"
21 #include "cbs_jpeg.h"
22 
23 
24 #define HEADER(name) do { \
25  ff_cbs_trace_header(ctx, name); \
26  } while (0)
27 
28 #define CHECK(call) do { \
29  err = (call); \
30  if (err < 0) \
31  return err; \
32  } while (0)
33 
34 #define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
35 
36 #define u(width, name, range_min, range_max) \
37  xu(width, name, range_min, range_max, 0)
38 #define us(width, name, sub, range_min, range_max) \
39  xu(width, name, range_min, range_max, 1, sub)
40 
41 
42 #define READ
43 #define READWRITE read
44 #define RWContext GetBitContext
45 #define FUNC(name) cbs_jpeg_read_ ## name
46 
47 #define xu(width, name, range_min, range_max, subs, ...) do { \
48  uint32_t value; \
49  CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \
50  SUBSCRIPTS(subs, __VA_ARGS__), \
51  &value, range_min, range_max)); \
52  current->name = value; \
53  } while (0)
54 
56 
57 #undef READ
58 #undef READWRITE
59 #undef RWContext
60 #undef FUNC
61 #undef xu
62 
63 #define WRITE
64 #define READWRITE write
65 #define RWContext PutBitContext
66 #define FUNC(name) cbs_jpeg_write_ ## name
67 
68 #define xu(width, name, range_min, range_max, subs, ...) do { \
69  uint32_t value = current->name; \
70  CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \
71  SUBSCRIPTS(subs, __VA_ARGS__), \
72  value, range_min, range_max)); \
73  } while (0)
74 
75 
77 
78 #undef WRITE
79 #undef READWRITE
80 #undef RWContext
81 #undef FUNC
82 #undef xu
83 
84 
85 static void cbs_jpeg_free_application_data(void *unit, uint8_t *content)
86 {
88  av_buffer_unref(&ad->Ap_ref);
89  av_freep(&content);
90 }
91 
92 static void cbs_jpeg_free_comment(void *unit, uint8_t *content)
93 {
95  av_buffer_unref(&comment->Cm_ref);
96  av_freep(&content);
97 }
98 
99 static void cbs_jpeg_free_scan(void *unit, uint8_t *content)
100 {
101  JPEGRawScan *scan = (JPEGRawScan*)content;
102  av_buffer_unref(&scan->data_ref);
103  av_freep(&content);
104 }
105 
108  int header)
109 {
110  AVBufferRef *data_ref;
111  uint8_t *data;
112  size_t data_size;
113  int unit, start, end, marker, next_start, next_marker;
114  int err, i, j, length;
115 
116  if (frag->data_size < 4) {
117  // Definitely too short to be meaningful.
118  return AVERROR_INVALIDDATA;
119  }
120 
121  for (i = 0; i + 1 < frag->data_size && frag->data[i] != 0xff; i++);
122  if (i > 0) {
123  av_log(ctx->log_ctx, AV_LOG_WARNING, "Discarding %d bytes at "
124  "beginning of image.\n", i);
125  }
126  for (++i; i + 1 < frag->data_size && frag->data[i] == 0xff; i++);
127  if (i + 1 >= frag->data_size && frag->data[i]) {
128  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: "
129  "no SOI marker found.\n");
130  return AVERROR_INVALIDDATA;
131  }
132  marker = frag->data[i];
133  if (marker != JPEG_MARKER_SOI) {
134  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: first "
135  "marker is %02x, should be SOI.\n", marker);
136  return AVERROR_INVALIDDATA;
137  }
138  for (++i; i + 1 < frag->data_size && frag->data[i] == 0xff; i++);
139  if (i + 1 >= frag->data_size) {
140  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: "
141  "no image content found.\n");
142  return AVERROR_INVALIDDATA;
143  }
144  marker = frag->data[i];
145  start = i + 1;
146 
147  for (unit = 0;; unit++) {
148  if (marker == JPEG_MARKER_EOI) {
149  break;
150  } else if (marker == JPEG_MARKER_SOS) {
151  next_marker = -1;
152  end = start;
153  for (i = start; i + 1 < frag->data_size; i++) {
154  if (frag->data[i] != 0xff)
155  continue;
156  end = i;
157  for (++i; i + 1 < frag->data_size &&
158  frag->data[i] == 0xff; i++);
159  if (i + 1 < frag->data_size) {
160  if (frag->data[i] == 0x00)
161  continue;
162  next_marker = frag->data[i];
163  next_start = i + 1;
164  }
165  break;
166  }
167  } else {
168  i = start;
169  if (i + 2 > frag->data_size) {
170  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: "
171  "truncated at %02x marker.\n", marker);
172  return AVERROR_INVALIDDATA;
173  }
174  length = AV_RB16(frag->data + i);
175  if (i + length > frag->data_size) {
176  av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid JPEG image: "
177  "truncated at %02x marker segment.\n", marker);
178  return AVERROR_INVALIDDATA;
179  }
180  end = start + length;
181 
182  i = end;
183  if (frag->data[i] != 0xff) {
184  next_marker = -1;
185  } else {
186  for (++i; i + 1 < frag->data_size &&
187  frag->data[i] == 0xff; i++);
188  if (i + 1 >= frag->data_size) {
189  next_marker = -1;
190  } else {
191  next_marker = frag->data[i];
192  next_start = i + 1;
193  }
194  }
195  }
196 
197  if (marker == JPEG_MARKER_SOS) {
198  length = AV_RB16(frag->data + start);
199 
200  if (length > end - start)
201  return AVERROR_INVALIDDATA;
202 
203  data_ref = NULL;
204  data = av_malloc(end - start +
206  if (!data)
207  return AVERROR(ENOMEM);
208 
209  memcpy(data, frag->data + start, length);
210  for (i = start + length, j = length; i < end; i++, j++) {
211  if (frag->data[i] == 0xff) {
212  while (frag->data[i] == 0xff)
213  ++i;
214  data[j] = 0xff;
215  } else {
216  data[j] = frag->data[i];
217  }
218  }
219  data_size = j;
220 
221  memset(data + data_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
222 
223  } else {
224  data = frag->data + start;
225  data_size = end - start;
226  data_ref = frag->data_ref;
227  }
228 
229  err = ff_cbs_insert_unit_data(ctx, frag, unit, marker,
230  data, data_size, data_ref);
231  if (err < 0) {
232  if (!data_ref)
233  av_freep(&data);
234  return err;
235  }
236 
237  if (next_marker == -1)
238  break;
239  marker = next_marker;
240  start = next_start;
241  }
242 
243  return 0;
244 }
245 
247  CodedBitstreamUnit *unit)
248 {
249  GetBitContext gbc;
250  int err;
251 
252  err = init_get_bits(&gbc, unit->data, 8 * unit->data_size);
253  if (err < 0)
254  return err;
255 
256  if (unit->type >= JPEG_MARKER_SOF0 &&
257  unit->type <= JPEG_MARKER_SOF3) {
258  err = ff_cbs_alloc_unit_content(ctx, unit,
259  sizeof(JPEGRawFrameHeader),
260  NULL);
261  if (err < 0)
262  return err;
263 
264  err = cbs_jpeg_read_frame_header(ctx, &gbc, unit->content);
265  if (err < 0)
266  return err;
267 
268  } else if (unit->type >= JPEG_MARKER_APPN &&
269  unit->type <= JPEG_MARKER_APPN + 15) {
270  err = ff_cbs_alloc_unit_content(ctx, unit,
271  sizeof(JPEGRawApplicationData),
273  if (err < 0)
274  return err;
275 
276  err = cbs_jpeg_read_application_data(ctx, &gbc, unit->content);
277  if (err < 0)
278  return err;
279 
280  } else if (unit->type == JPEG_MARKER_SOS) {
281  JPEGRawScan *scan;
282  int pos;
283 
284  err = ff_cbs_alloc_unit_content(ctx, unit,
285  sizeof(JPEGRawScan),
287  if (err < 0)
288  return err;
289  scan = unit->content;
290 
291  err = cbs_jpeg_read_scan_header(ctx, &gbc, &scan->header);
292  if (err < 0)
293  return err;
294 
295  pos = get_bits_count(&gbc);
296  av_assert0(pos % 8 == 0);
297  if (pos > 0) {
298  scan->data_size = unit->data_size - pos / 8;
299  scan->data_ref = av_buffer_ref(unit->data_ref);
300  if (!scan->data_ref)
301  return AVERROR(ENOMEM);
302  scan->data = unit->data + pos / 8;
303  }
304 
305  } else {
306  switch (unit->type) {
307 #define SEGMENT(marker, type, func, free) \
308  case JPEG_MARKER_ ## marker: \
309  { \
310  err = ff_cbs_alloc_unit_content(ctx, unit, \
311  sizeof(type), free); \
312  if (err < 0) \
313  return err; \
314  err = cbs_jpeg_read_ ## func(ctx, &gbc, unit->content); \
315  if (err < 0) \
316  return err; \
317  } \
318  break
322 #undef SEGMENT
323  default:
324  return AVERROR(ENOSYS);
325  }
326  }
327 
328  return 0;
329 }
330 
332  CodedBitstreamUnit *unit,
333  PutBitContext *pbc)
334 {
335  JPEGRawScan *scan = unit->content;
336  int i, err;
337 
338  err = cbs_jpeg_write_scan_header(ctx, pbc, &scan->header);
339  if (err < 0)
340  return err;
341 
342  if (scan->data) {
343  if (scan->data_size * 8 > put_bits_left(pbc))
344  return AVERROR(ENOSPC);
345 
346  for (i = 0; i < scan->data_size; i++)
347  put_bits(pbc, 8, scan->data[i]);
348  }
349 
350  return 0;
351 }
352 
354  CodedBitstreamUnit *unit,
355  PutBitContext *pbc)
356 {
357  int err;
358 
359  if (unit->type >= JPEG_MARKER_SOF0 &&
360  unit->type <= JPEG_MARKER_SOF3) {
361  err = cbs_jpeg_write_frame_header(ctx, pbc, unit->content);
362  } else if (unit->type >= JPEG_MARKER_APPN &&
363  unit->type <= JPEG_MARKER_APPN + 15) {
364  err = cbs_jpeg_write_application_data(ctx, pbc, unit->content);
365  } else {
366  switch (unit->type) {
367 #define SEGMENT(marker, func) \
368  case JPEG_MARKER_ ## marker: \
369  err = cbs_jpeg_write_ ## func(ctx, pbc, unit->content); \
370  break;
371  SEGMENT(DQT, dqt);
372  SEGMENT(DHT, dht);
373  SEGMENT(COM, comment);
374  default:
375  return AVERROR_PATCHWELCOME;
376  }
377  }
378 
379  return err;
380 }
381 
383  CodedBitstreamUnit *unit,
384  PutBitContext *pbc)
385 {
386  if (unit->type == JPEG_MARKER_SOS)
387  return cbs_jpeg_write_scan (ctx, unit, pbc);
388  else
389  return cbs_jpeg_write_segment(ctx, unit, pbc);
390 }
391 
394 {
395  const CodedBitstreamUnit *unit;
396  uint8_t *data;
397  size_t size, dp, sp;
398  int i;
399 
400  size = 4; // SOI + EOI.
401  for (i = 0; i < frag->nb_units; i++) {
402  unit = &frag->units[i];
403  size += 2 + unit->data_size;
404  if (unit->type == JPEG_MARKER_SOS) {
405  for (sp = 0; sp < unit->data_size; sp++) {
406  if (unit->data[sp] == 0xff)
407  ++size;
408  }
409  }
410  }
411 
413  if (!frag->data_ref)
414  return AVERROR(ENOMEM);
415  data = frag->data_ref->data;
416 
417  dp = 0;
418 
419  data[dp++] = 0xff;
420  data[dp++] = JPEG_MARKER_SOI;
421 
422  for (i = 0; i < frag->nb_units; i++) {
423  unit = &frag->units[i];
424 
425  data[dp++] = 0xff;
426  data[dp++] = unit->type;
427 
428  if (unit->type != JPEG_MARKER_SOS) {
429  memcpy(data + dp, unit->data, unit->data_size);
430  dp += unit->data_size;
431  } else {
432  sp = AV_RB16(unit->data);
433  av_assert0(sp <= unit->data_size);
434  memcpy(data + dp, unit->data, sp);
435  dp += sp;
436 
437  for (; sp < unit->data_size; sp++) {
438  if (unit->data[sp] == 0xff) {
439  data[dp++] = 0xff;
440  data[dp++] = 0x00;
441  } else {
442  data[dp++] = unit->data[sp];
443  }
444  }
445  }
446  }
447 
448  data[dp++] = 0xff;
449  data[dp++] = JPEG_MARKER_EOI;
450 
451  av_assert0(dp == size);
452 
453  memset(data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
454  frag->data = data;
455  frag->data_size = size;
456 
457  return 0;
458 }
459 
462 
463  .split_fragment = &cbs_jpeg_split_fragment,
464  .read_unit = &cbs_jpeg_read_unit,
465  .write_unit = &cbs_jpeg_write_unit,
466  .assemble_fragment = &cbs_jpeg_assemble_fragment,
467 };
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
av_buffer_alloc
AVBufferRef * av_buffer_alloc(int size)
Allocate an AVBuffer of the given size using av_malloc().
Definition: buffer.c:67
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
cbs_jpeg.h
JPEG_MARKER_SOI
@ JPEG_MARKER_SOI
Definition: cbs_jpeg.h:35
AVBufferRef::data
uint8_t * data
The data buffer.
Definition: buffer.h:89
CodedBitstreamUnit::content
void * content
Pointer to the decomposed form of this unit.
Definition: cbs.h:101
get_bits_count
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:219
end
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
cbs_jpeg_syntax_template.c
put_bits
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
Definition: j2kenc.c:208
JPEGRawScan::data_ref
AVBufferRef * data_ref
Definition: cbs_jpeg.h:84
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:168
data
const char data[16]
Definition: mxf.c:91
CodedBitstreamUnit::type
CodedBitstreamUnitType type
Codec-specific type of this unit.
Definition: cbs.h:68
cbs.h
JPEGRawScan::data
uint8_t * data
Definition: cbs_jpeg.h:82
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:659
CodedBitstreamUnit
Coded bitstream unit structure.
Definition: cbs.h:64
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:31
cbs_jpeg_write_segment
static int cbs_jpeg_write_segment(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_jpeg.c:353
JPEG_MARKER_SOF3
@ JPEG_MARKER_SOF3
Definition: cbs_jpeg.h:32
start
void INT64 start
Definition: avisynth_c.h:767
GetBitContext
Definition: get_bits.h:61
JPEGRawScan::data_size
size_t data_size
Definition: cbs_jpeg.h:83
put_bits_left
static int put_bits_left(PutBitContext *s)
Definition: put_bits.h:93
JPEGRawQuantisationTableSpecification
Definition: cbs_jpeg.h:93
CodedBitstreamUnit::data
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
Definition: cbs.h:75
JPEGRawApplicationData::Ap_ref
AVBufferRef * Ap_ref
Definition: cbs_jpeg.h:113
ff_cbs_insert_unit_data
int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, uint8_t *data, size_t data_size, AVBufferRef *data_buf)
Insert a new unit into a fragment with the given data bitstream.
Definition: cbs.c:759
CodedBitstreamFragment::units
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
Definition: cbs.h:162
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
COM
@ COM
Definition: mjpeg.h:111
CodedBitstreamFragment
Coded bitstream fragment structure, combining one or more units.
Definition: cbs.h:116
CodedBitstreamFragment::data_size
size_t data_size
The number of bytes in the bitstream.
Definition: cbs.h:129
cbs_jpeg_assemble_fragment
static int cbs_jpeg_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_jpeg.c:392
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
ctx
AVFormatContext * ctx
Definition: movenc.c:48
cbs_internal.h
CodedBitstreamType::codec_id
enum AVCodecID codec_id
Definition: cbs_internal.h:29
PutBitContext
Definition: put_bits.h:35
cbs_jpeg_write_scan
static int cbs_jpeg_write_scan(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_jpeg.c:331
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
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:125
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:80
cbs_jpeg_read_unit
static int cbs_jpeg_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_jpeg.c:246
JPEG_MARKER_EOI
@ JPEG_MARKER_EOI
Definition: cbs_jpeg.h:36
JPEGRawHuffmanTableSpecification
Definition: cbs_jpeg.h:105
sp
#define sp
Definition: regdef.h:63
size
int size
Definition: twinvq_data.h:11134
CodedBitstreamFragment::data
uint8_t * data
Pointer to the bitstream form of this fragment.
Definition: cbs.h:122
JPEG_MARKER_SOF0
@ JPEG_MARKER_SOF0
Definition: cbs_jpeg.h:29
cbs_jpeg_free_scan
static void cbs_jpeg_free_scan(void *unit, uint8_t *content)
Definition: cbs_jpeg.c:99
ff_cbs_type_jpeg
const CodedBitstreamType ff_cbs_type_jpeg
Definition: cbs_jpeg.c:460
header
static const uint8_t header[24]
Definition: sdr2.c:67
CodedBitstreamType
Definition: cbs_internal.h:28
DQT
@ DQT
Definition: mjpeg.h:73
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: avcodec.h:225
JPEGRawScan::header
JPEGRawScanHeader header
Definition: cbs_jpeg.h:81
CodedBitstreamUnit::data_ref
AVBufferRef * data_ref
A reference to the buffer containing data.
Definition: cbs.h:92
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
uint8_t
uint8_t
Definition: audio_convert.c:194
DHT
@ DHT
Definition: mjpeg.h:56
JPEGRawApplicationData
Definition: cbs_jpeg.h:110
cbs_jpeg_split_fragment
static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_jpeg.c:106
SEGMENT
#define SEGMENT(marker, type, func, free)
JPEGRawScan
Definition: cbs_jpeg.h:80
comment
static int FUNC() comment(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawComment *current)
Definition: cbs_jpeg_syntax_template.c:174
dht
static int FUNC() dht(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawHuffmanTableSpecification *current)
Definition: cbs_jpeg_syntax_template.c:102
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: avcodec.h:790
cbs_jpeg_write_unit
static int cbs_jpeg_write_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_jpeg.c:382
ff_cbs_alloc_unit_content
int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, size_t size, void(*free)(void *opaque, uint8_t *data))
Definition: cbs.c:644
JPEG_MARKER_APPN
@ JPEG_MARKER_APPN
Definition: cbs_jpeg.h:40
dqt
static int FUNC() dqt(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawQuantisationTableSpecification *current)
Definition: cbs_jpeg_syntax_template.c:62
av_buffer_ref
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:93
cbs_jpeg_free_application_data
static void cbs_jpeg_free_application_data(void *unit, uint8_t *content)
Definition: cbs_jpeg.c:85
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:81
JPEGRawFrameHeader
Definition: cbs_jpeg.h:53
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
JPEGRawComment
Definition: cbs_jpeg.h:116
JPEG_MARKER_SOS
@ JPEG_MARKER_SOS
Definition: cbs_jpeg.h:37
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
length
const char int length
Definition: avisynth_c.h:860
CodedBitstreamFragment::data_ref
AVBufferRef * data_ref
A reference to the buffer containing data.
Definition: cbs.h:139
CodedBitstreamFragment::nb_units
int nb_units
Number of units in this fragment.
Definition: cbs.h:147
AV_RB16
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_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:94
cbs_jpeg_free_comment
static void cbs_jpeg_free_comment(void *unit, uint8_t *content)
Definition: cbs_jpeg.c:92