I work on an image processing code base that uses image2d_t objects everywhere. These have their shape (width and height) formally declared which enables programmers to use built-in boundary checking and so on.
To speed-up a separable 2D convolution, I would like to transpose the image temporarily, so the two 1D convolutions access memory along lines. But since all the image2d_t buffers have the same shape, I need to reshape 2 of them, while not reallocating them (if I need to realloc + transpose, then the speed-up adds up to almost nothing).
Is there a way to switch width and height properties in the image2d_t object ?