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.

DM365 de-interlacing with resizer in single shot mode

Other Parts Discussed in Thread: TMS320DM6446

Hello,

 

I want do de-interlace an image from ram using the resizer (remove odd rows and scale).

I found the document SPRAAK3B (De-Interlacing and YUV 4:2:2 to 4:2:0 Conversion on TMS320DM6446 Using the Resizer)

but the ioctl "RSZ_S_PARAM" doesn't exist on DM365 (see SPRS566A LSP 2.10 DaVinci Linux Drivers)

How can I tell the resizer to skip odd rows?

 

Regards,

Sandro

  • Sandro,

    On DM365 there should be a way to configure the IPIPE to help with de-interlacing.

    You start with something like a D1 UYVY image:

            720 width, 1440 pitch
    +------------------------------------+
    |                                    |
    |                                    |
    |                                    | 480
    |                                    |
    |                                    |
    |                                    |
     
    +------------------------------------+

    Then you set-up the IPIPE like you're doing a re-size, but when you set the input paramaters, you tell the IPIPE the input looks like this:

            720 width, 2880 pitch
    +------------------------------------------------------------------------+
    |                                                                        |
    |                                                                        | 240
    |                                                                        |
    +------------------------------------------------------------------------+

    Now, when you resize from 720x240 UYVY to 720x480 UYVY, it will resize the left 720x2 bytes to be a full D1 image, which throws away the second field of the interlaced image:

            720 width, 2880 pitch
    +------------------------------------------------------------------------+
    |                                     |                                  |
    |          FIELD 1                    |     FIELD 2                      | 240
    |                                     |                                  |
    +------------------------------------------------------------------------+

                ||
                \/

            720 width, 1440 pitch
    +------------------------------------+
    |                                    |
    |                                    |
    |         FIELD 1                    | 480
    |                                    |
    |                                    |
    |                                    |
     
    +------------------------------------+

    Unfortunately, I don't have reference code I can point you to.  DM355 implements this in the DVSDK demos using the "Smooth" module in the DMAI library, but deinterlacing doesn't appear to be supported by the DM365 demos.

    If you don't have access to the DM355 demos, you can download DMAI from https://gforge.ti.com/gf/project/dmai/ and look at DM355's implementation of the Smooth module.  Be aware, however, that there are some differences in the IPIPE configuration between DM355 and DM365, so make sure you look at the PSP IPIPE examples for DM365 when implementing this.

    Hope this helps!

    Thanks and regards,
    Don

  • Hi Don,

    the Smooth module in the DMAI uses the IPIPE_SET_PARAM ioctl,
    but this call not supported by the linux driver for the dm365.

    I think there are 2 possible solutions:

    • do it in the ARM (propably much to slow for me)
    • modify the linux driver for the resizer (i'm not very well versed in th ipipe system / daVinci drivers)

     

    Regards,

    Sandro

     

     

  • Here's what I did to modify the linux driver and dmai code to perform deinterlacing in single-shot mode on dm365.  Make your own copy of the Resize_config function from the dmai Resize.c code, add a deinterlace flag, and make these changes:

        BufferGfx_getDimensions(hSrcBuf, &srcDim);
        if (deinterlace) srcDim.height /= 2;
        BufferGfx_getDimensions(hDstBuf, &dstDim);

    ...

        /* input params are set at the resizer */
        rsz_ss_config.input.image_width  = srcDim.width;
        rsz_ss_config.input.image_height = srcDim.height;
        rsz_ss_config.input.ppln = rsz_ss_config.input.image_width * (deinterlace ? 2 : 1) + 8;
        rsz_ss_config.input.lpfr = rsz_ss_config.input.image_height + 10;
        rsz_ss_config.input.pix_fmt = pixFormatConversion(BufferGfx_getColorSpace(hSrcBuf));

    This effectively halves the height and doubles the pitch of the source image, as illustrated above.  Then you need to modify the driver to use the ppln value in calculating the adofs param for the ipipeif.  Change the configure_resizer_in_ss_mode() function in drivers/char/dm365_ipipe.c with the following:

        ret = rsz_validate_input_image_format(dev,
                              ss_config->input.pix_fmt,
                              ss_config->input.ppln - 8,
                              ss_config->input.image_height,
                              &line_len);

    Note: this is for dvsdk 2.10.  It looks like there was a ss_config->input.line_length parameter added in 3.10.

  • Thanks Pete. It works.

    how VDCE can be modified to do the same thing on dm6467 ?

    Thanks,

    Claudio

     

  • Hello,

    We are working with the DM365 in continues mode and have the opposite problem. In our setup we would like to cancel the de-interalce option.

    We understand that in this working mode the TI driver was configured by default to drop one of the fields and to duplicate the other one using the resize.

    What are the changes that we should do for canceling this de-interlace feature ?

     

    Thanks,

    Shar.

  • Hi Shar,

    I am working on leopardboard DM365 as well and would like to stop the de-interlacing feature. Can you let me the method too.

    Thanks,

    Maz