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

Subversion Repositories t6507lp

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

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 222 creep
// note: this converts 7 ypbpr bits into 24 rgb bits. In order to use less rgb bits just use the most significant ones.
46 218 creep
 
47 222 creep
 
48 218 creep
module video_converter(ypbpr, rgb);
49
 
50 219 creep
input [6:0] ypbpr;
51
output reg [23:0] rgb;
52
 
53
always @(*) begin
54
        case (ypbpr[2:0]) // luminance
55 218 creep
                3'h0: begin
56 219 creep
                        case (ypbpr[6:3])
57 218 creep
                                4'h0: rgb = 24'h000000;
58
                                4'h1: rgb = 24'h444400;
59
                                4'h2: rgb = 24'h702800;
60
                                4'h3: rgb = 24'h841800;
61
                                4'h4: rgb = 24'h880000;
62
                                4'h5: rgb = 24'h78005C;
63
                                4'h6: rgb = 24'h480078;
64
                                4'h7: rgb = 24'h140084;
65
                                4'h8: rgb = 24'h000088;
66
                                4'h9: rgb = 24'h00187C;
67
                                4'hA: rgb = 24'h002C5C;
68
                                4'hB: rgb = 24'h003C2C;
69
                                4'hC: rgb = 24'h003C00;
70 219 creep
                                4'hD: rgb = 24'h143800;
71
                                4'hE: rgb = 24'h2C3000;
72
                                4'hF: rgb = 24'h442800;
73 218 creep
                        endcase
74
                end
75 219 creep
                3'h1: begin
76
                        case (ypbpr[6:3])
77
                                4'h0: rgb = 24'h404040;
78
                                4'h1: rgb = 24'h646410;
79
                                4'h2: rgb = 24'h844414;
80
                                4'h3: rgb = 24'h983418;
81
                                4'h4: rgb = 24'h9C2020;
82
                                4'h5: rgb = 24'h8C2074;
83
                                4'h6: rgb = 24'h602090;
84
                                4'h7: rgb = 24'h302098;
85
                                4'h8: rgb = 24'h1C209C;
86
                                4'h9: rgb = 24'h1C3890;
87
                                4'hA: rgb = 24'h1C4C78;
88
                                4'hB: rgb = 24'h1C5C48;
89
                                4'hC: rgb = 24'h205C20;
90
                                4'hD: rgb = 24'h345C1C;
91
                                4'hE: rgb = 24'h4C501C;
92
                                4'hF: rgb = 24'h644818;
93
                        endcase
94
                end
95
                3'h2: begin
96
                        case (ypbpr[6:3])
97
                                4'h0: rgb = 24'h6C6C6C;
98
                                4'h1: rgb = 24'h848424;
99
                                4'h2: rgb = 24'h985C28;
100
                                4'h3: rgb = 24'hAC5030;
101
                                4'h4: rgb = 24'hB03C3C;
102
                                4'h5: rgb = 24'hA03C88;
103
                                4'h6: rgb = 24'h783CA4;
104
                                4'h7: rgb = 24'h4C3CAC;
105
                                4'h8: rgb = 24'h3840B0;
106
                                4'h9: rgb = 24'h3854A8;
107
                                4'hA: rgb = 24'h386890;
108
                                4'hB: rgb = 24'h387C64;
109
                                4'hC: rgb = 24'h407C40;
110
                                4'hD: rgb = 24'h507C38;
111
                                4'hE: rgb = 24'h687034;
112
                                4'hF: rgb = 24'h846830;
113
                        endcase
114
                end
115
                3'h3: begin
116
                        case (ypbpr[6:3])
117
                                4'h0: rgb = 24'h909090;
118
                                4'h1: rgb = 24'hA0A034;
119
                                4'h2: rgb = 24'hAC783C;
120
                                4'h3: rgb = 24'hC06848;
121
                                4'h4: rgb = 24'hC05858;
122
                                4'h5: rgb = 24'hB0589C;
123
                                4'h6: rgb = 24'h8C58B8;
124
                                4'h7: rgb = 24'h6858C0;
125
                                4'h8: rgb = 24'h505CC0;
126
                                4'h9: rgb = 24'h5070BC;
127
                                4'hA: rgb = 24'h5084AC;
128
                                4'hB: rgb = 24'h509C80;
129
                                4'hC: rgb = 24'h5C9C5C;
130
                                4'hD: rgb = 24'h6C9850;
131
                                4'hE: rgb = 24'h848C4C;
132
                                4'hF: rgb = 24'hA08444;
133
                        endcase
134
                end
135
                3'h4: begin
136
                        case (ypbpr[6:3])
137
                                4'h0: rgb = 24'hB0B0B0;
138
                                4'h1: rgb = 24'hB8B840;
139
                                4'h2: rgb = 24'hBC8C4C;
140
                                4'h3: rgb = 24'hD0805C;
141
                                4'h4: rgb = 24'hD07070;
142
                                4'h5: rgb = 24'hC070B0;
143
                                4'h6: rgb = 24'hA070CC;
144
                                4'h7: rgb = 24'h7C70D0;
145
                                4'h8: rgb = 24'h6874D0;
146
                                4'h9: rgb = 24'h6888CC;
147
                                4'hA: rgb = 24'h689CC0;
148
                                4'hB: rgb = 24'h68B494;
149
                                4'hC: rgb = 24'h74B474;
150
                                4'hD: rgb = 24'h84B468;
151
                                4'hE: rgb = 24'h9CA864;
152
                                4'hF: rgb = 24'hB89C58;
153
                        endcase
154
                end
155
                3'h5: begin
156
                        case (ypbpr[6:3])
157
                                4'h0: rgb = 24'hC8C8C8;
158
                                4'h1: rgb = 24'hD0D050;
159
                                4'h2: rgb = 24'hCCA05C;
160
                                4'h3: rgb = 24'hE09470;
161
                                4'h4: rgb = 24'hE08888;
162
                                4'h5: rgb = 24'hD084C0;
163
                                4'h6: rgb = 24'hB484DC;
164
                                4'h7: rgb = 24'h9488E0;
165
                                4'h8: rgb = 24'h7C8CE0;
166
                                4'h9: rgb = 24'h7C9CDC;
167
                                4'hA: rgb = 24'h7CB4D4;
168
                                4'hB: rgb = 24'h7CD0AC;
169
                                4'hC: rgb = 24'h8CD08C;
170
                                4'hD: rgb = 24'h9CCC7C;
171
                                4'hE: rgb = 24'hB4C078;
172
                                4'hF: rgb = 24'hD0B46C;
173
                        endcase
174
                end
175
                3'h6: begin
176
                        case (ypbpr[6:3])
177
                                4'h0: rgb = 24'hDCDCDC;
178
                                4'h1: rgb = 24'hE8E85C;
179
                                4'h2: rgb = 24'hDCB468;
180
                                4'h3: rgb = 24'hECA880;
181
                                4'h4: rgb = 24'hECA0A0;
182
                                4'h5: rgb = 24'hDC9CD0;
183
                                4'h6: rgb = 24'hC49CEC;
184
                                4'h7: rgb = 24'hA8A0EC;
185
                                4'h8: rgb = 24'h90A4EC;
186
                                4'h9: rgb = 24'h90B4EC;
187
                                4'hA: rgb = 24'h90CCE8;
188
                                4'hB: rgb = 24'h90E4C0;
189
                                4'hC: rgb = 24'hA4E4A4;
190
                                4'hD: rgb = 24'hB4E490;
191
                                4'hE: rgb = 24'hCCD488;
192
                                4'hF: rgb = 24'hE8CC7C;
193
                        endcase
194
                end
195
                3'h7: begin
196
                        case (ypbpr[6:3])
197
                                4'h0: rgb = 24'hECECEC;
198
                                4'h1: rgb = 24'hFCFC68;
199
                                4'h2: rgb = 24'hECC878;
200
                                4'h3: rgb = 24'hFCBC94;
201
                                4'h4: rgb = 24'hFCB4B4;
202
                                4'h5: rgb = 24'hECB0E0;
203
                                4'h6: rgb = 24'hD4B0FC;
204
                                4'h7: rgb = 24'hBCB4FC;
205
                                4'h8: rgb = 24'hA4B8FC;
206
                                4'h9: rgb = 24'hA4C8FC;
207
                                4'hA: rgb = 24'hA4E0FC;
208
                                4'hB: rgb = 24'hA4FCD4;
209
                                4'hC: rgb = 24'hB8FCB8;
210
                                4'hD: rgb = 24'hC8FCA4;
211
                                4'hE: rgb = 24'hE0EC9C;
212
                                4'hF: rgb = 24'hFCE08C;
213
                        endcase
214
                end
215 218 creep
        endcase
216 219 creep
end
217 218 creep
endmodule
218
 

powered by: WebSVN 2.1.0

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