My goal is to take an image in DDR2 in bayer format, run it through the previewer & resizer to produce a 1/2 resolution YUV 4:2:2 interleaved image that I can run through the jpeg baseline encoder provided by TI. I have been able to do this in pieces, by running the previewer to output the full res image to ddr2, then running a second pass to resize, then calling the jpeg encoder on the result. Right now, I have each previewer step shaving 32 pixels from each line, and would like to minimize this.
From what I understand, the input to the previewer engine from ddr2 has to have a line width that is a multiple of 32 bytes. (spru977 6.2.6, RADR_OFFSET)
The resizer output also has to be a line width that is a multiple of 32 bytes. (spru977, 6.3.10 SDR_OUTOFF)
The jpeg encoder has to have a line width multiple of 16 bytes (sprueh4, section 4.2.1.3)
It would seem that since the previewer eats a few pixels from each line, my best result would be if the resizer could output a line that is 16 bytes smaller than the original input image, but that had an extra 16 bytes of "junk" on each line to maintain the 32 byte spacing requirement. I could then program the jpeg encoder parameters to encode the (line - 16) size with an original image of (line - 0) size. Is this possible, or is using any portion of the preview image always going to shave 32 bytes from the original image?
Also, in studying the documentation, I was very confused by the resizer IN_START register HORZ_ST value (quoting from spru977 section 6.3.5):
Horizontal starting pixel. This field makes sense when the resizer obtains its input from the preview
engine. When the resizer gets its input from SDRAM, this field must be set to ≤15 for YUV 16-bit
data and ≤31 for 8-bit color separate data.
Horizontal starting pixel value is in number of pixels, if input is from SDRAM.
If the input to the resizer is from CCD controller/preview engine, this field needs to be programmed
as follows:
1. Program this field using number of bytes (twice number of pixels).
2. Change the lowest bit to reflect start position in pixels (effectively change from a value 0 to a
value 1, if required).
What on earth does this mean?
Thanks,
Matt