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.

Resizer

Hi

I am using a sensor (dm6437 with mt9p031) to capture raw image (RGB 1280x800), and I am doing the preview to converter RGB2YCbCr (YCbCr 1280x800 (without driver)), but I need the image YCbCr 1280x480.
I configured
PRV_PCR = 0x040A0004
WADD_OFFSET = 0x500
To do preview and resize in one time.
And configured
RSZ_CNT = 0x006A500  // hrsz = 0x100  vrsz = 0x1A9
OUT_SIZE = 0x02800500
IN_SIZE = 0x03200500
But I cant configure the coefficients!
Someone can help me? I read the sprue38f and I cant understand the equations….
Did I set the registers correct? And how to work s10q8?

Thanks

  • Hi

     

    Try configuring coefficient with the following values.

    horz coeff = {256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0, 256, 0, 0, 0}

    vert coeff = {33, 190, 33, 0, 19, 186, 51, 0, 10, 172, 74, 0, 4, 152, 100, 0, 1, 127, 127, 1, 0, 100, 152, 4, 0, 74, 172, 10, 0, 51, 186, 19}

     

    Thx,

    Brijesh

  • Hi Brijesh!

    How can I converter dec 2 hex? I didn’t understand how to work the S10Q8…
    And how did you calculate them?

    Thank you!

     

     

  • Hi,

     

    I dont remember exactly the size of the coefficient field in the register. I think S10Q8 means it is signed fractional number with 2 bits for integer and 8 for fractional part.

    The numbers i have given already takes care of converting to S10Q8, so you would just need to write them to coefficient registers.

     

    Thx,

    Brijesh

  • Sorry for my bad question.. it is just to converter dec2hex….
    I tried the values! And my image come with a half of height than I want….
    The image come as 1280x240 and it is walking into my buffer… something like the figure below

    Some idea?

    Thanks!

  • I tried another configuration:

    OUT_SIZE = 0x1D60500 // 1280x470

    RSZ_CNT = 0x06C900

    And the image stopped to rotate! But come with half of height than I want yet…


     

  • I tried another configuration again:
    OUT_SIZE = 0x1E00500 // 1280x480
    RSZ_CNT = 0x06A500
    vert coeff = {0,256,0,0,-6,246,16,0,-7,219,44,0,-5,179,83,-1,-3,130,132,-9,-1,83,179,-5,0,44,219,-7,0,16,246,-6}
    (These values I got on psp video sample source file (resize))
    Now the image rotate and walk! But come with the height than I want .
    I think than fault some sync....

    Thanks

  • I saw the RSZ_PCR.BUSY all the time is 1...

  • Can you try enabling resizer first and then previewer?

     

    It may be because resizer is still receiving data from the previewer.

     

    Can you please also take care of constraints mentioned in resizer document when it is taking input data from previewer?

     

     

    thx,

    Brijesh

  • Hi!
    Yes, I am doing it!

    RSZ_PCR |= 0x01;  // enable resize
    PRV_PCR |= 0x01; // enable preview
    while (!RSZ_PCR & 0x02) {  // waiting for busy
    }
    while (RSZ_PCR & 0x02) {  // waiting finish
    }

    "waiting finish" never finish....

    the constraints:
    • Vertical and horizontal resize ratio values (RSZ_CNT.VRSZ and RSZ_CNT.HRSZ) should be within
    the range: 64 to 1024.  // OK
    • Output Width:
    – Should be within the maximum limit:
    • width < 1280 (if vertical resize value is in the range: RSZ_CNT.VRSZ = 64 to 512)  // OK
    • width < 640 (if vertical resize value is in the range: RSZ_CNT.VRSZ = 513 to 1024)
    – Should be even // OK
    – Should be a multiple of 16 bytes (for vertical upsizing)
    • When input is from the preview engine/CCD controller:
    – The input height and width should be ≤ the output of the preview engine/CCD controller.  // OK
    – The input address and offset should be 0.  // OK
    – The input can not be color separate data.  // OK
    • Input height and width must adhere to the equations listed in Table 26.  // OK

    Another advice?
    I want to know (also), how to calculate the coefficients. Are there some software to do it?

    Thanks for help!

  • Hi Marcio,

    Did you resolve your issue of RSZ_PCR.BUSY = 1 always? I am having the same problem.

    Thanks

    Armen.


  • Hi Armen!

    Unfortunately I gave up of resize..... Now I just showing a part of image with preview.....
    I noticed that the part of coefficient affects the resize.. and I cant do calculate these coefficients! I tryed a lot of values in 2 weeks, and nothing..... if you do the resize, please tell me!

    Thanks!