OpenCores
URL https://opencores.org/ocsvn/t6507lp/t6507lp/trunk

Subversion Repositories t6507lp

[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [video_converter.v] - Blame information for rev 220

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 218 creep
////////////////////////////////////////////////////////////////////////////
2
////                                                                    ////
3
//// t2600 IP Core                                                      ////
4
////                                                                    ////
5
//// This file is part of the t2600 project                             ////
6
//// http://www.opencores.org/cores/t2600/                              ////
7
////                                                                    ////
8
//// Description                                                        ////
9
//// Color scheme conversion                                            ////
10
////                                                                    ////
11
//// TODO:                                                              ////
12 220 creep
//// - Maybe less colors will be used                                   ////
13 218 creep
////                                                                    ////
14
//// Author(s):                                                         ////
15
//// - Gabriel Oshiro Zardo, gabrieloshiro@gmail.com                    ////
16
//// - Samuel Nascimento Pagliarini (creep), snpagliarini@gmail.com     ////
17
////                                                                    ////
18
////////////////////////////////////////////////////////////////////////////
19
////                                                                    ////
20
//// Copyright (C) 2001 Authors and OPENCORES.ORG                       ////
21
////                                                                    ////
22
//// This source file may be used and distributed without               ////
23
//// restriction provided that this copyright statement is not          ////
24
//// removed from the file and that any derivative work contains        ////
25
//// the original copyright notice and the associated disclaimer.       ////
26
////                                                                    ////
27
//// This source file is free software; you can redistribute it         ////
28
//// and/or modify it under the terms of the GNU Lesser General         ////
29
//// Public License as published by the Free Software Foundation;       ////
30
//// either version 2.1 of the License, or (at your option) any         ////
31
//// later version.                                                     ////
32
////                                                                    ////
33
//// This source is distributed in the hope that it will be             ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied         ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR            ////
36
//// PURPOSE. See the GNU Lesser General Public License for more        ////
37
//// details.                                                           ////
38
////                                                                    ////
39
//// You should have received a copy of the GNU Lesser General          ////
40
//// Public License along with this source; if not, download it         ////
41
//// from http://www.opencores.org/lgpl.shtml                           ////
42
////                                                                    ////
43
////////////////////////////////////////////////////////////////////////////
44
 
45
 
46
module video_converter(ypbpr, rgb);
47
 
48 219 creep
input [6:0] ypbpr;
49
output reg [23:0] rgb;
50
 
51
always @(*) begin
52
        case (ypbpr[2:0]) // luminance
53 218 creep
                3'h0: begin
54 219 creep
                        case (ypbpr[6:3])
55 218 creep
                                4'h0: rgb = 24'h000000;
56
                                4'h1: rgb = 24'h444400;
57
                                4'h2: rgb = 24'h702800;
58
                                4'h3: rgb = 24'h841800;
59
                                4'h4: rgb = 24'h880000;
60
                                4'h5: rgb = 24'h78005C;
61
                                4'h6: rgb = 24'h480078;
62
                                4'h7: rgb = 24'h140084;
63
                                4'h8: rgb = 24'h000088;
64
                                4'h9: rgb = 24'h00187C;
65
                                4'hA: rgb = 24'h002C5C;
66
                                4'hB: rgb = 24'h003C2C;
67
                                4'hC: rgb = 24'h003C00;
68 219 creep
                                4'hD: rgb = 24'h143800;
69
                                4'hE: rgb = 24'h2C3000;
70
                                4'hF: rgb = 24'h442800;
71 218 creep
                        endcase
72
                end
73 219 creep
                3'h1: begin
74
                        case (ypbpr[6:3])
75
                                4'h0: rgb = 24'h404040;
76
                                4'h1: rgb = 24'h646410;
77
                                4'h2: rgb = 24'h844414;
78
                                4'h3: rgb = 24'h983418;
79
                                4'h4: rgb = 24'h9C2020;
80
                                4'h5: rgb = 24'h8C2074;
81
                                4'h6: rgb = 24'h602090;
82
                                4'h7: rgb = 24'h302098;
83
                                4'h8: rgb = 24'h1C209C;
84
                                4'h9: rgb = 24'h1C3890;
85
                                4'hA: rgb = 24'h1C4C78;
86
                                4'hB: rgb = 24'h1C5C48;
87
                                4'hC: rgb = 24'h205C20;
88
                                4'hD: rgb = 24'h345C1C;
89
                                4'hE: rgb = 24'h4C501C;
90
                                4'hF: rgb = 24'h644818;
91
                        endcase
92
                end
93
                3'h2: begin
94
                        case (ypbpr[6:3])
95
                                4'h0: rgb = 24'h6C6C6C;
96
                                4'h1: rgb = 24'h848424;
97
                                4'h2: rgb = 24'h985C28;
98
                                4'h3: rgb = 24'hAC5030;
99
                                4'h4: rgb = 24'hB03C3C;
100
                                4'h5: rgb = 24'hA03C88;
101
                                4'h6: rgb = 24'h783CA4;
102
                                4'h7: rgb = 24'h4C3CAC;
103
                                4'h8: rgb = 24'h3840B0;
104
                                4'h9: rgb = 24'h3854A8;
105
                                4'hA: rgb = 24'h386890;
106
                                4'hB: rgb = 24'h387C64;
107
                                4'hC: rgb = 24'h407C40;
108
                                4'hD: rgb = 24'h507C38;
109
                                4'hE: rgb = 24'h687034;
110
                                4'hF: rgb = 24'h846830;
111
                        endcase
112
                end
113
                3'h3: begin
114
                        case (ypbpr[6:3])
115
                                4'h0: rgb = 24'h909090;
116
                                4'h1: rgb = 24'hA0A034;
117
                                4'h2: rgb = 24'hAC783C;
118
                                4'h3: rgb = 24'hC06848;
119
                                4'h4: rgb = 24'hC05858;
120
                                4'h5: rgb = 24'hB0589C;
121
                                4'h6: rgb = 24'h8C58B8;
122
                                4'h7: rgb = 24'h6858C0;
123
                                4'h8: rgb = 24'h505CC0;
124
                                4'h9: rgb = 24'h5070BC;
125
                                4'hA: rgb = 24'h5084AC;
126
                                4'hB: rgb = 24'h509C80;
127
                                4'hC: rgb = 24'h5C9C5C;
128
                                4'hD: rgb = 24'h6C9850;
129
                                4'hE: rgb = 24'h848C4C;
130
                                4'hF: rgb = 24'hA08444;
131
                        endcase
132
                end
133
                3'h4: begin
134
                        case (ypbpr[6:3])
135
                                4'h0: rgb = 24'hB0B0B0;
136
                                4'h1: rgb = 24'hB8B840;
137
                                4'h2: rgb = 24'hBC8C4C;
138
                                4'h3: rgb = 24'hD0805C;
139
                                4'h4: rgb = 24'hD07070;
140
                                4'h5: rgb = 24'hC070B0;
141
                                4'h6: rgb = 24'hA070CC;
142
                                4'h7: rgb = 24'h7C70D0;
143
                                4'h8: rgb = 24'h6874D0;
144
                                4'h9: rgb = 24'h6888CC;
145
                                4'hA: rgb = 24'h689CC0;
146
                                4'hB: rgb = 24'h68B494;
147
                                4'hC: rgb = 24'h74B474;
148
                                4'hD: rgb = 24'h84B468;
149
                                4'hE: rgb = 24'h9CA864;
150
                                4'hF: rgb = 24'hB89C58;
151
                        endcase
152
                end
153
                3'h5: begin
154
                        case (ypbpr[6:3])
155
                                4'h0: rgb = 24'hC8C8C8;
156
                                4'h1: rgb = 24'hD0D050;
157
                                4'h2: rgb = 24'hCCA05C;
158
                                4'h3: rgb = 24'hE09470;
159
                                4'h4: rgb = 24'hE08888;
160
                                4'h5: rgb = 24'hD084C0;
161
                                4'h6: rgb = 24'hB484DC;
162
                                4'h7: rgb = 24'h9488E0;
163
                                4'h8: rgb = 24'h7C8CE0;
164
                                4'h9: rgb = 24'h7C9CDC;
165
                                4'hA: rgb = 24'h7CB4D4;
166
                                4'hB: rgb = 24'h7CD0AC;
167
                                4'hC: rgb = 24'h8CD08C;
168
                                4'hD: rgb = 24'h9CCC7C;
169
                                4'hE: rgb = 24'hB4C078;
170
                                4'hF: rgb = 24'hD0B46C;
171
                        endcase
172
                end
173
                3'h6: begin
174
                        case (ypbpr[6:3])
175
                                4'h0: rgb = 24'hDCDCDC;
176
                                4'h1: rgb = 24'hE8E85C;
177
                                4'h2: rgb = 24'hDCB468;
178
                                4'h3: rgb = 24'hECA880;
179
                                4'h4: rgb = 24'hECA0A0;
180
                                4'h5: rgb = 24'hDC9CD0;
181
                                4'h6: rgb = 24'hC49CEC;
182
                                4'h7: rgb = 24'hA8A0EC;
183
                                4'h8: rgb = 24'h90A4EC;
184
                                4'h9: rgb = 24'h90B4EC;
185
                                4'hA: rgb = 24'h90CCE8;
186
                                4'hB: rgb = 24'h90E4C0;
187
                                4'hC: rgb = 24'hA4E4A4;
188
                                4'hD: rgb = 24'hB4E490;
189
                                4'hE: rgb = 24'hCCD488;
190
                                4'hF: rgb = 24'hE8CC7C;
191
                        endcase
192
                end
193
                3'h7: begin
194
                        case (ypbpr[6:3])
195
                                4'h0: rgb = 24'hECECEC;
196
                                4'h1: rgb = 24'hFCFC68;
197
                                4'h2: rgb = 24'hECC878;
198
                                4'h3: rgb = 24'hFCBC94;
199
                                4'h4: rgb = 24'hFCB4B4;
200
                                4'h5: rgb = 24'hECB0E0;
201
                                4'h6: rgb = 24'hD4B0FC;
202
                                4'h7: rgb = 24'hBCB4FC;
203
                                4'h8: rgb = 24'hA4B8FC;
204
                                4'h9: rgb = 24'hA4C8FC;
205
                                4'hA: rgb = 24'hA4E0FC;
206
                                4'hB: rgb = 24'hA4FCD4;
207
                                4'hC: rgb = 24'hB8FCB8;
208
                                4'hD: rgb = 24'hC8FCA4;
209
                                4'hE: rgb = 24'hE0EC9C;
210
                                4'hF: rgb = 24'hFCE08C;
211
                        endcase
212
                end
213 218 creep
        endcase
214 219 creep
end
215 218 creep
endmodule
216
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.