avcodec/gdv: Optimize 2x scaling loop a little in gdv_decode_frame()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-08-05 17:12:33 +02:00
parent 6a4788e7b3
commit 510bd61941
1 changed files with 6 additions and 2 deletions

View File

@ -481,8 +481,12 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
if (!gdv->scale_v) {
memcpy(dst + didx, gdv->frame + sidx, avctx->width);
} else {
for (x = 0; x < avctx->width; x++) {
dst[didx + x] = gdv->frame[sidx + x/2];
for (x = 0; x < avctx->width - 1; x+=2) {
dst[didx + x ] =
dst[didx + x + 1] = gdv->frame[sidx + (x>>1)];
}
for (; x < avctx->width; x++) {
dst[didx + x] = gdv->frame[sidx + (x>>1)];
}
}
if (!gdv->scale_h || ((y & 1) == 1)) {