static void vertical_compose_dd137iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, int width) { int i; for(i=0; i<width; i++){ b2[i] = COMPOSE_DD137iL0(b0[i], b1[i], b2[i], b3[i], b4[i]); } }
static void horizontal_compose_dd137i(IDWTELEM *b, IDWTELEM *tmp, int w) { const int w2 = w >> 1; int x; tmp[0] = COMPOSE_DD137iL0(b[w2], b[w2], b[0], b[w2 ], b[w2+1]); tmp[1] = COMPOSE_DD137iL0(b[w2], b[w2], b[1], b[w2+1], b[w2+2]); for (x = 2; x < w2-1; x++) tmp[x] = COMPOSE_DD137iL0(b[x+w2-2], b[x+w2-1], b[x], b[x+w2], b[x+w2+1]); tmp[w2-1] = COMPOSE_DD137iL0(b[w-3], b[w-2], b[w2-1], b[w-1], b[w-1]); // extend the edges tmp[-1] = tmp[0]; tmp[w2+1] = tmp[w2] = tmp[w2-1]; for (x = 0; x < w2; x++) { b[2*x ] = (tmp[x] + 1)>>1; b[2*x+1] = (COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1; } }
static void RENAME(vertical_compose_dd137iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, uint8_t *_b3, uint8_t *_b4, int width) { int i; TYPE *b0 = (TYPE *)_b0; TYPE *b1 = (TYPE *)_b1; TYPE *b2 = (TYPE *)_b2; TYPE *b3 = (TYPE *)_b3; TYPE *b4 = (TYPE *)_b4; for(i=0; i<width; i++){ b2[i] = COMPOSE_DD137iL0(b0[i], b1[i], b2[i], b3[i], b4[i]); } }
static void RENAME(horizontal_compose_dd137i)(uint8_t *_b, uint8_t *_tmp, int w) { const int w2 = w >> 1; int x; TYPE *b = (TYPE *)_b; TYPE *tmp = (TYPE *)_tmp; tmp[0] = COMPOSE_DD137iL0(b[w2], b[w2], b[0], b[w2 ], b[w2+1]); tmp[1] = COMPOSE_DD137iL0(b[w2], b[w2], b[1], b[w2+1], b[w2+2]); for (x = 2; x < w2-1; x++) tmp[x] = COMPOSE_DD137iL0(b[x+w2-2], b[x+w2-1], b[x], b[x+w2], b[x+w2+1]); tmp[w2-1] = COMPOSE_DD137iL0(b[w-3], b[w-2], b[w2-1], b[w-1], b[w-1]); // extend the edges tmp[-1] = tmp[0]; tmp[w2+1] = tmp[w2] = tmp[w2-1]; for (x = 0; x < w2; x++) { b[2*x ] = (tmp[x] + 1)>>1; b[2*x+1] = (COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1; } }