This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | get_imageParamsThis(x) ( framePars[this_frame & PARS_FRAMES_MASK].pars[x]) |
Functions | |
| unsigned long | get_imageParamsThat (int indx, unsigned long frame) |
| return value of parameter 'index' from frame 'frame' - use pastPars if too late for framePars | |
| int | get_imageParamsThatValid (int indx, unsigned long frame) |
| return value of parameter 'indx' from frame 'frame' - use pastPars if too late for framePars (31 bits only) | |
| long | getPercentile (unsigned long frame, int color, unsigned long fraction, int request_colors) |
| calculate pixel value corresponding so that specified fraction of all pixels have value less or equal than it both result and input fraction are 16.16 format, so 0x10000 is 1.0 | |
| int | recalibrateDim (void) |
| Measure the percentile input (sensor) level for the specified by [P_AEXP_FRACPIX] fraction of all pixels for VEXPOS = 1 line, use that as a zero level for exposure calculations. | |
| unsigned long | gammaDirect (unsigned long x) |
| calculates direct gamma conversion using gamma tables indexed by global gamma_index | |
| unsigned long | gammaReverse (unsigned long x) |
| calculates reverse gamma conversion using gamma tables indexed by global gamma_index | |
| int | waitRequstPrevHist (unsigned long next_frame) |
| int | poorLog (int x) |
| int | poorExp (int x) |
| #define get_imageParamsThis | ( | x | ) | ( framePars[this_frame & PARS_FRAMES_MASK].pars[x]) |
Definition at line 41 of file aexp_utils.h.
Referenced by circbuf_lseek(), framepars_lseek(), histograms_lseek(), main(), stream__ioctl(), updateIRQ_Exif(), x353raw_frame_lseek(), x353raw_frame_open(), x353raw_frame_read(), x353raw_frame_readline(), x353raw_frame_write(), and x353raw_frame_writeline().
| unsigned long gammaDirect | ( | unsigned long | x | ) |
calculates direct gamma conversion using gamma tables indexed by global gamma_index
| x | - argument 0..0xffff (proportional to sensor data) |
truncating , no interpolation
Definition at line 180 of file aexp_utils.c.
References gamma_stuct_t::direct, gamma_cache, and gamma_index.
Referenced by whiteBalanceCorr().
| unsigned long gammaReverse | ( | unsigned long | x | ) |
calculates reverse gamma conversion using gamma tables indexed by global gamma_index
| x | - argument 0..0xffff (proportional to 8-bit internal data to be compressed) |
[257] "Gamma" table, 16-bit for both non-scaled prototypes and scaled, 0..0xffff range (hardware will use less)
[256] reverse table to speed-up reversing (still need interpolation).Index - most significant 8 bits, data - largest direct
8 MSBs used as index
seems gamma_reverse[] rounds up, not down
adjust down (is that needed at all?)
adjust up (is that needed at all?)
limit just in case?
Definition at line 193 of file aexp_utils.c.
References gamma_stuct_t::direct, gamma_cache, gamma_direct, gamma_index, gamma_reverse, MDF2, gamma_stuct_t::reverse, and stderr.
Referenced by aexpCorr(), getPercentile(), and whiteBalanceCorr().
| unsigned long get_imageParamsThat | ( | int | indx, | |
| unsigned long | frame | |||
| ) |
return value of parameter 'index' from frame 'frame' - use pastPars if too late for framePars
| indx | parameter indx | |
| frame | absolute frame number |
Locate frame info in framePars
too late, try pastPars
not saved
should be retrieved before checking frame (interrupts)
too late even for pastPars? Or a bug?
Definition at line 224 of file aexp_utils.c.
| int get_imageParamsThatValid | ( | int | indx, | |
| unsigned long | frame | |||
| ) |
return value of parameter 'indx' from frame 'frame' - use pastPars if too late for framePars (31 bits only)
| indx | parameter index | |
| frame | absolute frame number |
Locate frame info in framePars
too late, try pastPars
not saved
too late even for pastPars? Or a bug?
Definition at line 251 of file aexp_utils.c.
References ELP_FERR, framePars, P_FRAME, framepars_t::pars, PARS_FRAMES_MASK, PARS_SAVE_FROM, PARS_SAVE_NUM, framepars_past_t::past_pars, pastPars, PASTPARS_SAVE_ENTRIES_MASK, stderr, and value.
Referenced by aexpCorr(), and main().
| long getPercentile | ( | unsigned long | frame, | |
| int | color, | |||
| unsigned long | fraction, | |||
| int | request_colors | |||
| ) |
calculate pixel value corresponding so that specified fraction of all pixels have value less or equal than it both result and input fraction are 16.16 format, so 0x10000 is 1.0
| frame | - absolute frame number for which percentile is requested | |
| color | - color number (0 - R, 1 - G1(G), 2 - G2(GB), 3 - B). G1 is also used for autoexposure | |
| fraction | - fraction of all pixels that should have value less or equal result 16.16 format - 0x10000 == 1.0 == all pixels | |
| request_colors | - if 0 - use the same histogram index as already calculated, otherwise it is a bit mask of colors to request, i.e. (1<<color) - request only the specified color, 0xf - request all colors |
256 of cumulated histogram values (in pixels)
256 of rounded percentiles (1 byte) - used as a starting point for linear interpolation
number of pixels corresponding to a specified fraction (rounded down)
Get the histogram (including percentiles)
at minimum for the new frame request_colors= 1<<color
wait for all histograms, not just Y (G1)
wait for just Y (G1)
specify that reverse histogram(s) are needed
request histograms for the specified frame
histograms for frame will be available 1 frame later
8 MSBs used as index
seems hist_percentile[perc] rounds up, not down
adjust down (is that needed at all?)
adjust up (is that needed at all?)
here perc_frac is the intermediate result, so that (1<<PERCENTILE_SHIFT) corresponds to full scale of after-gamma data Now we need to "un-gamma" it to reference to the (supposingly linear) input range that is proportional to exposure
here file->fpos resets to 0?
Definition at line 106 of file aexp_utils.c.
References COLOR_Y_NUMBER, histogram_stuct_t::cumul_hist, ELP_FERR, fd_gamma_cache, fd_histogram_cache, G_THIS_FRAME, gamma_index, GAMMA_MODE_NEED_REVERSE, gammaReverse(), GLOBALPARS, histogram_stuct_t::gtab, hist_index, histogram_cache, LSEEK_HIST_NEEDED, LSEEK_HIST_WAIT_C, LSEEK_HIST_WAIT_Y, MDF2, MDF7, histogram_stuct_t::percentile, PERCENTILE_1, PERCENTILE_SHIFT, SEEK_CUR, SEEK_END, SEEK_SET, stderr, this_frame, and write.
Referenced by aexpCorr(), and recalibrateDim().
| int poorExp | ( | int | x | ) |
Definition at line 62 of file aexp_utils.c.
| int poorLog | ( | int | x | ) |
*************************************************************************** ! FILE NAME : aexp_utils.c ! DESCRIPTION: Daemon to adjust camera exposure and white balance ! Copyright (C) 2008 Elphel, Inc. ! -----------------------------------------------------------------------------** ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** ! !
0-> 0 32-> 512 64-> 768 128 ->1024 256 ->1280 0x10000000 -> 0x1900 0x80000000 -> 0x1c00
0..511 gets here
first time always
Definition at line 35 of file aexp_utils.c.
Referenced by aexpCorr().
| int recalibrateDim | ( | void | ) |
Measure the percentile input (sensor) level for the specified by [P_AEXP_FRACPIX] fraction of all pixels for VEXPOS = 1 line, use that as a zero level for exposure calculations.
or is +1 enough? 2 seems to be required for Micron free running mode, for async 1 is OK
no error check here
all colors are needed. Will skip frames
all colors are needed. Will skip frames
Definition at line 277 of file aexp_utils.c.
References fd_fparmsall, fd_histogram_cache, framePars, FRAMEPARS_SETFRAME, G_HIST_DIM_01, G_HIST_DIM_23, G_THIS_FRAME, getPercentile(), GLOBALPARS, MDF1, P_AEXP_FRACPIX, P_VEXPOS, framepars_t::pars, PARS_FRAMES_MASK, RECALIBRATE_AFTER, RECALIBRATE_AHEAD, SEEK_SET, stderr, this_frame, and write.
Referenced by main().
| int waitRequstPrevHist | ( | unsigned long | next_frame | ) |
Definition at line 70 of file aexp_utils.c.
References fd_fparmsall, FRAMEPARS_SETFRAME, G_THIS_FRAME, GLOBALPARS, LSEEK_FRAME_WAIT_ABS, MDF2, P_HISTRQ_YC, SEEK_END, stderr, this_frame, and write.
Referenced by main().
1.5.1