3 use ieee.std_logic_1164.
all;
4 use ieee.numeric_std.
all;
6 entity ReconPixelIndex
is
9 RPI_POS_WIDTH
: positive
:= 17;
10 HV_FRAG_WIDTH
: positive
:= 8;
11 Y_STRIDE_WIDTH
: positive
:= 12;
12 UV_STRIDE_WIDTH
: positive
:= 11;
13 Y_PL_FRAG_WIDTH
: positive
:= 21;
14 UV_PL_FRAG_WIDTH
: positive
:= 19;
15 RECON_Y_DATA_OFS_WIDTH
: positive
:= 20;
16 RECON_UV_DATA_OFS_WIDTH
: positive
:= 20
21 rpi_position
: in unsigned
(RPI_POS_WIDTH
-1 downto 0);
22 HFragments
: in unsigned
(HV_FRAG_WIDTH
-1 downto 0);
23 VFragments
: in unsigned
(HV_FRAG_WIDTH
-1 downto 0);
24 YStride
: in unsigned
(Y_STRIDE_WIDTH
-1 downto 0);
25 UVStride
: in unsigned
(UV_STRIDE_WIDTH
-1 downto 0);
26 YPlaneFragments
: in unsigned
(Y_PL_FRAG_WIDTH
-1 downto 0);
27 UVPlaneFragments
: in unsigned
(UV_PL_FRAG_WIDTH
-1 downto 0);
28 ReconYDataOffset
: in unsigned
(RECON_Y_DATA_OFS_WIDTH
-1 downto 0);
29 ReconUDataOffset
: in unsigned
(RECON_UV_DATA_OFS_WIDTH
-1 downto 0);
30 ReconVDataOffset
: in unsigned
(RECON_UV_DATA_OFS_WIDTH
-1 downto 0);
32 rpi_value
: out signed
(31 downto 0)
36 architecture a_ReconPixelIndex
of ReconPixelIndex
is
37 constant VFRAGPIXELS
: unsigned
(3 downto 0) := x"
8"
;
38 constant HFRAGPIXELS
: unsigned
(3 downto 0) := x"
8"
;
40 begin -- a_ReconPixelIndex
46 ((rpi_position
/ HFragments
) * VFRAGPIXELS
* YStride
) +
47 ((rpi_position
mod HFragments
) * HFRAGPIXELS
) +
48 ReconYDataOffset
), 32)
49 when rpi_position
< YPlaneFragments
else
52 (((rpi_position
- YPlaneFragments
) / SHIFT_RIGHT
(HFragments
, 1)) * VFRAGPIXELS
* UVStride
) +
53 (((rpi_position
- YPlaneFragments
) mod SHIFT_RIGHT
(HFragments
, 1)) * HFRAGPIXELS
) +
54 ReconUDataOffset
), 32)
55 when rpi_position
< YPlaneFragments
+ UVPlaneFragments
else
58 (((rpi_position
- (YPlaneFragments
+ UVPlaneFragments
))/ SHIFT_RIGHT
(HFragments
, 1)) * VFRAGPIXELS
* UVStride
) +
59 (((rpi_position
- (YPlaneFragments
+ UVPlaneFragments
)) mod SHIFT_RIGHT
(HFragments
, 1)) * HFRAGPIXELS
) +
60 ReconVDataOffset
), 32);
62 end a_ReconPixelIndex
;