avcodec/qpeg: speed-up copy of bytes

This commit is contained in:
Paul B Mahol 2020-08-31 23:25:22 +02:00
parent a13a23bdf2
commit 97c73ba565
1 changed files with 5 additions and 2 deletions

View File

@ -101,8 +101,11 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
} 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;