/* this function is used to calculate the params for resizing  */
int32_t ipu_ic_calc_resize_coeffs(int32_t in_size, int32_t out_size, int32_t *resize_coeff, int32_t *downsize_coeff)
/* this function is used to calculate the params for resizing  */
int32_t ipu_ic_calc_resize_coeffs(int32_t in_size, int32_t out_size, int32_t *resize_coeff, int32_t *downsize_coeff)
{
    int32_t tempSize;
    int32_t tempDownsize;
    if ((out_size << 3) < in_size)
        return -1;
    tempDownsize = 0;
    tempSize = in_size;
    while (((tempSize >= out_size * 2) || (tempSize > 1024))
           && (tempDownsize < 2)) {
        tempSize >>= 1;
        tempDownsize++;
    }
    *downsize_coeff = tempDownsize;
    *resize_coeff = (8192L * (tempSize - 1)) / (out_size - 1);
    if (*resize_coeff >= 16384L) {
        printf("Overflow on resize coeff %d.\n", *resize_coeff);
        *resize_coeff = 0x3FFF;
    }
    return 0;
}