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

Subversion Repositories djpeg

[/] [djpeg/] [trunk/] [src/] [jpeg_dht.v] - Diff between revs 3 and 5

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 3 Rev 5
Line 56... Line 56...
   reg [7:0]     ReadDataYdc;
   reg [7:0]     ReadDataYdc;
   reg [7:0]     ReadDataYac;
   reg [7:0]     ReadDataYac;
   reg [7:0]     ReadDataCdc;
   reg [7:0]     ReadDataCdc;
   reg [7:0]     ReadDataCac;
   reg [7:0]     ReadDataCac;
 
 
   reg [7:0]     ReadData;
   wire [7:0]    ReadData;
 
 
   // RAM
   // RAM
   always @(posedge clk) begin
   always @(posedge clk) begin
      if(DataInEnable ==1'b1 & DataInColor ==2'b00) begin
      if(DataInEnable ==1'b1 & DataInColor ==2'b00) begin
         DHT_Ydc[DataInCount[3:0]] <= DataIn;
         DHT_Ydc[DataInCount[3:0]] <= DataIn;
Line 82... Line 82...
      ReadDataCdc <= DHT_Cdc[TableNumber[3:0]];
      ReadDataCdc <= DHT_Cdc[TableNumber[3:0]];
      ReadDataCac <= DHT_Cac[TableNumber];
      ReadDataCac <= DHT_Cac[TableNumber];
   end // always @ (posedge clk or negedge rst)
   end // always @ (posedge clk or negedge rst)
 
 
   // Selector
   // Selector
   always @(*) begin
/*
 
   always @(*) begin
 
      case (ColorNumber)
 
        2'b00: ReadData <= ReadDataYdc;
 
        2'b01: ReadData <= ReadDataYac;
 
        2'b10: ReadData <= ReadDataCdc;
 
        2'b11: ReadData <= ReadDataCac;
 
      endcase // case(ColorNumber)
 
   end
 
*/
 
        function [7:0] ReadDataSel;
 
                input [1:0]      ColorNumber;
 
                input [7:0]      ReadDataYdc;
 
                input [7:0]      ReadDataYac;
 
                input [7:0]      ReadDataCdc;
 
                input [7:0]      ReadDataCac;
 
        begin
      case (ColorNumber)
      case (ColorNumber)
        2'b00: ReadData <= ReadDataYdc;
                2'b00: ReadDataSel = ReadDataYdc;
        2'b01: ReadData <= ReadDataYac;
                2'b01: ReadDataSel = ReadDataYac;
        2'b10: ReadData <= ReadDataCdc;
                2'b10: ReadDataSel = ReadDataCdc;
        2'b11: ReadData <= ReadDataCac;
                2'b11: ReadDataSel = ReadDataCac;
      endcase // case(ColorNumber)
                endcase
   end
   end
 
        endfunction
 
 
 
   assign ReadData = ReadDataSel(ColorNumber, ReadDataYdc, ReadDataYac, ReadDataCdc, ReadDataCac);
 
 
   assign ZeroTable  = ReadData[7:4];
   assign ZeroTable  = ReadData[7:4];
   assign WidhtTable = ReadData[3:0];
   assign WidhtTable = ReadData[3:0];
 
 
endmodule // jpeg_dht
endmodule // jpeg_dht

powered by: WebSVN 2.1.0

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