User`s guide
Key Blockset Con cepts
Optimizing Your Implementation
Optimizing your implementation is a crucial step toward real-time video
processing. The following tips can help improve the performance of your
model:
• Minimize the number of blocks in y our model.
• Process o nly the regions of interest to reduce the input data size.
• Use efficient algorithms or the simplest version of an algorithm that
achieves the desired result.
• Use efficient block parameter settings. How eve r, you need to decide
whether these settings best suit your algorithm. For example, the most
efficient block parameter s ettings might not yield the most accurate results.
You can find out more about individual block parameters and their effect o n
performance by review ing specific block reference pages.
The two following examples show settings that make each block’s operatio n
the least computationally expensive:
- Resize block — Interpolation method = Neares t neighbor
- Blocks that support fixed point — On the Fixed-Point tab, Overflow
mode =
Wrap
• Choose data types carefully.
- Avoid data type conversions.
- Use the smallest data type ne cessary to represent your data to reduce
memory usage and accelerate data processing.
In simulation mode, models with floating-point data types run faster
than models with fixed-point data types. To speed up fixed-point m odels,
you must run them in accelerator mode. Simulink contains additional
code to process a ll fixe d-point data types. This code affects simulation
performance. After you run your model in accelerator mode or generate
code for your target using Real-Time Workshop, the fixed-point data
types are specific to the choices you made for the fixed-point parameters.
Therefore, the fixed-point model and generated code run faster.
1-25