FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nut.c
Go to the documentation of this file.
1 /*
2  * nut
3  * Copyright (c) 2004-2007 Michael Niedermayer
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/mathematics.h"
23 #include "libavutil/tree.h"
24 #include "nut.h"
25 #include "riff.h"
26 #include "internal.h"
27 
29  { AV_CODEC_ID_TEXT, MKTAG('U', 'T', 'F', '8') },
30  { AV_CODEC_ID_DVD_SUBTITLE, MKTAG('D', 'V', 'D', 'S') },
31  { AV_CODEC_ID_DVB_SUBTITLE, MKTAG('D', 'V', 'B', 'S') },
32  { AV_CODEC_ID_DVB_TELETEXT, MKTAG('D', 'V', 'B', 'T') },
33  { AV_CODEC_ID_NONE, 0 }
34 };
35 
37  { AV_CODEC_ID_TEXT, MKTAG('U', 'T', 'F', '8') },
38  { AV_CODEC_ID_NONE, 0 }
39 };
40 
42  { AV_CODEC_ID_GIF, MKTAG('G', 'I', 'F', 0 ) },
43  { AV_CODEC_ID_XFACE, MKTAG('X', 'F', 'A', 'C') },
44  { AV_CODEC_ID_VP9, MKTAG('V', 'P', '9', '0') },
45  { AV_CODEC_ID_HEVC, MKTAG('H', 'E', 'V', 'C') },
46  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
47  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
48  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 16 ) },
49  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 16 ) },
50  { AV_CODEC_ID_RAWVIDEO, MKTAG(15 , 'B', 'G', 'R') },
51  { AV_CODEC_ID_RAWVIDEO, MKTAG(15 , 'R', 'G', 'B') },
52  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'B', 'G', 'R') },
53  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'R', 'G', 'B') },
54  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 12 ) },
55  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 12 ) },
56  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 'B', 'G', 'R') },
57  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 'R', 'G', 'B') },
58  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 'A') },
59  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 0 ) },
60  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 'A') },
61  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 0 ) },
62  { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'B', 'G', 'R') },
63  { AV_CODEC_ID_RAWVIDEO, MKTAG( 0 , 'B', 'G', 'R') },
64  { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'R', 'G', 'B') },
65  { AV_CODEC_ID_RAWVIDEO, MKTAG( 0 , 'R', 'G', 'B') },
66  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 24 ) },
67  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 24 ) },
68  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '1', '1', 'P') },
69  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
70  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
71  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
72  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
73  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
74  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
75  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '1', 'W', '0') },
76  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '0', 'W', '1') },
77  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 8 ) },
78  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 8 ) },
79  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 4 ) },
80  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 4 ) },
81  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '4', 'B', 'Y') },
82  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', '4', 'B', 'Y') },
83  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 48 ) },
84  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 48 ) },
85  { AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'B', 'G', 'R') },
86  { AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'R', 'G', 'B') },
87  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'B', 'A', 64 ) },
88  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'R', 'A', 64 ) },
89  { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'R', 'B', 'A') },
90  { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'B', 'R', 'A') },
91  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 9 ) },
92  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 11 , '3', 'Y') },
93  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 9 ) },
94  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 10 , '3', 'Y') },
95  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 9 ) },
96  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 0 , '3', 'Y') },
97  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 10 ) },
98  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 11 , '3', 'Y') },
99  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 10 ) },
100  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 10 , '3', 'Y') },
101  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 10 ) },
102  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 0 , '3', 'Y') },
103  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 12 ) },
104  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 11 , '3', 'Y') },
105  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 12 ) },
106  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 10 , '3', 'Y') },
107  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 12 ) },
108  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 0 , '3', 'Y') },
109  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 14 ) },
110  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 11 , '3', 'Y') },
111  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 14 ) },
112  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 10 , '3', 'Y') },
113  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 14 ) },
114  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 0 , '3', 'Y') },
115  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 16 ) },
116  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '1', 'Y') },
117  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 16 ) },
118  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 11 , '3', 'Y') },
119  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 16 ) },
120  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 10 , '3', 'Y') },
121  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 16 ) },
122  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '3', 'Y') },
123  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 8 ) },
124  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10 , 8 ) },
125  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0 , 8 ) },
126  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '2', 0 , 8 ) },
127 
128  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 9) },
129  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 0, '1', 'Y') },
130  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 9) },
131  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 11, '4', 'Y') },
132  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 9) },
133  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 10, '4', 'Y') },
134  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 9) },
135  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 0, '4', 'Y') },
136 
137  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 10) },
138  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '1', 'Y') },
139  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 10) },
140  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 11, '4', 'Y') },
141  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 10) },
142  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 10, '4', 'Y') },
143  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 10) },
144  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '4', 'Y') },
145 
146  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 12) },
147  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 0, '1', 'Y') },
148  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 16) },
149  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '1', 'Y') },
150  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 16) },
151  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 11, '4', 'Y') },
152  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 16) },
153  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 10, '4', 'Y') },
154  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 16) },
155  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '4', 'Y') },
156 
157  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 8) },
158 
159  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 9) },
160  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9, 0, '3', 'G') },
161  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 10) },
162  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '3', 'G') },
163  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 12) },
164  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 0, '3', 'G') },
165  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 14) },
166  { AV_CODEC_ID_RAWVIDEO, MKTAG(14, 0, '3', 'G') },
167  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 16) },
168  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '3', 'G') },
169 
170  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 0, 8) },
171 
172  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 10 ) },
173  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 00 , '4', 'G') },
174  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 12 ) },
175  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 00 , '4', 'G') },
176  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 16 ) },
177  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 00 , '4', 'G') },
178 
179  { AV_CODEC_ID_RAWVIDEO, MKTAG('X', 'Y', 'Z' , 36 ) },
180  { AV_CODEC_ID_RAWVIDEO, MKTAG(36 , 'Z' , 'Y', 'X') },
181 
182  { AV_CODEC_ID_RAWVIDEO, MKTAG('P', 'A', 'L', 8 ) },
183 
184  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 8 ) },
185  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 16 ) },
186  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'B', 0xBA) },
187  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 8 ) },
188  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 16 ) },
189  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'R', 0xBA) },
190  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 8 ) },
191  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 16 ) },
192  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'B', 'G', 0xBA) },
193  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 8 ) },
194  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 16 ) },
195  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'R', 'G', 0xBA) },
196 
197  { AV_CODEC_ID_NONE, 0 }
198 };
199 
201  { AV_CODEC_ID_COMFORT_NOISE, MKTAG('3', '3', '8', '9') },
202  { AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') },
203  { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
204  { AV_CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
205  { AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') },
206  { AV_CODEC_ID_WAVPACK, MKTAG('w', 'v', 'p', 'k') },
207  { AV_CODEC_ID_NONE, 0 }
208 };
209 
211  { AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') },
212  { AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) },
213  { AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') },
214  { AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) },
215  { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
216  { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
217  { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
218  { AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
219  { AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
220  { AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
221  { AV_CODEC_ID_PCM_S8, MKTAG('P', 'S', 'D', 8 ) },
222  { AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
223  { AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
224  { AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
225  { AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
226  { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
227  { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
228  { AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) },
229  { AV_CODEC_ID_PCM_S8_PLANAR, MKTAG('P', 'S', 'P', 8 ) },
230  { AV_CODEC_ID_PCM_S16BE_PLANAR, MKTAG(16 , 'P', 'S', 'P') },
231  { AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) },
232  { AV_CODEC_ID_PCM_S24LE_PLANAR, MKTAG('P', 'S', 'P', 24 ) },
233  { AV_CODEC_ID_PCM_S32LE_PLANAR, MKTAG('P', 'S', 'P', 32 ) },
234  { AV_CODEC_ID_NONE, 0 }
235 };
236 
237 const AVCodecTag * const ff_nut_codec_tags[] = {
240 };
241 
242 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
243 {
244  int i;
245  for (i = 0; i < nut->avf->nb_streams; i++)
246  nut->stream[i].last_pts =
247  av_rescale_rnd(val,
248  time_base.num * (int64_t)nut->stream[i].time_base->den,
249  time_base.den * (int64_t)nut->stream[i].time_base->num,
250  AV_ROUND_DOWN);
251 }
252 
253 int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
254 {
255  int64_t mask = (1ULL << stream->msb_pts_shift) - 1;
256  int64_t delta = stream->last_pts - mask / 2;
257  return ((lsb - delta) & mask) + delta;
258 }
259 
260 int ff_nut_sp_pos_cmp(const void *a, const void *b)
261 {
262  const Syncpoint *va = a, *vb = b;
263  return ((va->pos - vb->pos) >> 32) - ((vb->pos - va->pos) >> 32);
264 }
265 
266 int ff_nut_sp_pts_cmp(const void *a, const void *b)
267 {
268  const Syncpoint *va = a, *vb = b;
269  return ((va->ts - vb->ts) >> 32) - ((vb->ts - va->ts) >> 32);
270 }
271 
272 int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
273 {
274  Syncpoint *sp = av_mallocz(sizeof(Syncpoint));
275  struct AVTreeNode *node = av_tree_node_alloc();
276 
277  if (!sp || !node) {
278  av_freep(&sp);
279  av_freep(&node);
280  return AVERROR(ENOMEM);
281  }
282 
283  nut->sp_count++;
284 
285  sp->pos = pos;
286  sp->back_ptr = back_ptr;
287  sp->ts = ts;
288  av_tree_insert(&nut->syncpoints, sp, ff_nut_sp_pos_cmp, &node);
289  if (node) {
290  av_free(sp);
291  av_free(node);
292  }
293 
294  return 0;
295 }
296 
297 static int enu_free(void *opaque, void *elem)
298 {
299  av_free(elem);
300  return 0;
301 }
302 
304 {
305  if (nut->syncpoints) {
308  }
309 }
310 
312  { "default", AV_DISPOSITION_DEFAULT },
313  { "dub", AV_DISPOSITION_DUB },
314  { "original", AV_DISPOSITION_ORIGINAL },
315  { "comment", AV_DISPOSITION_COMMENT },
316  { "lyrics", AV_DISPOSITION_LYRICS },
317  { "karaoke", AV_DISPOSITION_KARAOKE },
318  { "", 0 }
319 };
320 
322  { "Author", "artist" },
323  { "X-CreationTime", "date" },
324  { "CreationTime", "date" },
325  { "SourceFilename", "filename" },
326  { "X-Language", "language" },
327  { "X-Disposition", "disposition" },
328  { "X-Replaces", "replaces" },
329  { "X-Depends", "depends" },
330  { "X-Uses", "uses" },
331  { "X-UsesFont", "usesfont" },
332  { 0 },
333 };
#define NULL
Definition: coverity.c:32
const char const char void * val
Definition: avisynth_c.h:771
const AVCodecTag ff_nut_audio_extra_tags[]
Definition: nut.c:200
int num
Numerator.
Definition: rational.h:59
const char * b
Definition: vf_curves.c:113
Definition: nut.h:58
#define AV_DISPOSITION_DUB
Definition: avformat.h:820
int64_t ts
Definition: nut.h:62
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:236
Definition: nut.h:91
int ff_nut_sp_pos_cmp(const void *a, const void *b)
Definition: nut.c:260
#define AV_DISPOSITION_KARAOKE
Definition: avformat.h:824
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
Definition: tree.c:34
float delta
A tree container.
const AVMetadataConv ff_nut_metadata_conv[]
Definition: nut.c:321
int ff_nut_sp_pts_cmp(const void *a, const void *b)
Definition: nut.c:266
#define sp
Definition: regdef.h:63
const AVCodecTag ff_nut_data_tags[]
Definition: nut.c:36
void av_tree_destroy(AVTreeNode *t)
Definition: tree.c:146
AVFormatContext * avf
Definition: nut.h:93
int64_t last_pts
Definition: nut.h:78
void ff_nut_free_sp(NUTContext *nut)
Definition: nut.c:303
static const uint16_t mask[17]
Definition: lzw.c:38
#define AVERROR(e)
Definition: error.h:43
uint64_t pos
Definition: nut.h:59
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: avcodec.h:552
int sp_count
Definition: nut.h:109
const AVCodecTag ff_nut_audio_tags[]
Definition: nut.c:210
const AVCodecTag ff_codec_wav_tags[]
Definition: riff.c:475
#define AV_DISPOSITION_LYRICS
Definition: avformat.h:823
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:1398
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
Definition: nut.c:242
const AVCodecTag ff_codec_bmp_tags[]
Definition: riff.c:32
AVRational time_base
Definition: signature.h:103
int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
Definition: nut.c:253
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
struct AVTreeNode * syncpoints
Definition: nut.h:108
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
Definition: mathematics.c:58
int msb_pts_shift
Definition: nut.h:81
#define AV_DISPOSITION_DEFAULT
Definition: avformat.h:819
const AVCodecTag ff_nut_subtitle_tags[]
Definition: nut.c:28
static int enu_free(void *opaque, void *elem)
Definition: nut.c:297
Rational number (pair of numerator and denominator).
Definition: rational.h:58
StreamContext * stream
Definition: nut.h:100
Round toward -infinity.
Definition: mathematics.h:82
const Dispositions ff_nut_dispositions[]
Definition: nut.c:311
raw UTF-8 text
Definition: avcodec.h:645
const AVCodecTag ff_nut_video_tags[]
Definition: nut.c:41
int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
Definition: nut.c:272
int den
Denominator.
Definition: rational.h:60
#define av_free(p)
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
Definition: tree.c:59
#define AV_DISPOSITION_COMMENT
Definition: avformat.h:822
#define av_freep(p)
uint64_t back_ptr
Definition: nut.h:60
#define MKTAG(a, b, c, d)
Definition: common.h:366
void av_tree_enumerate(AVTreeNode *t, void *opaque, int(*cmp)(void *opaque, void *elem), int(*enu)(void *opaque, void *elem))
Apply enu(opaque, &elem) to all the elements in the tree in a given range.
Definition: tree.c:155
const AVCodecTag *const ff_nut_codec_tags[]
Definition: nut.c:237
#define AV_DISPOSITION_ORIGINAL
Definition: avformat.h:821
void * elem
Definition: tree.c:28