SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
Figure 9-51 shows the ISS ISP IPIPEIF dark-frame subtraction subblock.
The dark-frame subtract (DFS) function is used to remove fixed pattern baseline noise from the sensor for a high-quality still image capture use case, where there is a mechanical shutter. Typically, the ISIF module previously writes a dark frame (frame captured when the shutter is closed) to SDRAM using 8 bits of linear data packed into 2 pixels per 16 bits.
In this mode, RAW data from the ISIF and SDRAM is used. Data can also be read from SDRAM with the IPIPEIF_CFG1[9:8] UNPACK bit field set to 1. Each pixel read from SDRAM is subtracted from each pixel sent from the VP or ISIF.
The mux at the input of the dark-frame subtraction subblock is implicitly controlled by the selection of the IPIPEIF_CFG1[15:14] INPSRC1 and IPIPEIF_CFG1[3:2] INPSRC2 bit fields:
The output of the DFS operation is 12 bits wide (U12Q0). There must be adequate SDRAM bandwidth if this feature is enabled. If the data fetched from memory arrives late, an underflow bit (IPIPEIF_DTUF) must be triggered to know it.
When SDRAM data underflow occurs, the data from SDRAM is coming in at a lower rate than the rate at which it is being read/requested by the IPIPEIF. In DFS operation mode, IPIPEIF reads data from both SDRAM and the VP/ISIF. To ensure not corrupting subsequent data processing downstream in the case of SDRAM data underflow, the IPIPEIF stalls the input data, storing remaining sensor data into an internal FIFO (16-deep), and then stops sending new data downstream. The IPIPEIF recommences DFS processing when data from SDRAM becomes available, by using the pixel data from the FIFO and that from SDRAM for processing. To avoid an overflow of the internal FIFO, the IPIPEIF deasserts the stall only when the number of FIFO slots indicated by the IPIPEIF_DTUDF[5:2] FIFOWMRKLVL register bit field are free. A safe number of free locations can be configured taking into consideration the pixel clock frequency with respect to that of the functional clock, as the pixel clock speed is allowed to vary up to the functional clock speed. When the pixel clock and functional clock are equal, the stall deassertion can be programmed to occur when the 16-deep FIFO is empty.