} else {
if (bytestream2_get_bytes_left(&qctx->buffer) < copy)
copy = bytestream2_get_bytes_left(&qctx->buffer);
- for(i = 0; i < copy; i++) {
- dst[filled++] = bytestream2_get_byte(&qctx->buffer);
+ while (copy > 0) {
+ int step = FFMIN(copy, width - filled);
+ bytestream2_get_bufferu(&qctx->buffer, dst + filled, step);
+ filled += step;
+ copy -= step;
if (filled >= width) {
filled = 0;
dst -= stride;
}
}
-static const int qpeg_table_h[16] =
+static const uint8_t qpeg_table_h[16] =
{ 0x00, 0x20, 0x20, 0x20, 0x18, 0x10, 0x10, 0x20, 0x10, 0x08, 0x18, 0x08, 0x08, 0x18, 0x10, 0x04};
-static const int qpeg_table_w[16] =
+static const uint8_t qpeg_table_w[16] =
{ 0x00, 0x20, 0x18, 0x08, 0x18, 0x10, 0x20, 0x10, 0x08, 0x10, 0x20, 0x20, 0x08, 0x10, 0x18, 0x04};
/* Decodes delta frames */
.decode = decode_frame,
.flush = decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
};