Lines Matching refs:gbc

48 static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc,
55 unsigned int idx = bytestream2_get_be16(gbc); /* color index */
59 bytestream2_skip(gbc, 6);
64 r = bytestream2_get_byte(gbc);
65 bytestream2_skip(gbc, 1);
66 g = bytestream2_get_byte(gbc);
67 bytestream2_skip(gbc, 1);
68 b = bytestream2_get_byte(gbc);
69 bytestream2_skip(gbc, 1);
75 static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
88 size = left = bytestream2_get_be16(gbc);
90 size = left = bytestream2_get_byte(gbc);
91 if (bytestream2_get_bytes_left(gbc) < size)
96 code = bytestream2_get_byte(gbc);
98 pix = bytestream2_get_byte(gbc);
112 pix = bytestream2_get_byte(gbc);
130 static int decode_rle_bpp4(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
142 size = left = bytestream2_get_be16(gbc);
143 if (bytestream2_get_bytes_left(gbc) < size)
148 code = bytestream2_get_byte(gbc);
150 pix = bytestream2_get_byte(gbc);
160 pix = bytestream2_get_byte(gbc);
174 static int decode_rle16(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc)
186 size = left = bytestream2_get_be16(gbc);
187 if (bytestream2_get_bytes_left(gbc) < size)
192 code = bytestream2_get_byte(gbc);
194 pix = bytestream2_get_be16(gbc);
204 out[pos++] = bytestream2_get_be16(gbc);
206 bytestream2_skip(gbc, 2);
217 static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
230 size = left = bytestream2_get_be16(gbc);
231 if (bytestream2_get_bytes_left(gbc) < size)
236 code = bytestream2_get_byte(gbc);
238 pix = bytestream2_get_byte(gbc);
251 pix = bytestream2_get_byte(gbc);
294 GetByteContext gbc;
299 bytestream2_init(&gbc, avpkt->data, avpkt->size);
300 if ( bytestream2_get_bytes_left(&gbc) >= 552
301 && check_header(gbc.buffer + 512, bytestream2_get_bytes_left(&gbc) - 512)
303 bytestream2_skip(&gbc, 512);
305 ver = check_header(gbc.buffer, bytestream2_get_bytes_left(&gbc));
308 if (bytestream2_get_bytes_left(&gbc) < 40) {
310 bytestream2_get_bytes_left(&gbc));
314 bytestream2_skip(&gbc, 6);
315 h = bytestream2_get_be16(&gbc);
316 w = bytestream2_get_be16(&gbc);
328 avpriv_request_sample(avctx, "QuickDraw version unknown (%X)", bytestream2_get_be32(&gbc));
332 bytestream2_skip(&gbc, 4+26);
334 while (bytestream2_get_bytes_left(&gbc) >= 4) {
338 int opcode = bytestream2_get_be16(&gbc);
342 bytestream2_skip(&gbc, 10);
348 flags = bytestream2_get_be16(&gbc) & 0xC000;
349 bytestream2_skip(&gbc, 28);
350 bppcnt = bytestream2_get_be16(&gbc); /* cmpCount */
351 bpp = bytestream2_get_be16(&gbc); /* cmpSize */
368 bytestream2_skip(&gbc, 18);
369 colors = bytestream2_get_be16(&gbc);
376 if (bytestream2_get_bytes_left(&gbc) < (colors + 1) * 8) {
378 bytestream2_get_bytes_left(&gbc));
384 ret = parse_palette(avctx, &gbc, (uint32_t *)p->data[1], colors, flags & 0x8000);
390 bytestream2_skip(&gbc, 18);
393 bytestream2_skip(&gbc, 2 + 8); /* size + rect */
398 ret = decode_rle16(avctx, p, &gbc);
400 ret = decode_rle_bpp2(avctx, p, &gbc);
402 ret = decode_rle_bpp4(avctx, p, &gbc);
404 ret = decode_rle(avctx, p, &gbc, bppcnt);
413 bytestream2_skip(&gbc, 4);
414 rowbytes = bytestream2_get_be16(&gbc) & 0x3FFF;
420 bytestream2_skip(&gbc, 4);
421 h = bytestream2_get_be16(&gbc);
422 w = bytestream2_get_be16(&gbc);
423 bytestream2_skip(&gbc, 2);
429 pack_type = bytestream2_get_be16(&gbc);
431 bytestream2_skip(&gbc, 16);
432 bppcnt = bytestream2_get_be16(&gbc); /* cmpCount */
433 bpp = bytestream2_get_be16(&gbc); /* cmpSize */
457 if (bytestream2_get_bytes_left(&gbc) < 30)
463 bytestream2_skip(&gbc, 30);
466 bytestream2_skip(&gbc, 2 + 8); /* size + rect */
471 ret = decode_rle16(avctx, p, &gbc);
473 ret = decode_rle(avctx, p, &gbc, bppcnt);
479 bytestream2_get_be16(&gbc);
480 bytestream2_skip(&gbc, bytestream2_get_be16(&gbc));
491 bytestream2_skip(&gbc, bytestream2_get_bytes_left(&gbc) % 2);
493 eop = bytestream2_get_be16(&gbc);
494 trail = bytestream2_get_bytes_left(&gbc);