5 #include <schroedinger/schroutils.h>
6 #include <schroedinger/schroframe.h>
11 typedef struct _SchroMetricScan SchroMetricScan
;
12 typedef struct _SchroMetricInfo SchroMetricInfo
;
14 #ifdef SCHRO_ENABLE_UNSTABLE_API
16 #define SCHRO_LIMIT_METRIC_SCAN 42
18 struct _SchroMetricInfo
{
20 SchroFrame
*ref_frame
;
27 int (*metric
) (SchroMetricInfo
*info
, int ref_x
, int ref_y
,
29 int (*metric_right
) (SchroMetricInfo
*info
, int ref_x
, int ref_y
,
31 int (*metric_bottom
) (SchroMetricInfo
*info
, int ref_x
, int ref_y
,
33 int (*metric_corner
) (SchroMetricInfo
*info
, int ref_x
, int ref_y
,
38 struct _SchroMetricScan
{
40 SchroFrame
*ref_frame
;
48 int gravity_x
, gravity_y
;
51 uint32_t metrics
[SCHRO_LIMIT_METRIC_SCAN
*SCHRO_LIMIT_METRIC_SCAN
];
52 uint32_t chroma_metrics
[SCHRO_LIMIT_METRIC_SCAN
*SCHRO_LIMIT_METRIC_SCAN
];
55 #define SCHRO_METRIC_INVALID INT_MAX
57 int schro_metric_absdiff_u8 (uint8_t *a
, int a_stride
, uint8_t *b
,
58 int b_stride
, int width
, int height
);
59 int schro_metric_haar (uint8_t *src1
, int stride1
, uint8_t *src2
, int stride2
,
60 int width
, int height
);
61 int schro_metric_haar_const (uint8_t *data
, int stride
, int dc_value
,
62 int width
, int height
);
63 int schro_metric_abssum_s16 (int16_t *data
, int stride
, int width
, int height
);
64 int schro_metric_sum_u8 (uint8_t *data
, int stride
, int width
, int height
);
66 void schro_metric_scan_do_scan (SchroMetricScan
*scan
);
67 int schro_metric_scan_get_min (SchroMetricScan
*scan
, int *dx
, int *dy
68 , uint32_t* chroma_metric
);
69 void schro_metric_scan_setup (SchroMetricScan
*scan
, int dx
, int dy
, int dist
72 int schro_metric_get (SchroFrameData
*src1
, SchroFrameData
*src2
, int width
, int height
);
73 int schro_metric_get_biref (SchroFrameData
*fd
, SchroFrameData
*src1
,
74 int weight1
, SchroFrameData
*src2
, int weight2
, int shift
, int width
,
76 int schro_metric_get_dc (SchroFrameData
*src
, int value
, int width
, int height
);
78 void schro_metric_info_init (SchroMetricInfo
*info
, SchroFrame
*frame
,
79 SchroFrame
*ref_frame
, int block_width
, int block_height
);
81 int schro_metric_fast_block (SchroMetricInfo
*info
, int x
, int y
,
83 int schro_metric_fast_subsuperblock (SchroMetricInfo
*info
, int x
, int y
,
85 int schro_metric_fast_superblock (SchroMetricInfo
*info
, int x
, int y
,