Video and Vision Processing Suite Intel® FPGA IP User Guide

ID 683329
Date 8/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

26.5. Scaler IP Software API

The IP includes software for run-time control. The IP does not fit any of the generic device models provided by the Nios II HAL and it exposes a set of dedicated accessors to the control and status registers. The IP driver structure inherits the base driver structure so all common methods defined in Video and Vision Processing IPs Software API are applicable.

Register definition header file: intel_vvp_scaler_regs.h

Include file: intel_vvp_scaler.h

Table 432.  Scaler IP Software API
Name Description
intel_vvp_scaler_init Initialize the Scaler instance
Intel_vvp_core_* .Accessors defined in Video and Vision Processing IPs Software Programming Model . Writable when Lite is on. Readable when Lite is off and Debug features is on.
intel_vvp_scaler_get_lite_mode Returns if Lite mode is on
intel_vvp_scaler_get_debug_enabled Returns if Debug features is on

intel_vvp_scaler_get_pixels_in_parallel

Returns the number of pixels transmitted in parallel (per valid beat)

intel_vvp_scaler_get_max_input_width

Returns the maximum input width supported

intel_vvp_scaler_get_max_output_width

Returns the maximum output width supported
intel_vvp_scaler_get_scaling_algorithm Returns the scaling algorithm
intel_vvp_scaler_is_coeffs_loading_enabled Returns if the scaling coefficients can be loaded/updated at run-time
intel_vvp_scaler_are_coeffs_preinitialized Returns if the scaling coefficients are automatically initialized with default values out of reset
intel_vvp_scaler_is_vertical_scaling_enabled Returns if the IP can do vertical scaling
Intel_vvp_scaler_is_partial_vertical_scaling_enabled

Returns if the IP can do split vertical scaling

intel_vvp_scaler_get_num_vertical_taps Returns the number of vertical taps
intel_vvp_scaler_get_num_vertical_phases Returns the number of vertical phases
intel_vvp_scaler_get_num_vertical_banks Returns the number of vertical banks
intel_vvp_scaler_are_vertical_coeffs_signed Returns if the vertical scaling coefficients have a sign bit and can be negative

intel_vvp_scaler_get_vertical_coeffs_int_bits

Returns the number of integer bits (excluding sign bit) available to quantize the vertical scaling coefficients

intel_vvp_scaler_get_vertical_coeffs_frac_bits

Returns the number of fractional bits available to quantize the vertical scaling coefficients
intel_vvp_scaler_is_horizontal_scaling_enabled Returns if the IP can do horizontal scaling
intel_vvp_scaler_is_partial_horizontal_scaling_enabled Returns if the IP can do split horizontal scaling
intel_vvp_scaler_get_num_horizontal_taps Returns the number of horizontal taps
intel_vvp_scaler_get_num_horizontal_phases Returns the number of horizontal phases
intel_vvp_scaler_get_num_horizontal_banks Returns the number of horizontal banks
intel_vvp_scaler_are_ horizontal_coeffs_signed Returns if the horizontal scaling coefficients have a sign bit and can be negative

intel_vvp_scaler_get_ horizontal_coeffs_int_bits

Returns the number of integer bits (excluding sign bit) available to quantize the horizontal scaling coefficients

intel_vvp_scaler_get_ horizontal_coeffs_frac_bits

Returns the number of fractional bits available to quantize the horizontal scaling coefficients
intel_vvp_scaler_get_rounding_method Returns the method used to convert floating-point values back to integer values at the output of the IP
intel_vvp_scaler_is_running Returns if the IP is currently processing video data
intel_vvp_scaler_get_commit_status Returns if there are uncommitted writes
intel_vvp_scaler_get_status Reads the status register
intel_vvp_scaler_set_output_width Selects the output width
intel_vvp_scaler_set_total_input_width

Selects the full image input width (split scaling only)

intel_vvp_scaler_set_total_output_width

Selects the full image output width (split scaling only)

intel_vvp_scaler_set_output_height Selects the output height
intel_vvp_scaler_set_total_input_height

Selects the full image input height (split scaling only)

intel_vvp_scaler_set_total_output_height

Selects the full image output height (split scaling only)

intel_vvp_scaler_set_h_pos_error

Selects the horizontal offset error (split scaling only)

intel_vvp_scaler_set_v_pos_error

Selects the vertical offset error (split scaling only)

intel_vvp_scaler_set_h_extended_fill

Enables horizontal split extension (split scaling only)

intel_vvp_scaler_set_v_extended_fill

Enables vertical split extension (split scaling only)

intel_vvp_scaler_set_h_phase_offset_error

Selects the horizontal phase offset (split scaling only)

intel_vvp_scaler_set_v_phase_offset_error

Selects the vertical phase offset (split scaling only)

intel_vvp_scaler_set_split_h_scaling

Setup the scaler for a horizontal split scaling

intel_vvp_scaler_set_split_v_scaling

Setup the scaler for a vertical split scaling

intel_vvp_scaler_set_v_bank Selects the vertical coefficients bank for the next commit
intel_vvp_scaler_set_h_bank Selects the horizontal coefficients bank for the next commit
intel_vvp_scaler_get_output_width Returns the last selected output width
intel_vvp_scaler_get_total_input_width

Returns the last selected full image input width (split scaling)

intel_vvp_scaler_get_total_output_width

Returns the last selected full image output width (split scaling)

intel_vvp_scaler_get_output_height Returns the last selected output height
intel_vvp_scaler_get_total_input_height

Returns the last selected full image input height (split scaling)

intel_vvp_scaler_get_total_output_height

Returns the last selected full image output height (split scaling)

intel_vvp_scaler_get_h_pos_error

Returns the last selected horizontal offset error (split scaling)

intel_vvp_scaler_get_v_pos_error

Returns the last selected vertical offset error (split scaling)

intel_vvp_scaler_get_h_extended_fill

Returns whether horizontal split extension was enabled (split scaling only)

intel_vvp_scaler_get_v_extended_fill

Returns whether vertical split extension was enabled (split scaling only)

intel_vvp_scaler_get_ h_phase_offset_error

Returns the last selected horizontal phase offset and error (split scaling)

intel_vvp_scaler_get_ v_phase_offset_error Returns the last selected vertical phase offset and error (split scaling)
intel_vvp_scaler_get_v_bank Returns the last selected vertical coefficients bank
intel_vvp_scaler_get_h_bank Returns the last selected horizontal coefficients bank
intel_vvp_scaler_set_quantized_coeffs Program the IP with a new set of quantized coefficients for a specified phase
intel_vvp_scaler_set_coeffs Program the IP with a new set of floating-point coefficients for a specified phase
intel_vvp_scaler_commit_writes Commit all outstanding writes

enum eIntelVvpScalerAlgorithms

Members

kIntelVvpScalerNearestNeighborScaling (0) – Nearest neighbor scaling

kIntelVvpScalerBilinearScaling (1) – Bilinear scaling

kIntelVvpScalerPolyphaseScaling (2) – Polyphase scaling

kIntelVvpScalerInvalidScalingAlgo (-1) – Invalid scaling algorithm (used to indicate errors)

Description

Enumeration for the configurable scaling algorithms

intel_vvp_scaler_init

Prototype
int intel_vvp_scaler_init(intel_vvp_scaler_instance *instance, intel_vvp_core_base base);
Description

Initializes a Scaler instance. The initialization stops early if the vendor ID or product ID read at the base address are not a match or if the register map version is not supported. Otherwise, the function proceeds to read and store the IP compile-time parameterization. The instance is not fully initialized and the application should not use it further if returning a non-zero error code.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

base – base address of the register map

Returns

kIntelVvpCoreOk (0) in case of success, a negative error code in case of error

kIntelVvpCoreVidErr if the vendor id of the core is not the IntelFPGA vendor ID (0x6AF7).

kIntelVvpCorePidErr if the product_id does not match with the Scaler product ID

kIntelVvpCoreInstanceErr if the instance is a null pointer

kIntelVvpScalerMapVersionErr if the register map is not supported

intel_vvp_scaler_get_lite_mode

Prototype
bool intel_vvp_scaler_get_lite_mode(intel_vvp_scaler_instance *instance);
Description

Returns the value of the LITE_MODE register. The instance must be a valid intel_vvp_scaler_instance fully initialized

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

true if the IP is parameterized in lite mode

intel_vvp_scaler_get_debug_enabled

Prototype
 bool intel_vvp_scaler_get_debug_enabled(intel_vvp_scaler_instance *instance);
Description

Returns the value of the DEBUG_ENABLED register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

true if the IP is parameterized with debug features enabled

intel_vvp_scaler_get_pixels_in_parallel

Prototype
 uint8_t intel_vvp_scaler_get_pixels_in_parallel(intel_vvp_scaler_instance *instance);
Description

Returns the value of the PIXELS_IN_PARALLEL register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the pixel in parallel parameter (pixels transmitted per beat/clock cycle) used to generate the IP.

intel_vvp_scaler_get_max_input_width

Prototype
 uint32_t intel_vvp_scaler_get_max_input_width(intel_vvp_scaler_instance *instance);
Description

Returns the value of the MAX_INPUT_WIDTH register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the maximum input width supported by the IP

intel_vvp_scaler_get_max_output_width

Prototype
 uint32_t intel_vvp_scaler_get_max_output_width(intel_vvp_scaler_instance *instance);
Description

Returns the value of the MAX_OUTPUT_WIDTH register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the maximum output width supported by the IP

intel_vvp_scaler_get_scaling_algorithm

Prototype
 eIntelVvpScalerAlgorithms intel_vvp_scaler_get_scaling_algorithm(intel_vvp_scaler_instance* instance);
Description

Returns the value of the SCALER_ALGORITHM register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The scaling algorithm the IP is configured with

intel_vvp_scaler_is_coeffs_loading_enabled

Prototype
 bool intel_vvp_scaler_is_coeffs_loading_enabled(intel_vvp_scaler_instance* instance);
Description

Returns the value of the COEFFS_RUNTIME_LOAD register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If the IP is configured to support run-time reloading of coefficients

intel_vvp_scaler_are_coeffs_preinitialized

Prototype
 bool intel_vvp_scaler_are_coeffs_preinitialized(intel_vvp_scaler_instance* instance);
Description

Returns the value of the COEFFS_MEM_INIT register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If the IP is configured to start with initialized coefficients

intel_vvp_scaler_is_vertical_scaling_enabled

Prototype
 bool intel_vvp_scaler_is_vertical_scaling_enabled (intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_SCALING_ENABLED register. The instance must be a valid intel_vvp_scaler_instance fully initialized

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If the IP is configured to perform vertical scaling

intel_vvp_scaler_is_partial_vertical_scaling_enabled

Prototype
bool intel_vvp_scaler_is_ partial_ vertical_scaling_enabled (intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_PARTIAL_SCALING_ENABLED register. The instance must be a valid intel_vvp_scaler_instance fully initialized

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

Whether the IP is configured to perform split vertical scaling

intel_vvp_scaler_get_num_vertical_taps

Prototype
 uint8_t intel_vvp_scaler_get_num_vertical_taps(intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_NUM_TAPS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of taps used for vertical scaling

intel_vvp_scaler_get_num_vertical_phases

Prototype
 uint16_t intel_vvp_scaler_get_num_vertical_phases(intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_NUM_PHASES register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of taps used for vertical scaling

intel_vvp_scaler_get_num_vertical_banks

Prototype
 uint8_t intel_vvp_scaler_get_num_vertical_banks(intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_NUM_BANKS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of coefficient banks available for vertical scaling

intel_vvp_scaler_are_vertical_coeffs_signed

Prototype
 bool intel_vvp_scaler_are_coeffs_signed(intel_vvp_scaler_instance* instance);
Description

Returns the value of the V_COEFFS_SIGNED register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If signed coefficients have been enabled for vertical scaling at IP generation time

intel_vvp_scaler_get_vertical_coeffs_int_bits

Prototype
 uint8_t intel_vvp_scaler_get_coeffs_int_bits (intel_vvp_scaler_instance *instance);
Description

Returns the value of the V_COEFFS_INT_BITS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the number of integer bits, excluding sign bit, set at IP generation time to parameterize the quantization of the vertical scaling coefficients

intel_vvp_scaler_get_vertical_coeffs_frac_bits

Prototype
 uint8_t intel_vvp_scaler_get_vertical_coeffs_frac_bits (intel_vvp_scaler_instance *instance);
Description

Returns the value of the V_COEFFS_FRAC_BITS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the number of fractional bits set at IP generation time to parameterize the quantization of the vertical scaling coefficients

intel_vvp_scaler_is_horizontal_scaling_enabled

Prototype
 bool intel_vvp_scaler_is_horizontal_scaling_enabled (intel_vvp_scaler_instance* instance);
Description

Returns the value of the H_SCALING_ENABLED register. The instance must be a valid intel_vvp_scaler_instance fully initialized

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If the IP is configured to perform horizontal scaling

intel_vvp_scaler_is_partial_horizontal_scaling_enabled

Prototype

bool intel_vvp_scaler_is_partial_horizontal_scaling_enabled (intel_vvp_scaler_instance* instance);

Description

Returns the value of the H_PARTIAL_SCALING_ENABLED register. The instance must be a valid intel_vvp_scaler_instance fully initialized

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

Whether the IP is configured to perform split horizontal scaling

intel_vvp_scaler_get_num_horizontal_taps

Prototype
 uint8_t intel_vvp_scaler_get_num_horizontal_taps(intel_vvp_scaler_instance* instance);
Description

Returns the value of the H_NUM_TAPS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of taps used for horizontal scaling

intel_vvp_scaler_get_num_horizontal_phases

Prototype
 uint16_t intel_vvp_scaler_get_num_horizontal_phases(intel_vvp_scaler_instance* instance);
Description

Returns the value of the H_NUM_PHASES register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of taps used for horizontal scaling

intel_vvp_scaler_get_num_horizontal_banks

Prototype
 uint8_t intel_vvp_scaler_get_num_horizontal_banks(intel_vvp_scaler_instance* instance);
Description

Returns the value of the H_NUM_BANKS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The number of coefficient banks available for horizontal scaling

intel_vvp_scaler_are_horizontal_coeffs_signed

Prototype
 bool intel_vvp_scaler_are_coeffs_signed(intel_vvp_scaler_instance* instance);
Description

Returns the value of the H_COEFFS_SIGNED register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

If signed coefficients have been enabled for horizontal scaling at IP generation time

intel_vvp_scaler_get_horizontal_coeffs_int_bits

Prototype
 uint8_t intel_vvp_scaler_get_coeffs_int_bits (intel_vvp_scaler_instance *instance);
Description

Returns the value of the H_COEFFS_INT_BITS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the number of integer bits, excluding sign bit, set at IP generation time to parameterize the quantization of the horizontal scaling coefficients

intel_vvp_scaler_get_horizontal_coeffs_frac_bits

Prototype
 uint8_t intel_vvp_scaler_get_horizontal_coeffs_frac_bits (intel_vvp_scaler_instance *instance);
Description

Returns the value of the H_COEFFS_FRAC_BITS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal polyphase scaling

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the number of fractional bits set at IP generation time to parameterize the quantization of the horizontal scaling coefficients

intel_vvp_scaler_is_running

Prototype
 bool intel_vvp_scaler_is_running(intel_vvp_scaler_instance* instance);
Description

Reads and returns the running bit of the STATUS register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

True is the IP is currently receiving/storing an input field, false when between two input fields

intel_vvp_scaler_get_commit_status

Prototype
 bool intel_vvp_scaler_get_commit_status(intel_vvp_clipper_instance* instance);
Description

Reads and returns the commit pending bit of the STATUS register. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured in full mode.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

True is the IP is configured in full mode and if the agent interface contains uncommitted writes.

intel_vvp_scaler_get_status

Prototype
 uint32_t intel_vvp_scaler_get_status(intel_vvp_scaler_instance* instance);
Description

Reads the STATUS register. The instance must be a valid intel_vvp_scaler_instance fully initialized.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

The content of the STATUS register

intel_vvp_scaler_set_output_width

Prototype
 int intel_vvp_scaler_set_output_width(intel_vvp_scaler_instance *instance, uint32_t output_width)
Description

Selects the new output width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal scaling. Also, the output width must be within the allowed range.

If split horizontal scaling is enabled, consider using intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

output_width – new output width in the range [1..max_h_width-1] where max_h_width is the maximum configured output_width returned by intel_vvp_scaler_get_max_output_width

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for horizontal scaling

kIntelVvpScalerParameterErr if the new output width is out-of-range

intel_vvp_scaler_set_total_input_width

Prototype
int intel_vvp_scaler_set_total_input_width(intel_vvp_scaler_instance *instance, uint32_t total_input_width)
Description

Selects the new total input width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Consider using intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_input_width – new width of the full input image

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

kIntelVvpScalerParameterErr if the new input width is invalid

intel_vvp_scaler_set_total_output_width

Prototype
int intel_vvp_scaler_set_total_output_width(intel_vvp_scaler_instance *instance, uint32_t total_output_width)
Description

Selects the new total output width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Consider using intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_output_width – new width of the full output image

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

kIntelVvpScalerParameterErr if the new output width is invalid

intel_vvp_scaler_set_output_height

Prototype
 int intel_vvp_scaler_set_output_height(intel_vvp_scaler_instance *instance, uint32_t output_height)
Description

Selects the new output height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical scaling. If split vertical scaling is enabled, consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

output_height – new output height

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for vertical scaling

kIntelVvpScalerParameterErr if the new output height is invalid

intel_vvp_scaler_set_total_input_height

Prototype
int intel_vvp_scaler_set_total_input_height(intel_vvp_scaler_instance *instance, uint32_t total_input_height)
Description

Selects the new total input height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_input_height – new height of the full input image

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

kIntelVvpScalerParameterErr if the new input height is invalid

intel_vvp_scaler_set_total_output_height

Prototype
int intel_vvp_scaler_set_total_output_height(intel_vvp_scaler_instance *instance, uint32_t total_output_height)
Description

Selects the new total output height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_output_height – new height of the full output image

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

kIntelVvpScalerParameterErr if the new output height is invalid

intel_vvp_scaler_set_h_pos_error

Prototype
int intel_vvp_scaler_set_h_pos_error(intel_vvp_scaler_instance *instance, uint32_t h_pos_error)
Description

Selects the new horizontal position error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Consider using intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

h_pos_error – new horizontal position error

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

intel_vvp_scaler_set_v_pos_error

Prototype

int intel_vvp_scaler_set_v_pos_error(intel_vvp_scaler_instance *instance, uint32_t v_pos_error)

Description

Selects the new vertical position error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

v_pos_error – new vertical position error

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

intel_vvp_scaler_set_h_extended_fill

Prototype
int intel_vvp_scaler_set_h_extended_fill(intel_vvp_scaler_instance *instance, bool extended_fill)
Description

Enables horizontal extension for split scaling. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Consider using

intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

extended_fill – whether horizontal split extension is enabled

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

intel_vvp_scaler_set_v_extended_fill

Prototype
int intel_vvp_scaler_set_v_extended_fill(intel_vvp_scaler_instance *instance, bool extended_fill)
Description

Enables vertical extension for split scaling. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

extended_fill – whether vertical split extension is enabled

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

intel_vvp_scaler_set_h_phase_offset_error

Prototype
int intel_vvp_scaler_set_h_phase_offset_error(intel_vvp_scaler_instance *instance, uint32_t phase_offset, uint32_t phase_error);
Description

Sets the phase offset and phase offset error for split horizontal scaling. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Consider using intel_vvp_scaler_set_split_h_scaling to set up the scaler for split horizontal scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

phase_offset – new phase offset

phase_error – new phase offset error

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

intel_vvp_scaler_set_v_phase_offset_error

Prototype
int intel_vvp_scaler_set_v_phase_offset_error(intel_vvp_scaler_instance *instance, uint32_t phase_offset, uint32_t phase_error);
Description

Sets the phase offset and phase offset error for split vertical scaling. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Consider using intel_vvp_scaler_set_split_v_scaling to set up the scaler for split vertical scaling rather than modifying individual registers manually.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

phase_offset – new phase offset

phase_error – new phase offset error

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

intel_vvp_scaler_set_split_h_scaling

Prototype
int intel_vvp_scaler_set_split_h_scaling(intel_vvp_scaler_instance *instance, uint32_t total_input_width, uint32_t total_output_width, uint32_t split_output_width, uint32_t split_output_left_offset, bool extended_fill, uint32_t *split_input_width, uint32_t *split_input_left_offset);
Description

This function sets the scaler for split horizontal scaling. Specify the full width of the input image, the full width of the desired output image and the required offset/width of the output split to set up the scaler to generate the given output band. Optionally, the function returns the offset and width of the corresponding band in the input image. This should be used to configure the upstream video processing pipeline and stream the correct video portion into the scaler. This call does not update the input width image info register in Lite mode. intel_vvp_core_set_img_info_width should still be called, presumably using the split_input_width value returned here as a parameter.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_input_width – new width of the full input image

total_output_width – new width of the full output image

split_output_width – width of the scaled split (at the output)

split_output_left_offset – left offset of the scaled split (at the output)

extended_fill – whether the input split should contain extra columns of pixels on the left and/or right to ensure the output splits can be stitched with a joint that is not noticeable

split_input_width – the recommended width for the input split. The value is computed and returned by this call (optional, may be NULL)

split_input_left_offset – the recommended left offset for the input split respective to the full input image. The value is computed and returned by this call (optional, may be NULL)

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split horizontal scaling

kIntelVvpScalerParameterErr, if one of the dimensions is invalid or if the split output width is larger than allowed by the configuration.

kIntelVvpScalerParameterErr, if the width and left offset of the output split go out-of-range compared to the total output width

kIntelVvpScalerParameterErr, if the split_input_width value computed during the call is larger than allowed by the configuration. Note that this value is computed last and the scaler is still reprogrammed in this case.

intel_vvp_scaler_set_split_v_scaling

Prototype
int intel_vvp_scaler_set_split_v_scaling(intel_vvp_scaler_instance *instance, uint32_t total_input_height, uint32_t total_output_height, uint32_t split_output_height, uint32_t split_output_top_offset, bool extended_fill, uint32_t *split_input_height, uint32_t *split_input_top_offset);
Description

Description This function sets the scaler for split vertical scaling. Specify the full height of the input image, the full height of the desired output image and the required offset/height of the output split to set up the scaler to generate the given output band. Optionally, the function returns the offset and height of the corresponding band in the input image. This should be used to configure the upstream video processing pipeline and stream the correct video portion into the scaler. This call does not update the input height image info register in Lite mode. intel_vvp_core_set_img_info_height should still be called, presumably using the split_input_height value returned here as a parameter.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

total_input_height – new height of the full input image

total_output_height – new height of the full output image

split_output_height – height of the scaled split (at the output)

split_output_top_offset – top offset of the scaled split (at the output)

extended_fill – whether the input split should contain extra lines on the top and/or bottom to ensure the output splits can be stitched with a joint that is not noticeable

split_input_height – the recommended height for the input split. The value is computed and returned by this call (optional, may be NULL)

split_input_top_offset – the recommended top offset for the input split respective to the full input image. The value is computed and returned by this call (optional, may be NULL)

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for split vertical scaling

kIntelVvpScalerParameterErr, if one of the dimensions is invalid

kIntelVvpScalerParameterErr, if the height and top offset of the output split go out-of-range compared to the total output height

intel_vvp_scaler_set_v_bank

Prototype
 int intel_vvp_scaler_set_v_bank(intel_vvp_scaler_instance *instance, uint8_t bank);
Description

Selects the bank of vertical scaler coefficient to use. The instance must be a valid intel_vvp_scaler_instance, fully initialized, and configured for vertical polyphase scaling. Also, the bank of vertical coefficient should be valid

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

bank – the identifier for the horizontal bank in the range [0..num_v_banks-1] where v_num_banks is the value returned by intel_vvp_scaler_get_num_vertical_banks

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for vertical polyphase scaling

kIntelVvpScalerParameterErr if the vertical bank is invalid

intel_vvp_scaler_set_h_bank

Prototype
 int intel_vvp_scaler_set_h_bank(intel_vvp_scaler_instance *instance, uint8_t bank);
Description

Selects the bank of horizontal scaler coefficient to use. The instance must be a valid intel_vvp_scaler_instance, fully initialized, and configured for horizontal polyphase scaling. Also, the bank of horizontal coefficient should be valid

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

bank – the identifier for the horizontal bank in the range [0..num_h_banks-1] where h_num_banks is the value returned by intel_vvp_scaler_get_num_horizontal_banks

Returns

kIntelVvpCoreOk for success, negative error code in case of failures

kIntelVvpCoreInstanceErr if the instance is invalid or not configured for horizontal polyphase scaling

kIntelVvpScalerParameterErr if the horizontal bank is invalid

intel_vvp_scaler_get_output_width

Prototype
 uint32_t intel_vvp_scaler_get_output_width(intel_vvp_scaler_instance *instance)
Description

Returns the selected output width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for horizontal scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected output width

intel_vvp_scaler_get_total_input_width

Prototype
uint32_t intel_vvp_scaler_get_total_input_width(intel_vvp_scaler_instance *instance)
Description

Returns the selected total input width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected total input width for the full image

intel_vvp_scaler_get_total_output_width

Prototype
uint32_t intel_vvp_scaler_get_total_output_width(intel_vvp_scaler_instance *instance)
Description

Returns the selected total output width. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected total output width for the full image

intel_vvp_scaler_get_output_height

Prototype
 uint32_t intel_vvp_scaler_get_output_height(intel_vvp_scaler_instance *instance)
Description

Returns the selected output height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for vertical scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected output height

intel_vvp_scaler_get_total_input_height

Prototype
uint32_t intel_vvp_scaler_get_total_input_height(intel_vvp_scaler_instance *instance)
Description

Returns the selected total input height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected total input height for the full image

intel_vvp_scaler_get_total_output_height

Prototype
uint32_t intel_vvp_scaler_get_total_output_height (intel_vvp_scaler_instance *instance)
Description

Returns the selected total output height. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected total output height for the full image

intel_vvp_scaler_get_h_pos_error

Prototype
uint32_t intel_vvp_scaler_get_h_pos_error(intel_vvp_scaler_instance *instance)
Description

Returns the selected horizontal position error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected horizontal position error for the full image

intel_vvp_scaler_get_v_pos_error

Prototype
uint32_t intel_vvp_scaler_get_v_pos_error(intel_vvp_scaler_instance *instance)
Description

Returns the selected vertical position error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected vertical position error for the full image

intel_vvp_scaler_get_h_extended_fill

Prototype
bool intel_vvp_scaler_get_h_extended_fill(intel_vvp_scaler_instance *instance)
Description

Returns whether horizontal extended fill is enabled. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

whether horizontal extended fill is assumed

intel_vvp_scaler_get_v_extended_fill

Prototype
bool intel_vvp_scaler_get_v_extended_fill(intel_vvp_scaler_instance *instance)
Description

Returns whether vertical extended fill is enabled. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split vertical scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

whether vertical extended fill is assumed

intel_vvp_scaler_get_h_phase_offset_error

Prototype
int intel_vvp_scaler_get_h_phase_offset_error(intel_vvp_scaler_instance *instance, uint32_t *phase_offset, uint32_t *phase_error)
Description

Returns the selected horizontal phase offset and phase offset error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal polyphase scaling. Also, debug should be enabled to read sensible values back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

kIntelVvpCoreOk in case of success, negative error code otherwise

kIntelVvpCoreInstanceErr if the instance is invalid, or not configured for horizontal split scaling with polyphase scaling algorithm

kIntelVvpCoreNullPtrErr if phase_offset or phase_error are NULL pointers

intel_vvp_scaler_get_ v_phase_offset_error

Prototype
int intel_vvp_scaler_get_v_phase_offset_error(intel_vvp_scaler_instance *instance, uint32_t *phase_offset, uint32_t *phase_error)
Description

Returns the selected vertical phase offset and phase offset error. The instance must be a valid intel_vvp_scaler_instance fully initialized and configured for split horizontal polyphase scaling. Also, debug should be enabled to read a sensible value back

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

kIntelVvpCoreOk in case of success, negative error code otherwise

kIntelVvpCoreInstanceErr if the instance is invalid, or not configured for vertical split scaling with polyphase scaling algorithm

kIntelVvpCoreNullPtrErr if phase_offset or phase_error are NULL pointers

intel_vvp_scaler_get_v_bank

Prototype
 uint8_t intel_vvp_scaler_get_v_bank(intel_vvp_scaler_instance *instance);
Description

Returns the selected bank of vertical scaling coefficient. The instance must be a valid intel_vvp_scaler_instance, fully initialized, and configured for vertical polyphase scaling. Also, debug must be enabled to read a sensible value back.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected vertical bank

intel_vvp_scaler_get_h_bank

Prototype
 uint8_t intel_vvp_scaler_get_h_bank(intel_vvp_scaler_instance *instance);
Description

Returns the selected bank of horizontal scaling coefficient. The instance must be a valid intel_vvp_scaler_instance, fully initialized, and configured for horizontal polyphase scaling. Also, debug must be enabled to read a sensible value back.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

the selected horizontal bank

intel_vvp_scaler_set_quantized_coeffs

Prototype
 int intel_vvp_scaler_set_quantized_coeffs(intel_vvp_scaler_instance* instance, bool h_coeffs, const int32_t* quantized_coeffs, uint8_t num_coeffs, uint8_t bank, uint8_t phase);
Description

Programs the IP with a new set of num_coeffs coefficients for the specified horizontal or vertical phase in the specified bank of coefficients. An error is returned if the IP is not properly configured to use these coefficients. The num_coeffs parameter indicates the guaranteed minimum size of the quantized_coeffs array and must match with the number of horizontal or vertical taps as appropriate. Also, the call checks for correctness of the quantized values and returns an error if invalid bits are set. Sign extension to the full 32 bit range is accepted. Quantization errors do not prevent the coefficients from being updated

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

h_coeffs – true if committing a set of horizontal coefficients, false for a set of vertical coefficients

quantized_coeffs – pointer to the structure containing the quantized coefficients

num_coeffs – the number of horizontal taps if h_coeffs is true, otherwise the number of vertical taps. The caller guarantees that the quantized_coeffs array is larger than the specified number of values

bank – the bank of coefficients used to commit the new set

phase – the phase for the set of new coefficients

Returns

kIntelVvpCoreOk in case of success, negative error code otherwise

kIntelVvpCoreInstanceErr if the instance is invalid, or not configured for horizontal/vertical polyphase scaling and run-time loading of coefficients

kIntelVvpScalerParameterErr if the phase, bank or number of coefficients are invalid for the IP configuration

kIntelVvpCoreNullPtrErr if quantized_coeffs is a NULL pointer

kIntelVvpScalerQuantizationErr if the quantized coefficients are out-of-range (this does not prevent the coefficients update)

intel_vvp_scaler_set_coeffs

Prototype
 int intel_vvp_scaler_set_coeffs(intel_vvp_scaler_instance* instance, bool h_coeffs, const float* quantized_coeffs, uint8_t num_coeffs, uint8_t bank, uint8_t phase);
Description

Programs the IP with a new set of num_coeffs coefficients for the specified horizontal or vertical phase in the specified bank of coefficients. Coefficients are quantized using the fixed-point configuration reported by the IP. An error is returned if the IP is not properly configured to use these coefficients. The num_coeffs parameter indicates the guaranteed minimum size of the coeffs array and must match with the number of horizontal or vertical taps as appropriate. An error is returned if the quantization could not be achieved successfully.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

h_coeffs – true if committing a set of horizontal coefficients, false for a set of vertical coefficients

coeffs – pointer to the structure containing the set of floating-point coefficients

num_coeffs – the number of horizontal taps if h_coeffs is true, otherwise the number of vertical taps. The caller guarantees that the quantized_coeffs array is larger than the specified number of values

bank – the bank of coefficients used to commit the new set

phase – the phase for the set of new coefficients

Returns

kIntelVvpCoreOk in case of success, negative error code otherwise

kIntelVvpCoreInstanceErr if the instance is invalid, or not configured for horizontal/vertical polyphase scaling and run-time loading of coefficients

kIntelVvpScalerParameterErr if the phase, bank or number of coefficients are invalid for the IP configuration

kIntelVvpCoreNullPtrErr if quantized_coeffs is a NULL pointer

kIntelVvpScalerQuantizationErr if the quantized coefficients are out-of-range for the quantization constraints (which does not prevent the coefficients update)

intel_vvp_scaler_commit_writes

Prototype
 int intel_vvp_scaler_commit_writes(intel_vvp_scaler_instance* instance)
Description

Commits all pending writes before processing the next field. The instance must be valid and parameterized in full mode.

Arguments

instance – pointer to the intel_vvp_scaler_instance software driver instance structure

Returns

kIntelVvpCoreOk (0) for success, negative error code otherwise