FFmpeg  4.3.9
notchlc.c
Go to the documentation of this file.
1 /*
2  * NotchLC decoder
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 <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 
26 #define BITSTREAM_READER_LE
27 #include "libavutil/intreadwrite.h"
28 #include "avcodec.h"
29 #include "bytestream.h"
30 #include "get_bits.h"
31 #include "internal.h"
32 #include "lzf.h"
33 #include "thread.h"
34 
35 typedef struct NotchLCContext {
36  unsigned compressed_size;
37  unsigned format;
38 
41 
44 
45  unsigned texture_size_x;
46  unsigned texture_size_y;
51  unsigned y_data_offset;
52  unsigned uv_data_offset;
53  unsigned y_data_size;
54  unsigned uv_count_size;
55  unsigned uv_count_offset;
56  unsigned a_count_size;
57  unsigned data_end;
58 
62 
64 {
67  avctx->colorspace = AVCOL_SPC_RGB;
70 
71  return 0;
72 }
73 
74 #define HISTORY_SIZE (64 * 1024)
75 
76 static int lz4_decompress(AVCodecContext *avctx,
79 {
80  unsigned reference_pos, match_length, delta, pos = 0;
81  uint8_t history[64 * 1024];
82 
83  while (bytestream2_get_bytes_left(gb) > 0) {
84  uint8_t token = bytestream2_get_byte(gb);
85  unsigned num_literals = token >> 4;
86 
87  if (num_literals == 15) {
88  unsigned char current;
89  do {
90  current = bytestream2_get_byte(gb);
91  num_literals += current;
92  } while (current == 255);
93  }
94 
95  if (bytestream2_get_bytes_left(gb) < num_literals)
96  return AVERROR_INVALIDDATA;
97 
98  if (pos + num_literals < HISTORY_SIZE) {
99  bytestream2_get_buffer(gb, history + pos, num_literals);
100  pos += num_literals;
101  } else {
102  while (num_literals-- > 0) {
103  history[pos++] = bytestream2_get_byte(gb);
104  if (pos == HISTORY_SIZE) {
105  bytestream2_put_buffer(pb, history, HISTORY_SIZE);
106  pos = 0;
107  }
108  }
109  }
110 
111  if (bytestream2_get_bytes_left(gb) <= 0)
112  break;
113 
114  delta = bytestream2_get_byte(gb);
115  delta |= (unsigned)bytestream2_get_byte(gb) << 8;
116  if (delta == 0)
117  return 0;
118  match_length = 4 + (token & 0x0F);
119  if (match_length == 4 + 0x0F) {
120  uint8_t current;
121 
122  do {
123  current = bytestream2_get_byte(gb);
124  match_length += current;
125  } while (current == 255);
126  }
127  reference_pos = (pos >= delta) ? (pos - delta) : (HISTORY_SIZE + pos - delta);
128  if (pos + match_length < HISTORY_SIZE && reference_pos + match_length < HISTORY_SIZE) {
129  if (pos >= reference_pos + match_length || reference_pos >= pos + match_length) {
130  memcpy(history + pos, history + reference_pos, match_length);
131  pos += match_length;
132  } else {
133  while (match_length-- > 0)
134  history[pos++] = history[reference_pos++];
135  }
136  } else {
137  while (match_length-- > 0) {
138  history[pos++] = history[reference_pos++];
139  if (pos == HISTORY_SIZE) {
140  bytestream2_put_buffer(pb, history, HISTORY_SIZE);
141  pos = 0;
142  }
143  reference_pos %= HISTORY_SIZE;
144  }
145  }
146  }
147 
148  bytestream2_put_buffer(pb, history, pos);
149 
150  return bytestream2_tell_p(pb);
151 }
152 
154  unsigned uncompressed_size)
155 {
156  NotchLCContext *s = avctx->priv_data;
157  GetByteContext rgb, dgb, *gb = &s->gb;
159  int ylinesize, ulinesize, vlinesize, alinesize;
160  uint16_t *dsty, *dstu, *dstv, *dsta;
161  int ret;
162 
163  s->texture_size_x = bytestream2_get_le32(gb);
164  s->texture_size_y = bytestream2_get_le32(gb);
165 
166  ret = ff_set_dimensions(avctx, s->texture_size_x, s->texture_size_y);
167  if (ret < 0)
168  return ret;
169 
170  s->uv_offset_data_offset = bytestream2_get_le32(gb);
171  if (s->uv_offset_data_offset >= UINT_MAX / 4)
172  return AVERROR_INVALIDDATA;
173  s->uv_offset_data_offset *= 4;
174  if (s->uv_offset_data_offset >= uncompressed_size)
175  return AVERROR_INVALIDDATA;
176 
177  s->y_control_data_offset = bytestream2_get_le32(gb);
178  if (s->y_control_data_offset >= UINT_MAX / 4)
179  return AVERROR_INVALIDDATA;
180  s->y_control_data_offset *= 4;
181  if (s->y_control_data_offset >= uncompressed_size)
182  return AVERROR_INVALIDDATA;
183 
184  s->a_control_word_offset = bytestream2_get_le32(gb);
185  if (s->a_control_word_offset >= UINT_MAX / 4)
186  return AVERROR_INVALIDDATA;
187  s->a_control_word_offset *= 4;
188  if (s->a_control_word_offset >= uncompressed_size)
189  return AVERROR_INVALIDDATA;
190 
191  s->uv_data_offset = bytestream2_get_le32(gb);
192  if (s->uv_data_offset >= UINT_MAX / 4)
193  return AVERROR_INVALIDDATA;
194  s->uv_data_offset *= 4;
195  if (s->uv_data_offset >= uncompressed_size)
196  return AVERROR_INVALIDDATA;
197 
198  s->y_data_size = bytestream2_get_le32(gb);
199  if (s->y_data_size >= UINT_MAX / 4)
200  return AVERROR_INVALIDDATA;
201 
202  s->uv_count_size = bytestream2_get_le32(gb);
203  if (s->uv_count_size >= UINT_MAX / 4)
204  return AVERROR_INVALIDDATA;
205  s->uv_count_size *= 4;
206  if (s->uv_count_size >= uncompressed_size)
207  return AVERROR_INVALIDDATA;
208 
209  s->a_count_size = bytestream2_get_le32(gb);
210  if (s->a_count_size >= UINT_MAX / 4)
211  return AVERROR_INVALIDDATA;
212  s->a_count_size *= 4;
213  if (s->a_count_size >= uncompressed_size)
214  return AVERROR_INVALIDDATA;
215 
216  s->data_end = bytestream2_get_le32(gb);
217  if (s->data_end > uncompressed_size)
218  return AVERROR_INVALIDDATA;
219 
221  if (s->data_end <= s->y_data_size)
222  return AVERROR_INVALIDDATA;
223  s->y_data_offset = s->data_end - s->y_data_size;
224  if (s->y_data_offset <= s->uv_count_size)
225  return AVERROR_INVALIDDATA;
227 
228  if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0)
229  return ret;
230 
231  rgb = *gb;
232  dgb = *gb;
233  bytestream2_seek(&rgb, s->y_data_row_offsets, SEEK_SET);
234  bytestream2_seek(gb, s->y_control_data_offset, SEEK_SET);
235 
236  dsty = (uint16_t *)p->data[0];
237  dsta = (uint16_t *)p->data[3];
238  ylinesize = p->linesize[0] / 2;
239  alinesize = p->linesize[3] / 2;
240 
241  for (int y = 0; y < avctx->height; y += 4) {
242  const unsigned row_offset = bytestream2_get_le32(&rgb);
243 
244  bytestream2_seek(&dgb, s->y_data_offset + row_offset, SEEK_SET);
245 
246  ret = init_get_bits8(&bit, dgb.buffer, bytestream2_get_bytes_left(&dgb));
247  if (ret < 0)
248  return ret;
249  for (int x = 0; x < avctx->width; x += 4) {
250  unsigned item = bytestream2_get_le32(gb);
251  unsigned y_min = item & 4095;
252  unsigned y_max = (item >> 12) & 4095;
253  unsigned y_diff = y_max - y_min;
254  unsigned control[4];
255 
256  control[0] = (item >> 24) & 3;
257  control[1] = (item >> 26) & 3;
258  control[2] = (item >> 28) & 3;
259  control[3] = (item >> 30) & 3;
260 
261  for (int i = 0; i < 4; i++) {
262  const int nb_bits = control[i] + 1;
263  const int div = (1 << nb_bits) - 1;
264  const int add = div - 1;
265 
266  dsty[x + i * ylinesize + 0] = av_clip_uintp2(y_min + ((y_diff * get_bits(&bit, nb_bits) + add) / div), 12);
267  dsty[x + i * ylinesize + 1] = av_clip_uintp2(y_min + ((y_diff * get_bits(&bit, nb_bits) + add) / div), 12);
268  dsty[x + i * ylinesize + 2] = av_clip_uintp2(y_min + ((y_diff * get_bits(&bit, nb_bits) + add) / div), 12);
269  dsty[x + i * ylinesize + 3] = av_clip_uintp2(y_min + ((y_diff * get_bits(&bit, nb_bits) + add) / div), 12);
270  }
271  }
272 
273  dsty += 4 * ylinesize;
274  dsta += 4 * alinesize;
275  }
276 
277  rgb = *gb;
278  dgb = *gb;
279  bytestream2_seek(&rgb, s->uv_offset_data_offset, SEEK_SET);
280  bytestream2_seek(gb, s->a_control_word_offset, SEEK_SET);
281 
282  dstu = (uint16_t *)p->data[1];
283  dstv = (uint16_t *)p->data[2];
284  ulinesize = p->linesize[1] / 2;
285  vlinesize = p->linesize[2] / 2;
286 
287  for (int y = 0; y < avctx->height; y += 16) {
288  for (int x = 0; x < avctx->width; x += 16) {
289  unsigned offset = bytestream2_get_le32(&rgb) * 4;
290  int u[16][16] = { 0 }, v[16][16] = { 0 };
291  int u0, v0, u1, v1, udif, vdif;
292  unsigned escape, is8x8, loc;
293 
294  bytestream2_seek(&dgb, s->uv_data_offset + offset, SEEK_SET);
295 
296  is8x8 = bytestream2_get_le16(&dgb);
297  escape = bytestream2_get_le16(&dgb);
298 
299  if (escape == 0 && is8x8 == 0) {
300  u0 = bytestream2_get_byte(&dgb);
301  v0 = bytestream2_get_byte(&dgb);
302  u1 = bytestream2_get_byte(&dgb);
303  v1 = bytestream2_get_byte(&dgb);
304  loc = bytestream2_get_le32(&dgb);
305  u0 = (u0 << 4) | (u0 & 0xF);
306  v0 = (v0 << 4) | (v0 & 0xF);
307  u1 = (u1 << 4) | (u1 & 0xF);
308  v1 = (v1 << 4) | (v1 & 0xF);
309  udif = u1 - u0;
310  vdif = v1 - v0;
311 
312  for (int i = 0; i < 16; i += 4) {
313  for (int j = 0; j < 16; j += 4) {
314  for (int ii = 0; ii < 4; ii++) {
315  for (int jj = 0; jj < 4; jj++) {
316  u[i + ii][j + jj] = u0 + ((udif * (int)(loc & 3) + 2) / 3);
317  v[i + ii][j + jj] = v0 + ((vdif * (int)(loc & 3) + 2) / 3);
318  }
319  }
320 
321  loc >>= 2;
322  }
323  }
324  } else {
325  for (int i = 0; i < 16; i += 8) {
326  for (int j = 0; j < 16; j += 8) {
327  if (is8x8 & 1) {
328  u0 = bytestream2_get_byte(&dgb);
329  v0 = bytestream2_get_byte(&dgb);
330  u1 = bytestream2_get_byte(&dgb);
331  v1 = bytestream2_get_byte(&dgb);
332  loc = bytestream2_get_le32(&dgb);
333  u0 = (u0 << 4) | (u0 & 0xF);
334  v0 = (v0 << 4) | (v0 & 0xF);
335  u1 = (u1 << 4) | (u1 & 0xF);
336  v1 = (v1 << 4) | (v1 & 0xF);
337  udif = u1 - u0;
338  vdif = v1 - v0;
339 
340  for (int ii = 0; ii < 8; ii += 2) {
341  for (int jj = 0; jj < 8; jj += 2) {
342  for (int iii = 0; iii < 2; iii++) {
343  for (int jjj = 0; jjj < 2; jjj++) {
344  u[i + ii + iii][j + jj + jjj] = u0 + ((udif * (int)(loc & 3) + 2) / 3);
345  v[i + ii + iii][j + jj + jjj] = v0 + ((vdif * (int)(loc & 3) + 2) / 3);
346  }
347  }
348 
349  loc >>= 2;
350  }
351  }
352  } else if (escape) {
353  for (int ii = 0; ii < 8; ii += 4) {
354  for (int jj = 0; jj < 8; jj += 4) {
355  u0 = bytestream2_get_byte(&dgb);
356  v0 = bytestream2_get_byte(&dgb);
357  u1 = bytestream2_get_byte(&dgb);
358  v1 = bytestream2_get_byte(&dgb);
359  loc = bytestream2_get_le32(&dgb);
360  u0 = (u0 << 4) | (u0 & 0xF);
361  v0 = (v0 << 4) | (v0 & 0xF);
362  u1 = (u1 << 4) | (u1 & 0xF);
363  v1 = (v1 << 4) | (v1 & 0xF);
364  udif = u1 - u0;
365  vdif = v1 - v0;
366 
367  for (int iii = 0; iii < 4; iii++) {
368  for (int jjj = 0; jjj < 4; jjj++) {
369  u[i + ii + iii][j + jj + jjj] = u0 + ((udif * (int)(loc & 3) + 2) / 3);
370  v[i + ii + iii][j + jj + jjj] = v0 + ((vdif * (int)(loc & 3) + 2) / 3);
371 
372  loc >>= 2;
373  }
374  }
375  }
376  }
377  }
378 
379  is8x8 >>= 1;
380  }
381  }
382  }
383 
384  for (int i = 0; i < 16; i++) {
385  for (int j = 0; j < 16; j++) {
386  dstu[x + i * ulinesize + j] = u[i][j];
387  dstv[x + i * vlinesize + j] = v[i][j];
388  }
389  }
390  }
391 
392  dstu += 16 * ulinesize;
393  dstv += 16 * vlinesize;
394  }
395 
396  return 0;
397 }
398 
399 static int decode_frame(AVCodecContext *avctx,
400  void *data, int *got_frame,
401  AVPacket *avpkt)
402 {
403  NotchLCContext *s = avctx->priv_data;
404  ThreadFrame frame = { .f = data };
405  GetByteContext *gb = &s->gb;
406  PutByteContext *pb = &s->pb;
407  unsigned uncompressed_size;
408  AVFrame *p = data;
409  int ret;
410 
411  if (avpkt->size <= 40)
412  return AVERROR_INVALIDDATA;
413 
414  bytestream2_init(gb, avpkt->data, avpkt->size);
415 
416  if (bytestream2_get_le32(gb) != MKBETAG('N','L','C','1'))
417  return AVERROR_INVALIDDATA;
418 
419  uncompressed_size = bytestream2_get_le32(gb);
420  s->compressed_size = bytestream2_get_le32(gb);
421  s->format = bytestream2_get_le32(gb);
422 
423  if (s->format > 2)
424  return AVERROR_PATCHWELCOME;
425 
426  if (s->format == 0) {
427  ret = ff_lzf_uncompress(gb, &s->lzf_buffer, &s->lzf_size);
428  if (ret < 0)
429  return ret;
430 
431  if (uncompressed_size > s->lzf_size)
432  return AVERROR_INVALIDDATA;
433 
434  bytestream2_init(gb, s->lzf_buffer, uncompressed_size);
435  } else if (s->format == 1) {
437  uncompressed_size);
438  if (!s->uncompressed_buffer)
439  return AVERROR(ENOMEM);
440 
442 
443  ret = lz4_decompress(avctx, gb, pb);
444  if (ret != uncompressed_size)
445  return AVERROR_INVALIDDATA;
446 
447  bytestream2_init(gb, s->uncompressed_buffer, uncompressed_size);
448  }
449 
450  ret = decode_blocks(avctx, p, &frame, uncompressed_size);
451  if (ret < 0)
452  return ret;
453 
455  p->key_frame = 1;
456 
457  *got_frame = 1;
458 
459  return avpkt->size;
460 }
461 
463 {
464  NotchLCContext *s = avctx->priv_data;
465 
467  s->uncompressed_size = 0;
468  av_freep(&s->lzf_buffer);
469  s->lzf_size = 0;
470 
471  return 0;
472 }
473 
475  .name = "notchlc",
476  .long_name = NULL_IF_CONFIG_SMALL("NotchLC"),
477  .type = AVMEDIA_TYPE_VIDEO,
478  .id = AV_CODEC_ID_NOTCHLC,
479  .priv_data_size = sizeof(NotchLCContext),
480  .init = decode_init,
481  .close = decode_end,
482  .decode = decode_frame,
484 };
int64_t lzf_size
Definition: notchlc.c:43
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
unsigned a_control_word_offset
Definition: notchlc.c:50
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:379
unsigned uv_count_size
Definition: notchlc.c:54
unsigned uncompressed_size
Definition: notchlc.c:40
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
Definition: utils.c:104
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
unsigned uv_count_offset
Definition: notchlc.c:55
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:1161
uint8_t * lzf_buffer
Definition: notchlc.c:42
int size
Definition: packet.h:356
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
Definition: bytestream.h:143
unsigned y_data_row_offsets
Definition: notchlc.c:47
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:736
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:133
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
Definition: utils.c:70
static av_cold int decode_init(AVCodecContext *avctx)
Definition: notchlc.c:63
AVCodec.
Definition: codec.h:190
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
Definition: pixfmt.h:510
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
unsigned uv_data_offset
Definition: notchlc.c:52
PutByteContext pb
Definition: notchlc.c:60
unsigned y_data_size
Definition: notchlc.c:53
uint8_t
#define av_cold
Definition: attributes.h:88
float delta
AVCodec ff_notchlc_decoder
Definition: notchlc.c:474
Multithreading support functions.
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: notchlc.c:399
#define u(width, name, range_min, range_max)
Definition: cbs_h2645.c:262
static AVFrame * frame
const char data[16]
Definition: mxf.c:91
uint8_t * data
Definition: packet.h:355
const uint8_t * buffer
Definition: bytestream.h:34
unsigned y_control_data_offset
Definition: notchlc.c:49
bitstream reader API header.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:154
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
Definition: lzf.c:40
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:188
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
Definition: bytestream.h:263
unsigned int pos
Definition: spdifenc.c:412
unsigned format
Definition: notchlc.c:37
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
Definition: pixfmt.h:457
const char * name
Name of the codec implementation.
Definition: codec.h:197
static const uint8_t offset[127][2]
Definition: vf_spp.c:93
static av_always_inline int bytestream2_tell_p(PutByteContext *p)
Definition: bytestream.h:193
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:106
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:383
static int decode_blocks(AVCodecContext *avctx, AVFrame *p, ThreadFrame *frame, unsigned uncompressed_size)
Definition: notchlc.c:153
int width
picture width / height.
Definition: avcodec.h:699
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:1140
#define s(width, name)
Definition: cbs_vp9.c:257
GetByteContext gb
Definition: notchlc.c:59
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, const uint8_t *src, unsigned int size)
Definition: bytestream.h:282
the normal 2^n-1 "JPEG" YUV ranges
Definition: pixfmt.h:535
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
static av_always_inline int bytestream2_tell(GetByteContext *g)
Definition: bytestream.h:188
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:331
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:677
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
main external API structure.
Definition: avcodec.h:526
long long int64_t
Definition: coverity.c:34
unsigned a_count_size
Definition: notchlc.c:56
unsigned data_end
Definition: notchlc.c:57
static av_cold int decode_end(AVCodecContext *avctx)
Definition: notchlc.c:462
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:1154
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:1147
#define HISTORY_SIZE
Definition: notchlc.c:74
uint8_t * uncompressed_buffer
Definition: notchlc.c:39
unsigned compressed_size
Definition: notchlc.c:36
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:404
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:314
#define v0
Definition: regdef.h:26
int
IEC 61966-2-1 (sRGB or sYCC)
Definition: pixfmt.h:494
common internal api header.
static int lz4_decompress(AVCodecContext *avctx, GetByteContext *gb, PutByteContext *pb)
Definition: notchlc.c:76
#define bit(string, value)
Definition: cbs_mpeg2.c:58
unsigned uv_offset_data_offset
Definition: notchlc.c:48
#define MKBETAG(a, b, c, d)
Definition: common.h:407
void * priv_data
Definition: avcodec.h:553
unsigned y_data_offset
Definition: notchlc.c:51
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:378
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
Definition: bytestream.h:208
unsigned texture_size_y
Definition: notchlc.c:46
#define av_freep(p)
unsigned texture_size_x
Definition: notchlc.c:45
This structure stores compressed data.
Definition: packet.h:332
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50