aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-10-07 16:30:40 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 09:17:56 -0500
commit26f61c0ddf0e191fdab5c15f00c4bf8f3544be6b (patch)
tree2ffa9a163aae74481f3edeaebf81add00ccb2d44 /drivers/media/pci/cx88
parent045d69ce2116f72d9e658ff59427a11c93754a98 (diff)
[media] cx88-dsp: Add some spaces for better code readability
Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-dsp.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/media/pci/cx88/cx88-dsp.c b/drivers/media/pci/cx88/cx88-dsp.c
index 341e24432fab..33f3c58f8197 100644
--- a/drivers/media/pci/cx88/cx88-dsp.c
+++ b/drivers/media/pci/cx88/cx88-dsp.c
@@ -31,7 +31,7 @@
31#define INT_PI ((s32)(3.141592653589 * 32768.0)) 31#define INT_PI ((s32)(3.141592653589 * 32768.0))
32 32
33#define compat_remainder(a, b) \ 33#define compat_remainder(a, b) \
34 ((float)(((s32)((a)*100))%((s32)((b)*100)))/100.0) 34 ((float)(((s32)((a) * 100)) % ((s32)((b) * 100))) / 100.0)
35 35
36#define baseband_freq(carrier, srate, tone) ((s32)( \ 36#define baseband_freq(carrier, srate, tone) ((s32)( \
37 (compat_remainder(carrier + tone, srate)) / srate * 2 * INT_PI)) 37 (compat_remainder(carrier + tone, srate)) / srate * 2 * INT_PI))
@@ -82,15 +82,15 @@ static s32 int_cos(u32 x)
82 if (period % 2) 82 if (period % 2)
83 return -int_cos(x - INT_PI); 83 return -int_cos(x - INT_PI);
84 x = x % INT_PI; 84 x = x % INT_PI;
85 if (x > INT_PI/2) 85 if (x > INT_PI / 2)
86 return -int_cos(INT_PI/2 - (x % (INT_PI/2))); 86 return -int_cos(INT_PI / 2 - (x % (INT_PI / 2)));
87 /* Now x is between 0 and INT_PI/2. 87 /* Now x is between 0 and INT_PI/2.
88 * To calculate cos(x) we use it's Taylor polinom. */ 88 * To calculate cos(x) we use it's Taylor polinom. */
89 t2 = x*x/32768/2; 89 t2 = x * x / 32768 / 2;
90 t4 = t2*x/32768*x/32768/3/4; 90 t4 = t2 * x / 32768 * x / 32768 / 3 / 4;
91 t6 = t4*x/32768*x/32768/5/6; 91 t6 = t4 * x / 32768 * x / 32768 / 5 / 6;
92 t8 = t6*x/32768*x/32768/7/8; 92 t8 = t6 * x / 32768 * x / 32768 / 7 / 8;
93 ret = 32768-t2+t4-t6+t8; 93 ret = 32768 - t2 + t4 - t6 + t8;
94 return ret; 94 return ret;
95} 95}
96 96
@@ -100,14 +100,14 @@ static u32 int_goertzel(s16 x[], u32 N, u32 freq)
100 * given frequency in the signal */ 100 * given frequency in the signal */
101 s32 s_prev = 0; 101 s32 s_prev = 0;
102 s32 s_prev2 = 0; 102 s32 s_prev2 = 0;
103 s32 coeff = 2*int_cos(freq); 103 s32 coeff = 2 * int_cos(freq);
104 u32 i; 104 u32 i;
105 105
106 u64 tmp; 106 u64 tmp;
107 u32 divisor; 107 u32 divisor;
108 108
109 for (i = 0; i < N; i++) { 109 for (i = 0; i < N; i++) {
110 s32 s = x[i] + ((s64)coeff*s_prev/32768) - s_prev2; 110 s32 s = x[i] + ((s64)coeff * s_prev / 32768) - s_prev2;
111 s_prev2 = s_prev; 111 s_prev2 = s_prev;
112 s_prev = s; 112 s_prev = s;
113 } 113 }
@@ -138,7 +138,7 @@ static u32 noise_magnitude(s16 x[], u32 N, u32 freq_start, u32 freq_end)
138 138
139 if (N > 192) { 139 if (N > 192) {
140 /* The last 192 samples are enough for noise detection */ 140 /* The last 192 samples are enough for noise detection */
141 x += (N-192); 141 x += (N - 192);
142 N = 192; 142 N = 192;
143 } 143 }
144 144
@@ -196,8 +196,8 @@ static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N)
196 196
197 if (core->tvaudio == WW_EIAJ) { 197 if (core->tvaudio == WW_EIAJ) {
198 /* EIAJ checks may need adjustments */ 198 /* EIAJ checks may need adjustments */
199 if ((carrier > max(stereo, dual)*2) && 199 if ((carrier > max(stereo, dual) * 2) &&
200 (carrier < max(stereo, dual)*6) && 200 (carrier < max(stereo, dual) * 6) &&
201 (carrier > 20 && carrier < 200) && 201 (carrier > 20 && carrier < 200) &&
202 (max(stereo, dual) > min(stereo, dual))) { 202 (max(stereo, dual) > min(stereo, dual))) {
203 /* For EIAJ the carrier is always present, 203 /* For EIAJ the carrier is always present,
@@ -205,11 +205,11 @@ static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N)
205 return ret; 205 return ret;
206 } 206 }
207 } else { 207 } else {
208 if ((carrier > max(stereo, dual)*2) && 208 if ((carrier > max(stereo, dual) * 2) &&
209 (carrier < max(stereo, dual)*8) && 209 (carrier < max(stereo, dual) * 8) &&
210 (carrier > 20 && carrier < 200) && 210 (carrier > 20 && carrier < 200) &&
211 (noise < 10) && 211 (noise < 10) &&
212 (max(stereo, dual) > min(stereo, dual)*2)) { 212 (max(stereo, dual) > min(stereo, dual) * 2)) {
213 return ret; 213 return ret;
214 } 214 }
215 } 215 }
@@ -234,9 +234,9 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N)
234 s16 *samples; 234 s16 *samples;
235 235
236 unsigned int i; 236 unsigned int i;
237 unsigned int bpl = srch->fifo_size/AUD_RDS_LINES; 237 unsigned int bpl = srch->fifo_size / AUD_RDS_LINES;
238 unsigned int spl = bpl/4; 238 unsigned int spl = bpl / 4;
239 unsigned int sample_count = spl*(AUD_RDS_LINES-1); 239 unsigned int sample_count = spl * (AUD_RDS_LINES - 1);
240 240
241 u32 current_address = cx_read(srch->ptr1_reg); 241 u32 current_address = cx_read(srch->ptr1_reg);
242 u32 offset = (current_address - srch->fifo_start + bpl); 242 u32 offset = (current_address - srch->fifo_start + bpl);
@@ -252,7 +252,7 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N)
252 *N = sample_count; 252 *N = sample_count;
253 253
254 for (i = 0; i < sample_count; i++) { 254 for (i = 0; i < sample_count; i++) {
255 offset = offset % (AUD_RDS_LINES*bpl); 255 offset = offset % (AUD_RDS_LINES * bpl);
256 samples[i] = cx_read(srch->fifo_start + offset); 256 samples[i] = cx_read(srch->fifo_start + offset);
257 offset += 4; 257 offset += 4;
258 } 258 }