This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA3: EDMA Autoincrement transfer with in EVE

Part Number: TDA3

We are working on Rotating of an 1280 x 768 image by 90 degree by using the Rotate kernel provided in the eve_sw_01_12_00_00 software.

In the process of the same we are using the autoincrement DMA transfer to transfer a block of 64 x 64 from the input image to the internal memory of EVE.

But while writing the 64x64 processed block to the output memory, we are not able to configure the output transfer parameters . To explain the scenario better i have taken a 4 x 3 matrix as the input image and after rotation the 4x3 matrix will become 3 x 4 matrix.

Consider a, b,c,d  as  64 x 64 block

a b c d
e f g h
i j k l

After Rotation 

d h l
c g k
b f j
a e i

Input blocks to be transferred to the internal memory will be in the sequence a, b , c ,d.......

But while writing to the output buffer first block will come in the last row. So for each input block processing, I have to jump by a stride of (64 x 768) to place the b block into the output buffer. 

Please find the dma transfer properties given below for the output transfer and correct me if I am wrong.

    initParam.transferProp[1].roiWidth              768
    initParam.transferProp[1].roiHeight             1280
    initParam.transferProp[1].roiOffset             0
    initParam.transferProp[1].blkWidth              64
    initParam.transferProp[1].blkHeight             64
    initParam.transferProp[1].extBlkIncrementX      0
    initParam.transferProp[1].extBlkIncrementY      -64
    initParam.transferProp[1].intBlkIncrementX      0
    initParam.transferProp[1].intBlkIncrementY      0
    initParam.transferProp[1].extMemPtrStride       1280
    initParam.transferProp[1].interMemPtrStride     64
    initParam.transferProp[1].extMemPtr             ptr+(1280-64)*768
    initParam.transferProp[1].interMemPtr          
    initParam.transferProp[1].dmaQueNo             
    initParam.transferProp[1].interMemPtr blkptr
    initParam.transferProp[1].dmaQueNo

Regards,

Sritam

  • Hi Sritam,

    I have forwarded your question to EVE experts.

    Regards,
    Yordan
  • Hi Sritam,

       Autoincrement utility requires that number of blocks in horizontal and vertical direction are same for both input and output transfer. To achieve your data flow you can use two instances of auto increment utility one which is configured for input blocks and the other which is configured for output blocks. Let me know if this will work for you.

    Regards,

    Anshu

  • Hello Anshu,

    I have configured 2 different instances of autoincrement utility. But the challenge i am facing is in configuring the transferProp parameters for out transfer.

    For an example if we consider an input image of 1280 x 768 and block size of 32 x 32, then the input transfer parameters are listed below

    initParamIn.numInTransfers = 1;
    initParamIn.numOutTransfers = 0;
    initParamIn.transferType = EDMA_UTILS_TRANSFER_IN;

    initParamIn.transferProp[0].roiWidth = 1280;
    initParamIn.transferProp[0].roiHeight = 768;
    initParamIn.transferProp[0].roiOffset = 0;
    initParamIn.transferProp[0].blkWidth = 32;
    initParamIn.transferProp[0].blkHeight = 32;
    initParamIn.transferProp[0].extBlkIncrementX = 32;
    initParamIn.transferProp[0].extBlkIncrementY = 32;
    initParamIn.transferProp[0].intBlkIncrementX = 0;
    initParamIn.transferProp[0].intBlkIncrementY = 0;
    initParamIn.transferProp[0].extMemPtrStride = 1280;
    initParamIn.transferProp[0].interMemPtrStride = 32;
    initParamIn.transferProp[0].extMemPtr = src;
    initParamIn.transferProp[0].interMemPtr = srcBlk;
    initParamIn.transferProp[0].dmaQueNo = 0;

    The output transfer parameters are mentioned below. 

    initParamOut.numInTransfers = 0;
    initParamOut.numOutTransfers = 1;
    initParamOut.transferType = EDMA_UTILS_TRANSFER_OUT;

    initParamOut.transferProp[0].roiWidth = 768;
    initParamOut.transferProp[0].roiHeight = 1280;
    initParamOut.transferProp[0].roiOffset = 0;
    initParamOut.transferProp[0].blkWidth = 32;
    initParamOut.transferProp[0].blkHeight = 32;
    initParamOut.transferProp[0].extBlkIncrementX = 0;
    initParamOut.transferProp[0].extBlkIncrementY = -32;   ??/* Please comment */
    initParamOut.transferProp[0].intBlkIncrementX = 0;
    initParamOut.transferProp[0].intBlkIncrementY = 0;
    initParamOut.transferProp[0].extMemPtrStride = 768;
    initParamOut.transferProp[0].interMemPtrStride = 32;
    initParamOut.transferProp[0].extMemPtr = dst+(1280-32)*768;
    initParamOut.transferProp[0].interMemPtr = dstBlk;
    initParamOut.transferProp[0].dmaQueNo = 0;

    In the output transfer param the extMemPtr is pointing to the 32th line from the last of the image. After the first processed block of size 32 x 32 is written at that location, next processed block  needs to be written 32 lines above to the previous location where it has been written. So the extBlkIncrementY has to be -32. But this variable can expect only unsigned integers.

    Please suggest how can we configure the output transfer parameters.

    Regards,

    Sritam

  • Hi Sritam,

       Currently we dont support negative values for increment. I am not able to fully understand what you are trying to do. From what I understand is that you want to do auto increment in such a way that first you write the last block row followed by the one above it ( ie starting from bottom of an image and going to the top). I am not sure why you need this. If you can explain your data flow in more detail we could try to suggest best alternative available.

    Regards,

    Anshu

  • Hello Anshu,

    We are trying to Rotate an image of dimension 1280 x 768 by 90 degree in EVE.
    To achieve the same we are using the provided ROTATE kernel in the imgsiglib directory. This helps us to rotate a block of M x N dimension with each being a multiple of 32.
    Now after each block has been rotated, we have to place each rotated block in transposed manner to have the entire image rotated by 90 degree.

    We also couldn't find any example where rotation is happening on the entire image to get a hang of the DMA transfer parameters.

    Please suggest.

    Regards,
    Sritam
  • Hi Sritam,

    As mentioned current interface doesn't support negative increments in X and Y direction. But one can change the interface to make these increments to be int16_t to support your requirement and rebuild DMA utilities. You might need to make slight modification in EDMA_UTILS_autoIncrement_configure function to make sure numBlkHorz and numBlkVert are not negative. Simple way would be to just go through the code to see where extBlkIncrementX and extBlkIncrementY are used and see if making them negative is breaking something. We have not verified this at our end so you will have to try it. But I think it should work. 

    Regards,

    Anshu