SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
The boxcar function can be used simultaneously with the histogram function if needed.
For the locations of histogram memory access, see Section 9.3.3.11, ISS ISP Memory Mapping.
The histogram module counts the number of pixels that have a value in a region and can be enabled from the IPIPE_HST_EN[0] EN bit. In addition to RAW input mode, Histogram can be performed on on YUV input in YUVtoRGB_MODE or YUV444_MODE (( SRC_FMT [FMT]=3, SRC_FMT [FMT2]=1 or 2). Moreover, if enabled, the IPIPE_HST_MODE register can be set to work constantly or one time. If the IPIPE_HST_MODE[0] OST bit is set to 1, the histogram is disabled by clearing the IPIPE_HST_EN[0] EN bit to 0 after one run (one-shot mode).
After enabling the module, the following features are available:
For the G histogram, Gb, Gr, or the average is used, through the IPIPE_HST_SEL[1:0] TYP bit field.
The histogram memory can be cleared at the VD signal. When the memory is cleared, the first line of each frame cannot be sampled by the histogram if the width of the frame is larger than 512. If the width of the frame is smaller than 512, the first ceil (512/width) lines cannot be collected, where ceil(x) is the smallest integer value above x. If the clearing function is not enabled, the histogram bins are accumulated over the previous values.
The histogram has two banks of memories, which can be switched alternatively. The two memory banks are slipped into four histogram memory tables. Only two tables can be used at a time: output memory tables 0 and 1, or tables 2 and 3. To initialize tables, set the IPIPE_HST_TBL[1] CLR bit to 1, and to select which set of tables to uses, switch the IPIPE_HST_TBL[0] SEL bit between 0 and 1.
The mapping of histogram memory is shown in Table 9-184. The switching of the two memories is done through HST_TBL[SEL], which is latched at VD. Example of the use of this switching is as following
Memory # | Address | Histogram Table | Table Address |
---|---|---|---|
(32 bit word) | |||
Histogram memory #0 | 0x0000h | Histogram 0 (Bank 0) | Table address = 0x0000h |
Histogram memory #0 | 0x0001h | Histogram 0 (Bank 0) | Table address = 0x0001h |
Histogram memory #0 | 0x0002h | Histogram 0 (Bank 0) | Table address = 0x0002h |
. | . | . | . |
. | . | . | . |
. | . | . | . |
Histogram memory #0 | 0x01FEh | Histogram 0 (Bank 0) | Table address = 0x01FEh |
Histogram memory #0 | 0x01FFh | Histogram 0 (Bank 0) | Table address = 0x01FFh |
Memory # | Address (byte) | Histogram table | Table Address |
Histogram memory #1 | 0x0000h | Histogram 1 (Bank 0) | Table address = 0x0000h |
Histogram memory #1 | 0x0001h | Histogram 1 (Bank 0) | Table address = 0x0001h |
Histogram memory #1 | 0x0002h | Histogram 1 (Bank 0) | Table address = 0x0002h |
. | . | . | . |
. | . | . | . |
. | . | . | . |
Histogram memory #1 | 0x01FEh | Histogram 1 (Bank 0) | Table address = 0x01FEh |
Histogram memory #1 | 0x01FFh | Histogram 1 (Bank 0) | Table address = 0x01FFh |
Memory # | Address (byte) | Histogram table | Table Address |
Histogram memory #2 | 0x0000h | Histogram 0 (Bank 1) | Table address = 0x0000h |
Histogram memory #2 | 0x0001h | Histogram 0 (Bank 1) | Table address = 0x0001h |
Histogram memory #2 | 0x0002h | Histogram 0 (Bank 1) | Table address = 0x0002h |
. | . | . | . |
. | . | . | . |
. | . | . | . |
Histogram memory #2 | 0x01FEh | Histogram 0 (Bank 1) | Table address = 0x01FEh |
Histogram memory #2 | 0x01FFh | Histogram 0 (Bank 1) | Table address = 0x01FFh |
Memory # | Address (byte) | Histogram table | Table Address |
Histogram memory #3 | 0x0000h | Histogram 1 (Bank 1) | Table address = 0x0000h |
Histogram memory #3 | 0x0001h | Histogram 1 (Bank 1) | Table address = 0x0001h |
Histogram memory #3 | 0x0002h | Histogram 1 (Bank 1) | Table address = 0x0002h |
. | . | . | . |
. | . | . | . |
. | . | . | . |
Histogram memory #3 | 0x01FEh | Histogram 1 (Bank 1) | Table address = 0x01FEh |
Histogram memory #3 | 0x01FFh | Histogram 1 (Bank 1) | Table address = 0x01FFh |
A gain for each color can be applied using the IPIPE_HST_MUL_x registers, where x = R, GR, GB, or B.