diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-08-05 16:55:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-28 01:25:17 +0200 |
commit | 6228ce0a33c77d8bd84a7abf61f502b46a8ce46f (patch) | |
tree | cff0af85d1705f22b2837153512934eab5eb837a /libavcodec/gdv.c | |
parent | a423970511bc3b271a1e4202f3bcf60773de657b (diff) | |
download | ffmpeg-6228ce0a33c77d8bd84a7abf61f502b46a8ce46f.tar.gz |
avcodec/gdv: Combine first and 3rd case in rescale()
Simplifies code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/gdv.c')
-rw-r--r-- | libavcodec/gdv.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index 274552a7be..1efc64b1dc 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -80,11 +80,11 @@ static void rescale(GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, in return; } - if (gdv->scale_h && gdv->scale_v) { + if (gdv->scale_v) { for (j = 0; j < h; j++) { int y = h - j - 1; uint8_t *dst1 = dst + PREAMBLE_SIZE + y * w; - uint8_t *src1 = dst + PREAMBLE_SIZE + (y>>1) * (w>>1); + uint8_t *src1 = dst + PREAMBLE_SIZE + (y>>!!gdv->scale_h) * (w>>1); for (i = 0; i < w; i++) { int x = w - i - 1; dst1[x] = src1[(x>>1)]; @@ -97,16 +97,6 @@ static void rescale(GDVContext *gdv, uint8_t *dst, int w, int h, int scale_v, in uint8_t *src1 = dst + PREAMBLE_SIZE + (y>>1) * w; memcpy(dst1, src1, w); } - } else if (gdv->scale_v) { - for (j = 0; j < h; j++) { - int y = h - j - 1; - uint8_t *dst1 = dst + PREAMBLE_SIZE + y * w; - uint8_t *src1 = dst + PREAMBLE_SIZE + y * (w>>1); - for (i = 0; i < w; i++) { - int x = w - i - 1; - dst1[x] = src1[(x>>1)]; - } - } } if (scale_h && scale_v) { |