diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-05 17:12:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-28 01:25:17 +0200 |
commit | 510bd61941548b653ae446ede199013d9af01257 (patch) | |
tree | da103affc8aef9a091b7a1530e1d55164d8fece7 /libavcodec/gdv.c | |
parent | 6a4788e7b31ae2382466048289dbba21b2dff3bb (diff) | |
download | ffmpeg-510bd61941548b653ae446ede199013d9af01257.tar.gz |
avcodec/gdv: Optimize 2x scaling loop a little in gdv_decode_frame()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/gdv.c')
-rw-r--r-- | libavcodec/gdv.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index 1623febd1a..d497f76157 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -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)) { |