Lines Matching refs:gb
56 static int decode_copy(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_copy() argument
60 if (bytestream2_get_buffer(gb, frame, size) != size) in decode_copy()
65 static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_tsw1() argument
74 segments = bytestream2_get_le32(gb); in decode_tsw1()
75 offset = bytestream2_get_le32(gb); in decode_tsw1()
82 if (bytestream2_get_bytes_left(gb) < 2) in decode_tsw1()
85 bitbuf = bytestream2_get_le16u(gb); in decode_tsw1()
91 v = bytestream2_get_le16(gb); in decode_tsw1()
99 *frame++ = bytestream2_get_byte(gb); in decode_tsw1()
100 *frame++ = bytestream2_get_byte(gb); in decode_tsw1()
108 static int decode_dsw1(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_dsw1() argument
115 segments = bytestream2_get_le16(gb); in decode_dsw1()
117 if (bytestream2_get_bytes_left(gb) < 2) in decode_dsw1()
120 bitbuf = bytestream2_get_le16u(gb); in decode_dsw1()
126 v = bytestream2_get_le16(gb); in decode_dsw1()
134 frame += bytestream2_get_le16(gb); in decode_dsw1()
136 *frame++ = bytestream2_get_byte(gb); in decode_dsw1()
137 *frame++ = bytestream2_get_byte(gb); in decode_dsw1()
145 static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_dds1() argument
154 segments = bytestream2_get_le16(gb); in decode_dds1()
156 if (bytestream2_get_bytes_left(gb) < 2) in decode_dds1()
159 bitbuf = bytestream2_get_le16u(gb); in decode_dds1()
164 v = bytestream2_get_le16(gb); in decode_dds1()
176 v = bytestream2_get_le16(gb)*2; in decode_dds1()
184 frame[width] = frame[width + 1] = bytestream2_get_byte(gb); in decode_dds1()
187 frame[width] = frame[width + 1] = bytestream2_get_byte(gb); in decode_dds1()
196 static int decode_bdlt(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_bdlt() argument
201 count = bytestream2_get_le16(gb); in decode_bdlt()
205 lines = bytestream2_get_le16(gb); in decode_bdlt()
210 if (bytestream2_get_bytes_left(gb) < 1) in decode_bdlt()
214 segments = bytestream2_get_byteu(gb); in decode_bdlt()
216 if (frame - line_ptr <= bytestream2_peek_byte(gb)) in decode_bdlt()
218 line_ptr += bytestream2_get_byte(gb); in decode_bdlt()
219 count = (int8_t)bytestream2_get_byte(gb); in decode_bdlt()
223 if (bytestream2_get_buffer(gb, line_ptr, count) != count) in decode_bdlt()
229 memset(line_ptr, bytestream2_get_byte(gb), count); in decode_bdlt()
238 static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_wdlt() argument
245 lines = bytestream2_get_le16(gb); in decode_wdlt()
250 if (bytestream2_get_bytes_left(gb) < 2) in decode_wdlt()
252 segments = bytestream2_get_le16u(gb); in decode_wdlt()
260 segments = bytestream2_get_le16(gb); in decode_wdlt()
267 segments = bytestream2_get_le16(gb); in decode_wdlt()
275 if (frame - line_ptr <= bytestream2_peek_byte(gb)) in decode_wdlt()
277 line_ptr += bytestream2_get_byte(gb); in decode_wdlt()
278 count = (int8_t)bytestream2_get_byte(gb); in decode_wdlt()
282 if (bytestream2_get_buffer(gb, line_ptr, count * 2) != count * 2) in decode_wdlt()
289 v = bytestream2_get_le16(gb); in decode_wdlt()
299 static int decode_tdlt(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_tdlt() argument
302 uint32_t segments = bytestream2_get_le32(gb); in decode_tdlt()
306 if (bytestream2_get_bytes_left(gb) < 2) in decode_tdlt()
308 copy = bytestream2_get_byteu(gb) * 2; in decode_tdlt()
309 skip = bytestream2_get_byteu(gb) * 2; in decode_tdlt()
311 bytestream2_get_bytes_left(gb) < copy) in decode_tdlt()
314 bytestream2_get_buffer(gb, frame, copy); in decode_tdlt()
321 static int decode_blck(GetByteContext *gb, uint8_t *frame, int width, int height) in decode_blck() argument
328 typedef int (*chunk_decoder)(GetByteContext *gb, uint8_t *frame, int width, int height);
345 GetByteContext gb; in dfa_decode_frame() local
356 bytestream2_init(&gb, avpkt->data, avpkt->size); in dfa_decode_frame()
357 while (bytestream2_get_bytes_left(&gb) > 0) { in dfa_decode_frame()
358 if (bytestream2_get_bytes_left(&gb) < 12) in dfa_decode_frame()
360 bytestream2_skip(&gb, 4); in dfa_decode_frame()
361 chunk_size = bytestream2_get_le32(&gb); in dfa_decode_frame()
362 chunk_type = bytestream2_get_le32(&gb); in dfa_decode_frame()
368 s->pal[i] = bytestream2_get_be24(&gb) << 2; in dfa_decode_frame()
373 if (decoder[chunk_type - 2](&gb, s->frame_buf, avctx->width, avctx->height)) { in dfa_decode_frame()