Mercurial > mplayer.hg
annotate libvo/csputils.h @ 34598:877e37095c2d
Optimize midentify script to not wasted time filling the cache.
This could take particularly much time when the file is
live audio stream and the cache is set large in the configuration.
Based on suggestion by Rodrigo Campos [rodrigo [at] sdfg com ar]
author | reimar |
---|---|
date | Sat, 11 Feb 2012 17:21:14 +0000 |
parents | 9bc9e1851a13 |
children | 9bcec2bb02b3 |
rev | line source |
---|---|
30108
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
1 /* |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
2 * This file is part of MPlayer. |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
3 * |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
7 * (at your option) any later version. |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
8 * |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
12 * GNU General Public License for more details. |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
13 * |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
31310
4b888c2d2a1d
Allow LGPL for csputils as well, they were previously part of gl_common
reimar
parents:
30293
diff
changeset
|
17 * |
4b888c2d2a1d
Allow LGPL for csputils as well, they were previously part of gl_common
reimar
parents:
30293
diff
changeset
|
18 * You can alternatively redistribute this file and/or |
4b888c2d2a1d
Allow LGPL for csputils as well, they were previously part of gl_common
reimar
parents:
30293
diff
changeset
|
19 * modify it under the terms of the GNU Lesser General Public |
4b888c2d2a1d
Allow LGPL for csputils as well, they were previously part of gl_common
reimar
parents:
30293
diff
changeset
|
20 * License as published by the Free Software Foundation; either |
4b888c2d2a1d
Allow LGPL for csputils as well, they were previously part of gl_common
reimar
parents:
30293
diff
changeset
|
21 * version 2.1 of the License, or (at your option) any later version. |
30108
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
22 */ |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
23 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
24 #ifndef MPLAYER_CSPUTILS_H |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
25 #define MPLAYER_CSPUTILS_H |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
26 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
27 #include <stdint.h> |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
28 |
30109
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
29 enum mp_csp_standard { |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
30 MP_CSP_DEFAULT, |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
31 MP_CSP_BT_601, |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
32 MP_CSP_BT_709, |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
33 MP_CSP_SMPTE_240M, |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
34 MP_CSP_EBU, |
30121
28cbec606cbb
Slightly generalize code to generate YUV->RGB conversion table and add
reimar
parents:
30109
diff
changeset
|
35 MP_CSP_XYZ, |
30109
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
36 MP_CSP_COUNT |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
37 }; |
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
38 |
30293
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
39 enum mp_csp_levelconv { |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
40 MP_CSP_LEVELCONV_TV_TO_PC, |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
41 MP_CSP_LEVELCONV_PC_TO_TV, |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
42 MP_CSP_LEVELCONV_NONE, |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
43 MP_CSP_LEVELCONV_COUNT |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
44 }; |
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
45 |
30108
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
46 struct mp_csp_params { |
30109
0f25d3062987
First steps to supporting different YUV->RGB conversion definitions.
reimar
parents:
30108
diff
changeset
|
47 enum mp_csp_standard format; |
30293
aeab18b1923d
Add support for adjustable TV <-> PC level conversion.
reimar
parents:
30121
diff
changeset
|
48 enum mp_csp_levelconv levelconv; |
30108
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
49 float brightness; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
50 float contrast; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
51 float hue; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
52 float saturation; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
53 float rgamma; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
54 float ggamma; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
55 float bgamma; |
33414 | 56 int input_shift; |
30108
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
57 }; |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
58 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
59 void mp_gen_gamma_map(unsigned char *map, int size, float gamma); |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
60 #define ROW_R 0 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
61 #define ROW_G 1 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
62 #define ROW_B 2 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
63 #define COL_Y 0 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
64 #define COL_U 1 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
65 #define COL_V 2 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
66 #define COL_C 3 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
67 void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]); |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
68 void mp_gen_yuv2rgb_map(struct mp_csp_params *params, uint8_t *map, int size); |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
69 |
0898adc64a6f
Extract functions to generate yuv->rgb matrices and lookup tables into a
reimar
parents:
diff
changeset
|
70 #endif /* MPLAYER_CSPUTILS_H */ |