亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ycrcb2rgb_v2mult.v

?? YUV轉(zhuǎn)RGB的源程序
?? V
字號:


//-----------------------------------------------------------------
// ycrcb2rgb_wire_mult.v - Color Space Converter
//                         Virtex-II Video Demo Board
//
//
//
//
//                  Author: Gregg C. Hawkes
//                  Senior Staff Applications Engineer
//
//                  Video Applications
//                  Advanced Products Division
//                  Xilinx, Inc.
//
//                  Copyright (c) 1999 Xilinx, Inc.
//                  All rights reserved
//
//                  Date:   Aug. 6, 2001
//                  For:    Video Demo Board
//
//                  RESTRICTED RIGHTS LEGEND
//
//      This software has not been published by the author, and 
//      has been disclosed to others for the purpose of enhancing 
//      and promoting design productivity in Xilinx products.
//
//      Therefore use, duplication or disclosure, now and in the 
//      future should give consideration to the productivity 
//      enhancements afforded the user of this code by the author's 
//      efforts.  Thank you for using our products !
//
// Disclaimer:  THESE DESIGNS ARE PROVIDED "AS IS" WITH NO WARRANTY 
//              WHATSOEVER AND XILINX SPECIFICALLY DISCLAIMS ANY 
//              IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
//              A PARTICULAR PURPOSE, OR AGAINST INFRINGEMENT.
//
//
// 
// Revision:
//          Aug. 6, 2001     Creation
//
//
// Other modules instanced in this design:
//
/*

BRIEF DESCRIPTION

This version replaces all 5 multipliers with approximations built out of
simple shifts and 5 adders. Also notice that the error introduced, about
1 to 8 percent is all to the downside. Therefore a slight increase in
gain of the components (at the display) will make the differences even
less noticeable.

Color space Conversion for consumer equipment is typically performed on
8 bit data. Of the eight bits, 7 bits are needed to represent the
magnitude of Cr and Cb and 8 bits for Y. The equations used in this
module convert gamma corrected Y (scaled 16 to 235) and CrCb (scaled 16
to 240, with 128 being zero) to gamma corrected RGB (scaled from 0 to
255).

The Virtex II Video Demo Board supports broadcast quality with 10 bit
data.


DETAILED DESCRIPTION:

YCbCr Color Space - YCbCr Color Space was developed as part of the
Recommendation ITU-R BT.601 for worldwide digital component video
standard and is used in television transmissions. Here the color space
is separated into a Luma part (Y) and two Chroma parts (Cb and Cr).

Historically engineers found they could trasmit 1/2 the Chroma values
without extreme picture degradation. Color Space Definition - The human
eye has three types of photoreceptor cells called cones. Stimulating the
cells causes the human brain to "perceive" color. Colors can be
specified, created, and visualized using different color formats or
"color spaces". 

Whatever historical reasons caused color space choices in the past, the
convergence of computers, the Internet, and a wide variety of video
devices, all using different color representations, is forcing the
digital designer today to convert between them. The objective is to have
a common color space that all inputs are converted to before algorithms
and processes are executed.

The converters are useful for a number of markets, such as Multi-media
and image processing. Their basic function is to convert from one color
space to another.

RGB Color Space - RGB color space is a simple definition used in
computer systems. RGB corresponds most closely to the behavior of the
human eye.

RGB is an additive color system. The three primary colors red, green,
and blue are added to form the desired color. Each component has a range
of 0 to 255, with all three 0s producing black and all three 255s
producing 100% saturated, 100% amplitude white.


For 10 bit video
R' = 1.164(Y-64) + 1.596(Cr-512)
G' = 1.164(Y-64) -  .813(Cr-512) - .392(Cb-512)
B' = 1.164(Y-64) +  2.017(Cb-512)

For eight bit video
R' = 1.164(Y-16) + 1.596(Cr-128)
G' = 1.164(Y-16) -  .813(Cr-128) - .392(Cb-128)
B' = 1.164(Y-16) +  2.017(Cb-128)

approximations
--------------

1.164 ~ 1 + .125        -> 1.125 (.039/1.164 = 3% error)
1.596 ~ 1 + .125 + .5   -> 1.625 (.032/1.596 = 2% error)
2.017 ~ 2               -> 2.000 (.017/2.017 = 1% error)
 .813 ~.5 + .25 + .0625 -> .8125 (.0005/.813 = 1% error)
 .382 ~.25 + .125       -> .375  (.007/.382  = 2% error)

It should be noted that this module will produce large excursions beyond
legal values of RGB. These excursions are coherced to the maximum and
minimum RGB values by a follow on module.  The decision to do this was
based on the fact that the follow on format module is used in a number
of places in the pipeline.


Design Information
------------------
xc2v1000-ff896-6

Slices      130
FFs          62
LUTs        183
IO           64
gates     2,455

Minimum period:  16.647ns (Maximum frequency:  60.071MHz)
Maximum net delay:   3.593ns

*/


`timescale 1ns / 100ps

module ycrcb2rgb_v2mult (
rst,
clk,

Fi,           // Low to High signals start of Field One
Vi,           // High signals Vertical Blanking
Hi,           // High signals Horizontal Blanking

Fo,           // Field signal delayed by pipe length
Vo,           // Vertical signal delayed by pipe length
Ho,           // Horizontal signal delayed by pipe length

cei,          // component rate is 1/2 the clock rate
ceo,          // component rate is 1/2 the clock rate

Y_in,
Cr_in,
Cb_in,

R_out,
G_out,
B_out
);

// PIPE_LENGTH must be an even number thereby
// making the length of the pipe an even 
// number of FFs.
parameter PIPE_LENGTH = 2;

input rst, clk, Fi, Vi, Hi, cei;
input [9:0] Y_in, Cr_in, Cb_in;

output [9:0]  R_out, G_out, B_out;
output Fo, Vo, Ho, ceo;

reg [PIPE_LENGTH-1:0] F_rg, V_rg, H_rg, ce_rg;
wire Fo, Vo, Ho, ceo;

reg [9:0] Y_rg, Cr_rg, Cb_rg;

wire [12:0] Y_sub, Cr_sub, Cb_sub;
wire [35:0] P0, P1, P2, P3, P4;
reg [12:0]  Y_1d1640, Cr_0d813, Cr_1d596, Cb_2d017, Cb_0d392;
wire [12:0] R, G, B;

reg [9:0] R_out, G_out , B_out;

integer i;

//-----------------------------------------------------------------------
//
// Shift register delays Fi, Vi, and Hi by the length of the pipe line
//
always @ (posedge clk) begin
  if (rst) begin F_rg <= 0; V_rg <= 0; H_rg <= 0; ce_rg <= 0; end
  else begin
    F_rg[PIPE_LENGTH-1:0] <= {F_rg[PIPE_LENGTH-2:0], Fi};
    V_rg[PIPE_LENGTH-1:0] <= {V_rg[PIPE_LENGTH-2:0], Vi};
    H_rg[PIPE_LENGTH-1:0] <= {H_rg[PIPE_LENGTH-2:0], Hi};
    ce_rg[PIPE_LENGTH-1:0] <= {ce_rg[PIPE_LENGTH-2:0], cei};
  end
end

assign Fo = F_rg[PIPE_LENGTH-1];
assign Vo = V_rg[PIPE_LENGTH-1];
assign Ho = H_rg[PIPE_LENGTH-1];
assign ceo = ce_rg[PIPE_LENGTH-1];



//-----------------------------------------------------------------------
//
// Register Y, Cr, and Cb inputs
//
always @ (posedge clk) begin
  if (rst) begin Y_rg <= 0; Cr_rg <= 0; Cb_rg <= 0; end
  else if (cei) begin Y_rg <= Y_in; Cr_rg <= Cr_in; Cb_rg <= Cb_in; end
  else begin Y_rg <= Y_rg; Cr_rg <= Cr_rg; Cb_rg <= Cb_rg; end
end



//-----------------------------------------------------------------------
//
// Offset Y, Cr, and Cb.
// Note: Internal wires are all 13 bits from here out, to allow for 
// increasing bit extent due to additions, subtractions, and multiplies
// Signs are extended when appropriate.
//
assign Y_sub  = ({3'b000, Y_rg}  - 'd64);  // result always positive
assign Cr_sub = ({3'b000, Cr_rg} - 'd512); // result is positive or negative
assign Cb_sub = ({3'b000, Cb_rg} - 'd512); // result is positive or negative



//-----------------------------------------------------------------------
//
// These equations are v2 multiplier versions of the color space 
// conversion multiplications.
//
/*

Full accuracy equations for 10 bit component video
--------------------------------------------------
R' = 1.164(Y-64) + 1.596(Cr-512)
G' = 1.164(Y-64) -  .813(Cr-512) - .392(Cb-512)
B' = 1.164(Y-64) + 2.017(Cb-512)

use full precision of multiply to experiment with coefficients
1.164 -> I[1:0].F[15:0]  .164 X 2^16 = 094FD or 00 1.001 0100 1111 1101 
0.813 -> I[1:0].F[15:0]  .813 X 2^16 = 06810 or 00 0.110 1000 0001 0000
1.596 -> I[1:0].F[15:0]  .596 X 2^16 = 0CC49 or 00 1.100 1100 0100 1001
2.017 -> I[1:0].F[15:0]  .017 X 2^16 = 1022D or 01 0.000 0010 0010 1101
0.392 -> I[1:0].F[15:0]  .392 X 2^16 = 0322D or 00 0.011 0010 0010 1101

*/

MULT18X18 U1  (.P(P0),  .A(18'h094FD), .B({ Y_sub[12],  Y_sub[12],  Y_sub[12],  Y_sub[12],  Y_sub[12],  Y_sub}));
MULT18X18 U2  (.P(P1),  .A(18'h06810), .B({Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub}));
MULT18X18 U3  (.P(P2),  .A(18'h0CC49), .B({Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub[12], Cr_sub}));
MULT18X18 U4  (.P(P3),  .A(18'h1022D), .B({Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub}));
MULT18X18 U5  (.P(P4),  .A(18'h0322D), .B({Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub[12], Cb_sub}));

// S[1]I[17].F[0] * S[1]I[2].F[15] = S[1]I[20].F[15]

//-----------------------------------------------------------------------
//
// Register outputs of multiply
// Note: P is 24 bits so make P_rg 26 bits and sign smear [25:0]
//
always @ (posedge clk) begin
  if (rst) begin
    Y_1d1640 <= 0;
    Cr_0d813 <= 0;
    Cr_1d596 <= 0;
    Cb_2d017 <= 0;
    Cb_0d392 <= 0;
  end
  else if (ce_rg[1])begin
    Y_1d1640 <= P0[27:15];
    Cr_0d813 <= P1[27:15];
    Cr_1d596 <= P2[27:15];
    Cb_2d017 <= P3[27:15];
    Cb_0d392 <= P4[27:15];
  end
  else begin
    Y_1d1640 <= Y_1d1640;
    Cr_0d813 <= Cr_0d813;
    Cr_1d596 <= Cr_1d596;
    Cb_2d017 <= Cb_2d017;
    Cb_0d392 <= Cb_0d392;
  end
end



//-----------------------------------------------------------------------
//
// Sum the proper outputs from the multiply to form R'G'B'
//
assign R = Y_1d1640 + Cr_1d596;
assign G = Y_1d1640 - Cr_0d813 - Cb_0d392;
assign B = Y_1d1640 + Cb_2d017;




//-----------------------------------------------------------------------
//
// Correct overflows and underflows
//
always @ (posedge clk) begin
  if (rst) R_out <= 0;
  else if (ce_rg[1] & (R[12])) R_out <= 0;              // min value = 0
  else if (ce_rg[1] & (R > 13'h3FC)) R_out <= 13'h3FC;  // max value = 255
  else if (ce_rg[1]) R_out <= R[9:0];                   // otherwise pass
  else R_out <= R_out;                                  // hold
end

always @ (posedge clk) begin
  if (rst) G_out <= 0;
  else if (ce_rg[1] & (G[12])) G_out <= 0;              // min value = 0
  else if (ce_rg[1] & (G > 13'h3FC)) G_out <= 13'h3FC;  // max value = 255
  else if (ce_rg[1]) G_out <= G[9:0];                   // otherwise pass
  else G_out <= G_out;                                  // hold
end

always @ (posedge clk) begin
  if (rst) B_out <= 0;
  else if (ce_rg[1] & (B[12])) B_out <= 0;              // min value = 0
  else if (ce_rg[1] & (B > 13'h3FC)) B_out <= 13'h3FC;  // max value = 255
  else if (ce_rg[1]) B_out <= B[9:0];                   // otherwise pass
  else B_out <= B_out;                                  // hold
end


endmodule




?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃精品在线观看| 中文字幕国产一区二区| 亚洲一区二区三区四区五区中文 | 九九九精品视频| 欧美一区二区三区在线观看| 热久久免费视频| 2023国产一二三区日本精品2022| 国产精品一区二区久激情瑜伽| 欧美高清在线一区| av在线不卡观看免费观看| 伊人色综合久久天天人手人婷| 欧美日韩中字一区| 精品中文av资源站在线观看| 久久久国产精华| 91在线一区二区| 日韩av一区二区三区四区| 久久色中文字幕| 色综合天天综合| 精品一区在线看| 欧美精彩视频一区二区三区| 91视频免费播放| 日韩福利视频导航| 国产精品色哟哟| 欧美午夜不卡视频| 国产综合久久久久影院| 中文字幕制服丝袜成人av| 精品视频1区2区| 国产乱一区二区| 亚洲一区二区综合| 国产亚洲精品久| 欧美日本韩国一区二区三区视频| 激情久久五月天| 伊人婷婷欧美激情| 国产无人区一区二区三区| 日本精品一级二级| 国产精品资源在线观看| 亚洲丶国产丶欧美一区二区三区| 国产亚洲欧美在线| 欧美巨大另类极品videosbest | 欧美日本乱大交xxxxx| 国产99精品国产| 99这里只有精品| 免费在线观看成人| 一区二区高清视频在线观看| 久久综合九色综合欧美亚洲| 欧美午夜一区二区三区| 国产精品亚洲一区二区三区在线| 亚洲一区二区三区四区的| 国产午夜久久久久| 日韩欧美一区在线| 欧洲激情一区二区| 成人污视频在线观看| 麻豆专区一区二区三区四区五区| 亚洲女同一区二区| 国产日韩影视精品| 精品国产免费久久| 欧美精品久久一区二区三区| 91在线国内视频| 国产精品一区一区| 精品一区二区日韩| 免费在线观看日韩欧美| 亚洲一级不卡视频| 亚洲婷婷综合色高清在线| 亚洲国产精品成人综合| 久久综合九色综合97婷婷女人| 91精品福利在线一区二区三区| 欧美性色综合网| 91激情在线视频| 91蜜桃婷婷狠狠久久综合9色| 国产高清视频一区| 国产精品资源在线观看| 国产中文字幕精品| 国内精品不卡在线| 国产精品一区二区果冻传媒| 久久精品免费观看| 极品美女销魂一区二区三区| 精品一区二区三区在线播放| 免费日本视频一区| 国产最新精品精品你懂的| 久久国产精品72免费观看| 久久97超碰国产精品超碰| 精品一区二区三区在线播放视频 | 亚洲精品日韩一| 亚洲精品日产精品乱码不卡| 亚洲精品中文在线| 亚洲国产精品一区二区久久恐怖片 | 国产精品91xxx| 国产九色sp调教91| 成人免费视频caoporn| 成人高清免费在线播放| 99国产欧美久久久精品| 色噜噜久久综合| 欧美色大人视频| 欧美一级欧美一级在线播放| 日韩视频免费观看高清完整版在线观看| 正在播放亚洲一区| 欧美成人精品二区三区99精品| 精品精品欲导航| 欧美韩国一区二区| 亚洲激情自拍视频| 日韩—二三区免费观看av| 韩国视频一区二区| 成人国产精品视频| 欧美色视频在线观看| 欧美一二三区在线观看| 国产肉丝袜一区二区| 亚洲色图一区二区三区| 日韩二区三区在线观看| 国产不卡在线播放| 91极品视觉盛宴| 日韩精品一区二区三区三区免费 | 中文字幕中文乱码欧美一区二区| 一区二区三区免费看视频| 日韩电影一区二区三区四区| 国产凹凸在线观看一区二区| 欧美在线播放高清精品| 精品欧美黑人一区二区三区| 1区2区3区国产精品| 日本欧美一区二区三区| yourporn久久国产精品| 日韩写真欧美这视频| 国产精品私人影院| 开心九九激情九九欧美日韩精美视频电影 | 国产精品色哟哟网站| 天天综合色天天| aa级大片欧美| 久久欧美一区二区| 午夜精品福利一区二区三区蜜桃| 国产一区二区三区观看| 欧美日韩中文国产| 国产精品欧美精品| 美国十次了思思久久精品导航| 色婷婷久久综合| 欧美极品另类videosde| 午夜欧美在线一二页| 成人晚上爱看视频| 久久综合丝袜日本网| 首页国产丝袜综合| 91性感美女视频| 国产亚洲精品久| 精品一区二区免费在线观看| 欧美日韩在线播放一区| 亚洲男人都懂的| 成人性生交大片免费看中文| 精品久久久网站| 热久久久久久久| 69精品人人人人| 亚洲第一狼人社区| 欧美亚洲丝袜传媒另类| 1区2区3区国产精品| 国产91精品精华液一区二区三区| 欧美一级理论片| 视频一区中文字幕| 欧美日韩三级视频| 亚洲高清在线精品| 欧美自拍偷拍午夜视频| 亚洲精品高清在线观看| 99视频一区二区| 亚洲欧洲日产国产综合网| 成人免费av网站| 欧美精彩视频一区二区三区| 国产传媒久久文化传媒| 久久一区二区三区国产精品| 捆绑紧缚一区二区三区视频| 欧美一级精品在线| 免费观看一级欧美片| 91精品国产日韩91久久久久久| 亚洲综合无码一区二区| 欧美在线观看视频一区二区三区| 樱花影视一区二区| 欧美性欧美巨大黑白大战| 亚洲精品成人在线| 欧美性大战久久久久久久| 亚洲伊人色欲综合网| 欧美日韩国产色站一区二区三区| 亚洲福利视频三区| 日韩午夜激情av| 国产在线播放一区| 国产精品视频一二| 91美女片黄在线| 亚洲一区二区三区四区不卡| 欧美女孩性生活视频| 全国精品久久少妇| 久久精品视频免费| caoporm超碰国产精品| 一区二区三区小说| 91精品国产一区二区| 国产一区二区导航在线播放| 日本一区二区视频在线观看| 91丨九色porny丨蝌蚪| 亚洲国产成人av网| 日韩欧美一二区| 成人午夜电影小说| 亚洲综合成人网| 欧美成人在线直播| 99国产精品一区| 奇米777欧美一区二区| 国产亚洲欧美日韩俺去了| 色一情一伦一子一伦一区| 免费观看久久久4p|