Libav
vmnc.c
Go to the documentation of this file.
1 /*
2  * VMware Screen Codec (VMnc) 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 
28 #include <stdio.h>
29 #include <stdlib.h>
30 
31 #include "libavutil/common.h"
32 #include "libavutil/intreadwrite.h"
33 #include "avcodec.h"
34 #include "internal.h"
35 #include "bytestream.h"
36 
37 enum EncTypes {
38  MAGIC_WMVd = 0x574D5664,
45 };
46 
48  HT_RAW = 1, // tile is raw
49  HT_BKG = 2, // background color is present
50  HT_FG = 4, // foreground color is present
51  HT_SUB = 8, // subrects are present
52  HT_CLR = 16 // each subrect has own color
53 };
54 
55 /*
56  * Decoder context
57  */
58 typedef struct VmncContext {
61 
62  int bpp;
63  int bpp2;
64  int bigendian;
65  uint8_t pal[768];
66  int width, height;
68 
69  /* cursor data */
70  int cur_w, cur_h;
71  int cur_x, cur_y;
72  int cur_hx, cur_hy;
75 } VmncContext;
76 
77 /* read pixel value from stream */
79 {
80  switch (bpp * 2 + be) {
81  case 2:
82  case 3:
83  return bytestream2_get_byte(gb);
84  case 4:
85  return bytestream2_get_le16(gb);
86  case 5:
87  return bytestream2_get_be16(gb);
88  case 8:
89  return bytestream2_get_le32(gb);
90  case 9:
91  return bytestream2_get_be32(gb);
92  default: return 0;
93  }
94 }
95 
96 static void load_cursor(VmncContext *c)
97 {
98  int i, j, p;
99  const int bpp = c->bpp2;
100  uint8_t *dst8 = c->curbits;
101  uint16_t *dst16 = (uint16_t *)c->curbits;
102  uint32_t *dst32 = (uint32_t *)c->curbits;
103 
104  for (j = 0; j < c->cur_h; j++) {
105  for (i = 0; i < c->cur_w; i++) {
106  p = vmnc_get_pixel(&c->gb, bpp, c->bigendian);
107  if (bpp == 1)
108  *dst8++ = p;
109  if (bpp == 2)
110  *dst16++ = p;
111  if (bpp == 4)
112  *dst32++ = p;
113  }
114  }
115  dst8 = c->curmask;
116  dst16 = (uint16_t*)c->curmask;
117  dst32 = (uint32_t*)c->curmask;
118  for (j = 0; j < c->cur_h; j++) {
119  for (i = 0; i < c->cur_w; i++) {
120  p = vmnc_get_pixel(&c->gb, bpp, c->bigendian);
121  if (bpp == 1)
122  *dst8++ = p;
123  if (bpp == 2)
124  *dst16++ = p;
125  if (bpp == 4)
126  *dst32++ = p;
127  }
128  }
129 }
130 
131 static void put_cursor(uint8_t *dst, int stride, VmncContext *c, int dx, int dy)
132 {
133  int i, j;
134  int w, h, x, y;
135  w = c->cur_w;
136  if (c->width < c->cur_x + c->cur_w)
137  w = c->width - c->cur_x;
138  h = c->cur_h;
139  if (c->height < c->cur_y + c->cur_h)
140  h = c->height - c->cur_y;
141  x = c->cur_x;
142  y = c->cur_y;
143  if (x < 0) {
144  w += x;
145  x = 0;
146  }
147  if (y < 0) {
148  h += y;
149  y = 0;
150  }
151 
152  if ((w < 1) || (h < 1))
153  return;
154  dst += x * c->bpp2 + y * stride;
155 
156  if (c->bpp2 == 1) {
157  uint8_t *cd = c->curbits, *msk = c->curmask;
158  for (j = 0; j < h; j++) {
159  for (i = 0; i < w; i++)
160  dst[i] = (dst[i] & cd[i]) ^ msk[i];
161  msk += c->cur_w;
162  cd += c->cur_w;
163  dst += stride;
164  }
165  } else if (c->bpp2 == 2) {
166  uint16_t *cd = (uint16_t*)c->curbits, *msk = (uint16_t*)c->curmask;
167  uint16_t *dst2;
168  for (j = 0; j < h; j++) {
169  dst2 = (uint16_t*)dst;
170  for (i = 0; i < w; i++)
171  dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
172  msk += c->cur_w;
173  cd += c->cur_w;
174  dst += stride;
175  }
176  } else if (c->bpp2 == 4) {
177  uint32_t *cd = (uint32_t*)c->curbits, *msk = (uint32_t*)c->curmask;
178  uint32_t *dst2;
179  for (j = 0; j < h; j++) {
180  dst2 = (uint32_t*)dst;
181  for (i = 0; i < w; i++)
182  dst2[i] = (dst2[i] & cd[i]) ^ msk[i];
183  msk += c->cur_w;
184  cd += c->cur_w;
185  dst += stride;
186  }
187  }
188 }
189 
190 /* fill rectangle with given color */
191 static av_always_inline void paint_rect(uint8_t *dst, int dx, int dy,
192  int w, int h, int color,
193  int bpp, int stride)
194 {
195  int i, j;
196  dst += dx * bpp + dy * stride;
197  if (bpp == 1) {
198  for (j = 0; j < h; j++) {
199  memset(dst, color, w);
200  dst += stride;
201  }
202  } else if (bpp == 2) {
203  uint16_t *dst2;
204  for (j = 0; j < h; j++) {
205  dst2 = (uint16_t*)dst;
206  for (i = 0; i < w; i++)
207  *dst2++ = color;
208  dst += stride;
209  }
210  } else if (bpp == 4) {
211  uint32_t *dst2;
212  for (j = 0; j < h; j++) {
213  dst2 = (uint32_t*)dst;
214  for (i = 0; i < w; i++)
215  dst2[i] = color;
216  dst += stride;
217  }
218  }
219 }
220 
221 static av_always_inline void paint_raw(uint8_t *dst, int w, int h,
222  GetByteContext *gb, int bpp,
223  int be, int stride)
224 {
225  int i, j, p;
226  for (j = 0; j < h; j++) {
227  for (i = 0; i < w; i++) {
228  p = vmnc_get_pixel(gb, bpp, be);
229  switch (bpp) {
230  case 1:
231  dst[i] = p;
232  break;
233  case 2:
234  ((uint16_t*)dst)[i] = p;
235  break;
236  case 4:
237  ((uint32_t*)dst)[i] = p;
238  break;
239  }
240  }
241  dst += stride;
242  }
243 }
244 
246  int w, int h, int stride)
247 {
248  int i, j, k;
249  int bg = 0, fg = 0, rects, color, flags, xy, wh;
250  const int bpp = c->bpp2;
251  uint8_t *dst2;
252  int bw = 16, bh = 16;
253 
254  for (j = 0; j < h; j += 16) {
255  dst2 = dst;
256  bw = 16;
257  if (j + 16 > h)
258  bh = h - j;
259  for (i = 0; i < w; i += 16, dst2 += 16 * bpp) {
260  if (bytestream2_get_bytes_left(gb) <= 0) {
261  av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
262  return AVERROR_INVALIDDATA;
263  }
264  if (i + 16 > w)
265  bw = w - i;
266  flags = bytestream2_get_byte(gb);
267  if (flags & HT_RAW) {
268  if (bytestream2_get_bytes_left(gb) < bw * bh * bpp) {
269  av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
270  return AVERROR_INVALIDDATA;
271  }
272  paint_raw(dst2, bw, bh, gb, bpp, c->bigendian, stride);
273  } else {
274  if (flags & HT_BKG)
275  bg = vmnc_get_pixel(gb, bpp, c->bigendian);
276  if (flags & HT_FG)
277  fg = vmnc_get_pixel(gb, bpp, c->bigendian);
278  rects = 0;
279  if (flags & HT_SUB)
280  rects = bytestream2_get_byte(gb);
281  color = !!(flags & HT_CLR);
282 
283  paint_rect(dst2, 0, 0, bw, bh, bg, bpp, stride);
284 
285  if (bytestream2_get_bytes_left(gb) < rects * (color * bpp + 2)) {
286  av_log(c->avctx, AV_LOG_ERROR, "Premature end of data!\n");
287  return AVERROR_INVALIDDATA;
288  }
289  for (k = 0; k < rects; k++) {
290  int rect_x, rect_y, rect_w, rect_h;
291  if (color)
292  fg = vmnc_get_pixel(gb, bpp, c->bigendian);
293  xy = bytestream2_get_byte(gb);
294  wh = bytestream2_get_byte(gb);
295 
296  rect_x = xy >> 4;
297  rect_y = xy & 0xF;
298  rect_w = (wh >> 4) + 1;
299  rect_h = (wh & 0xF) + 1;
300 
301  if (rect_x + rect_w > bw || rect_y + rect_h > bh) {
302  av_log(c->avctx, AV_LOG_ERROR, "Invalid subrect\n");
303  return AVERROR_INVALIDDATA;
304  }
305 
306  paint_rect(dst2, rect_x, rect_y,
307  rect_w, rect_h, fg, bpp, stride);
308  }
309  }
310  }
311  dst += stride * 16;
312  }
313  return 0;
314 }
315 
316 static void reset_buffers(VmncContext *c)
317 {
318  av_freep(&c->curbits);
319  av_freep(&c->curmask);
320  av_freep(&c->screendta);
321  c->cur_w = c->cur_h = 0;
322 }
323 
324 static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
325  AVPacket *avpkt)
326 {
327  const uint8_t *buf = avpkt->data;
328  int buf_size = avpkt->size;
329  VmncContext * const c = avctx->priv_data;
330  GetByteContext *gb = &c->gb;
331  uint8_t *outptr;
332  int dx, dy, w, h, depth, enc, chunks, res, size_left, ret;
333 
334  if ((ret = ff_reget_buffer(avctx, c->pic)) < 0) {
335  av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
336  return ret;
337  }
338 
339  bytestream2_init(gb, buf, buf_size);
340 
341  c->pic->key_frame = 0;
343 
344  // restore screen after cursor
345  if (c->screendta) {
346  int i;
347  w = c->cur_w;
348  if (c->width < c->cur_x + w)
349  w = c->width - c->cur_x;
350  h = c->cur_h;
351  if (c->height < c->cur_y + h)
352  h = c->height - c->cur_y;
353  dx = c->cur_x;
354  if (dx < 0) {
355  w += dx;
356  dx = 0;
357  }
358  dy = c->cur_y;
359  if (dy < 0) {
360  h += dy;
361  dy = 0;
362  }
363  if ((w > 0) && (h > 0)) {
364  outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
365  for (i = 0; i < h; i++) {
366  memcpy(outptr, c->screendta + i * c->cur_w * c->bpp2,
367  w * c->bpp2);
368  outptr += c->pic->linesize[0];
369  }
370  }
371  }
372  bytestream2_skip(gb, 2);
373  chunks = bytestream2_get_be16(gb);
374  while (chunks--) {
375  dx = bytestream2_get_be16(gb);
376  dy = bytestream2_get_be16(gb);
377  w = bytestream2_get_be16(gb);
378  h = bytestream2_get_be16(gb);
379  enc = bytestream2_get_be32(gb);
380  outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
381  size_left = bytestream2_get_bytes_left(gb);
382  switch (enc) {
383  case MAGIC_WMVd: // cursor
384  if (size_left < 2 + w * h * c->bpp2 * 2) {
385  av_log(avctx, AV_LOG_ERROR,
386  "Premature end of data! (need %i got %i)\n",
387  2 + w * h * c->bpp2 * 2, size_left);
388  return AVERROR_INVALIDDATA;
389  }
390  bytestream2_skip(gb, 2);
391  c->cur_w = w;
392  c->cur_h = h;
393  c->cur_hx = dx;
394  c->cur_hy = dy;
395  if ((c->cur_hx > c->cur_w) || (c->cur_hy > c->cur_h)) {
396  av_log(avctx, AV_LOG_ERROR,
397  "Cursor hot spot is not in image: "
398  "%ix%i of %ix%i cursor size\n",
399  c->cur_hx, c->cur_hy, c->cur_w, c->cur_h);
400  c->cur_hx = c->cur_hy = 0;
401  }
402  if (c->cur_w * c->cur_h >= INT_MAX / c->bpp2) {
403  reset_buffers(c);
404  return AVERROR(EINVAL);
405  } else {
406  int screen_size = c->cur_w * c->cur_h * c->bpp2;
407  if ((ret = av_reallocp(&c->curbits, screen_size)) < 0 ||
408  (ret = av_reallocp(&c->curmask, screen_size)) < 0 ||
409  (ret = av_reallocp(&c->screendta, screen_size)) < 0) {
410  reset_buffers(c);
411  return ret;
412  }
413  }
414  load_cursor(c);
415  break;
416  case MAGIC_WMVe: // unknown
417  bytestream2_skip(gb, 2);
418  break;
419  case MAGIC_WMVf: // update cursor position
420  c->cur_x = dx - c->cur_hx;
421  c->cur_y = dy - c->cur_hy;
422  break;
423  case MAGIC_WMVg: // unknown
424  bytestream2_skip(gb, 10);
425  break;
426  case MAGIC_WMVh: // unknown
427  bytestream2_skip(gb, 4);
428  break;
429  case MAGIC_WMVi: // ServerInitialization struct
430  c->pic->key_frame = 1;
432  depth = bytestream2_get_byte(gb);
433  if (depth != c->bpp) {
434  av_log(avctx, AV_LOG_INFO,
435  "Depth mismatch. Container %i bpp, "
436  "Frame data: %i bpp\n",
437  c->bpp, depth);
438  }
439  bytestream2_skip(gb, 1);
440  c->bigendian = bytestream2_get_byte(gb);
441  if (c->bigendian & (~1)) {
442  av_log(avctx, AV_LOG_INFO,
443  "Invalid header: bigendian flag = %i\n", c->bigendian);
444  return AVERROR_INVALIDDATA;
445  }
446  //skip the rest of pixel format data
447  bytestream2_skip(gb, 13);
448  break;
449  case MAGIC_WMVj: // unknown
450  bytestream2_skip(gb, 2);
451  break;
452  case 0x00000000: // raw rectangle data
453  if ((dx + w > c->width) || (dy + h > c->height)) {
454  av_log(avctx, AV_LOG_ERROR,
455  "Incorrect frame size: %ix%i+%ix%i of %ix%i\n",
456  w, h, dx, dy, c->width, c->height);
457  return AVERROR_INVALIDDATA;
458  }
459  if (size_left < w * h * c->bpp2) {
460  av_log(avctx, AV_LOG_ERROR,
461  "Premature end of data! (need %i got %i)\n",
462  w * h * c->bpp2, size_left);
463  return AVERROR_INVALIDDATA;
464  }
465  paint_raw(outptr, w, h, gb, c->bpp2, c->bigendian,
466  c->pic->linesize[0]);
467  break;
468  case 0x00000005: // HexTile encoded rectangle
469  if ((dx + w > c->width) || (dy + h > c->height)) {
470  av_log(avctx, AV_LOG_ERROR,
471  "Incorrect frame size: %ix%i+%ix%i of %ix%i\n",
472  w, h, dx, dy, c->width, c->height);
473  return AVERROR_INVALIDDATA;
474  }
475  res = decode_hextile(c, outptr, gb, w, h, c->pic->linesize[0]);
476  if (res < 0)
477  return res;
478  break;
479  default:
480  av_log(avctx, AV_LOG_ERROR, "Unsupported block type 0x%08X\n", enc);
481  chunks = 0; // leave chunks decoding loop
482  }
483  }
484  if (c->screendta) {
485  int i;
486  // save screen data before painting cursor
487  w = c->cur_w;
488  if (c->width < c->cur_x + w)
489  w = c->width - c->cur_x;
490  h = c->cur_h;
491  if (c->height < c->cur_y + h)
492  h = c->height - c->cur_y;
493  dx = c->cur_x;
494  if (dx < 0) {
495  w += dx;
496  dx = 0;
497  }
498  dy = c->cur_y;
499  if (dy < 0) {
500  h += dy;
501  dy = 0;
502  }
503  if ((w > 0) && (h > 0)) {
504  outptr = c->pic->data[0] + dx * c->bpp2 + dy * c->pic->linesize[0];
505  for (i = 0; i < h; i++) {
506  memcpy(c->screendta + i * c->cur_w * c->bpp2, outptr,
507  w * c->bpp2);
508  outptr += c->pic->linesize[0];
509  }
510  outptr = c->pic->data[0];
511  put_cursor(outptr, c->pic->linesize[0], c, c->cur_x, c->cur_y);
512  }
513  }
514  *got_frame = 1;
515  if ((ret = av_frame_ref(data, c->pic)) < 0)
516  return ret;
517 
518  /* always report that the buffer was completely consumed */
519  return buf_size;
520 }
521 
523 {
524  VmncContext * const c = avctx->priv_data;
525 
526  c->avctx = avctx;
527  c->width = avctx->width;
528  c->height = avctx->height;
529  c->bpp = avctx->bits_per_coded_sample;
530  c->bpp2 = c->bpp / 8;
531 
532  switch (c->bpp) {
533  case 8:
534  avctx->pix_fmt = AV_PIX_FMT_PAL8;
535  break;
536  case 16:
537  avctx->pix_fmt = AV_PIX_FMT_RGB555;
538  break;
539  case 32:
540  avctx->pix_fmt = AV_PIX_FMT_RGB32;
541  break;
542  default:
543  av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp);
544  return AVERROR_INVALIDDATA;
545  }
546 
547  c->pic = av_frame_alloc();
548  if (!c->pic)
549  return AVERROR(ENOMEM);
550 
551  return 0;
552 }
553 
555 {
556  VmncContext * const c = avctx->priv_data;
557 
558  av_frame_free(&c->pic);
559 
560  av_free(c->curbits);
561  av_free(c->curmask);
562  av_free(c->screendta);
563  return 0;
564 }
565 
567  .name = "vmnc",
568  .long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"),
569  .type = AVMEDIA_TYPE_VIDEO,
570  .id = AV_CODEC_ID_VMNC,
571  .priv_data_size = sizeof(VmncContext),
572  .init = decode_init,
573  .close = decode_end,
574  .decode = decode_frame,
575  .capabilities = CODEC_CAP_DR1,
576 };
Definition: vmnc.c:52
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
uint8_t pal[768]
Definition: vmnc.c:65
Definition: vmnc.c:48
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
Definition: vmnc.c:49
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: vmnc.c:324
uint8_t * curbits
Definition: vmnc.c:73
int size
Definition: avcodec.h:974
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1270
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:132
int stride
Definition: mace.c:144
AVCodec.
Definition: avcodec.h:2812
static void put_cursor(uint8_t *dst, int stride, VmncContext *c, int dx, int dy)
Definition: vmnc.c:131
int height
Definition: vmnc.c:66
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
HexTile_Flags
Definition: vmnc.c:47
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:275
uint8_t
#define av_cold
Definition: attributes.h:66
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:57
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:76
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
Definition: frame.c:188
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:684
const char data[16]
Definition: mxf.c:70
uint8_t * data
Definition: avcodec.h:973
static av_always_inline void paint_raw(uint8_t *dst, int w, int h, GetByteContext *gb, int bpp, int be, int stride)
Definition: vmnc.c:221
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:140
static int flags
Definition: log.c:44
static av_always_inline int vmnc_get_pixel(GetByteContext *gb, int bpp, int be)
Definition: vmnc.c:78
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
Definition: avcodec.h:2523
int width
Definition: vmnc.c:66
int bigendian
Definition: vmnc.c:64
int cur_x
Definition: vmnc.c:71
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:186
GetByteContext gb
Definition: vmnc.c:67
static av_cold int decode_end(AVCodecContext *avctx)
Definition: vmnc.c:554
#define AVERROR(e)
Definition: error.h:43
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:161
EncTypes
Definition: vmnc.c:37
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:69
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:145
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:151
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:169
const char * name
Name of the codec implementation.
Definition: avcodec.h:2819
int cur_w
Definition: vmnc.c:70
int cur_hx
Definition: vmnc.c:72
Definition: vmnc.c:51
int cur_hy
Definition: vmnc.c:72
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
Definition: utils.c:808
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:196
int bpp
Definition: vmnc.c:62
static void load_cursor(VmncContext *c)
Definition: vmnc.c:96
int width
picture width / height.
Definition: avcodec.h:1229
AVCodecContext * avctx
Definition: vmnc.c:59
Definition: vmnc.c:50
static void reset_buffers(VmncContext *c)
Definition: vmnc.c:316
static int decode_hextile(VmncContext *c, uint8_t *dst, GetByteContext *gb, int w, int h, int stride)
Definition: vmnc.c:245
#define AV_LOG_INFO
Standard information.
Definition: log.h:134
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:153
main external API structure.
Definition: avcodec.h:1050
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:490
#define AV_PIX_FMT_RGB32
Definition: pixfmt.h:222
AVCodec ff_vmnc_decoder
Definition: vmnc.c:566
uint8_t * curmask
Definition: vmnc.c:73
AVFrame * pic
Definition: vmnc.c:60
static av_always_inline void paint_rect(uint8_t *dst, int dx, int dy, int w, int h, int color, int bpp, int stride)
Definition: vmnc.c:191
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:141
static av_cold int decode_init(AVCodecContext *avctx)
Definition: vmnc.c:522
int cur_h
Definition: vmnc.c:70
common internal api header.
common internal and external API header
uint8_t * screendta
Definition: vmnc.c:74
#define AV_PIX_FMT_RGB555
Definition: pixfmt.h:231
static const uint8_t color[]
Definition: log.c:55
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
void * priv_data
Definition: avcodec.h:1092
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:191
#define av_always_inline
Definition: attributes.h:40
int bpp2
Definition: vmnc.c:63
This structure stores compressed data.
Definition: avcodec.h:950
Predicted.
Definition: avutil.h:254
int cur_y
Definition: vmnc.c:71