Commit a5c0516e authored by Andrey Filippov's avatar Andrey Filippov

passed big endian in 16-bit mode from Python simulation/implementation script

parent 05f323bf
......@@ -788,7 +788,7 @@
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_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
......
......@@ -114,7 +114,8 @@ class X393Cmprs(object):
multi_frame = 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
@param run_mode - 0 - reset, 2 - run single from memory, 3 - run repetitive
......@@ -137,7 +138,8 @@ class X393Cmprs(object):
@param multi_frame - False - single-frame buffer, True - multi-frame video memory buffer,
@param bayer - Bayer shift (0..3)
@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
"""
data = 0;
......@@ -161,6 +163,10 @@ class X393Cmprs(object):
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)
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:
data |= (1 << vrlg.CMPRS_CBIT_BAYER)
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):
cmode = None,
multi_frame = 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
@param chn - compressor channel number, "a" or "all" - same for all 4 channels
......@@ -249,6 +255,7 @@ class X393Cmprs(object):
@param bayer - Bayer shift (0..3)
@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 be16 - big endian 16-bit mode (1 for 16-bit raw)
"""
try:
if (chn == all) or (chn[0].upper() == "A"): #all is a built-in function
......@@ -261,7 +268,8 @@ class X393Cmprs(object):
multi_frame = multi_frame,
bayer = bayer,
focus_mode = focus_mode,
row_lsb_raw = row_lsb_raw)
row_lsb_raw = row_lsb_raw,
be16 = be16)
return
except:
pass
......@@ -273,7 +281,9 @@ class X393Cmprs(object):
multi_frame = multi_frame,
bayer = bayer,
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,
data)
......@@ -597,7 +607,8 @@ class X393Cmprs(object):
multi_frame = multi_frame, # [15:14] 0 - single-frame buffer, 1 - multiframe video memory buffer
bayer = bayer, # [20:18] # Bayer shift
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(
chn = chn, # compressor channel number (0..3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment