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.

UG DM35x spruf71a Figure 74 Register Settings for Frame Division Mode - V

 Hi,

Is this documentation correct? I see for example Figure 73(d) H2 = H - H2 which can't be correct.

I would like clarification on the definition of the variables x0, X0, and x1 on page 103 of spruf71a.

Are the formulas calculating X0 and x1 correct?

I do not get any sensible values using the formulas. Could anyone possibly provide me with an example using these formulas, for example processing an 2368x1776 image to 2560x1944? I would be particularly interested in the values of x0, X0, x1 and h_initial_phase.

Thanks

Willem

  • Hi Williem,

    I am putting down the values as below:

    h1 = h2 = 2368/2 = 1184

    H1 = H2 = 2560/2 = 1280

    o = 20 as resize ratio is greater than 1/10

    d = 2368/2560*256 = 236

    For right side vertical slice, calculation are as below:

    xo = h1-o = 1184 - 20 = 1164

    X0 = 1260 (calculations based on formula)

    x1 = 1164 (based on calculation)

    input_h_position = 0

    output_h_position = 20

    output_h_size = 1280

    h_initial_phase = 384

     

    You need to change the input address and output address for the right block of the resizer. The address would be calculated as :

    Input Addr of right slice = Input Addr of Left Slice + 1164 pixels

    Output Addr of right slice = Output Addr of Left Slice + 1280 pixels

    Hope this helps.

    Regards,

    Anshuman

  • Hi Anshuman,

    Thank you very much for the reply.

    I am still having difficulty with the calculation of X0.

    The formula in spruf71a:

    X0 = 2 * ceil((x0 * 256) / (d / 2))

    = 2 * ceil((1164 * 256) / (236 / 2))

    = 2 * ceil(297984 / 118)

    = 2 * 2526

    = 5052

    Should the correct formula be:

    X0 = 2 * ceil(((x0 * 256) / d) / 2)

    = 2 * ceil(((1164 * 256) / 236) / 2)

    = 2 * ceil(1262.6 / 2)

    = 2 * 632

    = 1264


    Then I get:

    input_h_pos = 0

    output_h_pos = 16

    h_init_phase = 320


    How does the resizer know that it is to use Frame Division Mode V? Is RSZ_H_PHS the only parameter that specifies that it should be using Frame Division Mode V?


    Thanks

    Willem

  • Hi Willem,

    Willem Swart said:

    Should the correct formula be:

    X0 = 2 * ceil(((x0 * 256) / d) / 2)

    Yes, this formula is correct. I somehow used the same formula when computing my values and did not realize the difference till you pointed out. I will feed it back to our documentation team to see if they can fix it. BTW, i used value of "d" as 236.8 instead of 236, so our numbers would be looking a little different. But as you have done it, using 236 is correct.

    Willem Swart said:

    How does the resizer know that it is to use Frame Division Mode V? Is RSZ_H_PHS the only parameter that specifies that it should be using Frame Division Mode V?

     

     

    Yes, RSZ_H_PHS tells that there is a Frame Divison - V mode being used.

     

    Please mark the answer as verified if it worked for you, so that others can refer to it.

    Regards,

    Anshuman

     

     

  • Hi Anshuman,

    Thanks for the help, I haven't got it working yet, but am making progress, I would like to understand how it is working so that I can fix what I am doing wrong.

    Q1. In general, how does the resizer know how many pixels horizontally to use from the input as there is no RSZ_I_HSZ parameter?

    Q2. What is RSZ_H_PHS? How is it applied by the resizer? I am not sure of the meaning of RSZ_H_PHS. Elsewhere I have seen it described as the "mixing ratio of the first input line". Is this the ratio of the overlap in the input vs the overlap in the output?

    Q3: For some of the resolutions that I have to resize, e.g. 1280x960 -> 2560x1944, the calculated RSZ_H_PHS is 0. Does this mean Frame Division Mode V will not be used if the parameter RSZ_H_PHS is 0?

    Q4:

    Processing the left hand side:

    RSZ_O_HSZ = 1284 - 1, which is greater than H1, so I assume it is writing some overlap (about 4 pixels) to the output which the right hand side processing will take into account to prevent seaming in the middle of the image using the RSZ_H_PHS value?

    Processing the right hand side:

    The input buffer pointer is adjusted to be the start of the overlap position so it is going to process (h2 + overlap) pixels I assume and write that to the output image.

    The output buffer pointer is adjusted to be 1280 (effectively start position of H2), then RSZ_O_HST  is a 16 offset from 1280?. So in the output it will start processing at position 1280 + 16? (But RSZ_O_HSZ = 1280, and if we start at 1280 + 16 the RSZ_O_HSZ should be less than 1280?).

    Does the resizer use the RSZ_H_PHS parameter to run a filter over the overlapped pixels?

    How does the RSZ_H_PHS = 320 come into it?

    I would have thought processing the right hand side, RSZ_O_HSZ should be X0 size? (the input h2+overlap scaled to the output H2 +overlap?)

    So as you can see I really don't have a good idea of what is going on and would appreciate it if you clear things up to me as I would like to get this working.


    Thanks

    Willem

  • Hi,


    I'm still having a problem with the Frame division mode-V, the vertical seam looks ok, but the right-hand side strip's right edge of the image is smeared/blurred as per the image below. Any ideas as what could be wrong or could be causing it would be appreciated.

    Source image: 2368x1776

    Target image: 2560x1944

    h = 2368; h1 = h2 = 1184

    H = 2560; H1 = H2 = 1280

    overlap = 20

    d = 2368/2560 * 256 = 236

    x0 = 2368 - (1184 + 20) = 1164

    X0 = 2 * ceil(((x0 * 256)/d)/2) = 1264

    x1 = 1164

     

    Left side:

    I_HST = 0

    O_HST = 0

    O_HSZ = 1284

    H_PHS = 0

     

    Right side:

    I_HSZ = 1204

    I_HST = 0

    O_HST = 16

    O_HSZ = 1280

    H_PHS = 320

     

    Advance input buffer pointer by 1164

    Advance output buffer pointer by 1280

     

    The smeared/blurred strip for above example is approximately 16 pixels but I have no idea what causes it. I suspect it has something to do with the overlap size or filter.

     

    Image:

     

    Thanks

    Willem