summaryrefslogtreecommitdiffstats
path: root/package/nw802-2.4/patches/100-compile_fix.patch
blob: 1f3d20c3e432bd6e2d4a484194fcb7ddc41c0ae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
--- a/nw8xx_jpgl.c
+++ b/nw8xx_jpgl.c
@@ -111,18 +111,18 @@
 // Clamping table
 #define SAFE_CLAMP
 #ifdef SAFE_CLAMP
-inline unsigned char clamp(int x) {
+inline unsigned char nw8xx_clamp(int x) {
 	if ( x > 255 )
 		return 255;
 	if ( x < 0 )
 		return 0;
 	return x;
 }
-#define clamp_adjust(x) clamp(x+128)
+#define nw8xx_clamp_adjust(x) nw8xx_clamp(x+128)
 #else
-#define clamp(x) clampTbl[(x)+512]
-#define clamp_adjust(x) clampTbl[(x)+640]
-static char clampTbl[1280];
+#define nw8xx_clamp(x) nw8xx_clampTbl[(x)+512]
+#define nw8xx_clamp_adjust(x) nw8xx_clampTbl[(x)+640]
+static char nw8xx_clampTbl[1280];
 #endif
 
 // Code to initialize those tables
@@ -195,19 +195,19 @@
 }
 
 #ifndef SAFE_CLAMP
-static void clampTbl_init(void)
+static void nw8xx_clampTbl_init(void)
 {
 	// Instead of doing if(...) to test for overrange, we use
-	// a clamping table
+	// a nw8xx_clamping table
 	
 	int i;
 
 	for (i=0 ; i < 512 ; i++)
-		clampTbl[i] = 0;
+		nw8xx_clampTbl[i] = 0;
 	for (i=512 ; i < 768 ; i++ )
-		clampTbl[i] = i - 512;
+		nw8xx_clampTbl[i] = i - 512;
 	for (i=768 ; i < 1280 ; i++ )
-		clampTbl[i] = 255;
+		nw8xx_clampTbl[i] = 255;
 
 }
 #endif
@@ -521,16 +521,16 @@
 				for ( x=0 ; x<4 ; x++ )
 				{
 					// Y block
-					Yline[ 0] = clamp_adjust(block_y[block_idx   ]);
-					Yline[ 4] = clamp_adjust(block_y[block_idx+16]);
-					Yline[ 8] = clamp_adjust(block_y[block_idx+32]);
-					Yline[12] = clamp_adjust(block_y[block_idx+48]);
+					Yline[ 0] = nw8xx_clamp_adjust(block_y[block_idx   ]);
+					Yline[ 4] = nw8xx_clamp_adjust(block_y[block_idx+16]);
+					Yline[ 8] = nw8xx_clamp_adjust(block_y[block_idx+32]);
+					Yline[12] = nw8xx_clamp_adjust(block_y[block_idx+48]);
 
 					// U block
-					*Uline = clamp_adjust(block_u[block_idx]);
+					*Uline = nw8xx_clamp_adjust(block_u[block_idx]);
 
 					// V block
-					*Vline = clamp_adjust(block_v[block_idx]);
+					*Vline = nw8xx_clamp_adjust(block_v[block_idx]);
 
 					// Ajust pointers & index
 					block_idx++;
@@ -596,9 +596,9 @@
 				vc = Vline[0];
 
 					// B G R
-				*(fb++) = clamp(( yc + yuvTbl_v2[vc] ) >> 16);
-				*(fb++) = clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
-				*(fb++) = clamp(( yc + yuvTbl_u1[uc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_v2[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_u1[uc] ) >> 16);
 #ifdef _JPGL_TEST_
 				fb++;
 #endif
@@ -609,9 +609,9 @@
 				vc = ( 3*Vline[0] + Vline[1] ) >> 2;
 				
 					// B G R
-				*(fb++) = clamp(( yc + yuvTbl_v2[vc] ) >> 16);
-				*(fb++) = clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
-				*(fb++) = clamp(( yc + yuvTbl_u1[uc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_v2[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_u1[uc] ) >> 16);
 #ifdef _JPGL_TEST_
 				fb++;
 #endif
@@ -622,9 +622,9 @@
 				vc = ( Vline[0] + Vline[1] ) >> 1;
 
 					// B G R
-				*(fb++) = clamp(( yc + yuvTbl_v2[vc] ) >> 16);
-				*(fb++) = clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
-				*(fb++) = clamp(( yc + yuvTbl_u1[uc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_v2[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_u1[uc] ) >> 16);
 #ifdef _JPGL_TEST_
 				fb++;
 #endif
@@ -635,9 +635,9 @@
 				vc = ( Vline[0] + 3*Vline[1] ) >> 2;
 
 					// B G R
-				*(fb++) = clamp(( yc + yuvTbl_v2[vc] ) >> 16);
-				*(fb++) = clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
-				*(fb++) = clamp(( yc + yuvTbl_u1[uc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_v2[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc - yuvTbl_u2[uc] - yuvTbl_v1[vc] ) >> 16);
+				*(fb++) = nw8xx_clamp(( yc + yuvTbl_u1[uc] ) >> 16);
 #ifdef _JPGL_TEST_
 				fb++;
 #endif
@@ -707,6 +707,6 @@
 	vlcTbl_init();
 	yuvTbl_init();
 #ifndef SAFE_CLAMP
-	clampTbl_init();
+	nw8xx_clampTbl_init();
 #endif
 }