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.

Deinterlacing on DM365: what options?

As in subject: what options are available for deinterlacing interlaced input video on dm365? Aside from doubling the second field width, is there anything that can be done on the hardware to address this problem?

Thanks.

 

  • The resizer was used to de-interlace video on DM6446 (see http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraak3b ); DM365 should have a similar resizer (not exact same) that can be leveraged to do a similar de-interlacing process.

  • Thank you Juan, I'll have a look at it and post comments here.

  • Hi,

    finally I've had the time to check the doc. It is an interesting reading, but basically the suggested solution is to work with only 1 field of the frame, then try to fake the missing one with the DaVinci resizer  (no temporal correlation, only spatial) or on the decoding part. While we can discuss if, given limited resources, it is better to use a simple deinterlacing algorithm (with poor results) or to entirely discard a field and try to fix the resolution loss somehow, both proposed solutions involve losing resolution information. For me this means there is no real de-interlacing hardware.

    Btw, thanks again for the suggested reading.

     

  • Hi Marco,

    There is a hardware accelerator based Deinterlacing algorithm which can hopefully meet your requirement. It is not a very high-end deinterlacing algorithm. We have that implementation working on DM365.

    Please contact your local TI contact/FAE and i can help him to get the deinterlacing algorithm. The problem is that this implementation is not available as part of standard TI release packages, so need to go through local TI FAE.

     

    Regards,

    Anshuman

  • Hi ,

    I have get the deinterlace for TI FAE, but when i tested, i find it is not good. we use the Football video test source

     

    Regards

    Thanks

  • Hi Zack,

    Can you share the output of the deinterlacer and the parameters for the algorithm that you have set? Based on the output, we can comment better on the quality of the interlacer and how it can be tuned.

    BTW, the deinterlacer we implemented is performance optimized for DM365 platform and based on hardware accelerators, hence might not have all the level of filters that other algorithms have. As i said, let us look at your result and then we can comment better.

    Regards,

    Anshuman

  • Thanks Saxena

    in.yuv

    output.yuv

    the data is YUV422 720X480

    3513.dei.zip

  • Hi,

    I looked at your input content. Basically the frame 2 is completely different from frame 3. Now FYI, our deinterlacer uses previous frame information to do the deinterlacing. In your input case, it cannot get much from frame 2 and hence frame 3 cannot be deinterlaced properly.

    Just for this stream, you might want to set pObj->extParams.threshold = 0; and try the output. I think it will be much better than your current output. In this case, the deinterlacer algorithm just works on the previous field of the same frame and hence has no dependency on previous frame. But then if you use this option, for general streams, deinterlacer output would not be that great.

    Again, as i mentioned in my earlier reply, our deinterlacer is a light weight implementation that is well optimized for our hardware accelerators. You can surely get some better deinterlacers which are much more complex and can have intelligent detection of the previous frame similarity to current frame.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Thanks Anshuman,

    the pObj->extParams.threshold = 0 can slove the problem.

    if i set the threshhold to zero, the OSD on the video is no clear, Does the dei remove one field ? 

    And a also chose a normal stream for testing. but when i  increase the threshhold, the output is not as you has mentioned. the attached file is the test results.

     

    Regards

    Zack

    6457.dei-t.zip

  • Hi Zack,

    Here is little extra description of threshold:

    Threshold = 0 case: In this mode, deinterlacing algorithm does not use the information from past frames. It keeps one filed (say field 0) of the current frame as it is and the other field (field 1) is generated by interpolation of alternate lines of field 0. This means field 1 from the actual frame is removed and is replaced by the generated field after interpolation of field 0. So you understanding is correct about threshold =0. This also explains the behavipr you are seeing with OSD on the video.

     

    Threshold = (1 to 255) case: Threshold is basically a value against which the motion detection between current frame and previous frame is compared. If the threshold value is quite high, the motion detected between current frame and previous frame might not be able to cross threshold, and in this case, deinterlacing algorithm will do nothing and leave the field as-is (as input). This is why as you increase threshold, you might not see the effect of deinterlacing .

    Threshold parameter is provided for users to tune their deinterlacer operation. Higher the threshold, lower the time taken to do deinterlacing as for higher thresholds deinterlacing would not happen at all.

    Hope this gives you better explaination to the behavior you are seeing.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

     

  • Thanks Anshuman

    If i set the Threshold  to 1, the deinterlacer will be in the best way(do not care about the time taken)?

    Zack 

  • Yes. It should be.

    The recommended valus is 5, though.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Thanks Anshuman :)

  • I also have another question about the deinterlacer.

    The demo show this dei codec can run with H264. Does the DEI  H264 MJPEG can work simultaneously?

    Thanks

    Zack

  • Hi,

    DEI can run in parallel with H.264 but cannot run in parallel with MJPEG. This is because they both share resources. Also, if you have to use MJPEG with DEI (even sequentially), you would have to set askImCopRes = 0 and use semaphores in the application so that VIDENC1_process() of DEI and MJPEG are mutually exclusive.

    This is explained in the DEI documentation.

    Regards,

    Anshuman

  • Thanks Anshuman,

    If DEI and MJPEG use the same resources, Does the Mjpeg perfromance can reach D1(the DEI also run the D1 data)?

    Thanks

    Zack

  • Zack,

    The performance details for DEI and MJPEG are all listed in their respective datasheets. I think you can easily try to calculate the maximum performance based on those numbers and the clocking of DM365 that you are using.

    Regards,

    Anshuman

  • Thanks Anshuman

    Zack

  • Hi. I would ask you what is your input and output chroma format.

    I am trying to use the deinterlacer to get 736x576 4:2:0 semi planer progressive frames from the 736x576 4:2:2 ILE interlaced frames provided by the capture interface.

    In my case the call to the process function produces segmentation fault.

    Thank you.

  • Dear Anshuman:

    I have contacted China (PRC) local TI engineer for the Deinterlaced Algorithm, but i was told that they can't find the algorithm.  Please let me know if the algorithm still available?  And right person to contact in PRC? 

    Thanks!

    Shaohua

  • Hi,

    The DEI algorithm is very much available. It might be possible that your local contact might not be fully aware of the location where to find it. Please ask him/her to contact me (anshuman saxena) and i can help him with the package.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Hi Anshuman,

    I have a problem with using DEI algorithm. The algorithm demo can not even run correctly and a segmentation fault happened when entering frame process.(The creation of DEI is ok).

    The version ot DEI I am using is 1.80.00 and the DVSDK version for DM365 is 4.02.00.01. So I am not sure if the DVSDK version is supported by DEI?

    Thanks.

     

  • Dear Anshuman,

    I have requested local support to contact you but still not get response.  Is it possible you send me the DEI package directly? my mail address is: support@faramtech.com .

    Thanks!

    Shaohua

  • Hi,

    Can you share the log on the serial terminal when the segmentation fault occurs? Also, are you running DEI algorithm alone or is H.264 Enc/Dec, MPEG4 Enc/Dec etc. running in your system?

    I would suggest, keep the system to minimum operations and if still you see segmentation fault, we can try to debug that faster.

    Regards,

    Anshuman

  • Hi perty yin,

    Can you tell me the details of your local contact? In last 3-4 days i have shared the DEI library with multiple FAEs and hope your request is also taken care? If i dont get a response from your local FAE in next 2-3 days, i will send the DEI library directly to you. I just want to ensure that we use the right channel so that support and release licensing is taken care.

    Regards,

    Anshuman

  • Anshuman,

    I buy the TI chip from SeedDsp (http://www.seeddsp.com/) which is a distributor of TI in PRC.  So I ask support from the SeedDSP engineer, and he give me answer that he is waiting answer from TI.  So, could you send the package to me at support@faramtech.com

    Thanks!

    Perty

  • Anshuman,

    I got response that the local TI FAE who responsible for us is tuff-li@ti.com , Would you please send the DEI package to both him and my mail address? Thanks!

    Perty

  • Hi,

    I have provided all the details to Tuff Li and he should be able to give it to you.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Hi Anshuman,

    I got the DEI algorithm from the local TI FAE several days ago. The version is 1.70.00.
    I try to run it on DM368 IPNC system, but VIDENC1_process always return -1 with extended error 0x8000.

    My tool versions is identical with one in release notes:
    DVSDK Version: 2.10.01.18
    Framework Component: 2.25.00.04
    Linux Utils: 2.24.03
    XDC: 3.15.01.59
    Codec Engine: 2.24

    The attached file is the source code. The log is as following:
    	7853.alg_vidDei.rar
    # ./moduletest.out alg_vidDei
    ALG: VidEnc: Created DEI 1 !!!

    frameCount = 0, sizeFrame = 691200
    Calling Run 0... outWidth 720 outHeight 480 status -1
    ALG:DEI: process failed!! status -1, err 0x8000, bytesGenerated 0

    Profile Info : DEI
    ======================
    Avg Time (ms) : 7.00
    Avg Value : 1.00
    Avg Value/sec : 142.86

    ALG: ALG_deiConcRun() ERROR !!!

    Profile Info : DEI
    ======================
    Avg Time (ms) : 7.00
    Avg Value : 1.00
    Avg Value/sec : 142.86

    Could you help out to address this issue?

    Thanks,
    Jeff

  • Hi Jeff,

    The latest DM36x DEI version available is ver 1.9.

    It looks like your are using an old version of test bench,and there is version discepancy between the test bench and the algorithm libs.

    Can you get the latest packages from TI representative?

    regards,

    Anand

  • Hi Anand,

    I guess that the local (Chinese) TI FAE doesn't have the latest packages, since the package was gotten last week.

    Could you send me some stuffs for my test? This issue is urgent for me.:)

    Thanks,

    Jeff

  • Hi Jeff,

    Can you pl. ask TI FAE from whom you got the DEI package to contact me(Anand Kulkarni)?

    I will provide him the link to download the latest DEI package.

    regards,

    Anand

  • Hi Anand,

    I got v1.9 DEI algorithm from the local FAE just now. I works well for me. 

    Thank you very much!!

    Jeff

  • Hi Anand,

        I am finding the DEI package now. How can I get the code? Should I  ask the local FAE to contact you?

    Best Regards,

         Jimmy