1ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson/*
2a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
3ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *
4ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * Redistribution and use in source and binary forms, with or without
5ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * modification, are permitted provided that the following conditions are
6ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * met:
7ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *     * Redistributions of source code must retain the above copyright
8ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       notice, this list of conditions and the following disclaimer.
9ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *     * Redistributions in binary form must reproduce the above
10ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       copyright notice, this list of conditions and the following
11ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       disclaimer in the documentation and/or other materials provided
12ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       with the distribution.
13ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *     * Neither the name of The Linux Foundation nor the names of its
14ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       contributors may be used to endorse or promote products derived
15ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *       from this software without specific prior written permission.
16ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson *
17ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson */
29ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
30ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#ifndef _QDMETADATA_H
31ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#define _QDMETADATA_H
32ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
33a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson#ifdef __cplusplus
34a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsonextern "C" {
35a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson#endif
36a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson
37ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#define MAX_IGC_LUT_ENTRIES 256
38a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson
39a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsonenum ColorSpace_t{
40a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    ITU_R_601,
41a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    ITU_R_601_FR,
42a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    ITU_R_709,
43a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson};
44ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
45ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonstruct HSICData_t {
46ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t hue;
47ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    float   saturation;
48ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t intensity;
49ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    float   contrast;
50ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson};
51ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
52ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonstruct Sharp2Data_t {
53ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t strength;
54ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint32_t edge_thr;
55ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint32_t smooth_thr;
56ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint32_t noise_thr;
57ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson};
58ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
59ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonstruct IGCData_t{
60ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint16_t c0[MAX_IGC_LUT_ENTRIES];
61ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint16_t c1[MAX_IGC_LUT_ENTRIES];
62ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    uint16_t c2[MAX_IGC_LUT_ENTRIES];
63ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson};
64ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
65ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonstruct BufferDim_t {
66ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t sliceWidth;
67ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t sliceHeight;
68ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson};
69ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
70ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilsonstruct MetaData_t {
71ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t operation;
72ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t interlaced;
73a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    struct BufferDim_t bufferDim;
74a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    struct HSICData_t hsicData;
75ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t sharpness;
76ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int32_t video_interface;
77a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    struct IGCData_t igcData;
78a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    struct Sharp2Data_t Sharp2Data;
79ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    int64_t timestamp;
80a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    enum ColorSpace_t colorSpace;
81ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson};
82ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
83a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsonenum DispParamType {
84ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_HSIC       = 0x0001,
85ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_SHARPNESS  = 0x0002,
86ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_INTERLACED = 0x0004,
87ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_VID_INTFC  = 0x0008,
88ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_IGC        = 0x0010,
89ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_SHARP2     = 0x0020,
90ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    PP_PARAM_TIMESTAMP  = 0x0040,
91ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson    UPDATE_BUFFER_GEOMETRY = 0x0080,
92a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson    UPDATE_COLOR_SPACE = 0x0200,
93a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson};
94a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson
95a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsonstruct private_handle_t;
96a653efede03423aa840da24634f1ec6f20796f1eSimon Wilsonint setMetaData(struct private_handle_t *handle, enum DispParamType paramType,
97a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson        void *param);
98ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
99a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson#ifdef __cplusplus
100a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson}
101a653efede03423aa840da24634f1ec6f20796f1eSimon Wilson#endif
102ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
103ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson#endif /* _QDMETADATA_H */
104ef53c1c84ec55ed50f607d52b7abfbb86239408eSimon Wilson
105