diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-04-27 18:34:24 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-25 13:57:00 +0200 |
commit | 85ddf3070c3240eae9bf076fde259daa91838081 (patch) | |
tree | e1e2d4d1d4a8a3d7f3fba0764fee8718f6fd21fa | |
parent | a4572825d8b772b3b74b602136e0b01c6f72e9fd (diff) |
cfhd: Simplify memcpy expressions
-rw-r--r-- | libavcodec/cfhd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 9a3bb38656..7e2dec1b27 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -480,8 +480,8 @@ static int read_lowpass_coeffs(AVCodecContext *avctx, CFHDContext *s, /* Copy last coefficients line if height is odd. */ if (lowpass_height & 1) { - memcpy(&coeff_data[lowpass_height * lowpass_width], - &coeff_data[(lowpass_height - 1) * lowpass_width], + int16_t *last_line = &coeff_data[lowpass_height * lowpass_width]; + memcpy(last_line, &last_line[-lowpass_width], lowpass_width * sizeof(*coeff_data)); } @@ -582,8 +582,8 @@ static int read_highpass_coeffs(AVCodecContext *avctx, CFHDContext *s, /* Copy last line of coefficients if height is odd. */ if (highpass_height & 1) { - memcpy(&coeff_data[ highpass_height * highpass_stride], - &coeff_data[(highpass_height - 1) * highpass_stride], + int16_t *last_line = &coeff_data[expected]; + memcpy(last_line, &last_line[-highpass_stride], highpass_stride * sizeof(*coeff_data)); } |