Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Scaler II vs Scaler problems

Hi,

I have a working video processing design that includes the Scaler (v 9.1sp2). In the design I need to convert from 4:2:2 to 4:4:4, scale the video, and then go back to 4:2:2. With the Scaler II in Quartus 10.1, as I unerstand, I can scale the 4:2:2 video directly. I have replaced the Scaler with Scaler II, took away the chrome resamplers and enabled the 4:2:2 option in Scaler II. However, now the design stops working and I get FIFO overflow in my CVI.

I have set both scalers to scale 576p50 to 720p50, using bi-linear method. I have also noted (and compensated for) the change in register map for Scaler II. I have increased the CVI FIFO to over 20000 pixels, but still the same result. If I put the original scaler back (with the chroma resamplers) everything works again.

Does anyody have any experience with the Scaler II using 4:2:2 mode? Why would the Scaler II cause the FIFO overruns?

I also do not know what the option "No blanking in video" means. The description says that you should turn it on if there is no vertical blanking in the video. Does this refer to the video input to the CVI or the output of the CVI? The output of the CVI never contains vertical blanking since it is stripped by the CVI. And why would the scaler be concerned with whether the input video contains vertical blanking or not - except that it means there is a "pause" between valid video frames?

Lastly, the documentation seems to indicate that in some (all?) cases you need to load the coefficients (the note below table 3-21 in the VIP 10.1 UG). Is this required for bi-linear method or only for polyphase?

Regards,

Niki

18 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Istvan,

    when you say you are using the block diagram editor, does that mean you are using the Megawizard to generate the IP cores? What is the parameter set that you are using for the Scaler II?

    Also, when you say that you are using the 'new type of Avalon MM interface', does this mean that you have just changed the register map to match the Scaler II, or are you trying to use the dynamic addressing described in previous posts? Whether the slave uses dynamic or native addressing is only relevant if you connect IP cores using SOPC Builder. If you use the schematic flow to connect blocks then the slave will effectively always use native addressing.

    Best regards,

    Kieron
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Kieron,

    Yes, I use the Megawizard.

    The Scaler II is generated with 3x8bit parallel video data input. Runtime controlling option ha already been tried with both disabled and enabled state without any change in the result. Resolution is 1920x1200. 4:2:2 option is unchecked (4:4:4 input) and "No blanking in video" option has also been tried both checked and unchecked.

    Scaler algorithm is polyphase with shared hor/ver coefficients. Default settings are left unchanged for the precision.

    The older Scaler did not have byte enable pins while the new one has them. I modified my Scaler controller modul corresponding to the standard found in the Altera Avalon Interface Specification (p. 3.23). The new register set was also included into the Scaler II controller, of course but I use only the 0, 1, 3 and 4 registers for changing the output width and height.

    Best regards,

    Istvan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Istvan,

    Please correct me if I have misundertood, but you say that you are only using registers 0, 1, 3 and 4 when you update the control interface. Does this mean that you are not loading any coefficients into the Scaler II? The Scaler I supported a mode with constant compile time loaded coefficients. The user could select the coefficient set to use in the setup GUI and these would be loaded when the design is programmed to the device. However, the Scaler II currently does not support compile time coefficients (it is my underatanding that this feature should be supported in 11.0, but no guarantee) and so you must create and load coefficients at runtime through the control slave interface. If you don't load any coefficients the default contents of the coefficient memory will be used - probably all zeros - and that could explain why your output is all black.

    Best regards,

    Kieron
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Kieron,

    No, I am not loading any coefficient into the Scaler II. This really can be the reason.

    What about the other phenomena with the Scaler I? Is that unit fully accurate? Maybe it is also an abuse of the component. This problem was the first one which forced me to start experience with the Scaler II.

    Why was the Scaler II developed after the Scaler I?

    With many thanks,

    Istvan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Istvan,

    The 'missing' pixels you talk about are most likely an expected effect caused by downscale (you should not see any such effect for upscale or pass through). What are the input/output resolutions where you notice it the most? Basically, when the scaler downscales a line by a factor of N it starts at pixel 0 in the line and uses every Nth pixel as the center of point for the lanczos kernel to produce each output pixel. Hence, the final output pixel in each line was created from a kernel centered N-1 pixels from the edge of the input frame, so it might appear as if you lose a pixel or two for larger downscales. A similar affect occurs when downscaling the number of lines. The Scaler I and Scaler II use exactly the same algorithm so you will not currently see any improvement in the Scaler II.

    While this effect is expected of the algorithm used, it might be greater than it should be due to a potential error in the coefficients generated by the Megawizard. When you run the Megawizard for the Scaler I you can preview the coefficients it is going to generate. If you select, for example, 9 taps and look at the coefficients you will see that the center (highest value) for the kernel in phase 0 is not centered on tap 4, which should be the center tap, but is somewhere between 2 and 3. In fact, all the phases are centered slightly to the left of where the probably should be, meaning your whole image could be shifted up and left by one or two pixels more than it should. It is my understanding that this issue has been picked up at Altera and should be resolved in the Scaler II in the 11.0 release.

    I think the reason the Scaler II was created was because it uses a new line-based approach internally that will eventually allow some of the internal components to be exposed to users to generate more flexible systems than the current frame-based approach allows.

    Hope this helps.

    Regards,

    Kieron
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Kieron,

    Input resolution can be 1920x1080 or 1920x1200. I found the effect only at downscaling as you mentioned.

    I have a test pattern with several pixel wide white border on the for edges. It is fine on top and left but completly disappears on the right and bottom at around half size downscaling (e.g. from 1920x1080 to 960x540).

    The coefficients are not centered well into the whole interpolation range. You are right.

    So it seems I have to make an external coefficient loader for the scaler to try moving the center point of the interpolation.

    You helped so much, many thanks!

    Best regards,

    Istvan
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Istvan,

    If you are happy to keep using the Scaler I then you can opt to load your own custom coefficients at compile time - thus saving yourself the effort of adding extra logic to load the coefficients at runtime. On the final tab of the Scaler GUI there is an option to select the coefficient set, and th option of CUSTOM will allow you to specify a csv file with your custom coefficients. The user guide has information about how this should be formatted (I think).

    Good luck with your design.

    Best regards,

    Kieron
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello Kieron,

    I have found it, that's great!

    Thank you again!

    Regards,

    Istvan