Lines Matching refs:frame

57 static int decode_copy(GetByteContext *gb, uint8_t *frame, int width, int height)
61 if (bytestream2_get_buffer(gb, frame, size) != size)
66 static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height)
68 const uint8_t *frame_start = frame;
69 const uint8_t *frame_end = frame + width * height;
77 if (segments == 0 && offset == frame_end - frame)
78 return 0; // skip frame
79 if (frame_end - frame <= offset)
81 frame += offset;
89 if (frame_end - frame < 2)
95 if (frame - frame_start < offset || frame_end - frame < count)
97 av_memcpy_backptr(frame, offset, count);
98 frame += count;
100 *frame++ = bytestream2_get_byte(gb);
101 *frame++ = bytestream2_get_byte(gb);
109 static int decode_dsw1(GetByteContext *gb, uint8_t *frame, int width, int height)
111 const uint8_t *frame_start = frame;
112 const uint8_t *frame_end = frame + width * height;
124 if (frame_end - frame < 2)
130 if (frame - frame_start < offset || frame_end - frame < count)
132 av_memcpy_backptr(frame, offset, count);
133 frame += count;
135 frame += bytestream2_get_le16(gb);
137 *frame++ = bytestream2_get_byte(gb);
138 *frame++ = bytestream2_get_byte(gb);
146 static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height)
148 const uint8_t *frame_start = frame;
149 const uint8_t *frame_end = frame + width * height;
168 if (frame - frame_start < offset || frame_end - frame < count*2 + width)
171 frame[0] = frame[1] =
172 frame[width] = frame[width + 1] = frame[-offset];
174 frame += 2;
178 if (frame - frame_end < v)
180 frame += v;
182 if (width < 4 || frame_end - frame < width + 4)
184 frame[0] = frame[1] =
185 frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
186 frame += 2;
187 frame[0] = frame[1] =
188 frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
189 frame += 2;
197 static int decode_bdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
205 frame += width * count;
213 line_ptr = frame;
214 frame += width;
217 if (frame - line_ptr <= bytestream2_peek_byte(gb))
222 if (frame - line_ptr < count)
228 if (frame - line_ptr < count)
239 static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
241 const uint8_t *frame_end = frame + width * height;
257 if (frame_end - frame <= delta || y + lines + skip_lines > height)
259 frame += delta;
264 if (frame_end <= frame)
267 frame[width - 1] = segments & 0xFF;
270 line_ptr = frame;
271 if (frame_end - frame < width)
273 frame += width;
276 if (frame - line_ptr <= bytestream2_peek_byte(gb))
281 if (frame - line_ptr < count * 2)
288 if (frame - line_ptr < count * 2)
300 static int decode_tdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
302 const uint8_t *frame_end = frame + width * height;
311 if (frame_end - frame < copy + skip ||
314 frame += skip;
315 bytestream2_get_buffer(gb, frame, copy);
316 frame += copy;
322 static int decode_blck(GetByteContext *gb, uint8_t *frame, int width, int height)
324 memset(frame, 0, width * height);
329 typedef int (*chunk_decoder)(GetByteContext *gb, uint8_t *frame, int width, int height);
340 static int dfa_decode_frame(AVCodecContext *avctx, AVFrame *frame,
352 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
370 frame->palette_has_changed = 1;
386 dst = frame->data[0];
402 dst += frame->linesize[0];
405 av_image_copy_plane(dst, frame->linesize[0], buf, avctx->width,
408 memcpy(frame->data[1], s->pal, sizeof(s->pal));