1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
5 */
6
7 #include "ia_css_debug.h"
8 #include "ia_css_tdf.host.h"
9
10 static const s16 g_pyramid[8][8] = {
11 {128, 384, 640, 896, 896, 640, 384, 128},
12 {384, 1152, 1920, 2688, 2688, 1920, 1152, 384},
13 {640, 1920, 3200, 4480, 4480, 3200, 1920, 640},
14 {896, 2688, 4480, 6272, 6272, 4480, 2688, 896},
15 {896, 2688, 4480, 6272, 6272, 4480, 2688, 896},
16 {640, 1920, 3200, 4480, 4480, 3200, 1920, 640},
17 {384, 1152, 1920, 2688, 2688, 1920, 1152, 384},
18 {128, 384, 640, 896, 896, 640, 384, 128}
19 };
20
21 void
ia_css_tdf_vmem_encode(struct ia_css_isp_tdf_vmem_params * to,const struct ia_css_tdf_config * from,size_t size)22 ia_css_tdf_vmem_encode(
23 struct ia_css_isp_tdf_vmem_params *to,
24 const struct ia_css_tdf_config *from,
25 size_t size)
26 {
27 unsigned int i;
28 (void)size;
29
30 for (i = 0; i < ISP_VEC_NELEMS; i++) {
31 to->pyramid[0][i] = g_pyramid[i / 8][i % 8];
32 to->threshold_flat[0][i] = from->thres_flat_table[i];
33 to->threshold_detail[0][i] = from->thres_detail_table[i];
34 }
35 }
36
37 void
ia_css_tdf_encode(struct ia_css_isp_tdf_dmem_params * to,const struct ia_css_tdf_config * from,size_t size)38 ia_css_tdf_encode(
39 struct ia_css_isp_tdf_dmem_params *to,
40 const struct ia_css_tdf_config *from,
41 size_t size)
42 {
43 (void)size;
44 to->Epsilon_0 = from->epsilon_0;
45 to->Epsilon_1 = from->epsilon_1;
46 to->EpsScaleText = from->eps_scale_text;
47 to->EpsScaleEdge = from->eps_scale_edge;
48 to->Sepa_flat = from->sepa_flat;
49 to->Sepa_Edge = from->sepa_edge;
50 to->Blend_Flat = from->blend_flat;
51 to->Blend_Text = from->blend_text;
52 to->Blend_Edge = from->blend_edge;
53 to->Shading_Gain = from->shading_gain;
54 to->Shading_baseGain = from->shading_base_gain;
55 to->LocalY_Gain = from->local_y_gain;
56 to->LocalY_baseGain = from->local_y_base_gain;
57 }
58
59 void
ia_css_tdf_debug_dtrace(const struct ia_css_tdf_config * config,unsigned int level)60 ia_css_tdf_debug_dtrace(
61 const struct ia_css_tdf_config *config,
62 unsigned int level)
63 {
64 (void)config;
65 (void)level;
66 }
67