diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 22:21:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-20 22:25:45 +0100 |
commit | 13c33c8e1f6876671cafa97865c2e4f6229c7df3 (patch) | |
tree | c22da5d8aebfd518a1c9724a6d52255f181a4818 /libavcodec/lossless_videodsp.c | |
parent | 883570e6b70ae4d1413d2d2f552687d80b32e1e5 (diff) | |
download | ffmpeg-13c33c8e1f6876671cafa97865c2e4f6229c7df3.tar.gz |
Move add_hfyu_median_prediction_int16() to losslessviddsp
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/lossless_videodsp.c')
-rw-r--r-- | libavcodec/lossless_videodsp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/lossless_videodsp.c b/libavcodec/lossless_videodsp.c index e494072ae3..8279901f1e 100644 --- a/libavcodec/lossless_videodsp.c +++ b/libavcodec/lossless_videodsp.c @@ -19,6 +19,7 @@ */ #include "avcodec.h" #include "lossless_videodsp.h" +#include "libavcodec/mathops.h" static void add_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w){ long i; @@ -59,6 +60,23 @@ static void diff_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *sr dst[i] = (src1[i] - src2[i]) & mask; } +static void add_hfyu_median_prediction_int16_c(uint16_t *dst, const uint16_t *src, const uint16_t *diff, unsigned mask, int w, int *left, int *left_top){ + int i; + uint16_t l, lt; + + l = *left; + lt = *left_top; + + for(i=0; i<w; i++){ + l = (mid_pred(l, src[i], (l + src[i] - lt) & mask) + diff[i]) & mask; + lt = src[i]; + dst[i] = l; + } + + *left = l; + *left_top = lt; +} + static int add_hfyu_left_prediction_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w, int acc){ int i; @@ -84,6 +102,7 @@ void ff_llviddsp_init(LLVidDSPContext *c) c->add_int16 = add_int16_c; c->diff_int16= diff_int16_c; c->add_hfyu_left_prediction_int16 = add_hfyu_left_prediction_int16_c; + c->add_hfyu_median_prediction_int16 = add_hfyu_median_prediction_int16_c; if (ARCH_X86) ff_llviddsp_init_x86(c); |