49 for (i = 0; i < 3; ++i)
57 for (i = 0; i < 3; ++i) {
95 unsigned char *dst,
int dst_size)
98 unsigned char huff_code_table[15];
99 unsigned char *dst_cur = dst;
100 unsigned char *dst_end = dst + dst_size;
101 const unsigned char *src_end = src + src_size;
103 memcpy(huff_code_table, src, 15);
106 while (src < src_end) {
108 if ((huff_code >> 4) == 15) {
111 *dst_cur++ = b | (huff_code >> 4);
113 *dst_cur++ = huff_code_table[huff_code >> 4];
114 if (dst_cur >= dst_end)
118 if (huff_code == 15) {
121 *dst_cur++ = huff_code_table[huff_code];
122 if (dst_cur >= dst_end)
126 return dst_cur - dst;
130 unsigned char *dst,
int dst_size)
134 unsigned char *dst_end = dst + dst_size, *dst_start = dst;
135 const unsigned char *src_end = src + src_size;
137 while (src < src_end && dst < dst_end) {
139 for (i = 0; i < 8 && src < src_end && dst < dst_end; ++i) {
140 if (code & (1 << i)) {
146 if ((
int)(dst - dst_start) < offset + 1)
148 sz = (cmd & 0xF) + 2;
152 sz =
FFMIN(sz, dst_end - dst);
154 *dst = *(dst - offset - 1);
165 unsigned char *dst,
int dst_size)
168 unsigned char *dst_end = dst + dst_size;
169 const unsigned char *src_end = src + src_size;
171 while (src + 1 < src_end && dst < dst_end) {
175 memset(dst, *src++,
FFMIN(len, dst_end - dst));
178 if (len > src_end-src) {
182 memcpy(dst, src,
FFMIN3(len, dst_end - dst, src_end - src));
191 void *
data,
int *got_frame,
195 int buf_size = avpkt->
size;
197 int i,
y, palette_type, palette_colors_count,
198 bitmap_frame_type, bitmap_frame_size, res = 0;
200 palette_type = buf[0];
201 palette_colors_count =
AV_RL16(buf + 1);
202 bitmap_frame_type = buf[3];
205 bitmap_frame_size = buf_size - 4;
208 if (bitmap_frame_size < palette_colors_count * (3 + (palette_type != 0)))
210 if (palette_type == 0) {
211 if (palette_colors_count > 256)
213 for (i = 0; i < palette_colors_count; ++i) {
214 cin->
palette[i] = 0xFF
U << 24 | bytestream_get_le24(&buf);
215 bitmap_frame_size -= 3;
218 for (i = 0; i < palette_colors_count; ++i) {
221 bitmap_frame_size -= 4;
227 switch (bitmap_frame_type) {
308 .
name =
"dsicinvideo",