diff options
author | Paul B Mahol <onemda@gmail.com> | 2016-12-24 16:42:00 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-12-24 16:42:00 +0100 |
commit | 25c4035529c8033d4ec122c113274a9ff2746625 (patch) | |
tree | c61c699e62da1aaf612be78430db397de0788458 /libavcodec | |
parent | c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc (diff) | |
download | ffmpeg-25c4035529c8033d4ec122c113274a9ff2746625.tar.gz |
avcodec/pixlet: simplify lowpass_prediction() function
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pixlet.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 0f13b5bac9..c2583b10c7 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -343,21 +343,18 @@ static int read_highpass(AVCodecContext *avctx, uint8_t *ptr, int plane, AVFrame static void lowpass_prediction(int16_t *dst, int16_t *pred, int width, int height, ptrdiff_t stride) { - int16_t *next, val; + int16_t val; int i, j; memset(pred, 0, width * sizeof(*pred)); for (i = 0; i < height; i++) { - val = pred[0] + dst[0]; - dst[0] = val; - pred[0] = val; - next = dst + 2; - for (j = 1; j < width; j++, next++) { - val = pred[j] + next[-1]; - next[-1] = val; - pred[j] = val; - next[-1] += next[-2]; + val = pred[0] + dst[0]; + dst[0] = pred[0] = val; + for (j = 1; j < width; j++) { + val = pred[j] + dst[j]; + dst[j] = pred[j] = val; + dst[j] += dst[j-1]; } dst += stride; } |