Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
a5c0516e
Commit
a5c0516e
authored
Apr 19, 2019
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
passed big endian in 16-bit mode from Python simulation/implementation script
parent
05f323bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
x393_parameters.vh
includes/x393_parameters.vh
+1
-1
x393_cmprs.py
py393/x393_cmprs.py
+18
-7
No files found.
includes/x393_parameters.vh
View file @
a5c0516e
...
@@ -788,7 +788,7 @@
...
@@ -788,7 +788,7 @@
parameter CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 = 4'ha, // jp4, 4 blocks, differential, hdr,divide by 2
parameter CMPRS_CBIT_CMODE_JP4DIFFHDRDIV2 = 4'ha, // jp4, 4 blocks, differential, hdr,divide by 2
parameter CMPRS_CBIT_CMODE_MONO1 = 4'hb, // mono JPEG (not yet implemented)
parameter CMPRS_CBIT_CMODE_MONO1 = 4'hb, // mono JPEG (not yet implemented)
parameter CMPRS_CBIT_CMODE_MONO4 = 4'he, // mono, 4 blocks (but still not actual monochrome JPEG as the blocks are scanned in 2x2 macroblocks)
parameter CMPRS_CBIT_CMODE_MONO4 = 4'he, // mono, 4 blocks (but still not actual monochrome JPEG as the blocks are scanned in 2x2 macroblocks)
parameter CMPRS_CBIT_CMODE_RAW = 4'hf, // uncompressed
parameter CMPRS_CBIT_CMODE_RAW =
4'hf, // uncompressed
parameter CMPRS_CBIT_FRAMES_SINGLE = 0, //1, // use a single-frame buffer for images
parameter CMPRS_CBIT_FRAMES_SINGLE = 0, //1, // use a single-frame buffer for images
...
...
py393/x393_cmprs.py
View file @
a5c0516e
...
@@ -114,7 +114,8 @@ class X393Cmprs(object):
...
@@ -114,7 +114,8 @@ class X393Cmprs(object):
multi_frame
=
None
,
multi_frame
=
None
,
bayer
=
None
,
bayer
=
None
,
focus_mode
=
None
,
focus_mode
=
None
,
row_lsb_raw
=
None
):
row_lsb_raw
=
None
,
be16
=
None
):
"""
"""
Combine compressor control parameters into a single word. None value preserves old setting for the parameter
Combine compressor control parameters into a single word. None value preserves old setting for the parameter
@param run_mode - 0 - reset, 2 - run single from memory, 3 - run repetitive
@param run_mode - 0 - reset, 2 - run single from memory, 3 - run repetitive
...
@@ -137,7 +138,8 @@ class X393Cmprs(object):
...
@@ -137,7 +138,8 @@ class X393Cmprs(object):
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param bayer - Bayer shift (0..3)
@param bayer - Bayer shift (0..3)
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@param be16 - big endian 16-bit mode (1 for 16-bit raw)
@return combined data word
@return combined data word
"""
"""
data
=
0
;
data
=
0
;
...
@@ -161,6 +163,10 @@ class X393Cmprs(object):
...
@@ -161,6 +163,10 @@ class X393Cmprs(object):
data
|=
(
1
<<
vrlg
.
CMPRS_CBIT_FRAMES
)
data
|=
(
1
<<
vrlg
.
CMPRS_CBIT_FRAMES
)
data
|=
(
multi_frame
&
((
1
<<
vrlg
.
CMPRS_CBIT_FRAMES_BITS
)
-
1
))
<<
(
vrlg
.
CMPRS_CBIT_FRAMES
-
vrlg
.
CMPRS_CBIT_FRAMES_BITS
)
data
|=
(
multi_frame
&
((
1
<<
vrlg
.
CMPRS_CBIT_FRAMES_BITS
)
-
1
))
<<
(
vrlg
.
CMPRS_CBIT_FRAMES
-
vrlg
.
CMPRS_CBIT_FRAMES_BITS
)
if
not
be16
is
None
:
data
|=
(
1
<<
vrlg
.
CMPRS_CBIT_BE16
)
data
|=
(
bayer
&
((
1
<<
vrlg
.
CMPRS_CBIT_BE16_BITS
)
-
1
))
<<
(
vrlg
.
CMPRS_CBIT_BE16
-
vrlg
.
CMPRS_CBIT_BE16_BITS
)
if
not
bayer
is
None
:
if
not
bayer
is
None
:
data
|=
(
1
<<
vrlg
.
CMPRS_CBIT_BAYER
)
data
|=
(
1
<<
vrlg
.
CMPRS_CBIT_BAYER
)
data
|=
(
bayer
&
((
1
<<
vrlg
.
CMPRS_CBIT_BAYER_BITS
)
-
1
))
<<
(
vrlg
.
CMPRS_CBIT_BAYER
-
vrlg
.
CMPRS_CBIT_BAYER_BITS
)
data
|=
(
bayer
&
((
1
<<
vrlg
.
CMPRS_CBIT_BAYER_BITS
)
-
1
))
<<
(
vrlg
.
CMPRS_CBIT_BAYER
-
vrlg
.
CMPRS_CBIT_BAYER_BITS
)
...
@@ -223,8 +229,8 @@ class X393Cmprs(object):
...
@@ -223,8 +229,8 @@ class X393Cmprs(object):
cmode
=
None
,
cmode
=
None
,
multi_frame
=
None
,
multi_frame
=
None
,
bayer
=
None
,
bayer
=
None
,
focus_mode
=
None
,
row_lsb_raw
=
None
,
row_lsb_raw
=
None
):
be16
=
None
):
"""
"""
Combine compressor control parameters into a single word. None value preserves old setting for the parameter
Combine compressor control parameters into a single word. None value preserves old setting for the parameter
@param chn - compressor channel number, "a" or "all" - same for all 4 channels
@param chn - compressor channel number, "a" or "all" - same for all 4 channels
...
@@ -249,6 +255,7 @@ class X393Cmprs(object):
...
@@ -249,6 +255,7 @@ class X393Cmprs(object):
@param bayer - Bayer shift (0..3)
@param bayer - Bayer shift (0..3)
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param focus_mode - focus mode - how to combine image with "focus quality" in the result image
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@param row_lsb_raw - four LSBs of the window height - used in raw mode
@param be16 - big endian 16-bit mode (1 for 16-bit raw)
"""
"""
try
:
try
:
if
(
chn
==
all
)
or
(
chn
[
0
]
.
upper
()
==
"A"
):
#all is a built-in function
if
(
chn
==
all
)
or
(
chn
[
0
]
.
upper
()
==
"A"
):
#all is a built-in function
...
@@ -261,7 +268,8 @@ class X393Cmprs(object):
...
@@ -261,7 +268,8 @@ class X393Cmprs(object):
multi_frame
=
multi_frame
,
multi_frame
=
multi_frame
,
bayer
=
bayer
,
bayer
=
bayer
,
focus_mode
=
focus_mode
,
focus_mode
=
focus_mode
,
row_lsb_raw
=
row_lsb_raw
)
row_lsb_raw
=
row_lsb_raw
,
be16
=
be16
)
return
return
except
:
except
:
pass
pass
...
@@ -273,7 +281,9 @@ class X393Cmprs(object):
...
@@ -273,7 +281,9 @@ class X393Cmprs(object):
multi_frame
=
multi_frame
,
multi_frame
=
multi_frame
,
bayer
=
bayer
,
bayer
=
bayer
,
focus_mode
=
focus_mode
,
focus_mode
=
focus_mode
,
row_lsb_raw
=
row_lsb_raw
)
row_lsb_raw
=
row_lsb_raw
,
be16
=
be16
)
self
.
x393_axi_tasks
.
write_control_register
(
vrlg
.
CMPRS_GROUP_ADDR
+
chn
*
vrlg
.
CMPRS_BASE_INC
+
vrlg
.
CMPRS_CONTROL_REG
,
self
.
x393_axi_tasks
.
write_control_register
(
vrlg
.
CMPRS_GROUP_ADDR
+
chn
*
vrlg
.
CMPRS_BASE_INC
+
vrlg
.
CMPRS_CONTROL_REG
,
data
)
data
)
...
@@ -597,7 +607,8 @@ class X393Cmprs(object):
...
@@ -597,7 +607,8 @@ class X393Cmprs(object):
multi_frame
=
multi_frame
,
# [15:14] 0 - single-frame buffer, 1 - multiframe video memory buffer
multi_frame
=
multi_frame
,
# [15:14] 0 - single-frame buffer, 1 - multiframe video memory buffer
bayer
=
bayer
,
# [20:18] # Bayer shift
bayer
=
bayer
,
# [20:18] # Bayer shift
focus_mode
=
focus_mode
,
# [23:21] Set focus mode
focus_mode
=
focus_mode
,
# [23:21] Set focus mode
row_lsb_raw
=
row_lsb_raw
)
# [3:0] LSBs of the window height that do not fit into compressor format
row_lsb_raw
=
row_lsb_raw
,
# [3:0] LSBs of the window height that do not fit into compressor format
be16
=
bits16
)
# swap bytes in compressor channel
self
.
compressor_format
(
self
.
compressor_format
(
chn
=
chn
,
# compressor channel number (0..3)
chn
=
chn
,
# compressor channel number (0..3)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment