mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/qpeg: speed-up copy of bytes
This commit is contained in:
parent
a13a23bdf2
commit
97c73ba565
|
@ -101,8 +101,11 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
|
||||||
} else {
|
} else {
|
||||||
if (bytestream2_get_bytes_left(&qctx->buffer) < copy)
|
if (bytestream2_get_bytes_left(&qctx->buffer) < copy)
|
||||||
copy = bytestream2_get_bytes_left(&qctx->buffer);
|
copy = bytestream2_get_bytes_left(&qctx->buffer);
|
||||||
for(i = 0; i < copy; i++) {
|
while (copy > 0) {
|
||||||
dst[filled++] = bytestream2_get_byte(&qctx->buffer);
|
int step = FFMIN(copy, width - filled);
|
||||||
|
bytestream2_get_bufferu(&qctx->buffer, dst + filled, step);
|
||||||
|
filled += step;
|
||||||
|
copy -= step;
|
||||||
if (filled >= width) {
|
if (filled >= width) {
|
||||||
filled = 0;
|
filled = 0;
|
||||||
dst -= stride;
|
dst -= stride;
|
||||||
|
|
Loading…
Reference in New Issue