Lines Matching defs:cin
45 static av_cold void destroy_buffers(CinVideoContext *cin)
50 av_freep(&cin->bitmap_table[i]);
53 static av_cold int allocate_buffers(CinVideoContext *cin)
58 cin->bitmap_table[i] = av_mallocz(cin->bitmap_size);
59 if (!cin->bitmap_table[i]) {
60 av_log(cin->avctx, AV_LOG_ERROR, "Can't allocate bitmap buffers.\n");
61 destroy_buffers(cin);
71 CinVideoContext *cin = avctx->priv_data;
73 cin->avctx = avctx;
76 cin->frame = av_frame_alloc();
77 if (!cin->frame)
80 cin->bitmap_size = avctx->width * avctx->height;
81 if (allocate_buffers(cin))
196 CinVideoContext *cin = avctx->priv_data;
214 cin->palette[i] = 0xFFU << 24 | bytestream_get_le24(&buf);
219 cin->palette[buf[0]] = 0xFFU << 24 | AV_RL24(buf + 1);
230 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
234 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
235 cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
236 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
240 cin->bitmap_table[CIN_INT_BMP], cin->bitmap_size);
241 cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
242 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
246 cin->bitmap_table[CIN_INT_BMP],
247 cin->bitmap_size);
248 cin_decode_rle(cin->bitmap_table[CIN_INT_BMP], bitmap_frame_size,
249 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
250 cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
251 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
255 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
259 cin->bitmap_table[CIN_CUR_BMP],
260 cin->bitmap_size);
266 cin->bitmap_table[CIN_CUR_BMP],
267 cin->bitmap_size);
270 cin_apply_delta_data(cin->bitmap_table[CIN_PRE_BMP],
271 cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
275 if ((res = ff_reget_buffer(avctx, cin->frame)) < 0)
278 memcpy(cin->frame->data[1], cin->palette, sizeof(cin->palette));
279 cin->frame->palette_has_changed = 1;
280 for (y = 0; y < cin->avctx->height; ++y)
281 memcpy(cin->frame->data[0] + (cin->avctx->height - 1 - y) * cin->frame->linesize[0],
282 cin->bitmap_table[CIN_CUR_BMP] + y * cin->avctx->width,
283 cin->avctx->width);
285 FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP],
286 cin->bitmap_table[CIN_PRE_BMP]);
288 if ((res = av_frame_ref(data, cin->frame)) < 0)
298 CinVideoContext *cin = avctx->priv_data;
300 av_frame_free(&cin->frame);
302 destroy_buffers(cin);