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

Subversion Repositories t6507lp

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

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

powered by: WebSVN 2.1.0

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