Debian Codegraph @

libmmxnow/src/filter.c

raw symbols SCIP
1
2 enum {
3 MMXNOW_FILTERV_SOURCE,
4 MMXNOW_FILTERV_CONVERT,
5 MMXNOW_FILTERV_RESIZE_BILINEAR_WIDTH,
6 MMXNOW_FILTERV_RESIZE_BILINEAR_HEIGHT,
7 };
8
9 // C, mmx, mmx2, sse, sse2, 3dnow
10
11 table_MMXNOW_FILTER_SOURCE {
12 { mmxnow_flt_source, 0,
13
14 }
15
16
17 struct mmxnow_filter_s;
18
19 // filter processing function
20 typedef int(*mmxnow_func_destroy)(struct mmxnow_filter_s* filter);
21 typedef int(*mmxnow_func_process)(int lines, uint8_t planes[3], ...);
22
23
24 typedef struct mmxnow_filter_s {
25 int type;
26 struct mmxnow_filter_s* parent;
27 unsigned char* to_plane[3];
28 int to_stride[3];
29 int to_width;
30 int to_height;
31
32 unsigned char* from_plane[3];
33 int from_stride[3];
34 int from_width;
35 int from_height;
36 mmxnow_func_destroy destroy;
37 mmxnow_func_process process;
38
39
40 } mmxnow_filter_t;
41
42 static inline add_planes(mmxnow_filter_t* f)
43 {
44 f->to_plane[0] = f->from_plane[0];
45 f->from_plane[0] += f->from_stride[0];
46
47 f->to_plane[1] = f->from_plane[1];
48 f->from_plane[1] += f->from_stride[1];
49
50 f->to_plane[2] = f->from_plane[2];
51 f->from_plane[2] += f->from_stride[2];
52 }
53
54
55 mmxnow_filter_t* mmxnow_filter_create(int flags, int type, mmxnow_filter_t* parent)
56 {
57 mmxnow_filter_t* flt;
58 if (type != MMXNOW_FILTER_SOURCE && !parent)
59 {
60 // must be SOURCE filter when there is no parent!!
61 abort();
62 return 0;
63 }
64
65 flt = malloc(sizeof(mmxnow_filter_t));
66 if (!flt)
67 return 0;
68
69 memset(flt, 0, sizeof(mmxnow_filter_t));
70 flt->type = type;
71 flt->patent = parent;
72
73 switch (type)
74 {
75 case MMXNOW_FILTER_SOURCE:
76 table = table_MMXNOW_FILTER_SOURCE;
77 break;
78 case MMXNOW_FILTER_CONVERT:
79 break;
80 case MMXNOW_FILTER_RESIZE_BILINEAR_WIDTH:
81 break;
82 case MMXNOW_FILTER_RESIZE_BILINEAR_HEIGHT:
83 break;
84 }
85
86
87 flt->destroy = get_table(table, flags);
88 flt->process = get_table(table, flags);
89
90
91 return flt;
92 }
93
94 int mmxnow_filter_destroy_convert(mmxnow_filter_t* filter)
95 {
96 if (filter->parent)
97 mmxnow_filter_destroy(
98 free(filter);
99 }
100
101 int mmxnow_filter_init_convert(int param, ...)
102 {
103
104 }
105
106 int mmxnow_filter_process(uint8_t planes[3], int lines, ...)
107 {
108
109 }
110
111
112 static sourcef()
113 {
114
115
116 }
117
118 int mmxnow_filter_process_source_planar(mmxnow_filter_t* f, uint8_t* planes[3])
119 {
120 return 1;
121 }
122
123 int mmxnow_filter_process_convert_planar(mmxnow_filter_t* f, uint8_t* dstplanes[3])
124 {
125 uint8_t* p[0];
126 int i;
127 int l = f->parent->process(f->parent, f->planes, 1);
128
129 for (i = 0; i < f->width; i++)
130 f->from_plane[0] = p[0];
131
132 }
133
134 int proce2()
135 {
136 f = top;
137 while (f)
138 {
139 f->proces(f);
140 f = f->next();
141 }
142 }