Table of Contents |
Down-conversion: Filters | Results
The code for the down-conversion looks similar to the up-conversion code but it uses memory in a different way and only processes one column at a time. The down-conversion code only went through a few optimisation iterations as I took the lessons learnt from the up-conversion when I wrote the opposite process.
The down-conversion process needs to calculate every pixel in the smaller resultant image and as such there is no copying from one image to another. Obviously the new image will be smaller than the old image so we need an intermediate buffer to store the data after we have down-converted in one dimension only. Figure 5 shows how the down-conversion process used in the code applies to a simple 16-pixel image.
Figure 5 - Down conversion
The original image is represented on the left with the column buffer to the right and the final image on the far right. For the example I assume a three-tap filter.
The image is processed column by column to ensure we get maximum advantage from the column-contiguous storage array. The first step is to calculate our new column by applying the filter in the x-dimension but traversing the image in the y direction. In the example we would centre the filter on a then b etc. to calculate the column that is written into the column buffer. The column buffer is then filtered as shown to calculate the final column, which is written to the output image. Unfortunately there is no way to perform the conversion without using the intermediate buffer.