Diffstat (limited to 'noncore/multimedia/opieplayer2/yuv2rgb.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/yuv2rgb.h | 50 |
1 files changed, 35 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/yuv2rgb.h b/noncore/multimedia/opieplayer2/yuv2rgb.h index e453243..1833889 100644 --- a/noncore/multimedia/opieplayer2/yuv2rgb.h +++ b/noncore/multimedia/opieplayer2/yuv2rgb.h | |||
@@ -2,6 +2,10 @@ | |||
2 | #ifndef HAVE_YUV2RGB_H | 2 | #ifndef HAVE_YUV2RGB_H |
3 | #define HAVE_YUV2RGB_h | 3 | #define HAVE_YUV2RGB_h |
4 | 4 | ||
5 | #ifdef HAVE_MLIB | ||
6 | #include <mlib_video.h> | ||
7 | #endif | ||
8 | |||
5 | #include <inttypes.h> | 9 | #include <inttypes.h> |
6 | 10 | ||
7 | typedef struct yuv2rgb_s yuv2rgb_t; | 11 | typedef struct yuv2rgb_s yuv2rgb_t; |
@@ -22,7 +26,6 @@ typedef void (*yuy22rgb_fun_t) (yuv2rgb_t *this, uint8_t * image, uint8_t * p); | |||
22 | 26 | ||
23 | typedef uint32_t (*yuv2rgb_single_pixel_fun_t) (yuv2rgb_t *this, uint8_t y, uint8_t u, uint8_t v); | 27 | typedef uint32_t (*yuv2rgb_single_pixel_fun_t) (yuv2rgb_t *this, uint8_t y, uint8_t u, uint8_t v); |
24 | 28 | ||
25 | |||
26 | /* | 29 | /* |
27 | * modes supported - feel free to implement yours | 30 | * modes supported - feel free to implement yours |
28 | */ | 31 | */ |
@@ -41,7 +44,6 @@ typedef uint32_t (*yuv2rgb_single_pixel_fun_t) (yuv2rgb_t *this, uint8_t y, uint | |||
41 | #define MODE_PALETTE 12 | 44 | #define MODE_PALETTE 12 |
42 | 45 | ||
43 | struct yuv2rgb_s { | 46 | struct yuv2rgb_s { |
44 | |||
45 | /* | 47 | /* |
46 | * configure converter for scaling factors | 48 | * configure converter for scaling factors |
47 | */ | 49 | */ |
@@ -52,6 +54,16 @@ struct yuv2rgb_s { | |||
52 | int rgb_stride); | 54 | int rgb_stride); |
53 | 55 | ||
54 | /* | 56 | /* |
57 | * start a new field or frame if dest is NULL | ||
58 | */ | ||
59 | int (*next_slice) (yuv2rgb_t *this, uint8_t **dest); | ||
60 | |||
61 | /* | ||
62 | * free resources | ||
63 | */ | ||
64 | void (*dispose) (yuv2rgb_t *this); | ||
65 | |||
66 | /* | ||
55 | * this is the function to call for the yuv2rgb and scaling process | 67 | * this is the function to call for the yuv2rgb and scaling process |
56 | */ | 68 | */ |
57 | yuv2rgb_fun_t yuv2rgb_fun; | 69 | yuv2rgb_fun_t yuv2rgb_fun; |
@@ -74,8 +86,9 @@ struct yuv2rgb_s { | |||
74 | int y_stride, uv_stride; | 86 | int y_stride, uv_stride; |
75 | int dest_width, dest_height; | 87 | int dest_width, dest_height; |
76 | int rgb_stride; | 88 | int rgb_stride; |
89 | int slice_height, slice_offset; | ||
77 | int step_dx, step_dy; | 90 | int step_dx, step_dy; |
78 | int do_scale; | 91 | int do_scale, swapped; |
79 | 92 | ||
80 | uint8_t *y_buffer; | 93 | uint8_t *y_buffer; |
81 | uint8_t *u_buffer; | 94 | uint8_t *u_buffer; |
@@ -84,14 +97,22 @@ struct yuv2rgb_s { | |||
84 | void *u_chunk; | 97 | void *u_chunk; |
85 | void *v_chunk; | 98 | void *v_chunk; |
86 | 99 | ||
100 | #ifdef HAVE_MLIB | ||
101 | uint8_t *mlib_buffer; | ||
102 | uint8_t *mlib_resize_buffer; | ||
103 | void *mlib_chunk; | ||
104 | void *mlib_resize_chunk; | ||
105 | mlib_filter mlib_filter_type; | ||
106 | #endif | ||
107 | |||
87 | void **table_rV; | 108 | void **table_rV; |
88 | void **table_gU; | 109 | void **table_gU; |
89 | int *table_gV; | 110 | int *table_gV; |
90 | void **table_bU; | 111 | void **table_bU; |
112 | void *table_mmx; | ||
91 | 113 | ||
92 | uint8_t *cmap; | 114 | uint8_t *cmap; |
93 | scale_line_func_t scale_line; | 115 | scale_line_func_t scale_line; |
94 | |||
95 | } ; | 116 | } ; |
96 | 117 | ||
97 | /* | 118 | /* |
@@ -99,19 +120,19 @@ struct yuv2rgb_s { | |||
99 | */ | 120 | */ |
100 | 121 | ||
101 | struct yuv2rgb_factory_s { | 122 | struct yuv2rgb_factory_s { |
102 | |||
103 | yuv2rgb_t* (*create_converter) (yuv2rgb_factory_t *this); | 123 | yuv2rgb_t* (*create_converter) (yuv2rgb_factory_t *this); |
104 | 124 | ||
105 | /* | 125 | /* |
106 | * adjust gamma (-100 to 100 looks fine) | 126 | * set color space conversion levels |
107 | * for all converters produced by this factory | 127 | * for all converters produced by this factory |
108 | */ | 128 | */ |
109 | void (*set_gamma) (yuv2rgb_factory_t *this, int gamma); | 129 | void (*set_csc_levels) (yuv2rgb_factory_t *this, |
130 | int brightness, int contrast, int saturation); | ||
110 | 131 | ||
111 | /* | 132 | /* |
112 | * get gamma value | 133 | * free resources |
113 | */ | 134 | */ |
114 | int (*get_gamma) (yuv2rgb_factory_t *this); | 135 | void (*dispose) (yuv2rgb_factory_t *this); |
115 | 136 | ||
116 | /* private data */ | 137 | /* private data */ |
117 | 138 | ||
@@ -119,21 +140,20 @@ struct yuv2rgb_factory_s { | |||
119 | int swapped; | 140 | int swapped; |
120 | uint8_t *cmap; | 141 | uint8_t *cmap; |
121 | 142 | ||
122 | int gamma; | ||
123 | int entry_size; | ||
124 | |||
125 | uint32_t matrix_coefficients; | 143 | uint32_t matrix_coefficients; |
126 | 144 | ||
145 | void *table_base; | ||
127 | void *table_rV[256]; | 146 | void *table_rV[256]; |
128 | void *table_gU[256]; | 147 | void *table_gU[256]; |
129 | int table_gV[256]; | 148 | int table_gV[256]; |
130 | void *table_bU[256]; | 149 | void *table_bU[256]; |
150 | void *table_mmx_base; | ||
151 | void *table_mmx; | ||
131 | 152 | ||
132 | /* preselected functions for mode/swap/hardware */ | 153 | /* preselected functions for mode/swap/hardware */ |
133 | yuv2rgb_fun_t yuv2rgb_fun; | 154 | yuv2rgb_fun_t yuv2rgb_fun; |
134 | yuy22rgb_fun_t yuy22rgb_fun; | 155 | yuy22rgb_fun_t yuy22rgb_fun; |
135 | yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun; | 156 | yuv2rgb_single_pixel_fun_t yuv2rgb_single_pixel_fun; |
136 | |||
137 | }; | 157 | }; |
138 | 158 | ||
139 | yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colormap); | 159 | yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colormap); |
@@ -143,10 +163,10 @@ yuv2rgb_factory_t *yuv2rgb_factory_init (int mode, int swapped, uint8_t *colorma | |||
143 | * internal stuff below this line | 163 | * internal stuff below this line |
144 | */ | 164 | */ |
145 | 165 | ||
146 | void mmx_yuv2rgb_set_gamma(int gamma); | 166 | void mmx_yuv2rgb_set_csc_levels(yuv2rgb_factory_t *this, |
167 | int brightness, int contrast, int saturation); | ||
147 | void yuv2rgb_init_mmxext (yuv2rgb_factory_t *this); | 168 | void yuv2rgb_init_mmxext (yuv2rgb_factory_t *this); |
148 | void yuv2rgb_init_mmx (yuv2rgb_factory_t *this); | 169 | void yuv2rgb_init_mmx (yuv2rgb_factory_t *this); |
149 | void yuv2rgb_init_mlib (yuv2rgb_factory_t *this); | 170 | void yuv2rgb_init_mlib (yuv2rgb_factory_t *this); |
150 | void yuv2rgb_init_arm (yuv2rgb_factory_t *this); | ||
151 | 171 | ||
152 | #endif | 172 | #endif |