static inline imgpel filter_safe_positions( const ImgProcessFilter1D *flt, const imgpel *p_in )
{
  const short *c_coef = flt->coef1;
  int htap = flt->c_tap;
  const imgpel *p1 = p_in - flt->c_taps_div2;// + 1; //bug;

  int val = 0, k;

  for (k = 0; k < htap ; k++)
  { 
    val += *(p1++) * *(c_coef++);
  }
  return (imgpel)iClip1( flt->max_pel_value, shift_off_sf( val, flt->c_offset, flt->c_normal1 ) );
}
static inline imgpel filter_even_unsafe_right_positions( const ImgProcessFilter1D *flt, const imgpel *p_in, int right_samples  )
{
  const short *c_coef = flt->coef1;
  int hmin = -flt->c_taps_div2;
  int hmax = flt->c_tap + hmin;
  const imgpel *p1 = p_in - flt->c_taps_div2 -1;

  int val = 0, k;

  for (k = hmin; k < right_samples ; k++)
  { 
    val +=  *(++p1) * *(c_coef++);
  }
  for (k = right_samples; k < hmax ; k++)
  { 
    val += *p1 * *(c_coef++);
  }
  return (imgpel)iClip1( flt->max_pel_value, shift_off_sf( val, flt->c_offset, flt->c_normal1 ) );
}
Beispiel #3
0
static inline imgpel filter_unsafe_down_positions( const ImgProcessFilter1D *flt, const imgpel *p_in, int down_samples, int stride_in_imgpel  )
{
  const short *c_coef = flt->coef1;
  int hmin = -flt->c_taps_div2;// + 1;
  int hmax = flt->c_tap + hmin;
  const imgpel *p1 = p_in - (flt->c_taps_div2 +1)*stride_in_imgpel;

  int val = 0, k;

  for (k = hmin; k <= down_samples ; k++)
  { 
    p1 += stride_in_imgpel;
    val +=  *p1 * *(c_coef++);
  }
  for (k = down_samples + 1; k < hmax ; k++)
  { 
    val += *p1 * *(c_coef++);
  }
  return (imgpel)iClip1( flt->max_pel_value, shift_off_sf( val, flt->c_offset, flt->c_normal1 ) );
}