schrometric

## schrometric schrometric |

## Synopsis

                        SchroMetricScan;
    #define             SCHRO_METRIC_INVALID
    int                 schro_metric_absdiff_u8             (uint8_t *a,
                                                             int a_stride,
                                                             uint8_t *b,
                                                             int b_stride,
                                                             int width,
                                                             int height);
    int                 schro_metric_haar                   (uint8_t *src1,
                                                             int stride1,
                                                             uint8_t *src2,
                                                             int stride2,
                                                             int width,
                                                             int height);
    int                 schro_metric_haar_const             (uint8_t *data,
                                                             int stride,
                                                             int dc_value,
                                                             int width,
                                                             int height);
    int                 schro_metric_abssum_s16             (int16_t *data,
                                                             int stride,
                                                             int width,
                                                             int height);
    int                 schro_metric_sum_u8                 (uint8_t *data,
                                                             int stride,
                                                             int width,
                                                             int height);
    int                 schro_metric_get                    (SchroFrameData *src1,
                                                             SchroFrameData *src2,
                                                             int width,
                                                             int height);
    int                 schro_metric_get_biref              (SchroFrameData *fd,
                                                             SchroFrameData *src1,
                                                             int weight1,
                                                             SchroFrameData *src2,
                                                             int weight2,
                                                             int shift,
                                                             int width,
                                                             int height);
    int                 schro_metric_get_dc                 (SchroFrameData *src,
                                                             int value,
                                                             int width,
                                                             int height);
    void                schro_metric_scan_do_scan           (SchroMetricScan *scan);
    int                 schro_metric_scan_get_min           (SchroMetricScan *scan,
                                                             int *dx,
                                                             int *dy);
    void                schro_metric_scan_setup             (SchroMetricScan *scan,
                                                             int dx,
                                                             int dy,
                                                             int dist);

## Description

## Details

### SchroMetricScan

    typedef struct {
      SchroFrame *frame;
      SchroFrame *ref_frame;
      int block_width;
      int block_height;
      int x, y;
      int ref_x, ref_y;
      int scan_width;
      int scan_height;
      int gravity_scale;
      int gravity_x, gravity_y;
      /* output */
      uint32_t metrics[SCHRO_LIMIT_METRIC_SCAN*SCHRO_LIMIT_METRIC_SCAN];
    } SchroMetricScan;

### SCHRO_METRIC_INVALID

    #define SCHRO_METRIC_INVALID 0x7fff

### schro_metric_absdiff_u8 ()

    int                 schro_metric_absdiff_u8             (uint8_t *a,
                                                             int a_stride,
                                                             uint8_t *b,
                                                             int b_stride,
                                                             int width,
                                                             int height);

`a` : |
`a_stride` : |
`b` : |
`b_stride` : |
`width` : |
`height` : |
Returns : |

### schro_metric_haar ()

    int                 schro_metric_haar                   (uint8_t *src1,
                                                             int stride1,
                                                             uint8_t *src2,
                                                             int stride2,
                                                             int width,
                                                             int height);

`src1` : |
`stride1` : |
`src2` : |
`stride2` : |
`width` : |
`height` : |
Returns : |

### schro_metric_haar_const ()

    int                 schro_metric_haar_const             (uint8_t *data,
                                                             int stride,
                                                             int dc_value,
                                                             int width,
                                                             int height);

`data` : |
`stride` : |
`dc_value` : |
`width` : |
`height` : |
Returns : |

### schro_metric_abssum_s16 ()

    int                 schro_metric_abssum_s16             (int16_t *data,
                                                             int stride,
                                                             int width,
                                                             int height);

`data` : |
`stride` : |
`width` : |
`height` : |
Returns : |

### schro_metric_sum_u8 ()

    int                 schro_metric_sum_u8                 (uint8_t *data,
                                                             int stride,
                                                             int width,
                                                             int height);

`data` : |
`stride` : |
`width` : |
`height` : |
Returns : |

### schro_metric_get ()

    int                 schro_metric_get                    (SchroFrameData *src1,
                                                             SchroFrameData *src2,
                                                             int width,
                                                             int height);

`src1` : |
`src2` : |
`width` : |
`height` : |
Returns : |

### schro_metric_get_biref ()

    int                 schro_metric_get_biref              (SchroFrameData *fd,
                                                             SchroFrameData *src1,
                                                             int weight1,
                                                             SchroFrameData *src2,
                                                             int weight2,
                                                             int shift,
                                                             int width,
                                                             int height);

`fd` : |
`src1` : |
`weight1` : |
`src2` : |
`weight2` : |
`shift` : |
`width` : |
`height` : |
Returns : |

### schro_metric_get_dc ()

    int                 schro_metric_get_dc                 (SchroFrameData *src,
                                                             int value,
                                                             int width,
                                                             int height);

`src` : |
`value` : |
`width` : |
`height` : |
Returns : |

### schro_metric_scan_do_scan ()

    void                schro_metric_scan_do_scan           (SchroMetricScan *scan);

`scan` : |

### schro_metric_scan_get_min ()

    int                 schro_metric_scan_get_min           (SchroMetricScan *scan,
                                                             int *dx,
                                                             int *dy);

`scan` : |
`dx` : |
`dy` : |
Returns : |

### schro_metric_scan_setup ()

    void                schro_metric_scan_setup             (SchroMetricScan *scan,
                                                             int dx,
                                                             int dy,
                                                             int dist);

`scan` : |
`dx` : |
`dy` : |
`dist` : |