示例#1
0
PyObject* ClearParams( void ) {
    PyObject *OutObj = NULL;
    
    if (!CleanupParams(gIData)) {
        OutObj = Py_BuildValue("(i)", 0);
        assert(OutObj);
    } else {
        OutObj = Py_BuildValue("(i)", 1);
        assert(OutObj);
    }
    
    return OutObj;
}
int CleanupAll(AutoData *Data) {
    int result = 1;
    
    if (Data != NULL) {
        result = result && (CleanupParams(Data));
        result = result && (CleanupSolution(Data));
        result = result && (CleanupSpecialPoints(Data));
        
        FREE(Data);
        Data = NULL;
    }
    
    return result;
}
示例#3
0
int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride,
                         int strength) {
  const int radius = 4 * strength / 100;
  if (strength < 0 || strength > 100) return 0;
  if (data == NULL || width <= 0 || height <= 0) return 0;  // bad params
  if (radius > 0) {
    SmoothParams p;
    memset(&p, 0, sizeof(p));
    if (!InitParams(data, width, height, stride, radius, &p)) return 0;
    if (p.num_levels_ > 2) {
      for (; p.row_ < p.height_; ++p.row_) {
        VFilter(&p);  // accumulate average of input
        // Need to wait few rows in order to prime the filter,
        // before emitting some output.
        if (p.row_ >= p.radius_) {
          HFilter(&p);
          ApplyFilter(&p);
        }
      }
    }
    CleanupParams(&p);
  }
  return 1;
}