Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
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
linux-elphel
Commits
c96d81bb
Commit
c96d81bb
authored
Apr 13, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: imgsrv stops at reading frame params
parent
99dc26ff
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
185 additions
and
196 deletions
+185
-196
circbuf.c
src/drivers/elphel/circbuf.c
+59
-69
jpeghead.c
src/drivers/elphel/jpeghead.c
+98
-90
jpeghead.h
src/drivers/elphel/jpeghead.h
+1
-1
sensor_common.c
src/drivers/elphel/sensor_common.c
+18
-7
c313a.h
src/include/elphel/c313a.h
+9
-29
No files found.
src/drivers/elphel/circbuf.c
View file @
c96d81bb
This diff is collapsed.
Click to expand it.
src/drivers/elphel/jpeghead.c
View file @
c96d81bb
This diff is collapsed.
Click to expand it.
src/drivers/elphel/jpeghead.h
View file @
c96d81bb
...
...
@@ -38,7 +38,7 @@ struct huffman_pd {
int
jpeg_htable_is_programmed
(
void
);
void
jpeg_htable_init
(
void
);
int
jpeg_htable_fpga_encode
(
void
);
void
jpeg_htable_fpga_pgm
(
void
);
void
jpeg_htable_fpga_pgm
(
unsigned
int
chn
);
int
jpeg_prep_htable
(
struct
huffman_encoded_t
*
htable
,
struct
huffman_fpga_code_t
*
hcodes
);
#endif
/* _JPEGHEAD */
src/drivers/elphel/sensor_common.c
View file @
c96d81bb
...
...
@@ -283,7 +283,15 @@ inline void updateIRQFocus(struct jpeg_ptr_t *jptr)
u32
high_freq
=
x393_cmprs_hifreq
(
jptr
->
chn_num
);
}
static
void
set_default_interframe
(
struct
interframe_params_t
*
params
)
{
params
->
height
=
1936
;
params
->
width
=
2592
;
params
->
byrshift
=
0
;
params
->
color
=
0
;
params
->
quality2
=
127
;
dev_dbg
(
NULL
,
"%s: DEBUG, setting default interframe parameters
\n
"
,
__func__
);
}
/**
* @brief Locate area between frames in the circular buffer
...
...
@@ -310,10 +318,13 @@ inline struct interframe_params_t* updateIRQ_interframe(struct jpeg_ptr_t *jptr)
int
circbuf_size
=
BYTE2DW
(
get_globalParam
(
G_CIRCBUFSIZE
));
int
len_offset
=
X393_BUFFSUB
(
jptr
->
jpeg_wp
,
8
);
int
len32
=
circbuf_priv_ptr
[
jptr
->
chn_num
].
buf_ptr
[
len_offset
]
&
FRAME_LENGTH_MASK
;
int
frame_params_offset
=
X393_BUFFSUB
(
jptr
->
jpeg_wp
,
INTERFRAME_PARAMS_SZ
);
int
frame_params_offset
=
X393_BUFFSUB
(
jptr
->
jpeg_wp
,
OFFSET_X40
);
interframe
=
(
struct
interframe_params_t
*
)
&
circbuf_priv_ptr
[
jptr
->
chn_num
].
buf_ptr
[
frame_params_offset
];
interframe
->
frame_length
=
len32
;
//interframe->frame_length = len32;
set_default_interframe
(
interframe
);
set_globalParam
(
G_FRAME_SIZE
,
len32
);
return
interframe
;
...
...
@@ -462,9 +473,9 @@ static irqreturn_t compressor_irq_handler(int irq, void *dev_id)
if
(
updateIRQJPEG_wp
(
priv
))
{
update_irq_circbuf
(
priv
);
updateIRQFocus
(
priv
);
/*interframe = updateIRQ_interframe(
);
updateIRQ_Exif(interframe);
wake_up_interruptible(&circbuf_wait_queue);
*/
interframe
=
updateIRQ_interframe
(
priv
);
//
updateIRQ_Exif(interframe);
wake_up_interruptible
(
&
circbuf_wait_queue
);
}
//wake_up_interruptible(&framepars_wait_queue);
...
...
@@ -513,7 +524,7 @@ void tasklet_fpga_function(unsigned long arg) {
int
len32
;
int
circbuf_size
=
get_globalParam
(
G_CIRCBUFSIZE
);
unsigned
long
*
buf_ptr
;
printk
(
KERN_DEBUG
"%s: get_globalParam(G_CIRCBUFSIZE) = %d"
,
__func__
,
circbuf_size
);
printk
(
KERN_DEBUG
"%s: get_globalParam(G_CIRCBUFSIZE) = %d
\n
"
,
__func__
,
circbuf_size
);
#ifdef TEST_DISABLE_CODE
...
...
src/include/elphel/c313a.h
View file @
c96d81bb
...
...
@@ -1641,37 +1641,17 @@ struct sensorproc_t {
///*32-35*/ unsigned long timestamp_usec; //! number of microseconds to add
//};
/* Some fields were re
arranged to make old code happy, this should to be fixed
/* Some fields were re
moved, may be we will need them later
* Last three double words contain time stamp and (length+0xff) marker in new camera
*/
struct
interframe_params_t
{
/// This data will survive as long as the frame itself in the circular buffer. Some other fields (like exposure) are stored in Exif
/// dont move - should partially match P_* area
union
{
union
{
unsigned
long
hash32_r
;
struct
{
unsigned
short
scale_r
;
union
{
unsigned
short
hash16_r
;
struct
{
unsigned
char
gamma_r
;
unsigned
char
black_r
;
};};};};
///00-03
union
{
unsigned
long
hash32_g
;
struct
{
unsigned
short
scale_g
;
union
{
unsigned
short
hash16_g
;
struct
{
unsigned
char
gamma_g
;
unsigned
char
black_g
;
};};};};
///04-07
};
union
{
unsigned
long
hash32_gb
;
struct
{
unsigned
short
scale_gb
;
union
{
unsigned
short
hash16_gb
;
struct
{
unsigned
char
gamma_gb
;
unsigned
char
black_gb
;};};};};
///08-11
union
{
unsigned
long
hash32_b
;
struct
{
unsigned
short
scale_b
;
union
{
unsigned
short
hash16_b
;
struct
{
unsigned
char
gamma_b
;
unsigned
char
black_b
;
};};};};
///12-15
unsigned
short
quality2
;
/// Quality is represented by 2-byte value. Each byte uses Y table if the value is Q<128,// 16-17
/// and C table with (Q-128) if it is Q>=128.
/// If the High byte is zero, it is treated as Q^0x80 (Q|=(Q^0x80)<<8) for compatibility
/// with a standard single-byte Q value
/// updated in 8.0.8.37 - bit 7 in quality2 means "portrait mode"
unsigned
char
color
;
/// color mode //18
unsigned
char
byrshift
;
/// bayer shift in compressor //19
unsigned
short
width
;
/// frame width, pixels 20-21 - NOTE: should be 20-21
unsigned
short
height
;
/// frame height, pixels 22-23
/*24 */
/// unsigned char bindec_hor; //! ((bh-1) << 4) | (dh-1) & 0xf (binning/decimation horizontal, 1..16 for each)
/*25 */
/// unsigned char bindec_vert; //! ((bv-1) << 4) | (dv-1) & 0xf (binning/decimation vertical , 1..16 for each)
/*24-25*/
unsigned
long
meta_index
;
//! index of the linked meta page
union
{
/*28-31*/
unsigned
long
timestamp_sec
;
//! number of seconds since 1970 till the start of the frame exposure
/*28-31*/
unsigned
long
frame_length
;
//! JPEG frame length in circular buffer, bytes
};
/*32-35*/
unsigned
long
timestamp_usec
;
//! number of microseconds to add
unsigned
long
quality2
;
unsigned
long
color
;
unsigned
long
byrshift
;
unsigned
long
width
;
unsigned
long
height
;
unsigned
long
timestamp_sec
;
//! number of seconds since 1970 till the start of the frame exposure
unsigned
long
timestamp_usec
;
//! number of microseconds to add
union
{
unsigned
long
len32
;
//! should be 0xffxxyyzz - it will be a signature that JPEG data was not overwritten,
//! xxyyzz here is the length in 32 double words;
...
...
@@ -1679,7 +1659,7 @@ struct interframe_params_t {
unsigned
char
pad0
;
// pad double word with 3 bytes and use only most significant byte as 0xff marker
unsigned
char
pad1
;
unsigned
char
pad2
;
unsigned
char
signff
ff
;
unsigned
char
signff
;
};
};
};
...
...
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