Libav
kmvc.c
Go to the documentation of this file.
1 /*
2  * KMVC decoder
3  * Copyright (c) 2006 Konstantin Shishkov
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
27 #include <stdio.h>
28 #include <stdlib.h>
29 
30 #include "avcodec.h"
31 #include "bytestream.h"
32 #include "internal.h"
33 #include "libavutil/common.h"
34 
35 #define KMVC_KEYFRAME 0x80
36 #define KMVC_PALETTE 0x40
37 #define KMVC_METHOD 0x0F
38 #define MAX_PALSIZE 256
39 
40 /*
41  * Decoder context
42  */
43 typedef struct KmvcContext {
45 
46  int setpal;
47  int palsize;
48  uint32_t pal[MAX_PALSIZE];
50  uint8_t frm0[320 * 200], frm1[320 * 200];
52 } KmvcContext;
53 
54 typedef struct BitBuf {
55  int bits;
56  int bitbuf;
57 } BitBuf;
58 
59 #define BLK(data, x, y) data[av_clip((x) + (y) * 320, 0, 320 * 200 -1)]
60 
61 #define kmvc_init_getbits(bb, g) bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g);
62 
63 #define kmvc_getbit(bb, g, res) {\
64  res = 0; \
65  if (bb.bitbuf & (1 << bb.bits)) res = 1; \
66  bb.bits--; \
67  if(bb.bits == -1) { \
68  bb.bitbuf = bytestream2_get_byte(g); \
69  bb.bits = 7; \
70  } \
71 }
72 
73 static int kmvc_decode_intra_8x8(KmvcContext * ctx, int w, int h)
74 {
75  BitBuf bb;
76  int res, val;
77  int i, j;
78  int bx, by;
79  int l0x, l1x, l0y, l1y;
80  int mx, my;
81 
82  kmvc_init_getbits(bb, &ctx->g);
83 
84  for (by = 0; by < h; by += 8)
85  for (bx = 0; bx < w; bx += 8) {
86  if (!bytestream2_get_bytes_left(&ctx->g)) {
87  av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
88  return AVERROR_INVALIDDATA;
89  }
90  kmvc_getbit(bb, &ctx->g, res);
91  if (!res) { // fill whole 8x8 block
92  val = bytestream2_get_byte(&ctx->g);
93  for (i = 0; i < 64; i++)
94  BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
95  } else { // handle four 4x4 subblocks
96  for (i = 0; i < 4; i++) {
97  l0x = bx + (i & 1) * 4;
98  l0y = by + (i & 2) * 2;
99  kmvc_getbit(bb, &ctx->g, res);
100  if (!res) {
101  kmvc_getbit(bb, &ctx->g, res);
102  if (!res) { // fill whole 4x4 block
103  val = bytestream2_get_byte(&ctx->g);
104  for (j = 0; j < 16; j++)
105  BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
106  } else { // copy block from already decoded place
107  val = bytestream2_get_byte(&ctx->g);
108  mx = val & 0xF;
109  my = val >> 4;
110  for (j = 0; j < 16; j++)
111  BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
112  BLK(ctx->cur, l0x + (j & 3) - mx, l0y + (j >> 2) - my);
113  }
114  } else { // descend to 2x2 sub-sub-blocks
115  for (j = 0; j < 4; j++) {
116  l1x = l0x + (j & 1) * 2;
117  l1y = l0y + (j & 2);
118  kmvc_getbit(bb, &ctx->g, res);
119  if (!res) {
120  kmvc_getbit(bb, &ctx->g, res);
121  if (!res) { // fill whole 2x2 block
122  val = bytestream2_get_byte(&ctx->g);
123  BLK(ctx->cur, l1x, l1y) = val;
124  BLK(ctx->cur, l1x + 1, l1y) = val;
125  BLK(ctx->cur, l1x, l1y + 1) = val;
126  BLK(ctx->cur, l1x + 1, l1y + 1) = val;
127  } else { // copy block from already decoded place
128  val = bytestream2_get_byte(&ctx->g);
129  mx = val & 0xF;
130  my = val >> 4;
131  BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my);
132  BLK(ctx->cur, l1x + 1, l1y) =
133  BLK(ctx->cur, l1x + 1 - mx, l1y - my);
134  BLK(ctx->cur, l1x, l1y + 1) =
135  BLK(ctx->cur, l1x - mx, l1y + 1 - my);
136  BLK(ctx->cur, l1x + 1, l1y + 1) =
137  BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my);
138  }
139  } else { // read values for block
140  BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g);
141  BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g);
142  BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g);
143  BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g);
144  }
145  }
146  }
147  }
148  }
149  }
150 
151  return 0;
152 }
153 
154 static int kmvc_decode_inter_8x8(KmvcContext * ctx, int w, int h)
155 {
156  BitBuf bb;
157  int res, val;
158  int i, j;
159  int bx, by;
160  int l0x, l1x, l0y, l1y;
161  int mx, my;
162 
163  kmvc_init_getbits(bb, &ctx->g);
164 
165  for (by = 0; by < h; by += 8)
166  for (bx = 0; bx < w; bx += 8) {
167  kmvc_getbit(bb, &ctx->g, res);
168  if (!res) {
169  kmvc_getbit(bb, &ctx->g, res);
170  if (!res) { // fill whole 8x8 block
171  if (!bytestream2_get_bytes_left(&ctx->g)) {
172  av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
173  return AVERROR_INVALIDDATA;
174  }
175  val = bytestream2_get_byte(&ctx->g);
176  for (i = 0; i < 64; i++)
177  BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val;
178  } else { // copy block from previous frame
179  for (i = 0; i < 64; i++)
180  BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) =
181  BLK(ctx->prev, bx + (i & 0x7), by + (i >> 3));
182  }
183  } else { // handle four 4x4 subblocks
184  if (!bytestream2_get_bytes_left(&ctx->g)) {
185  av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n");
186  return AVERROR_INVALIDDATA;
187  }
188  for (i = 0; i < 4; i++) {
189  l0x = bx + (i & 1) * 4;
190  l0y = by + (i & 2) * 2;
191  kmvc_getbit(bb, &ctx->g, res);
192  if (!res) {
193  kmvc_getbit(bb, &ctx->g, res);
194  if (!res) { // fill whole 4x4 block
195  val = bytestream2_get_byte(&ctx->g);
196  for (j = 0; j < 16; j++)
197  BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val;
198  } else { // copy block
199  val = bytestream2_get_byte(&ctx->g);
200  mx = (val & 0xF) - 8;
201  my = (val >> 4) - 8;
202  for (j = 0; j < 16; j++)
203  BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) =
204  BLK(ctx->prev, l0x + (j & 3) + mx, l0y + (j >> 2) + my);
205  }
206  } else { // descend to 2x2 sub-sub-blocks
207  for (j = 0; j < 4; j++) {
208  l1x = l0x + (j & 1) * 2;
209  l1y = l0y + (j & 2);
210  kmvc_getbit(bb, &ctx->g, res);
211  if (!res) {
212  kmvc_getbit(bb, &ctx->g, res);
213  if (!res) { // fill whole 2x2 block
214  val = bytestream2_get_byte(&ctx->g);
215  BLK(ctx->cur, l1x, l1y) = val;
216  BLK(ctx->cur, l1x + 1, l1y) = val;
217  BLK(ctx->cur, l1x, l1y + 1) = val;
218  BLK(ctx->cur, l1x + 1, l1y + 1) = val;
219  } else { // copy block
220  val = bytestream2_get_byte(&ctx->g);
221  mx = (val & 0xF) - 8;
222  my = (val >> 4) - 8;
223  BLK(ctx->cur, l1x, l1y) = BLK(ctx->prev, l1x + mx, l1y + my);
224  BLK(ctx->cur, l1x + 1, l1y) =
225  BLK(ctx->prev, l1x + 1 + mx, l1y + my);
226  BLK(ctx->cur, l1x, l1y + 1) =
227  BLK(ctx->prev, l1x + mx, l1y + 1 + my);
228  BLK(ctx->cur, l1x + 1, l1y + 1) =
229  BLK(ctx->prev, l1x + 1 + mx, l1y + 1 + my);
230  }
231  } else { // read values for block
232  BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g);
233  BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g);
234  BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g);
235  BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g);
236  }
237  }
238  }
239  }
240  }
241  }
242 
243  return 0;
244 }
245 
246 static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame,
247  AVPacket *avpkt)
248 {
249  KmvcContext *const ctx = avctx->priv_data;
250  AVFrame *frame = data;
251  uint8_t *out, *src;
252  int i, ret;
253  int header;
254  int blocksize;
256 
257  bytestream2_init(&ctx->g, avpkt->data, avpkt->size);
258 
259  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
260  av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
261  return ret;
262  }
263 
264  header = bytestream2_get_byte(&ctx->g);
265 
266  /* blocksize 127 is really palette change event */
267  if (bytestream2_peek_byte(&ctx->g) == 127) {
268  bytestream2_skip(&ctx->g, 3);
269  for (i = 0; i < 127; i++) {
270  ctx->pal[i + (header & 0x81)] = bytestream2_get_be24(&ctx->g);
271  bytestream2_skip(&ctx->g, 1);
272  }
273  bytestream2_seek(&ctx->g, -127 * 4 - 3, SEEK_CUR);
274  }
275 
276  if (header & KMVC_KEYFRAME) {
277  frame->key_frame = 1;
278  frame->pict_type = AV_PICTURE_TYPE_I;
279  } else {
280  frame->key_frame = 0;
281  frame->pict_type = AV_PICTURE_TYPE_P;
282  }
283 
284  if (header & KMVC_PALETTE) {
285  frame->palette_has_changed = 1;
286  // palette starts from index 1 and has 127 entries
287  for (i = 1; i <= ctx->palsize; i++) {
288  ctx->pal[i] = bytestream2_get_be24(&ctx->g);
289  }
290  }
291 
292  if (pal) {
293  frame->palette_has_changed = 1;
294  memcpy(ctx->pal, pal, AVPALETTE_SIZE);
295  }
296 
297  if (ctx->setpal) {
298  ctx->setpal = 0;
299  frame->palette_has_changed = 1;
300  }
301 
302  /* make the palette available on the way out */
303  memcpy(frame->data[1], ctx->pal, 1024);
304 
305  blocksize = bytestream2_get_byte(&ctx->g);
306 
307  if (blocksize != 8 && blocksize != 127) {
308  av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize);
309  return AVERROR_INVALIDDATA;
310  }
311  memset(ctx->cur, 0, 320 * 200);
312  switch (header & KMVC_METHOD) {
313  case 0:
314  case 1: // used in palette changed event
315  memcpy(ctx->cur, ctx->prev, 320 * 200);
316  break;
317  case 3:
318  kmvc_decode_intra_8x8(ctx, avctx->width, avctx->height);
319  break;
320  case 4:
321  kmvc_decode_inter_8x8(ctx, avctx->width, avctx->height);
322  break;
323  default:
324  av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD);
325  return AVERROR_INVALIDDATA;
326  }
327 
328  out = frame->data[0];
329  src = ctx->cur;
330  for (i = 0; i < avctx->height; i++) {
331  memcpy(out, src, avctx->width);
332  src += 320;
333  out += frame->linesize[0];
334  }
335 
336  /* flip buffers */
337  if (ctx->cur == ctx->frm0) {
338  ctx->cur = ctx->frm1;
339  ctx->prev = ctx->frm0;
340  } else {
341  ctx->cur = ctx->frm0;
342  ctx->prev = ctx->frm1;
343  }
344 
345  *got_frame = 1;
346 
347  /* always report that the buffer was completely consumed */
348  return avpkt->size;
349 }
350 
351 
352 
353 /*
354  * Init kmvc decoder
355  */
356 static av_cold int decode_init(AVCodecContext * avctx)
357 {
358  KmvcContext *const c = avctx->priv_data;
359  int i;
360 
361  c->avctx = avctx;
362 
363  if (avctx->width > 320 || avctx->height > 200) {
364  av_log(avctx, AV_LOG_ERROR, "KMVC supports frames <= 320x200\n");
365  return AVERROR(EINVAL);
366  }
367 
368  c->cur = c->frm0;
369  c->prev = c->frm1;
370 
371  for (i = 0; i < 256; i++) {
372  c->pal[i] = i * 0x10101;
373  }
374 
375  if (avctx->extradata_size < 12) {
376  av_log(avctx, AV_LOG_WARNING,
377  "Extradata missing, decoding may not work properly...\n");
378  c->palsize = 127;
379  } else {
380  c->palsize = AV_RL16(avctx->extradata + 10);
381  if (c->palsize >= MAX_PALSIZE) {
382  av_log(avctx, AV_LOG_ERROR, "KMVC palette too large\n");
383  return AVERROR_INVALIDDATA;
384  }
385  }
386 
387  if (avctx->extradata_size == 1036) { // palette in extradata
388  uint8_t *src = avctx->extradata + 12;
389  for (i = 0; i < 256; i++) {
390  c->pal[i] = AV_RL32(src);
391  src += 4;
392  }
393  c->setpal = 1;
394  }
395 
396  avctx->pix_fmt = AV_PIX_FMT_PAL8;
397 
398  return 0;
399 }
400 
402  .name = "kmvc",
403  .long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"),
404  .type = AVMEDIA_TYPE_VIDEO,
405  .id = AV_CODEC_ID_KMVC,
406  .priv_data_size = sizeof(KmvcContext),
407  .init = decode_init,
408  .decode = decode_frame,
409  .capabilities = CODEC_CAP_DR1,
410 };
#define AVPALETTE_SIZE
Definition: avcodec.h:2959
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
#define MAX_PALSIZE
Definition: kmvc.c:38
This structure describes decoded (raw) audio or video data.
Definition: frame.h:107
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:129
GetByteContext g
Definition: kmvc.c:51
int size
Definition: avcodec.h:974
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1247
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:130
#define AV_RL16
Definition: intreadwrite.h:42
#define KMVC_PALETTE
Definition: kmvc.c:36
static int kmvc_decode_inter_8x8(KmvcContext *ctx, int w, int h)
Definition: kmvc.c:154
AVCodec.
Definition: avcodec.h:2755
#define BLK(data, x, y)
Definition: kmvc.c:59
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:269
uint8_t
#define av_cold
Definition: attributes.h:66
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:76
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1162
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=av_sample_fmt_is_planar(in_fmt);out_planar=av_sample_fmt_is_planar(out_fmt);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:711
const char data[16]
Definition: mxf.c:66
uint8_t * data
Definition: avcodec.h:973
AVCodecContext * avctx
Definition: kmvc.c:44
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
int palsize
Definition: kmvc.c:47
static int kmvc_decode_intra_8x8(KmvcContext *ctx, int w, int h)
Definition: kmvc.c:73
#define AVERROR(e)
Definition: error.h:43
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:159
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:142
int bitbuf
Definition: kmvc.c:56
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:149
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:148
const char * name
Name of the codec implementation.
Definition: avcodec.h:2762
#define kmvc_init_getbits(bb, g)
Definition: kmvc.c:61
int bits
Definition: kmvc.c:55
uint8_t frm1[320 *200]
Definition: kmvc.c:50
AVCodec ff_kmvc_decoder
Definition: kmvc.c:401
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:168
int width
picture width / height.
Definition: avcodec.h:1217
#define kmvc_getbit(bb, g, res)
Definition: kmvc.c:63
uint8_t frm0[320 *200]
Definition: kmvc.c:50
static av_cold int decode_init(AVCodecContext *avctx)
Definition: kmvc.c:356
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: kmvc.c:246
#define AV_RL32
Definition: intreadwrite.h:146
#define KMVC_METHOD
Definition: kmvc.c:37
int setpal
Definition: kmvc.c:46
NULL
Definition: eval.c:55
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:125
main external API structure.
Definition: avcodec.h:1054
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: utils.c:575
int extradata_size
Definition: avcodec.h:1163
Definition: kmvc.c:54
int palette_has_changed
Tell user application that palette has changed from previous frame.
Definition: frame.h:302
uint8_t * prev
Definition: kmvc.c:49
uint8_t * cur
Definition: kmvc.c:49
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:113
common internal api header.
common internal and external API header
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:498
#define KMVC_KEYFRAME
Definition: kmvc.c:35
void * priv_data
Definition: avcodec.h:1090
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:163
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
Definition: bytestream.h:193
uint8_t * av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
Definition: avpacket.c:286
uint32_t pal[MAX_PALSIZE]
Definition: kmvc.c:48
This structure stores compressed data.
Definition: avcodec.h:950
Predicted.
Definition: avutil.h:254