V4L2_META_FMT_RPI_BE_CFG
Raspberry Pi PiSP Back End configuration format #
The Raspberry Pi PiSP Back End memory-to-memory image signal processor is configured by userspace by providing a buffer of configuration parameters to the pispbe-config output video device node using the v4l2_meta_format interface.
The PiSP Back End processes images in tiles, and its configuration requires specifying two different sets of parameters by populating the members of pisp_be_tiles_config defined in the pisp_be_config.h header file.
The Raspberry Pi PiSP technical specification provide detailed description of the ISP back end configuration and programming model.
Global configuration data #
The global configuration data describe how the pixels in a particular image are to be processed and is therefore shared across all the tiles of the image. So for example, LSC (Lens Shading Correction) or Denoise parameters would be common across all tiles from the same frame.
Global configuration data are passed to the ISP by populating the member of pisp_be_config.
Tile parameters #
As the ISP processes images in tiles, each set of tiles parameters describe how a single tile in an image is going to be processed. A single set of tile parameters consist of 160 bytes of data and to process a batch of tiles several sets of tiles parameters are required.
Tiles parameters are passed to the ISP by populating the member of pisp_tile and the num_tiles fields of pisp_be_tiles_config.
Raspberry Pi PiSP Back End uAPI data types #
This section describes the data types exposed to userspace by the Raspberry Pi PiSP Back End. The section is informative only, for a detailed description of each field refer to the Raspberry Pi PiSP technical specification.
struct pisp_be_global_config #
PiSP global enable bitmaps
Definition
;
Members
bayer_enables: Bayer input enable flagsrgb_enables: RGB output enable flagsbayer_order: Bayer input format orderingpad: Padding bytes
struct pisp_be_input_buffer_config #
PiSP Back End input buffer
Definition
;
Members
addr: Input buffer address
struct pisp_be_dpc_config #
PiSP Back End DPC config
Definition
;
Members
coeff_level: Coefficient for the darkest neighbouring pixel valuecoeff_range: Coefficient for the range of pixels for this Bayer channelpad: Padding byteflags: DPC configuration flags
Description
Defective Pixel Correction configuration
struct pisp_be_geq_config #
PiSP Back End GEQ config
Definition
;
Members
offset: Offset value for threshold calculationslope_sharper: Slope/Sharper configurationmin: Minimum value the threshold may havemax: Maximum value the threshold may have
Description
Green Equalisation configuration
struct pisp_be_tdn_input_buffer_config #
PiSP Back End TDN input buffer
Definition
;
Members
addr: TDN input buffer address
struct pisp_be_tdn_config #
PiSP Back End TDN config
Definition
;
Members
black_level: Black level value subtracted from pixelsratio: Multiplier for the LTA input framenoise_constant: Constant offset value used in noise estimationnoise_slope: Noise estimation multiplierthreshold: Threshold for TDN operationsreset: Disable TDN operationspad: Padding byte
Description
Temporal Denoise configuration
struct pisp_be_tdn_output_buffer_config #
PiSP Back End TDN output buffer
Definition
;
Members
addr: TDN output buffer address
struct pisp_be_sdn_config #
PiSP Back End SDN config
Definition
;
Members
black_level: Black level subtracted from pixel for noise estimationleakage: Proportion of the original undenoised value to mix in denoised outputpad: Padding bytenoise_constant: Noise constant used for noise estimationnoise_slope: Noise slope value used for noise estimationnoise_constant2: Second noise constant used for noise estimationnoise_slope2: Second slope value used for noise estimation
Description
Spatial Denoise configuration
struct pisp_be_stitch_input_buffer_config #
PiSP Back End Stitch input
Definition
;
Members
addr: Stitch input buffer address
struct pisp_be_stitch_config #
PiSP Back End Stitch config
Definition
;
Members
threshold_lo: Low threshold valuethreshold_diff_power: Low and high threshold differencepad: Padding bytesexposure_ratio: Multiplier to convert long exposure pixels into short exposure pixelsmotion_threshold_256: Motion threshold above which short exposure pixels are usedmotion_threshold_recip: Reciprocal of motion_threshold_256 value
Description
Stitch block configuration
struct pisp_be_stitch_output_buffer_config #
PiSP Back End Stitch output
Definition
;
Members
addr: Stitch input buffer address
struct pisp_be_cdn_config #
PiSP Back End CDN config
Definition
;
Members
thresh: Constant for noise estimationiir_strength: Relative strength of the IIR part of the filterg_adjust: Proportion of the change assigned to the G channel
Description
Colour Denoise configuration
struct pisp_be_lsc_config #
PiSP Back End LSC config
Definition
;
Members
grid_step_x: Reciprocal of cell size widthgrid_step_y: Reciprocal of cell size heightlut_packed: Jointly-coded RGB gains for each LSC grid
Description
Lens Shading Correction configuration
struct pisp_be_lsc_extra #
PiSP Back End LSC Extra config
Definition
;
Members
offset_x: Horizontal offset into the LSC table of this tileoffset_y: Vertical offset into the LSC table of this tile
struct pisp_be_cac_config #
PiSP Back End CAC config
Definition
;
Members
grid_step_x: Reciprocal of cell size widthgrid_step_y: Reciprocal of cell size heightlut: Pixel shift for the CAC grid
Description
Chromatic Aberration Correction config
struct pisp_be_cac_extra #
PiSP Back End CAC extra config
Definition
;
Members
offset_x: Horizontal offset into the CAC table of this tileoffset_y: Horizontal offset into the CAC table of this tile
struct pisp_be_debin_config #
PiSP Back End Debin config
Definition
;
Members
coeffs: Filter coefficients for debinningh_enable: Horizontal debinning enablev_enable: Vertical debinning enablepad: Padding bytes
Description
Debinning configuration
struct pisp_be_tonemap_config #
PiSP Back End Tonemap config
Definition
;
Members
detail_constant: Constant value for threshold calculationdetail_slope: Slope value for threshold calculationiir_strength: Relative strength of the IIR fiterstrength: Strength factorlut: Look-up table for tonemap curve
Description
Tonemapping configuration
struct pisp_be_demosaic_config #
PiSP Back End Demosaic config
Definition
;
Members
sharper: Use other Bayer channels to increase sharpnessfc_mode: Built-in false colour suppression modepad: Padding bytes
Description
Demosaic configuration
struct pisp_be_ccm_config #
PiSP Back End CCM config
Definition
;
Members
coeffs: Matrix coefficientspad: Padding bytesoffsets: Offsets triplet
Description
Colour Correction Matrix configuration
struct pisp_be_sat_control_config #
PiSP Back End SAT config
Definition
;
Members
shift_r: Left shift for Red colour channelshift_g: Left shift for Green colour channelshift_b: Left shift for Blue colour channelpad: Padding byte
Description
Saturation Control configuration
struct pisp_be_false_colour_config #
PiSP Back End False Colour config
Definition
;
Members
distance: Distance of neighbouring pixels, either 1 or 2pad: Padding bytes
Description
False Colour configuration
struct pisp_be_sharpen_config #
PiSP Back End Sharpening config
Definition
;
Members
kernel0: Coefficient for filter 0pad0: Padding bytekernel1: Coefficient for filter 1pad1: Padding bytekernel2: Coefficient for filter 2pad2: Padding bytekernel3: Coefficient for filter 3pad3: Padding bytekernel4: Coefficient for filter 4pad4: Padding bytethreshold_offset0: Offset for filter 0 response calculationthreshold_slope0: Slope multiplier for the filter 0 response calculationscale0: Scale factor for filter 0 response calculationpad5: Padding bytethreshold_offset1: Offset for filter 0 response calculationthreshold_slope1: Slope multiplier for the filter 0 response calculationscale1: Scale factor for filter 0 response calculationpad6: Padding bytethreshold_offset2: Offset for filter 0 response calculationthreshold_slope2: Slope multiplier for the filter 0 response calculationscale2: Scale factor for filter 0 response calculationpad7: Padding bytethreshold_offset3: Offset for filter 0 response calculationthreshold_slope3: Slope multiplier for the filter 0 response calculationscale3: Scale factor for filter 0 response calculationpad8: Padding bytethreshold_offset4: Offset for filter 0 response calculationthreshold_slope4: Slope multiplier for the filter 0 response calculationscale4: Scale factor for filter 0 response calculationpad9: Padding bytepositive_strength: Factor to scale the positive sharpening strengthpositive_pre_limit: Maximum allowed possible positive sharpening valuepositive_func: Gain factor applied to positive sharpening responsepositive_limit: Final gain factor applied to positive sharpeningnegative_strength: Factor to scale the negative sharpening strengthnegative_pre_limit: Maximum allowed possible negative sharpening valuenegative_func: Gain factor applied to negative sharpening responsenegative_limit: Final gain factor applied to negative sharpeningenables: Filter enable maskwhite: White output pixel filter maskblack: Black output pixel filter maskgrey: Grey output pixel filter mask
Description
Sharpening configuration
struct pisp_be_sh_fc_combine_config #
PiSP Back End Sharpening and False Colour config
Definition
;
Members
y_factor: Control amount of desaturation of pixels being darkenedc1_factor: Control amount of brightening of a pixel for the Cb channelc2_factor: Control amount of brightening of a pixel for the Cr channelpad: Padding byte
Description
Sharpening and False Colour configuration
struct pisp_be_gamma_config #
PiSP Back End Gamma configuration
Definition
;
Members
lut: Gamma curve look-up table
struct pisp_be_crop_config #
PiSP Back End Crop config
Definition
;
Members
offset_x: Number of pixels cropped from the left of the tileoffset_y: Number of pixels cropped from the top of the tilewidth: Width of the cropped tile outputheight: Height of the cropped tile output
Description
Crop configuration
struct pisp_be_resample_config #
PiSP Back End Resampling config
Definition
;
Members
scale_factor_h: Horizontal scale factorscale_factor_v: Vertical scale factorcoef: Resample coefficients
Description
Resample configuration
struct pisp_be_resample_extra #
PiSP Back End Resample config
Definition
;
Members
scaled_width: Width in pixels of the scaled outputscaled_height: Height in pixels of the scaled outputinitial_phase_h: Initial horizontal phaseinitial_phase_v: Initial vertical phase
Description
Resample configuration
struct pisp_be_downscale_config #
PiSP Back End Downscale config
Definition
;
Members
scale_factor_h: Horizontal scale factorscale_factor_v: Vertical scale factorscale_recip_h: Horizontal reciprocal factorscale_recip_v: Vertical reciprocal factor
Description
Downscale configuration
struct pisp_be_downscale_extra #
PiSP Back End Downscale Extra config
Definition
;
Members
scaled_width: Scaled image widthscaled_height: Scaled image height
struct pisp_be_hog_config #
PiSP Back End HOG config
Definition
;
Members
compute_signed: Set 0 for unsigned gradients, 1 for signedchannel_mix: Channels proportions to usestride: Stride in bytes between blocks directly below
Description
Histogram of Oriented Gradients configuration
enum pisp_be_transform #
PiSP Back End Transform flags
Constants
PISP_BE_TRANSFORM_NONE: No transformPISP_BE_TRANSFORM_HFLIP: Horizontal flipPISP_BE_TRANSFORM_VFLIP: Vertical flipPISP_BE_TRANSFORM_ROT180: 180 degress rotation
struct pisp_be_output_buffer_config #
PiSP Back End Output buffer
Definition
;
Members
addr: Output buffer address
struct pisp_be_hog_buffer_config #
PiSP Back End HOG buffer
Definition
;
Members
addr: HOG buffer address
struct pisp_be_config #
RaspberryPi PiSP Back End Processing configuration
Definition
;
Members
input_buffer: Input buffer addressestdn_input_buffer: TDN input buffer addressesstitch_input_buffer: Stitch input buffer addressestdn_output_buffer: TDN output buffer addressesstitch_output_buffer: Stitch output buffer addressesoutput_buffer: Output buffers addresseshog_buffer: HOG buffer addressesglobal: Global PiSP configurationinput_format: Input image formatdecompress: Decompress configurationdpc: Defective Pixel Correction configurationgeq: Green Equalisation configurationtdn_input_format: Temporal Denoise input formattdn_decompress: Temporal Denoise decompress configurationtdn: Temporal Denoise configurationtdn_compress: Temporal Denoise compress configurationtdn_output_format: Temporal Denoise output formatsdn: Spatial Denoise configurationblc: Black Level Correction configurationstitch_compress: Stitch compress configurationstitch_output_format: Stitch output formatstitch_input_format: Stitch input formatstitch_decompress: Stitch decompress configurationstitch: Stitch configurationlsc: Lens Shading Correction configurationwbg: White Balance Gain configurationcdn: Colour Denoise configurationcac: Colour Aberration Correction configurationdebin: Debinning configurationtonemap: Tonemapping configurationdemosaic: Demosaicing configurationccm: Colour Correction Matrix configurationsat_control: Saturation Control configurationycbcr: YCbCr colour correction configurationsharpen: Sharpening configurationfalse_colour: False colour correctionsh_fc_combine: Sharpening and False Colour correctionycbcr_inverse: Inverse YCbCr colour correctiongamma: Gamma curve configurationcsc: Color Space Conversion configurationdownscale: Downscale configurationresample: Resampling configurationoutput_format: Output format configurationhog: HOG configurationaxi: AXI bus configurationlsc_extra: LSC extra infocac_extra: CAC extra infodownscale_extra: Downscaler extra inforesample_extra: Resample extra infocrop: Crop configurationhog_format: HOG format infodirty_flags_bayer: Bayer enable dirty flags (pisp_be_bayer_enable)dirty_flags_rgb: RGB enable dirty flags (pisp_be_rgb_enable)dirty_flags_extra: Extra dirty flags
enum pisp_tile_edge #
PiSP Back End Tile position
Constants
PISP_LEFT_EDGE: Left edge tilePISP_RIGHT_EDGE: Right edge tilePISP_TOP_EDGE: Top edge tilePISP_BOTTOM_EDGE: Bottom edge tile
struct pisp_tile #
Raspberry Pi PiSP Back End tile configuration
Definition
;
Members
edge: Edge tile flagpad0: Padding bytesinput_addr_offset: Top-left pixel offset, in bytesinput_addr_offset2: Top-left pixel offset, in bytes for the second/ third image planesinput_offset_x: Horizontal offset in pixels of this tile in the input imageinput_offset_y: Vertical offset in pixels of this tile in the input imageinput_width: Width in pixels of this tileinput_height: Height in pixels of the this tiletdn_input_addr_offset: TDN input image offset, in bytestdn_output_addr_offset: TDN output image offset, in bytesstitch_input_addr_offset: Stitch input image offset, in bytesstitch_output_addr_offset: Stitch output image offset, in byteslsc_grid_offset_x: Horizontal offset in the LSC table for this tilelsc_grid_offset_y: Vertical offset in the LSC table for this tilecac_grid_offset_x: Horizontal offset in the CAC table for this tilecac_grid_offset_y: Horizontal offset in the CAC table for this tilecrop_x_start: Number of pixels cropped from the left of the tilecrop_x_end: Number of pixels cropped from the right of the tilecrop_y_start: Number of pixels cropped from the top of the tilecrop_y_end: Number of pixels cropped from the bottom of the tiledownscale_phase_x: Initial horizontal phase in pixelsdownscale_phase_y: Initial vertical phase in pixelsresample_in_width: Width in pixels of the tile entering the Resample blockresample_in_height: Height in pixels of the tile entering the Resample blockresample_phase_x: Initial horizontal phase for the Resample blockresample_phase_y: Initial vertical phase for the Resample blockoutput_offset_x: Horizontal offset in pixels where the tile will be written into the output imageoutput_offset_y: Vertical offset in pixels where the tile will be written into the output imageoutput_width: Width in pixels in the output image of this tileoutput_height: Height in pixels in the output image of this tileoutput_addr_offset: Offset in bytes into the output bufferoutput_addr_offset2: Offset in bytes into the output buffer for the second and third planeoutput_hog_addr_offset: Offset in bytes into the HOG buffer where results of this tile are to be written
Description
Tile parameters: each set of tile parameters is a 160-bytes block of data which contains the tile processing parameters.
struct pisp_be_tiles_config #
Raspberry Pi PiSP Back End configuration
Definition
;
Members
config: PiSP Back End configurationtiles: Tile descriptorsnum_tiles: Number of tiles