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

Subversion Repositories nova

[/] [nova/] [tags/] [Start/] [src/] [Inter_pred_CPE.v] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 eexuke
//--------------------------------------------------------------------------------------------------
2
// Design    : nova
3
// Author(s) : Ke Xu
4
// Email           : eexuke@yahoo.com
5
// File      : Inter_pred_CPE.v
6
// Generated : Oct 14, 2005
7
// Copyright (C) 2008 Ke Xu                
8
//-------------------------------------------------------------------------------------------------
9
// Description 
10
// Processing Element for Inter prediction of Chroma pixels
11
//-------------------------------------------------------------------------------------------------
12
 
13
// synopsys translate_off
14
`include "timescale.v"
15
// synopsys translate_on
16
`include "nova_defines.v"
17
 
18
module Inter_pred_CPE (xFracC,yFracC,
19
        Inter_C_window_0_0,Inter_C_window_1_0,Inter_C_window_2_0,
20
        Inter_C_window_0_1,Inter_C_window_1_1,Inter_C_window_2_1,
21
        Inter_C_window_0_2,Inter_C_window_1_2,Inter_C_window_2_2,
22
        CPE0_out,CPE1_out,CPE2_out,CPE3_out);
23
        input [2:0] xFracC,yFracC;
24
        input [7:0] Inter_C_window_0_0,Inter_C_window_1_0,Inter_C_window_2_0;
25
        input [7:0] Inter_C_window_0_1,Inter_C_window_1_1,Inter_C_window_2_1;
26
        input [7:0] Inter_C_window_0_2,Inter_C_window_1_2,Inter_C_window_2_2;
27
        output [7:0] CPE0_out,CPE1_out,CPE2_out,CPE3_out;
28
 
29
        wire [3:0] xFracC_n,yFracC_n;
30
        assign xFracC_n = 4'b1000 - xFracC;
31
        assign yFracC_n = 4'b1000 - yFracC;
32
 
33
        CPE CPE0 (
34
                .xFracC(xFracC),
35
                .yFracC(yFracC),
36
                .xFracC_n(xFracC_n),
37
                .yFracC_n(yFracC_n),
38
                .a(Inter_C_window_0_0),
39
                .b(Inter_C_window_1_0),
40
                .c(Inter_C_window_0_1),
41
                .d(Inter_C_window_1_1),
42
                .out(CPE0_out)
43
                );
44
        CPE CPE1 (
45
                .xFracC(xFracC),
46
                .yFracC(yFracC),
47
                .xFracC_n(xFracC_n),
48
                .yFracC_n(yFracC_n),
49
                .a(Inter_C_window_1_0),
50
                .b(Inter_C_window_2_0),
51
                .c(Inter_C_window_1_1),
52
                .d(Inter_C_window_2_1),
53
                .out(CPE1_out)
54
                );
55
        CPE CPE2 (
56
                .xFracC(xFracC),
57
                .yFracC(yFracC),
58
                .xFracC_n(xFracC_n),
59
                .yFracC_n(yFracC_n),
60
                .a(Inter_C_window_0_1),
61
                .b(Inter_C_window_1_1),
62
                .c(Inter_C_window_0_2),
63
                .d(Inter_C_window_1_2),
64
                .out(CPE2_out)
65
                );
66
        CPE CPE3 (
67
                .xFracC(xFracC),
68
                .yFracC(yFracC),
69
                .xFracC_n(xFracC_n),
70
                .yFracC_n(yFracC_n),
71
                .a(Inter_C_window_1_1),
72
                .b(Inter_C_window_2_1),
73
                .c(Inter_C_window_1_2),
74
                .d(Inter_C_window_2_2),
75
                .out(CPE3_out)
76
                );
77
endmodule
78
 
79
module CPE (xFracC,yFracC,xFracC_n,yFracC_n,a,b,c,d,out);
80
        input [2:0] xFracC,yFracC;
81
        input [3:0] xFracC_n,yFracC_n;
82
        input [7:0] a,b,c,d;
83
        output [7:0] out;
84
 
85
        wire [13:0] CPE_base0_out,CPE_base1_out,CPE_base2_out,CPE_base3_out;
86
        wire [13:0] out_tmp;
87
 
88
        CPE_base CPE_base0 (
89
                .x(xFracC_n),
90
                .y(yFracC_n),
91
                .Int_pel(a),
92
                .out(CPE_base0_out)
93
                );
94
        CPE_base CPE_base1 (
95
                .x({1'b0,xFracC}),
96
                .y(yFracC_n),
97
                .Int_pel(b),
98
                .out(CPE_base1_out)
99
                );
100
        CPE_base CPE_base2 (
101
                .x(xFracC_n),
102
                .y({1'b0,yFracC}),
103
                .Int_pel(c),
104
                .out(CPE_base2_out)
105
                );
106
        CPE_base CPE_base3 (
107
                .x({1'b0,xFracC}),
108
                .y({1'b0,yFracC}),
109
                .Int_pel(d),
110
                .out(CPE_base3_out)
111
                );
112
        assign out_tmp = (CPE_base0_out + CPE_base1_out) + (CPE_base2_out + CPE_base3_out) + 32;
113
        assign out = out_tmp[13:6];
114
endmodule
115
 
116
module CPE_base (x,y,Int_pel,out);
117
        input [3:0] x;
118
        input [3:0] y;
119
        input [7:0] Int_pel;
120
        output [13:0] out;
121
 
122
        wire [10:0] sum_x3;
123
        wire [9:0] sum_x2;
124
        wire [8:0] sum_x1;
125
        wire [7:0] sum_x0;
126
        wire [10:0] sum_x;
127
 
128
        wire [13:0] sum_y3;
129
        wire [12:0] sum_y2;
130
        wire [11:0] sum_y1;
131
        wire [10:0] sum_y0;
132
 
133
        assign sum_x3 = (x[3] == 1'b1)? {Int_pel,3'b0}:0;
134
        assign sum_x2 = (x[2] == 1'b1)? {Int_pel,2'b0}:0;
135
        assign sum_x1 = (x[1] == 1'b1)? {Int_pel,1'b0}:0;
136
        assign sum_x0 = (x[0] == 1'b1)? Int_pel:0;
137
        assign sum_x = (sum_x3 + sum_x2) + (sum_x1 + sum_x0);
138
 
139
        assign sum_y3 = (y[3] == 1'b1)? {sum_x,3'b0}:0;
140
        assign sum_y2 = (y[2] == 1'b1)? {sum_x,2'b0}:0;
141
        assign sum_y1 = (y[1] == 1'b1)? {sum_x,1'b0}:0;
142
        assign sum_y0 = (y[0] == 1'b1)? sum_x:0;
143
        assign out = (sum_y3 + sum_y2) + (sum_y1 + sum_y0);
144
endmodule
145
 
146
 
147
 
148
 
149
 
150
 

powered by: WebSVN 2.1.0

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