T4 Pixel Pipeline Library

Quick follow up: @mjs513 and myself are making some progress on some of the above :D

For now, I turned off the output rotation, to make it easier to concentrate on the other stuff.

We fixed the issues with it wiping out memory. I am running a variant of the function mentioned earlier that has
a lot of input parameters. I am also bypassing some of the functions in the library.

The key to not screwing up memory is to make sure the PITCH members are correct as well as the OUT_PS_LRC.

Some answers to the above:

a) output image one or both directions is smaller than the screen. You set the: OUT_PS_ULC and OUT_PS_LRC,
to the offsets to where the image should start and image should end within your output buffer, like:
Code:
OUT_PS_ULC:     40, 10
OUT_PS_LRC:    439,309
When the actual size of the output is in:
Code:
OUT_LRC:       479,319

b) and c) - Input image clipping - You setup the PS_BUF: 70000020 to the
memory address of the first pixel you wish to output: That is if you wish for your image to start at ROW: 50 COL: 100,
you would setup the buffer to something like buffer + (50 * CAMERA_WIDTH + 100)
You need to make sure that the pitch is set properly such that it will increment the correct number of bytes per row.
It is also up to your code to make sure that your offsets are correct in that you don't extend outside the bounds of your actual image.

With the above understanding, the sketch is now setup to allow me to type in a scale factor and it now centers and/or clips the images.
Which is working better. Started off doing this with VGA input using HM0360 as being monochrome, the VGA image will fit into normal memory.

I am now playing again with the OV5640 and trying VGA/SVGA, which requires PSRAM on T4.1. Having some luck, but there are issues
with the PSRAM, probably not keeping up. It is doing better now that I updated it to run at 120mhz:
Changed in startup.c (configure_external_ram):
Code:
CCM_CBCMR = (CCM_CBCMR & ~(CCM_CBCMR_FLEXSPI2_PODF_MASK | CCM_CBCMR_FLEXSPI2_CLK_SEL_MASK))
        | CCM_CBCMR_FLEXSPI2_PODF(5) | CCM_CBCMR_FLEXSPI2_CLK_SEL(1); // 720/5 = 120 MHz

I tried the 133Mhz version, but it failed to work on the current board.

Next up: A little more trying to get the PSRAM sizes to work.
Then to add some support into the sketch that when zoomed in, add panning of the camera area...
 
As you know @KurtE and I have been making a few more mods to the PXP library which seem to resolve a couple of other issues we came across with further testing. Including fixing decimation which has now been tested down to a scale factor of 10 (anything smaller just shows a dot.).

So decided to test the PXP sketch with the Arduino style version of the ILI9488 parallel display:
Code:
Rotation 0:
Capture time (millis): 4, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 80, 319, 399)
Input clip Buffer(0x20200000 -> 0x202000a0)
PXP time(micros) : 158, Display time: 25

Rotation 1:
Capture time (millis): 5, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 0, 479, 319)
PXP time(micros) : 154, Display time: 24

Rotation 2:
Capture time (millis): 4, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 80, 319, 399)
Input clip Buffer(0x20200000 -> 0x202000a0)
PXP time(micros) : 158, Display time: 25

Rotation 3:
Capture time (millis): 4, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 0, 479, 319)
PXP time(micros) : 155, Display time: 25

Rotation 0 w/flip:
Capture time (millis): 4, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 80, 319, 399)
Input clip Buffer(0x20200000 -> 0x202000a0)
PXP time(micros) : 158, Display time: 25

Rotation 2 w/scaling:
Capture time (millis): 4, PXP_input_position(0, 0, 479, 319)
PXP_input_position(0, 133, 319, 345)
PXP time(micros) : 154, Display time: 25

Rotation 3 w/Scaling:
Capture time (millis): 5, PXP_input_position(0, 0, 479, 319)
PXP_input_position(80, 53, 399, 265)
PXP time(micros) : 155, Display time: 25

While the PXP time went up (~85 micros to ~155micros for the flexion_teensy_mm image) the display time significantly reduced from about 232 millis to about 25 millis. A significant reduction in display time.

EDIT: Note that test was using the non-dma version of pushPixels16bit. When using the DMA version images get displaed in about 3-4 microseconds. However, if I try to scale the image nothing is displayed.

I pushed up the new changes to separate branch: https://github.com/mjs513/T4_PXP/tree/pxp_fixes_kurte
 
Last edited:
Back
Top