summaryrefslogtreecommitdiff
path: root/libavcodec/lossless_videodsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-20 22:21:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-20 23:02:58 +0100
commitd9779d648e82baf4b9b033443cb3105a2f003651 (patch)
tree05d2101309bacc30aa45ac20669a6a9d46dddb84 /libavcodec/lossless_videodsp.c
parent13c33c8e1f6876671cafa97865c2e4f6229c7df3 (diff)
downloadffmpeg-d9779d648e82baf4b9b033443cb3105a2f003651.tar.gz
Move sub_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.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/lossless_videodsp.c b/libavcodec/lossless_videodsp.c
index 8279901f1e..72eeb269ae 100644
--- a/libavcodec/lossless_videodsp.c
+++ b/libavcodec/lossless_videodsp.c
@@ -77,6 +77,24 @@ static void add_hfyu_median_prediction_int16_c(uint16_t *dst, const uint16_t *sr
*left_top = lt;
}
+static void sub_hfyu_median_prediction_int16_c(uint16_t *dst, const uint16_t *src1, const uint16_t *src2, 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++){
+ const int pred = mid_pred(l, src1[i], (l + src1[i] - lt) & mask);
+ lt = src1[i];
+ l = src2[i];
+ dst[i] = (l - pred) & mask;
+ }
+
+ *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;
@@ -103,6 +121,7 @@ void ff_llviddsp_init(LLVidDSPContext *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;
+ c->sub_hfyu_median_prediction_int16 = sub_hfyu_median_prediction_int16_c;
if (ARCH_X86)
ff_llviddsp_init_x86(c);