## Other Function Classes

Other Function Classes — Other Function Classes

##

# Synopsis

    void        oil_clip_f32                    (float *dest,
                                                 int dstr,
                                                 const float *src,
                                                 int sstr,
                                                 int n,
                                                 const float *s2_1,
                                                 const float *s3_1);
    void        oil_clip_f64                    (double *dest,
                                                 int dstr,
                                                 const double *src,
                                                 int sstr,
                                                 int n,
                                                 const double *s2_1,
                                                 const double *s3_1);
    void        oil_clip_s16                    (int16_t *dest,
                                                 int dstr,
                                                 const int16_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int16_t *s2_1,
                                                 const int16_t *s3_1);
    void        oil_clip_s32                    (int32_t *dest,
                                                 int dstr,
                                                 const int32_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int32_t *s2_1,
                                                 const int32_t *s3_1);
    void        oil_clip_s8                     (int8_t *dest,
                                                 int dstr,
                                                 const int8_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int8_t *s2_1,
                                                 const int8_t *s3_1);
    void        oil_clip_u16                    (uint16_t *dest,
                                                 int dstr,
                                                 const uint16_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint16_t *s2_1,
                                                 const uint16_t *s3_1);
    void        oil_clip_u32                    (uint32_t *dest,
                                                 int dstr,
                                                 const uint32_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint32_t *s2_1,
                                                 const uint32_t *s3_1);
    void        oil_clip_u8                     (uint8_t *dest,
                                                 int dstr,
                                                 const uint8_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint8_t *s2_1,
                                                 const uint8_t *s3_1);
    void        oil_dequantize8x8_s16           (int16_t *d_8x8,
                                                 int dstr,
                                                 const int16_t *s1_8x8,
                                                 int sstr1,
                                                 const int16_t *s2_8x8,
                                                 int sstr2);
    void        oil_diffsquaresum_f64           (double *d_1,
                                                 const double *src1,
                                                 int sstr1,
                                                 const double *src2,
                                                 int sstr2,
                                                 int n);
    void        oil_md5                         (uint32_t *i_4,
                                                 const uint32_t *s_16);
    void        oil_mix_u8                      (uint8_t *dest,
                                                 const uint8_t *src1,
                                                 const uint8_t *src2,
                                                 const uint8_t *src3,
                                                 int n);
    void        oil_null                        ();
    void        oil_scanlinescale2_u8           (uint8_t *dest,
                                                 const uint8_t *src,
                                                 int n);
    void        oil_sincos_f64                  (double *dest1,
                                                 double *dest2,
                                                 int n,
                                                 const double *s1_1,
                                                 const double *s2_1);
    void        oil_utf8_validate               (int32_t *d_1,
                                                 const uint8_t *s,
                                                 int n);
    void        oil_diff8x8_s16_u8              (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);
    void        oil_diff8x8_average_s16_u8      (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2,
                                                 const uint8_t *s3_8x8,
                                                 int ss3);
    void        oil_err_inter8x8_u8_avg         (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 const uint8_t *s3_8x8,
                                                 int ss2);
    void        oil_recon8x8_inter              (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const int16_t *s2_8x8);
    void        oil_err_intra8x8_u8             (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1);
    void        oil_recon8x8_intra              (uint8_t *d_8x8,
                                                 int ds,
                                                 const int16_t *s_8x8);
    void        oil_colsad8x8_u8                (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);
    void        oil_composite_over_u8           (uint8_t *i_n,
                                                 const uint8_t *s1_n,
                                                 int n);
    void        oil_diff8x8_const128_s16_u8     (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1);
    void        oil_copy8x8_u8                  (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s_8x8,
                                                 int ss);
    void        oil_err_inter8x8_u8             (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);
    void        oil_fdct8x8theora               (const int16_t *s_8x8,
                                                 int16_t *d_8x8);
    void        oil_rowsad8x8_u8                (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 const uint8_t *s2_8x8);
    void        oil_recon8x8_inter2             (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2,
                                                 const int16_t *s3_8x8);
    void        oil_composite_add_u8            (uint8_t *i_n,
                                                 const uint8_t *s1_n,
                                                 int n);
    void        oil_sad8x8_u8_avg               (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 const uint8_t *s3_8x8,
                                                 int ss2);

## Description

Functions operate on arrays of data. The arrays can be either source arrays (input only), destination arrays (output only), or in-place arrays (both input and output).

The interpretation of a parameter can usually be determined from its name. Parameters for arrays are of the form d1_1xn, where the first character represents the direction (source, destination, or in-place), the second represents the index for that particular direction, and the characters after the underscore indicate the size of the array. In this case, "1xn" represents an array that is 1 by N. Note that the index and the size can both be omitted, giving a default of 1 for the index and 1xn for the size.

Parameters that represent strides are of the form "d1s". The interpretation is similar to above, except that the s indicates a stride parameter.

The exceptions to the above rule are "dest", "src", "dstr", "sstr", etc. These are aliases for "d1", "s1", "d1s", and "s1s", respectively. This form is deprecated and will be removed in the 0.4 series.

Two special parameters are "n" and "m", which determine the size of the arrays in other parameters.

Data arrays are laid out such that rows are separated by the number of bytes given by the corresponding stride. Elements in each row are contiguous. If there is no stride parameter corresponding to an array, the rows of the array are contiguous.

## Details

### oil_clip_f32 ()

    void        oil_clip_f32                    (float *dest,
                                                 int dstr,
                                                 const float *src,
                                                 int sstr,
                                                 int n,
                                                 const float *s2_1,
                                                 const float *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minumum
`s3_1` : | maximum

### oil_clip_f64 ()

    void        oil_clip_f64                    (double *dest,
                                                 int dstr,
                                                 const double *src,
                                                 int sstr,
                                                 int n,
                                                 const double *s2_1,
                                                 const double *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minumum
`s3_1` : | maximum

### oil_clip_s16 ()

    void        oil_clip_s16                    (int16_t *dest,
                                                 int dstr,
                                                 const int16_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int16_t *s2_1,
                                                 const int16_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minumum
`s3_1` : | maximum

### oil_clip_s32 ()

    void        oil_clip_s32                    (int32_t *dest,
                                                 int dstr,
                                                 const int32_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int32_t *s2_1,
                                                 const int32_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minimum
`s3_1` : | maximum

### oil_clip_s8 ()

    void        oil_clip_s8                     (int8_t *dest,
                                                 int dstr,
                                                 const int8_t *src,
                                                 int sstr,
                                                 int n,
                                                 const int8_t *s2_1,
                                                 const int8_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minimum
`s3_1` : | maximum

### oil_clip_u16 ()

    void        oil_clip_u16                    (uint16_t *dest,
                                                 int dstr,
                                                 const uint16_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint16_t *s2_1,
                                                 const uint16_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minimum
`s3_1` : | maximum

### oil_clip_u32 ()

    void        oil_clip_u32                    (uint32_t *dest,
                                                 int dstr,
                                                 const uint32_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint32_t *s2_1,
                                                 const uint32_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minimum
`s3_1` : | maximum

### oil_clip_u8 ()

    void        oil_clip_u8                     (uint8_t *dest,
                                                 int dstr,
                                                 const uint8_t *src,
                                                 int sstr,
                                                 int n,
                                                 const uint8_t *s2_1,
                                                 const uint8_t *s3_1);

Clips each element in the first source array.

`dest` : |
`dstr` : |
`src` : |
`sstr` : |
`n` : |
`s2_1` : | minimum
`s3_1` : | maximum

### oil_dequantize8x8_s16 ()

    void        oil_dequantize8x8_s16           (int16_t *d_8x8,
                                                 int dstr,
                                                 const int16_t *s1_8x8,
                                                 int sstr1,
                                                 const int16_t *s2_8x8,
                                                 int sstr2);

Multiplies each value in first source array with corresponding value in second source array, and places result in destination array. This function would be more appropriately called `oil_mult8x8_s16()`.

`d_8x8` : |
`dstr` : |
`s1_8x8` : |
`sstr1` : |
`s2_8x8` : |
`sstr2` : |

### oil_diffsquaresum_f64 ()

    void        oil_diffsquaresum_f64           (double *d_1,
                                                 const double *src1,
                                                 int sstr1,
                                                 const double *src2,
                                                 int sstr2,
                                                 int n);

Subtracts each value in first source array with corresponding value in second source array, squares the result, and then sums the results over the entire array, placing the result in the destination.

`d_1` : |
`src1` : |
`sstr1` : |
`src2` : |
`sstr2` : |
`n` : |

### oil_md5 ()

    void        oil_md5                         (uint32_t *i_4,
                                                 const uint32_t *s_16);

Convolves the MD5 checksum using the given source data. The complete algorithm for calculating MD5 checksums requires additional preparation of the data. See the example in the examples/md5 directory in the source tree.

`i_4` : |
`s_16` : |

### oil_mix_u8 ()

    void        oil_mix_u8                      (uint8_t *dest,
                                                 const uint8_t *src1,
                                                 const uint8_t *src2,
                                                 const uint8_t *src3,
                                                 int n);

`dest` : |
`src1` : |
`src2` : |
`src3` : |
`n` : |

### oil_null ()

    void        oil_null                        ();

Does nothing, and does it surprisingly fast.

### oil_scanlinescale2_u8 ()

    void        oil_scanlinescale2_u8           (uint8_t *dest,
                                                 const uint8_t *src,
                                                 int n);

`dest` : |
`src` : |
`n` : |

### oil_sincos_f64 ()

    void        oil_sincos_f64                  (double *dest1,
                                                 double *dest2,
                                                 int n,
                                                 const double *s1_1,
                                                 const double *s2_1);

`dest1` : |
`dest2` : |
`n` : |
`s1_1` : |
`s2_1` : |

### oil_utf8_validate ()

    void        oil_utf8_validate               (int32_t *d_1,
                                                 const uint8_t *s,
                                                 int n);

Checks the source array for valid UTF-8 characters. Processing stops once an invalid character is found. The number of bytes containing valid UTF-8 characters is placed in the destination.

`d_1` : |
`s` : |
`n` : |

### oil_diff8x8_s16_u8 ()

    void        oil_diff8x8_s16_u8              (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);

`d_64` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`ss2` : |

### oil_diff8x8_average_s16_u8 ()

    void        oil_diff8x8_average_s16_u8      (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2,
                                                 const uint8_t *s3_8x8,
                                                 int ss3);

`d_64` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`ss2` : |
`s3_8x8` : |
`ss3` : |

### oil_err_inter8x8_u8_avg ()

    void        oil_err_inter8x8_u8_avg         (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 const uint8_t *s3_8x8,
                                                 int ss2);

`d_1` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`s3_8x8` : |
`ss2` : |

### oil_recon8x8_inter ()

    void        oil_recon8x8_inter              (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const int16_t *s2_8x8);

`d_8x8` : |
`ds` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |

### oil_err_intra8x8_u8 ()

    void        oil_err_intra8x8_u8             (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1);

`d_1` : |
`s1_8x8` : |
`ss1` : |

### oil_recon8x8_intra ()

    void        oil_recon8x8_intra              (uint8_t *d_8x8,
                                                 int ds,
                                                 const int16_t *s_8x8);

`d_8x8` : |
`ds` : |
`s_8x8` : |

### oil_colsad8x8_u8 ()

    void        oil_colsad8x8_u8                (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);

`d_1` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`ss2` : |

### oil_composite_over_u8 ()

    void        oil_composite_over_u8           (uint8_t *i_n,
                                                 const uint8_t *s1_n,
                                                 int n);

`i_n` : |
`s1_n` : |
`n` : |

### oil_diff8x8_const128_s16_u8 ()

    void        oil_diff8x8_const128_s16_u8     (int16_t *d_64,
                                                 const uint8_t *s1_8x8,
                                                 int ss1);

`d_64` : |
`s1_8x8` : |
`ss1` : |

### oil_copy8x8_u8 ()

    void        oil_copy8x8_u8                  (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s_8x8,
                                                 int ss);

`d_8x8` : |
`ds` : |
`s_8x8` : |
`ss` : |

### oil_err_inter8x8_u8 ()

    void        oil_err_inter8x8_u8             (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2);

`d_1` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`ss2` : |

### oil_fdct8x8theora ()

    void        oil_fdct8x8theora               (const int16_t *s_8x8,
                                                 int16_t *d_8x8);

`s_8x8` : |
`d_8x8` : |

### oil_rowsad8x8_u8 ()

    void        oil_rowsad8x8_u8                (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 const uint8_t *s2_8x8);

`d_1` : |
`s1_8x8` : |
`s2_8x8` : |

### oil_recon8x8_inter2 ()

    void        oil_recon8x8_inter2             (uint8_t *d_8x8,
                                                 int ds,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 int ss2,
                                                 const int16_t *s3_8x8);

`d_8x8` : |
`ds` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`ss2` : |
`s3_8x8` : |

### oil_composite_add_u8 ()

    void        oil_composite_add_u8            (uint8_t *i_n,
                                                 const uint8_t *s1_n,
                                                 int n);

`i_n` : |
`s1_n` : |
`n` : |

### oil_sad8x8_u8_avg ()

    void        oil_sad8x8_u8_avg               (uint32_t *d_1,
                                                 const uint8_t *s1_8x8,
                                                 int ss1,
                                                 const uint8_t *s2_8x8,
                                                 const uint8_t *s3_8x8,
                                                 int ss2);

`d_1` : |
`s1_8x8` : |
`ss1` : |
`s2_8x8` : |
`s3_8x8` : |
`ss2` : |