diff options
author | Dirk Ausserhaus <dausserhaus@gmail.com> | 2014-06-08 13:44:17 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2014-06-26 19:17:33 +0200 |
commit | 5ec6d152e26c570c0a16ec72c1f354db95708179 (patch) | |
tree | 15bb4cb43131c00c87c2465e2e6e3d92ae74d730 /libavcodec/ivi_dsp.c | |
parent | 422e14f721c22cf9c19a8e7aae051ba9d559f6b6 (diff) | |
download | ffmpeg-5ec6d152e26c570c0a16ec72c1f354db95708179.tar.gz |
indeo4: B-frames decoding
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec/ivi_dsp.c')
-rw-r--r-- | libavcodec/ivi_dsp.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/libavcodec/ivi_dsp.c b/libavcodec/ivi_dsp.c index bd1f523f3e..ecc49b39bc 100644 --- a/libavcodec/ivi_dsp.c +++ b/libavcodec/ivi_dsp.c @@ -762,39 +762,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) @@ -803,3 +830,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) |