aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ivi_dsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-27 01:31:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-27 02:05:22 +0200
commit357168bcf63429e9472fb9fff1e1301f9514dca6 (patch)
tree04b94fe1d99e435cbe63d1b2ef06a728121f21e5 /libavcodec/ivi_dsp.c
parent826726b83fab660e45166bca476c4e91713c62aa (diff)
parent5ec6d152e26c570c0a16ec72c1f354db95708179 (diff)
downloadffmpeg-357168bcf63429e9472fb9fff1e1301f9514dca6.tar.gz
Merge commit '5ec6d152e26c570c0a16ec72c1f354db95708179'
* commit '5ec6d152e26c570c0a16ec72c1f354db95708179': indeo4: B-frames decoding Conflicts: libavcodec/ivi_common.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ivi_dsp.c')
-rw-r--r--libavcodec/ivi_dsp.c43
1 files changed, 37 insertions, 6 deletions
diff --git a/libavcodec/ivi_dsp.c b/libavcodec/ivi_dsp.c
index 9537cb0376..89121ac080 100644
--- a/libavcodec/ivi_dsp.c
+++ b/libavcodec/ivi_dsp.c
@@ -772,39 +772,66 @@ void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
}
#define IVI_MC_TEMPLATE(size, suffix, OP) \
-void ff_ivi_mc_ ## size ##x## size ## suffix (int16_t *buf, const int16_t *ref_buf, \
- uint32_t pitch, int mc_type) \
+static void ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, \
+ uint32_t dpitch, \
+ const int16_t *ref_buf, \
+ uint32_t pitch, int mc_type) \
{ \
int i, j; \
const int16_t *wptr; \
\
switch (mc_type) { \
case 0: /* fullpel (no interpolation) */ \
- for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) { \
+ for (i = 0; i < size; i++, buf += dpitch, ref_buf += pitch) { \
for (j = 0; j < size; j++) {\
OP(buf[j], ref_buf[j]); \
} \
} \
break; \
case 1: /* horizontal halfpel interpolation */ \
- for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) \
+ for (i = 0; i < size; i++, buf += dpitch, ref_buf += pitch) \
for (j = 0; j < size; j++) \
OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \
break; \
case 2: /* vertical halfpel interpolation */ \
wptr = ref_buf + pitch; \
- for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
+ for (i = 0; i < size; i++, buf += dpitch, wptr += pitch, ref_buf += pitch) \
for (j = 0; j < size; j++) \
OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \
break; \
case 3: /* vertical and horizontal halfpel interpolation */ \
wptr = ref_buf + pitch; \
- for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
+ for (i = 0; i < size; i++, buf += dpitch, wptr += pitch, ref_buf += pitch) \
for (j = 0; j < size; j++) \
OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
break; \
} \
} \
+\
+void ff_ivi_mc_ ## size ##x## size ## suffix(int16_t *buf, const int16_t *ref_buf, \
+ uint32_t pitch, int mc_type) \
+{ \
+ ivi_mc_ ## size ##x## size ## suffix(buf, pitch, ref_buf, pitch, mc_type); \
+} \
+
+#define IVI_MC_AVG_TEMPLATE(size, suffix, OP) \
+void ff_ivi_mc_avg_ ## size ##x## size ## suffix(int16_t *buf, \
+ const int16_t *ref_buf, \
+ const int16_t *ref_buf2, \
+ uint32_t pitch, \
+ int mc_type, int mc_type2) \
+{ \
+ int16_t tmp[size * size]; \
+ int i, j; \
+\
+ ivi_mc_ ## size ##x## size ## _no_delta(tmp, size, ref_buf, pitch, mc_type); \
+ ivi_mc_ ## size ##x## size ## _delta(tmp, size, ref_buf2, pitch, mc_type2); \
+ for (i = 0; i < size; i++, buf += pitch) { \
+ for (j = 0; j < size; j++) {\
+ OP(buf[j], tmp[i * size + j] >> 1); \
+ } \
+ } \
+} \
#define OP_PUT(a, b) (a) = (b)
#define OP_ADD(a, b) (a) += (b)
@@ -813,3 +840,7 @@ IVI_MC_TEMPLATE(8, _no_delta, OP_PUT)
IVI_MC_TEMPLATE(8, _delta, OP_ADD)
IVI_MC_TEMPLATE(4, _no_delta, OP_PUT)
IVI_MC_TEMPLATE(4, _delta, OP_ADD)
+IVI_MC_AVG_TEMPLATE(8, _no_delta, OP_PUT)
+IVI_MC_AVG_TEMPLATE(8, _delta, OP_ADD)
+IVI_MC_AVG_TEMPLATE(4, _no_delta, OP_PUT)
+IVI_MC_AVG_TEMPLATE(4, _delta, OP_ADD)