static void FUNC_NAME()

in Extended/libwebp/src/dsp/upsampling_msa.c [567:647]


static void FUNC_NAME(const uint8_t* top_y, const uint8_t* bot_y,        \
                      const uint8_t* top_u, const uint8_t* top_v,        \
                      const uint8_t* cur_u, const uint8_t* cur_v,        \
                      uint8_t* top_dst, uint8_t* bot_dst, int len)       \
{                                                                        \
  int size = (len - 1) >> 1;                                             \
  uint8_t temp_u[64];                                                    \
  uint8_t temp_v[64];                                                    \
  const uint32_t tl_uv = ((top_u[0]) | ((top_v[0]) << 16));              \
  const uint32_t l_uv = ((cur_u[0]) | ((cur_v[0]) << 16));               \
  const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2;            \
  const uint8_t* ptop_y = &top_y[1];                                     \
  uint8_t* ptop_dst = top_dst + XSTEP;                                   \
  const uint8_t* pbot_y = &bot_y[1];                                     \
  uint8_t* pbot_dst = bot_dst + XSTEP;                                   \
                                                                         \
  FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst);                      \
  if (bot_y != NULL) {                                                   \
    const uint32_t uv1 = (3 * l_uv + tl_uv + 0x00020002u) >> 2;          \
    FUNC(bot_y[0], uv1 & 0xff, (uv1 >> 16), bot_dst);                    \
  }                                                                      \
  while (size >= 16) {                                                   \
    v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1;                        \
    LD_UB2(top_u, 1, tu0, tu1);                                          \
    LD_UB2(cur_u, 1, cu0, cu1);                                          \
    LD_UB2(top_v, 1, tv0, tv1);                                          \
    LD_UB2(cur_v, 1, cv0, cv1);                                          \
    UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1);                               \
    UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1);                               \
    ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16);                          \
    ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16);                          \
    FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, 32);           \
    if (bot_y != NULL) {                                                 \
      FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, 32);        \
    }                                                                    \
    ptop_y   += 32;                                                      \
    pbot_y   += 32;                                                      \
    ptop_dst += XSTEP * 32;                                              \
    pbot_dst += XSTEP * 32;                                              \
    top_u    += 16;                                                      \
    top_v    += 16;                                                      \
    cur_u    += 16;                                                      \
    cur_v    += 16;                                                      \
    size     -= 16;                                                      \
  }                                                                      \
  if (size > 0) {                                                        \
    v16u8 tu0, tu1, tv0, tv1, cu0, cu1, cv0, cv1;                        \
    memcpy(&temp_u[ 0], top_u, 17 * sizeof(uint8_t));                    \
    memcpy(&temp_u[32], cur_u, 17 * sizeof(uint8_t));                    \
    memcpy(&temp_v[ 0], top_v, 17 * sizeof(uint8_t));                    \
    memcpy(&temp_v[32], cur_v, 17 * sizeof(uint8_t));                    \
    LD_UB2(&temp_u[ 0], 1, tu0, tu1);                                    \
    LD_UB2(&temp_u[32], 1, cu0, cu1);                                    \
    LD_UB2(&temp_v[ 0], 1, tv0, tv1);                                    \
    LD_UB2(&temp_v[32], 1, cv0, cv1);                                    \
    UPSAMPLE_32PIXELS(tu0, tu1, cu0, cu1);                               \
    UPSAMPLE_32PIXELS(tv0, tv1, cv0, cv1);                               \
    ST_UB4(tu0, tu1, cu0, cu1, &temp_u[0], 16);                          \
    ST_UB4(tv0, tv1, cv0, cv1, &temp_v[0], 16);                          \
    FUNC##Line(ptop_y, &temp_u[ 0], &temp_v[0], ptop_dst, size * 2);     \
    if (bot_y != NULL) {                                                 \
      FUNC##Line(pbot_y, &temp_u[32], &temp_v[32], pbot_dst, size * 2);  \
    }                                                                    \
    top_u += size;                                                       \
    top_v += size;                                                       \
    cur_u += size;                                                       \
    cur_v += size;                                                       \
  }                                                                      \
  if (!(len & 1)) {                                                      \
    const uint32_t t0 = ((top_u[0]) | ((top_v[0]) << 16));               \
    const uint32_t c0  = ((cur_u[0]) | ((cur_v[0]) << 16));              \
    const uint32_t tmp0 = (3 * t0 + c0 + 0x00020002u) >> 2;              \
    FUNC(top_y[len - 1], tmp0 & 0xff, (tmp0 >> 16),                      \
                top_dst + (len - 1) * XSTEP);                            \
    if (bot_y != NULL) {                                                 \
      const uint32_t tmp1 = (3 * c0 + t0 + 0x00020002u) >> 2;            \
      FUNC(bot_y[len - 1], tmp1 & 0xff, (tmp1 >> 16),                    \
           bot_dst + (len - 1) * XSTEP);                                 \
    }                                                                    \
  }                                                                      \
}