00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00029 #include "avcodec.h"
00030 #include "dsputil.h"
00031 #include "dwt.h"
00032 #include "ivi_common.h"
00033 #include "ivi_dsp.h"
00034
00035 void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
00036 const int dst_pitch)
00037 {
00038 int x, y, indx;
00039 int32_t p0, p1, p2, p3, tmp0, tmp1, tmp2;
00040 int32_t b0_1, b0_2, b1_1, b1_2, b1_3, b2_1, b2_2, b2_3, b2_4, b2_5, b2_6;
00041 int32_t b3_1, b3_2, b3_3, b3_4, b3_5, b3_6, b3_7, b3_8, b3_9;
00042 int32_t pitch, back_pitch;
00043 const IDWTELEM *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
00044 const int num_bands = 4;
00045
00046
00047 pitch = plane->bands[0].pitch;
00048
00049
00050 back_pitch = 0;
00051
00052
00053 b0_ptr = plane->bands[0].buf;
00054 b1_ptr = plane->bands[1].buf;
00055 b2_ptr = plane->bands[2].buf;
00056 b3_ptr = plane->bands[3].buf;
00057
00058 for (y = 0; y < plane->height; y += 2) {
00059
00060 if (y+2 >= plane->height)
00061 pitch= 0;
00062
00063 if (num_bands > 0) {
00064 b0_1 = b0_ptr[0];
00065 b0_2 = b0_ptr[pitch];
00066 }
00067
00068 if (num_bands > 1) {
00069 b1_1 = b1_ptr[back_pitch];
00070 b1_2 = b1_ptr[0];
00071 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch];
00072 }
00073
00074 if (num_bands > 2) {
00075 b2_2 = b2_ptr[0];
00076 b2_3 = b2_2;
00077 b2_5 = b2_ptr[pitch];
00078 b2_6 = b2_5;
00079 }
00080
00081 if (num_bands > 3) {
00082 b3_2 = b3_ptr[back_pitch];
00083 b3_3 = b3_2;
00084 b3_5 = b3_ptr[0];
00085 b3_6 = b3_5;
00086 b3_8 = b3_2 - b3_5*6 + b3_ptr[pitch];
00087 b3_9 = b3_8;
00088 }
00089
00090 for (x = 0, indx = 0; x < plane->width; x+=2, indx++) {
00091 if (x+2 >= plane->width) {
00092 b0_ptr --;
00093 b1_ptr --;
00094 b2_ptr --;
00095 b3_ptr --;
00096 }
00097
00098
00099
00100 b2_1 = b2_2;
00101 b2_2 = b2_3;
00102 b2_4 = b2_5;
00103 b2_5 = b2_6;
00104 b3_1 = b3_2;
00105 b3_2 = b3_3;
00106 b3_4 = b3_5;
00107 b3_5 = b3_6;
00108 b3_7 = b3_8;
00109 b3_8 = b3_9;
00110
00111 p0 = p1 = p2 = p3 = 0;
00112
00113
00114 if (num_bands > 0) {
00115 tmp0 = b0_1;
00116 tmp2 = b0_2;
00117 b0_1 = b0_ptr[indx+1];
00118 b0_2 = b0_ptr[pitch+indx+1];
00119 tmp1 = tmp0 + b0_1;
00120
00121 p0 = tmp0 << 4;
00122 p1 = tmp1 << 3;
00123 p2 = (tmp0 + tmp2) << 3;
00124 p3 = (tmp1 + tmp2 + b0_2) << 2;
00125 }
00126
00127
00128 if (num_bands > 1) {
00129 tmp0 = b1_2;
00130 tmp1 = b1_1;
00131 b1_2 = b1_ptr[indx+1];
00132 b1_1 = b1_ptr[back_pitch+indx+1];
00133
00134 tmp2 = tmp1 - tmp0*6 + b1_3;
00135 b1_3 = b1_1 - b1_2*6 + b1_ptr[pitch+indx+1];
00136
00137 p0 += (tmp0 + tmp1) << 3;
00138 p1 += (tmp0 + tmp1 + b1_1 + b1_2) << 2;
00139 p2 += tmp2 << 2;
00140 p3 += (tmp2 + b1_3) << 1;
00141 }
00142
00143
00144 if (num_bands > 2) {
00145 b2_3 = b2_ptr[indx+1];
00146 b2_6 = b2_ptr[pitch+indx+1];
00147
00148 tmp0 = b2_1 + b2_2;
00149 tmp1 = b2_1 - b2_2*6 + b2_3;
00150
00151 p0 += tmp0 << 3;
00152 p1 += tmp1 << 2;
00153 p2 += (tmp0 + b2_4 + b2_5) << 2;
00154 p3 += (tmp1 + b2_4 - b2_5*6 + b2_6) << 1;
00155 }
00156
00157
00158 if (num_bands > 3) {
00159 b3_6 = b3_ptr[indx+1];
00160 b3_3 = b3_ptr[back_pitch+indx+1];
00161
00162 tmp0 = b3_1 + b3_4;
00163 tmp1 = b3_2 + b3_5;
00164 tmp2 = b3_3 + b3_6;
00165
00166 b3_9 = b3_3 - b3_6*6 + b3_ptr[pitch+indx+1];
00167
00168 p0 += (tmp0 + tmp1) << 2;
00169 p1 += (tmp0 - tmp1*6 + tmp2) << 1;
00170 p2 += (b3_7 + b3_8) << 1;
00171 p3 += b3_7 - b3_8*6 + b3_9;
00172 }
00173
00174
00175 dst[x] = av_clip_uint8((p0 >> 6) + 128);
00176 dst[x+1] = av_clip_uint8((p1 >> 6) + 128);
00177 dst[dst_pitch+x] = av_clip_uint8((p2 >> 6) + 128);
00178 dst[dst_pitch+x+1] = av_clip_uint8((p3 >> 6) + 128);
00179 }
00180
00181 dst += dst_pitch << 1;
00182
00183 back_pitch = -pitch;
00184
00185 b0_ptr += pitch + 1;
00186 b1_ptr += pitch + 1;
00187 b2_ptr += pitch + 1;
00188 b3_ptr += pitch + 1;
00189 }
00190 }
00191
00192 void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
00193 const int dst_pitch)
00194 {
00195 int x, y, indx, b0, b1, b2, b3, p0, p1, p2, p3;
00196 const IDWTELEM *b0_ptr, *b1_ptr, *b2_ptr, *b3_ptr;
00197 int32_t pitch;
00198
00199
00200 pitch = plane->bands[0].pitch;
00201
00202
00203 b0_ptr = plane->bands[0].buf;
00204 b1_ptr = plane->bands[1].buf;
00205 b2_ptr = plane->bands[2].buf;
00206 b3_ptr = plane->bands[3].buf;
00207
00208 for (y = 0; y < plane->height; y += 2) {
00209 for (x = 0, indx = 0; x < plane->width; x += 2, indx++) {
00210
00211 b0 = b0_ptr[indx];
00212 b1 = b1_ptr[indx];
00213 b2 = b2_ptr[indx];
00214 b3 = b3_ptr[indx];
00215
00216
00217 p0 = (b0 + b1 + b2 + b3 + 2) >> 2;
00218 p1 = (b0 + b1 - b2 - b3 + 2) >> 2;
00219 p2 = (b0 - b1 + b2 - b3 + 2) >> 2;
00220 p3 = (b0 - b1 - b2 + b3 + 2) >> 2;
00221
00222
00223 dst[x] = av_clip_uint8(p0 + 128);
00224 dst[x + 1] = av_clip_uint8(p1 + 128);
00225 dst[dst_pitch + x] = av_clip_uint8(p2 + 128);
00226 dst[dst_pitch + x + 1] = av_clip_uint8(p3 + 128);
00227 }
00228
00229 dst += dst_pitch << 1;
00230
00231 b0_ptr += pitch;
00232 b1_ptr += pitch;
00233 b2_ptr += pitch;
00234 b3_ptr += pitch;
00235 }
00236 }
00237
00239 #define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
00240 t = (s1 - s2) >> 1;\
00241 o1 = (s1 + s2) >> 1;\
00242 o2 = t;\
00243
00244
00245 #define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
00246 d1, d2, d3, d4, d5, d6, d7, d8,\
00247 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
00248 t1 = s1 << 1; t5 = s5 << 1;\
00249 IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
00250 IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
00251 IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
00252 IVI_HAAR_BFLY(t7, s8, t7, t8, t0);\
00253 d1 = COMPENSATE(t1);\
00254 d2 = COMPENSATE(t2);\
00255 d3 = COMPENSATE(t3);\
00256 d4 = COMPENSATE(t4);\
00257 d5 = COMPENSATE(t5);\
00258 d6 = COMPENSATE(t6);\
00259 d7 = COMPENSATE(t7);\
00260 d8 = COMPENSATE(t8); }
00261
00263 #define INV_HAAR4(s1, s3, s5, s7) {\
00264 HAAR_BFLY(s1, s5); HAAR_BFLY(s1, s3); HAAR_BFLY(s5, s7);\
00265 s1 = COMPENSATE(s1);\
00266 s3 = COMPENSATE(s3);\
00267 s5 = COMPENSATE(s5);\
00268 s7 = COMPENSATE(s7); }
00269
00270 void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
00271 const uint8_t *flags)
00272 {
00273 int i, shift, sp1, sp2, sp3, sp4;
00274 const int32_t *src;
00275 int32_t *dst;
00276 int tmp[64];
00277 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
00278
00279
00280 #define COMPENSATE(x) (x)
00281 src = in;
00282 dst = tmp;
00283 for (i = 0; i < 8; i++) {
00284 if (flags[i]) {
00285
00286 shift = !(i & 4);
00287 sp1 = src[ 0] << shift;
00288 sp2 = src[ 8] << shift;
00289 sp3 = src[16] << shift;
00290 sp4 = src[24] << shift;
00291 INV_HAAR8( sp1, sp2, sp3, sp4,
00292 src[32], src[40], src[48], src[56],
00293 dst[ 0], dst[ 8], dst[16], dst[24],
00294 dst[32], dst[40], dst[48], dst[56],
00295 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00296 } else
00297 dst[ 0] = dst[ 8] = dst[16] = dst[24] =
00298 dst[32] = dst[40] = dst[48] = dst[56] = 0;
00299
00300 src++;
00301 dst++;
00302 }
00303 #undef COMPENSATE
00304
00305
00306 #define COMPENSATE(x) (x)
00307 src = tmp;
00308 for (i = 0; i < 8; i++) {
00309 if ( !src[0] && !src[1] && !src[2] && !src[3]
00310 && !src[4] && !src[5] && !src[6] && !src[7]) {
00311 memset(out, 0, 8 * sizeof(out[0]));
00312 } else {
00313 INV_HAAR8(src[0], src[1], src[2], src[3],
00314 src[4], src[5], src[6], src[7],
00315 out[0], out[1], out[2], out[3],
00316 out[4], out[5], out[6], out[7],
00317 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00318 }
00319 src += 8;
00320 out += pitch;
00321 }
00322 #undef COMPENSATE
00323 }
00324
00325 void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
00326 int blk_size)
00327 {
00328 int x, y;
00329 int16_t dc_coeff;
00330
00331 dc_coeff = (*in + 0) >> 3;
00332
00333 for (y = 0; y < blk_size; out += pitch, y++) {
00334 for (x = 0; x < blk_size; x++)
00335 out[x] = dc_coeff;
00336 }
00337 }
00338
00340 #define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
00341 t = s1 - s2;\
00342 o1 = s1 + s2;\
00343 o2 = t;\
00344
00345
00346 #define IVI_IREFLECT(s1, s2, o1, o2, t) \
00347 t = ((s1 + s2*2 + 2) >> 2) + s1;\
00348 o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
00349 o1 = t;\
00350
00351
00352 #define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
00353 t = s2 + ((s1*4 - s2 + 4) >> 3);\
00354 o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
00355 o1 = t;\
00356
00357
00358 #define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
00359 d1, d2, d3, d4, d5, d6, d7, d8,\
00360 t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
00361 IVI_SLANT_PART4(s4, s5, t4, t5, t0);\
00362 \
00363 IVI_SLANT_BFLY(s1, t5, t1, t5, t0); IVI_SLANT_BFLY(s2, s6, t2, t6, t0);\
00364 IVI_SLANT_BFLY(s7, s3, t7, t3, t0); IVI_SLANT_BFLY(t4, s8, t4, t8, t0);\
00365 \
00366 IVI_SLANT_BFLY(t1, t2, t1, t2, t0); IVI_IREFLECT (t4, t3, t4, t3, t0);\
00367 IVI_SLANT_BFLY(t5, t6, t5, t6, t0); IVI_IREFLECT (t8, t7, t8, t7, t0);\
00368 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
00369 IVI_SLANT_BFLY(t5, t8, t5, t8, t0); IVI_SLANT_BFLY(t6, t7, t6, t7, t0);\
00370 d1 = COMPENSATE(t1);\
00371 d2 = COMPENSATE(t2);\
00372 d3 = COMPENSATE(t3);\
00373 d4 = COMPENSATE(t4);\
00374 d5 = COMPENSATE(t5);\
00375 d6 = COMPENSATE(t6);\
00376 d7 = COMPENSATE(t7);\
00377 d8 = COMPENSATE(t8);}
00378
00380 #define IVI_INV_SLANT4(s1, s4, s2, s3, d1, d2, d3, d4, t0, t1, t2, t3, t4) {\
00381 IVI_SLANT_BFLY(s1, s2, t1, t2, t0); IVI_IREFLECT (s4, s3, t4, t3, t0);\
00382 \
00383 IVI_SLANT_BFLY(t1, t4, t1, t4, t0); IVI_SLANT_BFLY(t2, t3, t2, t3, t0);\
00384 d1 = COMPENSATE(t1);\
00385 d2 = COMPENSATE(t2);\
00386 d3 = COMPENSATE(t3);\
00387 d4 = COMPENSATE(t4);}
00388
00389 void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
00390 {
00391 int i;
00392 const int32_t *src;
00393 int32_t *dst;
00394 int tmp[64];
00395 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
00396
00397 #define COMPENSATE(x) (x)
00398 src = in;
00399 dst = tmp;
00400 for (i = 0; i < 8; i++) {
00401 if (flags[i]) {
00402 IVI_INV_SLANT8(src[0], src[8], src[16], src[24], src[32], src[40], src[48], src[56],
00403 dst[0], dst[8], dst[16], dst[24], dst[32], dst[40], dst[48], dst[56],
00404 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00405 } else
00406 dst[0] = dst[8] = dst[16] = dst[24] = dst[32] = dst[40] = dst[48] = dst[56] = 0;
00407
00408 src++;
00409 dst++;
00410 }
00411 #undef COMPENSATE
00412
00413 #define COMPENSATE(x) ((x + 1)>>1)
00414 src = tmp;
00415 for (i = 0; i < 8; i++) {
00416 if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
00417 memset(out, 0, 8*sizeof(out[0]));
00418 } else {
00419 IVI_INV_SLANT8(src[0], src[1], src[2], src[3], src[4], src[5], src[6], src[7],
00420 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
00421 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00422 }
00423 src += 8;
00424 out += pitch;
00425 }
00426 #undef COMPENSATE
00427 }
00428
00429 void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
00430 {
00431 int i;
00432 const int32_t *src;
00433 int32_t *dst;
00434 int tmp[16];
00435 int t0, t1, t2, t3, t4;
00436
00437 #define COMPENSATE(x) (x)
00438 src = in;
00439 dst = tmp;
00440 for (i = 0; i < 4; i++) {
00441 if (flags[i]) {
00442 IVI_INV_SLANT4(src[0], src[4], src[8], src[12],
00443 dst[0], dst[4], dst[8], dst[12],
00444 t0, t1, t2, t3, t4);
00445 } else
00446 dst[0] = dst[4] = dst[8] = dst[12] = 0;
00447
00448 src++;
00449 dst++;
00450 }
00451 #undef COMPENSATE
00452
00453 #define COMPENSATE(x) ((x + 1)>>1)
00454 src = tmp;
00455 for (i = 0; i < 4; i++) {
00456 if (!src[0] && !src[1] && !src[2] && !src[3]) {
00457 out[0] = out[1] = out[2] = out[3] = 0;
00458 } else {
00459 IVI_INV_SLANT4(src[0], src[1], src[2], src[3],
00460 out[0], out[1], out[2], out[3],
00461 t0, t1, t2, t3, t4);
00462 }
00463 src += 4;
00464 out += pitch;
00465 }
00466 #undef COMPENSATE
00467 }
00468
00469 void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
00470 {
00471 int x, y;
00472 int16_t dc_coeff;
00473
00474 dc_coeff = (*in + 1) >> 1;
00475
00476 for (y = 0; y < blk_size; out += pitch, y++) {
00477 for (x = 0; x < blk_size; x++)
00478 out[x] = dc_coeff;
00479 }
00480 }
00481
00482 void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
00483 {
00484 int i;
00485 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
00486
00487 #define COMPENSATE(x) ((x + 1)>>1)
00488 for (i = 0; i < 8; i++) {
00489 if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
00490 memset(out, 0, 8*sizeof(out[0]));
00491 } else {
00492 IVI_INV_SLANT8( in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
00493 out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
00494 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00495 }
00496 in += 8;
00497 out += pitch;
00498 }
00499 #undef COMPENSATE
00500 }
00501
00502 void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
00503 {
00504 int x, y;
00505 int16_t dc_coeff;
00506
00507 dc_coeff = (*in + 1) >> 1;
00508
00509 for (x = 0; x < blk_size; x++)
00510 out[x] = dc_coeff;
00511
00512 out += pitch;
00513
00514 for (y = 1; y < blk_size; out += pitch, y++) {
00515 for (x = 0; x < blk_size; x++)
00516 out[x] = 0;
00517 }
00518 }
00519
00520 void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
00521 {
00522 int i, row2, row4, row8;
00523 int t0, t1, t2, t3, t4, t5, t6, t7, t8;
00524
00525 row2 = pitch << 1;
00526 row4 = pitch << 2;
00527 row8 = pitch << 3;
00528
00529 #define COMPENSATE(x) ((x + 1)>>1)
00530 for (i = 0; i < 8; i++) {
00531 if (flags[i]) {
00532 IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
00533 out[0], out[pitch], out[row2], out[row2 + pitch], out[row4],
00534 out[row4 + pitch], out[row4 + row2], out[row8 - pitch],
00535 t0, t1, t2, t3, t4, t5, t6, t7, t8);
00536 } else {
00537 out[0] = out[pitch] = out[row2] = out[row2 + pitch] = out[row4] =
00538 out[row4 + pitch] = out[row4 + row2] = out[row8 - pitch] = 0;
00539 }
00540
00541 in++;
00542 out++;
00543 }
00544 #undef COMPENSATE
00545 }
00546
00547 void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
00548 {
00549 int x, y;
00550 int16_t dc_coeff;
00551
00552 dc_coeff = (*in + 1) >> 1;
00553
00554 for (y = 0; y < blk_size; out += pitch, y++) {
00555 out[0] = dc_coeff;
00556 for (x = 1; x < blk_size; x++)
00557 out[x] = 0;
00558 }
00559 }
00560
00561 void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
00562 const uint8_t *flags)
00563 {
00564 int x, y;
00565
00566 for (y = 0; y < 8; out += pitch, in += 8, y++)
00567 for (x = 0; x < 8; x++)
00568 out[x] = in[x];
00569 }
00570
00571 void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
00572 int blk_size)
00573 {
00574 int y;
00575
00576 out[0] = in[0];
00577 memset(out + 1, 0, 7*sizeof(out[0]));
00578 out += pitch;
00579
00580 for (y = 1; y < 8; out += pitch, y++)
00581 memset(out, 0, 8*sizeof(out[0]));
00582 }
00583
00584 #define IVI_MC_TEMPLATE(size, suffix, OP) \
00585 void ff_ivi_mc_ ## size ##x## size ## suffix (int16_t *buf, const int16_t *ref_buf, \
00586 uint32_t pitch, int mc_type) \
00587 { \
00588 int i, j; \
00589 const int16_t *wptr; \
00590 \
00591 switch (mc_type) { \
00592 case 0: \
00593 for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) { \
00594 for (j = 0; j < size; j++) {\
00595 OP(buf[j], ref_buf[j]); \
00596 } \
00597 } \
00598 break; \
00599 case 1: \
00600 for (i = 0; i < size; i++, buf += pitch, ref_buf += pitch) \
00601 for (j = 0; j < size; j++) \
00602 OP(buf[j], (ref_buf[j] + ref_buf[j+1]) >> 1); \
00603 break; \
00604 case 2: \
00605 wptr = ref_buf + pitch; \
00606 for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
00607 for (j = 0; j < size; j++) \
00608 OP(buf[j], (ref_buf[j] + wptr[j]) >> 1); \
00609 break; \
00610 case 3: \
00611 wptr = ref_buf + pitch; \
00612 for (i = 0; i < size; i++, buf += pitch, wptr += pitch, ref_buf += pitch) \
00613 for (j = 0; j < size; j++) \
00614 OP(buf[j], (ref_buf[j] + ref_buf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
00615 break; \
00616 } \
00617 } \
00618
00619 #define OP_PUT(a, b) (a) = (b)
00620 #define OP_ADD(a, b) (a) += (b)
00621
00622 IVI_MC_TEMPLATE(8, _no_delta, OP_PUT)
00623 IVI_MC_TEMPLATE(8, _delta, OP_ADD)
00624 IVI_MC_TEMPLATE(4, _no_delta, OP_PUT)
00625 IVI_MC_TEMPLATE(4, _delta, OP_ADD)