logiWIN

logiWIN - How is logiWIN memory map calculated if double/triple or no buffering is used
KBA-01035-GBF5PJ
Question
How is logiWIN memory map calculated if double/triple or no buffering is used?
Answer

logiWIN can access memory region defined with generic parameters C_VMEM_BASEADDR and C_VMEM_HIGHADDR. When setting these generic parameters it is impotant to ensure that the memory region allocated is large enough to store the complete image. Memory space required to store the complete image is defined with generic parameter C_OUTPUT_TYPE (defines image storage format) and the output image resolution. For example if the output image resolution is 1024 x 512 pixels and selected image storage format is RGB888 (4 bytres per pixel - 4 Bpp), than the memory space required to store the output image is calculated as

1024 pixels x 4 Bpp x 512 lines = 2 MB.

For logiWIN to properly store an output image, an output stride needs to be defined with C_ROW_STRIDE generic parameter as the maximum number of pixels in line. The value of this generic parameter has to be greater than or equal to the output image horizontal resolution (number of pixels in output image line). If C_ROW_STRIDE is greater than the horizontal resolution, logiWIN will occupy more memory space than the output image actually requires.

If double/triple buffering is not used, logiWIN will store image into a single buffer. Size of this buffer is than equal to the size of the entire memory region defined with generic parameters C_VMEM_BASEADDR and C_VMEM_HIGHADDR. Size of memory that logiWIN will occupy to store an output image is than calculated as

C_ROW_STRIDE x Bpp x output image vertical resolution

Occupied space must be less than or equal to the buffer size.

If double/tripple buffering is used, then the size of buffers must be specified.All buffers are of the same size. Generic parameter C_BUFFER_OFFSET specifies the number of lines in one buffer. The size of one buffer is than calculated as

C_ROW_STRIDE x Bpp x C_BUFFER_OFFSET

The size of one buffer must be greater than or equal to the size of memory required to store a complete output image.

If double buffering is used, than 2 buffers are allocated. Total size allocated (buffer 0 + buffer 1) must be less than or equal to the size of memory region defined with generic parameters C_VMEM_BASEADDR and C_VMEM_HIGHADDR.

If triple buffering is used, than 3 buffers are allocated. Total size allocated (buffer 0 + buffer 1 + buffer 2) must be less than or equal to the size of memory region defined with generic parameters C_VMEM_BASEADDR and C_VMEM_HIGHADDR. 

Additional Comments

Copyright © 2024 Xylon d.o.o.