OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / libhb / eedi2.h
1 // Used to order a sequeunce of metrics for median filtering
2 void eedi2_sort_metrics( int *order, const int length );
3
4 // Aping some Windows API funcctions AviSynth seems to like
5 // Taken from here: http://www.gidforums.com/t-8543.html
6 void *eedi2_aligned_malloc(size_t size, size_t align_size);
7 void eedi2_aligned_free(void *ptr);
8
9 // Copies bitmaps
10 void eedi2_bit_blit( uint8_t * dstp, int dst_pitch, const uint8_t * srcp, int src_pitch,
11                      int row_size, int height );
12
13 // Sets up the initial field-sized bitmap EEDI2 interpolates from
14 void eedi2_fill_half_height_buffer_plane( uint8_t * src, uint8_t * dst, int pitch, int height );
15
16 // Simple line doubler
17 void eedi2_upscale_by_2( uint8_t * srcp, uint8_t * dstp, int height, int pitch );
18
19 // Finds places where vertically adjacent pixels abruptly change intensity
20 void eedi2_build_edge_mask( uint8_t * dstp, int dst_pitch, uint8_t *srcp, int src_pitch,
21                             int mthresh, int lthresh, int vthresh, int height, int width );
22
23 // Expands and smooths out the edge mask by considering a pixel
24 // to be masked if >= dilation threshold adjacent pixels are masked.
25 void eedi2_dilate_edge_mask( uint8_t *mskp, int msk_pitch, uint8_t *dstp, int dst_pitch,
26                              int dstr, int height, int width );
27
28 // Contracts the edge mask by considering a pixel to be masked
29 // only if > erosion threshold adjacent pixels are masked
30 void eedi2_erode_edge_mask( uint8_t *mskp, int msk_pitch, uint8_t *dstp, int dst_pitch,
31                             int estr, int height, int width );
32
33 // Smooths out horizontally aligned holes in the mask
34 // If none of the 6 horizontally adjacent pixels are masked,
35 // don't consider the current pixel masked. If there are any
36 // masked on both sides, consider the current pixel masked.
37 void eedi2_remove_small_gaps( uint8_t * mskp, int msk_pitch, uint8_t * dstp, int dst_pitch, 
38                               int height, int width );
39
40 // Spatial vectors. Looks at maximum_search_distance surrounding pixels
41 // to guess which angle edges follow. This is EEDI2's timesink, and can be
42 // thought of as YADIF_CHECK on steroids. Both find edge directions.
43 void eedi2_calc_directions( const int plane, uint8_t * mskp, int msk_pitch, uint8_t * srcp, int src_pitch,
44                             uint8_t * dstp, int dst_pitch, int maxd, int nt, int height, int width  );
45
46 void eedi2_filter_map( uint8_t *mskp, int msk_pitch, uint8_t *dmskp, int dmsk_pitch,
47                        uint8_t * dstp, int dst_pitch, int height, int width );
48
49 void eedi2_filter_dir_map( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
50                            int dst_pitch, int height, int width );
51
52 void eedi2_expand_dir_map( uint8_t * mskp, int msk_pitch, uint8_t  *dmskp, int dmsk_pitch, uint8_t * dstp,
53                            int dst_pitch, int height, int width );
54
55 void eedi2_mark_directions_2x( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
56                                int dst_pitch, int tff, int height, int width );
57
58 void eedi2_filter_dir_map_2x( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
59                               int dst_pitch, int field, int height, int width );
60
61 void eedi2_expand_dir_map_2x( uint8_t * mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
62                               int dst_pitch, int field, int height, int width );
63
64 void eedi2_fill_gaps_2x( uint8_t *mskp, int msk_pitch, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
65                          int dst_pitch, int field, int height, int width );
66
67 void eedi2_interpolate_lattice( const int plane, uint8_t * dmskp, int dmsk_pitch, uint8_t * dstp,
68                                 int dst_pitch, uint8_t * omskp, int omsk_pitch, int field, int nt,
69                                 int height, int width );
70
71 void eedi2_post_process( uint8_t * nmskp, int nmsk_pitch, uint8_t * omskp, int omsk_pitch, uint8_t * dstp,
72                          int src_pitch, int field, int height, int width );
73
74 void eedi2_gaussian_blur1( uint8_t * src, int src_pitch, uint8_t * tmp, int tmp_pitch, uint8_t * dst,
75                            int dst_pitch, int height, int width );
76                            
77 void eedi2_gaussian_blur_sqrt2( int *src, int *tmp, int *dst, const int pitch,
78                                 const int height, const int width );
79                                 
80 void eedi2_calc_derivatives( uint8_t *srcp, int src_pitch, int height, int width,
81                              int *x2, int *y2, int *xy);
82
83 void eedi2_post_process_corner( int *x2, int *y2, int *xy, const int pitch, uint8_t * mskp, int msk_pitch,
84                                 uint8_t * dstp, int dst_pitch, int height, int width, int field );