FFmpeg
aaxdec.c
Go to the documentation of this file.
1 /*
2  * AAX demuxer
3  * Copyright (c) 2020 Paul B Mahol
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/intreadwrite.h"
23 #include "libavutil/mem.h"
24 #include "avformat.h"
25 #include "avio_internal.h"
26 #include "demux.h"
27 #include "internal.h"
28 
29 typedef struct AAXColumn {
30  uint8_t flag;
31  uint8_t type;
32  const char *name;
33  uint32_t offset;
34  int size;
35 } AAXColumn;
36 
37 typedef struct AAXSegment {
38  int64_t start;
39  int64_t end;
40 } AAXSegment;
41 
42 typedef struct AAXContext {
43  int64_t table_size;
44  uint16_t version;
45  int64_t rows_offset;
46  int64_t strings_offset;
47  int64_t data_offset;
48  int64_t name_offset;
49  uint16_t columns;
50  uint16_t row_width;
51  uint32_t nb_segments;
52  int64_t schema_offset;
53  int64_t strings_size;
54  char *string_table;
55 
56  uint32_t current_segment;
57 
60 } AAXContext;
61 
62 static int aax_probe(const AVProbeData *p)
63 {
64  if (AV_RB32(p->buf) != MKBETAG('@','U','T','F'))
65  return 0;
66  if (AV_RB32(p->buf + 4) == 0)
67  return 0;
68  if (AV_RB16(p->buf + 8) > 1)
69  return 0;
70  if (AV_RB32(p->buf + 28) < 1)
71  return 0;
72 
73  return AVPROBE_SCORE_MAX;
74 }
75 
76 enum ColumnFlag {
80  COLUMN_FLAG_UNDEFINED = 0x8 /* shouldn't exist */
81 };
82 
83 enum ColumnType {
96  COLUMN_TYPE_UINT128 = 0x0c, /* for GUIDs */
98 };
99 
100 static int64_t get_pts(AVFormatContext *s, int64_t pos, int size)
101 {
102  AAXContext *a = s->priv_data;
103  int64_t pts = 0;
104 
105  for (int seg = 0; seg < a->current_segment; seg++)
106  pts += (a->segments[seg].end - a->segments[seg].start) / size;
107 
108  pts += ((pos - a->segments[a->current_segment].start) / size);
109 
110  return pts;
111 }
112 
114 {
115  AAXContext *a = s->priv_data;
116  AVIOContext *pb = s->pb;
117  AVCodecParameters *par;
118  AVStream *st;
119  int64_t column_offset = 0;
120  int ret, extradata_size;
121  char *codec;
122  int64_t ret64;
123 
124  avio_skip(pb, 4);
125  a->table_size = avio_rb32(pb) + 8LL;
126  a->version = avio_rb16(pb);
127  a->rows_offset = avio_rb16(pb) + 8LL;
128  a->strings_offset = avio_rb32(pb) + 8LL;
129  a->data_offset = avio_rb32(pb) + 8LL;
130  a->name_offset = avio_rb32(pb);
131  a->columns = avio_rb16(pb);
132  a->row_width = avio_rb16(pb);
133  a->nb_segments = avio_rb32(pb);
134 
135  if (a->nb_segments < 1)
136  return AVERROR_INVALIDDATA;
137 
138  a->schema_offset = 0x20;
139  a->strings_size = a->data_offset - a->strings_offset;
140 
141  if (a->rows_offset > a->table_size ||
142  a->strings_offset > a->table_size ||
143  a->data_offset > a->table_size)
144  return AVERROR_INVALIDDATA;
145  if (a->strings_size <= 0 || a->name_offset >= a->strings_size ||
146  a->strings_size > UINT16_MAX)
147  return AVERROR_INVALIDDATA;
148  if (a->columns <= 0)
149  return AVERROR_INVALIDDATA;
150 
151  a->segments = av_calloc(a->nb_segments, sizeof(*a->segments));
152  if (!a->segments)
153  return AVERROR(ENOMEM);
154 
155  a->xcolumns = av_calloc(a->columns, sizeof(*a->xcolumns));
156  if (!a->xcolumns)
157  return AVERROR(ENOMEM);
158 
159  a->string_table = av_calloc(a->strings_size + 1, sizeof(*a->string_table));
160  if (!a->string_table)
161  return AVERROR(ENOMEM);
162 
163  for (int c = 0; c < a->columns; c++) {
164  uint8_t info = avio_r8(pb);
165  uint32_t offset = avio_rb32(pb);
166  int value_size;
167 
168  if (offset >= a->strings_size)
169  return AVERROR_INVALIDDATA;
170 
171  a->xcolumns[c].flag = info >> 4;
172  a->xcolumns[c].type = info & 0x0F;
173 
174  switch (a->xcolumns[c].type) {
175  case COLUMN_TYPE_UINT8:
176  case COLUMN_TYPE_SINT8:
177  value_size = 0x01;
178  break;
179  case COLUMN_TYPE_UINT16:
180  case COLUMN_TYPE_SINT16:
181  value_size = 0x02;
182  break;
183  case COLUMN_TYPE_UINT32:
184  case COLUMN_TYPE_SINT32:
185  case COLUMN_TYPE_FLOAT:
186  case COLUMN_TYPE_STRING:
187  value_size = 0x04;
188  break;
189  case COLUMN_TYPE_VLDATA:
190  value_size = 0x08;
191  break;
192  case COLUMN_TYPE_UINT128:
193  value_size = 0x10;
194  break;
195  default:
196  return AVERROR_INVALIDDATA;
197  }
198 
199  a->xcolumns[c].size = value_size;
200 
201  if (a->xcolumns[c].flag & COLUMN_FLAG_NAME)
202  a->xcolumns[c].name = a->string_table + offset;
203 
204  if (a->xcolumns[c].flag & COLUMN_FLAG_DEFAULT) {
205  /* data is found relative to columns start */
206  a->xcolumns[c].offset = avio_tell(pb) - a->schema_offset;
207  avio_skip(pb, value_size);
208  }
209 
210  if (a->xcolumns[c].flag & COLUMN_FLAG_ROW) {
211  /* data is found relative to row start */
212  a->xcolumns[c].offset = column_offset;
213  column_offset += value_size;
214  }
215  }
216 
217  ret = ret64 = avio_seek(pb, a->strings_offset, SEEK_SET);
218  if (ret64 < 0)
219  return ret;
220 
221  ret = ffio_read_size(pb, a->string_table, a->strings_size);
222  if (ret < 0)
223  return ret;
224 
225  for (int c = 0; c < a->columns; c++) {
226  int64_t data_offset = 0;
227  int64_t col_offset;
228  int flag, type;
229 
230  if (!a->xcolumns[c].name || strcmp(a->xcolumns[c].name, "data"))
231  continue;
232 
233  type = a->xcolumns[c].type;
234  flag = a->xcolumns[c].flag;
235  col_offset = a->xcolumns[c].offset;
236 
237  for (uint64_t r = 0; r < a->nb_segments; r++) {
238  if (flag & COLUMN_FLAG_DEFAULT) {
239  data_offset = a->schema_offset + col_offset;
240  } else if (flag & COLUMN_FLAG_ROW) {
241  data_offset = a->rows_offset + r * a->row_width + col_offset;
242  } else
243  return AVERROR_INVALIDDATA;
244 
245  ret = ret64 = avio_seek(pb, data_offset, SEEK_SET);
246  if (ret64 < 0)
247  return ret;
248 
249  if (type == COLUMN_TYPE_VLDATA) {
250  int64_t start, size;
251 
252  start = avio_rb32(pb);
253  size = avio_rb32(pb);
254  if (!size)
255  return AVERROR_INVALIDDATA;
256  a->segments[r].start = start + a->data_offset;
257  a->segments[r].end = a->segments[r].start + size;
258  if (r &&
259  a->segments[r].start < a->segments[r-1].end &&
260  a->segments[r].end > a->segments[r-1].start)
261  return AVERROR_INVALIDDATA;
262  } else
263  return AVERROR_INVALIDDATA;
264  }
265  }
266 
267  if (!a->segments[0].end)
268  return AVERROR_INVALIDDATA;
269 
270  st = avformat_new_stream(s, NULL);
271  if (!st)
272  return AVERROR(ENOMEM);
273  st->start_time = 0;
274  par = s->streams[0]->codecpar;
276 
277  codec = a->string_table + a->name_offset;
278  if (!strcmp(codec, "AAX")) {
280  ret64 = avio_seek(pb, a->segments[0].start, SEEK_SET);
281  if (ret64 < 0 || avio_rb16(pb) != 0x8000)
282  return AVERROR_INVALIDDATA;
283  extradata_size = avio_rb16(pb) + 4;
284  if (extradata_size < 12)
285  return AVERROR_INVALIDDATA;
286  avio_seek(pb, -4, SEEK_CUR);
287  ret = ff_get_extradata(s, par, pb, extradata_size);
288  if (ret < 0)
289  return ret;
290  par->ch_layout.nb_channels = AV_RB8 (par->extradata + 7);
291  par->sample_rate = AV_RB32(par->extradata + 8);
292  if (!par->ch_layout.nb_channels || !par->sample_rate)
293  return AVERROR_INVALIDDATA;
294 
295  avpriv_set_pts_info(st, 64, 32, par->sample_rate);
296  /*} else if (!strcmp(codec, "HCA") ){
297  par->codec_id = AV_CODEC_ID_HCA;*/
298  } else {
299  return AVERROR_INVALIDDATA;
300  }
301 
302  return 0;
303 }
304 
306 {
307  AAXContext *a = s->priv_data;
308  AVCodecParameters *par = s->streams[0]->codecpar;
309  AVIOContext *pb = s->pb;
310  const int size = 18 * par->ch_layout.nb_channels;
311  int ret, extradata_size = 0;
312  uint8_t *extradata = NULL;
313  int skip = 0;
314 
315  if (avio_feof(pb))
316  return AVERROR_EOF;
317 
318  pkt->pos = avio_tell(pb);
319 
320  for (uint32_t seg = 0; seg < a->nb_segments; seg++) {
321  int64_t start = a->segments[seg].start;
322  int64_t end = a->segments[seg].end;
323 
324  if (pkt->pos >= start && pkt->pos <= end) {
325  a->current_segment = seg;
326  if (par->codec_id == AV_CODEC_ID_ADPCM_ADX)
327  skip = (end - start) - ((end - start) / size) * size;
328  break;
329  }
330  }
331 
332  if (pkt->pos >= a->segments[a->current_segment].end - skip) {
333  if (a->current_segment + 1 == a->nb_segments)
334  return AVERROR_EOF;
335  a->current_segment++;
336  avio_seek(pb, a->segments[a->current_segment].start, SEEK_SET);
337 
338  if (par->codec_id == AV_CODEC_ID_ADPCM_ADX) {
339  if (avio_rb16(pb) != 0x8000)
340  return AVERROR_INVALIDDATA;
341  extradata_size = avio_rb16(pb) + 4;
342  avio_seek(pb, -4, SEEK_CUR);
343  if (extradata_size < 12)
344  return AVERROR_INVALIDDATA;
345  extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
346  if (!extradata)
347  return AVERROR(ENOMEM);
348  if (avio_read(pb, extradata, extradata_size) != extradata_size) {
349  av_free(extradata);
350  return AVERROR(EIO);
351  }
352  memset(extradata + extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
353  }
354  }
355 
356  ret = av_get_packet(pb, pkt, size);
357  if (ret != size) {
358  av_free(extradata);
359  return ret < 0 ? ret : AVERROR(EIO);
360  }
361  pkt->duration = 1;
362  pkt->stream_index = 0;
363  pkt->pts = get_pts(s, pkt->pos, size);
364 
365  if (extradata) {
366  ret = av_packet_add_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, extradata, extradata_size);
367  if (ret < 0) {
368  av_free(extradata);
369  return ret;
370  }
371  }
372 
373  return ret;
374 }
375 
377 {
378  AAXContext *a = s->priv_data;
379 
380  av_freep(&a->segments);
381  av_freep(&a->xcolumns);
382  av_freep(&a->string_table);
383 
384  return 0;
385 }
386 
388  .p.name = "aax",
389  .p.long_name = NULL_IF_CONFIG_SMALL("CRI AAX"),
390  .p.extensions = "aax",
391  .p.flags = AVFMT_GENERIC_INDEX,
392  .priv_data_size = sizeof(AAXContext),
393  .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
398 };
AAXSegment::start
int64_t start
Definition: aaxdec.c:38
AVCodecParameters::extradata
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:69
r
const char * r
Definition: vf_curves.c:127
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
AAXSegment::end
int64_t end
Definition: aaxdec.c:39
COLUMN_TYPE_DOUBLE
@ COLUMN_TYPE_DOUBLE
Definition: aaxdec.c:93
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
AAXContext::segments
AAXSegment * segments
Definition: aaxdec.c:59
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AV_PKT_DATA_NEW_EXTRADATA
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Definition: packet.h:56
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
COLUMN_TYPE_UNDEFINED
@ COLUMN_TYPE_UNDEFINED
Definition: aaxdec.c:97
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:538
aax_probe
static int aax_probe(const AVProbeData *p)
Definition: aaxdec.c:62
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:321
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
ff_get_extradata
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and f...
Definition: demux_utils.c:335
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:463
avpriv_set_pts_info
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition: avformat.c:853
av_packet_add_side_data
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
Definition: packet.c:197
COLUMN_TYPE_UINT128
@ COLUMN_TYPE_UINT128
Definition: aaxdec.c:96
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:480
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
pts
static int64_t pts
Definition: transcode_aac.c:644
COLUMN_TYPE_SINT32
@ COLUMN_TYPE_SINT32
Definition: aaxdec.c:89
aax_read_packet
static int aax_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: aaxdec.c:305
AAXContext::columns
uint16_t columns
Definition: aaxdec.c:49
AAXContext::string_table
char * string_table
Definition: aaxdec.c:54
aax_read_close
static int aax_read_close(AVFormatContext *s)
Definition: aaxdec.c:376
avio_rb32
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:761
pkt
AVPacket * pkt
Definition: movenc.c:60
AAXColumn
Definition: aaxdec.c:29
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:553
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:453
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
info
MIPS optimizations info
Definition: mips.txt:2
COLUMN_TYPE_SINT16
@ COLUMN_TYPE_SINT16
Definition: aaxdec.c:87
AAXContext::current_segment
uint32_t current_segment
Definition: aaxdec.c:56
FF_INFMT_FLAG_INIT_CLEANUP
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition: demux.h:35
AVFormatContext
Format I/O context.
Definition: avformat.h:1255
internal.h
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:550
get_pts
static int64_t get_pts(AVFormatContext *s, int64_t pos, int size)
Definition: aaxdec.c:100
NULL
#define NULL
Definition: coverity.c:32
COLUMN_TYPE_SINT64
@ COLUMN_TYPE_SINT64
Definition: aaxdec.c:91
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:451
AAXColumn::name
const char * name
Definition: aaxdec.c:32
COLUMN_FLAG_DEFAULT
@ COLUMN_FLAG_DEFAULT
Definition: aaxdec.c:78
COLUMN_TYPE_UINT8
@ COLUMN_TYPE_UINT8
Definition: aaxdec.c:84
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:180
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:184
COLUMN_TYPE_UINT64
@ COLUMN_TYPE_UINT64
Definition: aaxdec.c:90
AAXContext::table_size
int64_t table_size
Definition: aaxdec.c:43
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
AV_CODEC_ID_ADPCM_ADX
@ AV_CODEC_ID_ADPCM_ADX
Definition: codec_id.h:376
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
ColumnFlag
ColumnFlag
Definition: aaxdec.c:76
COLUMN_FLAG_ROW
@ COLUMN_FLAG_ROW
Definition: aaxdec.c:79
size
int size
Definition: twinvq_data.h:10344
AAXContext::rows_offset
int64_t rows_offset
Definition: aaxdec.c:45
MKBETAG
#define MKBETAG(a, b, c, d)
Definition: macros.h:56
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
ff_aax_demuxer
const FFInputFormat ff_aax_demuxer
Definition: aaxdec.c:387
COLUMN_TYPE_VLDATA
@ COLUMN_TYPE_VLDATA
Definition: aaxdec.c:95
AAXContext::strings_offset
int64_t strings_offset
Definition: aaxdec.c:46
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:41
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:603
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
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
AAXContext::data_offset
int64_t data_offset
Definition: aaxdec.c:47
AAXContext::name_offset
int64_t name_offset
Definition: aaxdec.c:48
AAXSegment
Definition: aaxdec.c:37
flag
#define flag(name)
Definition: cbs_av1.c:466
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:513
avio_internal.h
AAXColumn::type
uint8_t type
Definition: aaxdec.c:31
COLUMN_FLAG_UNDEFINED
@ COLUMN_FLAG_UNDEFINED
Definition: aaxdec.c:80
COLUMN_TYPE_STRING
@ COLUMN_TYPE_STRING
Definition: aaxdec.c:94
demux.h
av_calloc
void * av_calloc(size_t nmemb, size_t size)
Definition: mem.c:264
AAXContext::schema_offset
int64_t schema_offset
Definition: aaxdec.c:52
av_get_packet
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition: utils.c:91
AAXColumn::size
int size
Definition: aaxdec.c:34
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:743
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:231
avio_rb16
unsigned int avio_rb16(AVIOContext *s)
Definition: aviobuf.c:746
COLUMN_TYPE_FLOAT
@ COLUMN_TYPE_FLOAT
Definition: aaxdec.c:92
pos
unsigned int pos
Definition: spdifenc.c:414
avformat.h
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
AAXColumn::flag
uint8_t flag
Definition: aaxdec.c:30
COLUMN_TYPE_SINT8
@ COLUMN_TYPE_SINT8
Definition: aaxdec.c:85
AAXContext::strings_size
int64_t strings_size
Definition: aaxdec.c:53
aax_read_header
static int aax_read_header(AVFormatContext *s)
Definition: aaxdec.c:113
COLUMN_TYPE_UINT16
@ COLUMN_TYPE_UINT16
Definition: aaxdec.c:86
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:612
AV_RB8
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_WB16 unsigned int_TMPL AV_RB8
Definition: bytestream.h:99
AVPacket::stream_index
int stream_index
Definition: packet.h:522
AAXContext
Definition: aaxdec.c:42
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:318
AAXContext::row_width
uint16_t row_width
Definition: aaxdec.c:50
AAXContext::version
uint16_t version
Definition: aaxdec.c:44
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
COLUMN_TYPE_UINT32
@ COLUMN_TYPE_UINT32
Definition: aaxdec.c:88
mem.h
ColumnType
ColumnType
Definition: aaxdec.c:83
av_free
#define av_free(p)
Definition: tableprint_vlc.h:33
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:55
AVPacket
This structure stores compressed data.
Definition: packet.h:497
AAXContext::nb_segments
uint32_t nb_segments
Definition: aaxdec.c:51
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
AVPacket::pos
int64_t pos
byte position in stream, -1 if unknown
Definition: packet.h:540
FFInputFormat
Definition: demux.h:37
COLUMN_FLAG_NAME
@ COLUMN_FLAG_NAME
Definition: aaxdec.c:77
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
ffio_read_size
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:662
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:792
skip
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
Definition: bitstream_template.h:375
AAXColumn::offset
uint32_t offset
Definition: aaxdec.c:33
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:98
AAXContext::xcolumns
AAXColumn * xcolumns
Definition: aaxdec.c:58
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:346