Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-autoexposure
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-autoexposure
Commits
0a534fc8
Commit
0a534fc8
authored
Sep 14, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more updates for 393, rearranged some debug output
parent
7fb56744
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
6 deletions
+13
-6
autoexposure
src/autoexposure
+0
-0
autoexposure.c
src/autoexposure.c
+3
-3
autoexposure.h
src/autoexposure.h
+4
-0
globalsinit.c
src/globalsinit.c
+4
-1
globalsinit.h
src/globalsinit.h
+1
-1
white_balance.c
src/white_balance.c
+1
-1
No files found.
src/autoexposure
View file @
0a534fc8
No preview for this file type
src/autoexposure.c
View file @
0a534fc8
...
...
@@ -137,7 +137,7 @@ int main (int argc, char *argv[]) {
if
((
daemon_bit
<
0
)
||
(
daemon_bit
>
31
))
{
printf
(
"Invalid bit number %d (should be 0..31)
\n
"
,
daemon_bit
);
exit
(
1
);}
fprintf
(
stderr
,
"autoexposure started, daemon_bit=0x%x, debug=0x%x
\n
"
,
daemon_bit
,
autoexposure_debug
);
// MDF1(fprintf(stderr,"\n"));
if
(
initFilesMmap
(
sensor_port
)
<
0
)
exit
(
1
);
/// initialization errors
if
(
initFilesMmap
(
sensor_port
,
sensor_subchannel
)
<
0
)
exit
(
1
);
/// initialization errors
if
(
autoexposure_debug
<
0
)
{
/// tempoorary hack for testing
GLOBALPARS_SNGL
(
G_DEBUG
)
=
0
;
exit
(
0
);
...
...
@@ -181,7 +181,7 @@ int main (int argc, char *argv[]) {
/// debugging
old_vexp
=
framePars
[(
this_frame
+
exp_ahead
)
&
PARS_FRAMES_MASK
].
pars
[
P_VEXPOS
];
old_that_vexpos
=
get_imageParamsThatValid
(
P_VEXPOS
,
this_frame
-
1
);
MDF
3
(
fprintf
(
stderr
,
"this_frame= 0x%x, this_frame+exp_ahead= 0x%x, old_vexp= 0x%x, old_that_vexpos = 0x%x
\n
"
,
(
int
)
this_frame
,(
int
)
(
this_frame
+
exp_ahead
),
(
int
)
old_vexp
,
(
int
)
old_that_vexpos
));
MDF
8
(
fprintf
(
stderr
,
"this_frame= 0x%x, this_frame+exp_ahead= 0x%x, old_vexp= 0x%x, old_that_vexpos = 0x%x
\n
"
,
(
int
)
this_frame
,(
int
)
(
this_frame
+
exp_ahead
),
(
int
)
old_vexp
,
(
int
)
old_that_vexpos
));
if
(
hdr_mode
>
0
)
{
/// align target autoexposure frame to hdr mode
if
(
hdr_target_frame
&
1
)
hdr_target_frame
++
;
if
((
hdr_mode
>
1
)
&&
(
hdr_target_frame
&
2
))
hdr_target_frame
+=
2
;
...
...
@@ -194,7 +194,7 @@ MDF3(fprintf(stderr, "this_frame= 0x%x, this_frame+exp_ahead= 0x%x, old_vexp= 0x
}
old_vexp
=
framePars
[(
this_frame
+
exp_ahead
)
&
PARS_FRAMES_MASK
].
pars
[
P_VEXPOS
];
old_that_vexpos
=
get_imageParamsThatValid
(
P_VEXPOS
,
this_frame
-
1
);
MDF
3
(
fprintf
(
stderr
,
"this_frame= 0x%x, this_frame+exp_ahead= 0x%x, old_vexp= 0x%x, old_that_vexpos = 0x%x
\n
"
,
(
int
)
this_frame
,(
int
)
(
this_frame
+
exp_ahead
),
(
int
)
old_vexp
,
(
int
)
old_that_vexpos
));
MDF
8
(
fprintf
(
stderr
,
"this_frame= 0x%x, this_frame+exp_ahead= 0x%x, old_vexp= 0x%x, old_that_vexpos = 0x%x
\n
"
,
(
int
)
this_frame
,(
int
)
(
this_frame
+
exp_ahead
),
(
int
)
old_vexp
,
(
int
)
old_that_vexpos
));
if
(((
ae_rslt
=
aexpCorr
(
COLOR_Y_NUMBER
,
this_frame
,
this_frame
+
exp_ahead
)))
<
0
)
break
;
/// restart on errors
//GLOBALPARS_SNGL(G_AE_INTEGERR)
...
...
src/autoexposure.h
View file @
0a534fc8
...
...
@@ -78,6 +78,10 @@
#define MDF5(x) { if (autoexposure_debug & (1 << 5)) {fprintf(stderr,"%s:%d:%s: ",__FILE__,__LINE__,__FUNCTION__);x;} }
#define MDF6(x) { if (autoexposure_debug & (1 << 6)) {fprintf(stderr,"%s:%d:%s: ",__FILE__,__LINE__,__FUNCTION__);x;} }
#define MDF7(x) { if (autoexposure_debug & (1 << 7)) {fprintf(stderr,"%s:%d:%s: ",__FILE__,__LINE__,__FUNCTION__);x;} }
//moved from MDF3 - all what is active when autoexposure is off
#define MDF8(x) { if (autoexposure_debug & (1 << 8)) {fprintf(stderr,"%s:%d:%s: ",__FILE__,__LINE__,__FUNCTION__);x;} }
//moved from MDF3 - all what is active when white balance is off
#define MDF9(x) { if (autoexposure_debug & (1 << 9)) {fprintf(stderr,"%s:%d:%s: ",__FILE__,__LINE__,__FUNCTION__);x;} }
#else
#define MDF0(x)
#define MDF1(x)
...
...
src/globalsinit.c
View file @
0a534fc8
...
...
@@ -57,7 +57,7 @@
* uses global variables for files and mmap-ed data so they are accessible everywhere
* @return 0 - OK, <0 - problems opening/mma-ing
*/
int
initFilesMmap
(
int
sensor_port
)
{
int
initFilesMmap
(
int
sensor_port
,
int
sensor_subchannel
)
{
const
char
*
framepars_dev_names
[
SENSOR_PORTS
]
=
{
DEV393_PATH
(
DEV393_FRAMEPARS0
),
DEV393_PATH
(
DEV393_FRAMEPARS1
),
...
...
@@ -90,6 +90,9 @@ int initFilesMmap(int sensor_port) {
close
(
fd_fparmsall
);
return
-
1
;
}
// Select port and subchannel for histograms
lseek
(
fd_histogram_cache
,
LSEEK_HIST_SET_CHN
+
(
4
*
sensor_port
)
+
sensor_subchannel
,
SEEK_END
);
/// specify port/sub-channel is needed
histogram_cache
=
(
struct
histogram_stuct_t
*
)
mmap
(
0
,
sizeof
(
struct
histogram_stuct_t
)
*
HISTOGRAM_CACHE_NUMBER
,
PROT_READ
,
MAP_SHARED
,
fd_histogram_cache
,
0
);
if
((
int
)
histogram_cache
==
-
1
)
{
ELP_FERR
(
fprintf
(
stderr
,
"problems with mmap: %s
\n
"
,
histogram_driver_name
));
...
...
src/globalsinit.h
View file @
0a534fc8
...
...
@@ -46,7 +46,7 @@
extern
unsigned
long
this_frame
;
extern
int
autoexposure_debug
;
int
initFilesMmap
(
int
sensor_port
);
int
initFilesMmap
(
int
sensor_port
,
int
sensor_subchannel
);
int
initParams
(
int
daemon_bit
);
...
...
src/white_balance.c
View file @
0a534fc8
...
...
@@ -74,7 +74,7 @@ void initWhiteBalanceCorr(void) {
/// TODO: SupportT P_WB_MASK - now it is just ON/OFF. NOTE:When the bit is off it should be scaled with the G1 color!
int
whiteBalanceCorr
(
int
frame
,
int
target_frame
,
int
ae_rslt
)
{
MDF
3
(
fprintf
(
stderr
,
"frame=0x%x, target_frame=0x%x G_WB_INTEGERR=0x%08lx
\n
"
,
frame
,
target_frame
,
GLOBALPARS_SNGL
(
G_WB_INTEGERR
)));
///======= 0 here
MDF
9
(
fprintf
(
stderr
,
"frame=0x%x, target_frame=0x%x G_WB_INTEGERR=0x%08lx
\n
"
,
frame
,
target_frame
,
GLOBALPARS_SNGL
(
G_WB_INTEGERR
)));
///======= 0 here
int
rslt
;
int
colors
;
unsigned
long
write_data
[
18
];
...
...
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