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.

DVR RDK 4.0 1080i interlaced encoding + decoding sometimes show green mosaic

Hi,

 

I am using DVR RDK 4.0 to do capture + encoding + decoding + display.

When the video source is 1080p@30Hz, the video is very good.

When the video source is 1080i@60Hz, I set "fieldMergeEncodeEnable = FALSE, DecPrm.processCallLevel = FIELD_LEVEL" and I can see good video in most of the time. But when the picture starts to move, i will probably see green mosaic. Please see it in attached pictures.

As I know, we may have a new release to have better support on interlaced encoding and decoding in Sep. Did we have newer version DVR RDK now? If not, when will we have it?

Could you please help to guide me how to solve such issue?

  • Pls attach the 1080i60 h264 elementary stream so that it can be checked on latest DVR RDK codebase

  • Hi Badri,

     

    Please see the 1080i60 h264 file in link below .

    3755.HandsMove_GreenMosaic.zip

     

  • Hi Badri,

    This 1080i60 h264 file can be played well on PC with VLC. Video is good. But the TI decoder will have green mosaic. I tried the demo dec display user case, it is the same as my user case.

     

    Best regards,

    zzs

  • Looks like you have some sort of pixel-based alpha blending or transparency enabled. Are you using V4L2 or FBDEV to blend your multiple framebuffers?

    Ralph

  • We were able to recreate the issue on DVR RDK with the stream provided. It looks like the issue is with reference buffer size or alignment. We are currently debugging this. Issue is not seen if you create decoder channel for tiled memory output. Pls check if this is the same behavior in your application as well.We will update this post once the issue is resolved.

  • Hi Badri,

    Is there any update for this issue?

    Best regards,

    zzs

  • Attached patch should resolve the issue

    diff --git a/mcfw/src_bios6/links_m3video/codec_utils/utils_encdec.h b/mcfw/src_bios6/links_m3video/codec_utils/utils_encdec.h
    index 41df3fc..1002965 100755
    --- a/mcfw/src_bios6/links_m3video/codec_utils/utils_encdec.h
    +++ b/mcfw/src_bios6/links_m3video/codec_utils/utils_encdec.h
    @@ -457,6 +457,7 @@ static inline Bool Utils_encdecIsGopStart(UInt32 frameType, UInt32 contentType)
     #define UTILS_ENCDEC_GET_PADDED_HEIGHT(height)                                 \
                                             ((height) + (4 * UTILS_ENCDEC_H264PADY))
     
    +#define UTILS_ENCDEC_IVAHD_ALIGN                                            (16)
     Int Utils_encdecGetCodecLevel(UInt32 codingFormat,
                                   UInt32 maxWidth,
                                   UInt32 maxHeight,
    diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    index b2a734c..ea5497c 100755
    --- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    +++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    @@ -340,80 +340,80 @@ static Int32 DecLink_codecPopulateOutFrmFormat(DecLink_Obj *pObj, UInt32 chId)
             case UTILS_ENCDEC_RESOLUTION_CLASS_CIF:       // CIF
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_CIF_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_CIF_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_CIF_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_CIF_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_D1:        // D1
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_D1_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_D1_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_D1_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_D1_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_720P:      // 720p
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_720P_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_720P_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_720P_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_720P_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_1080P:     // 1080p
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_1080P_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_1080P_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_1080P_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_1080P_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_4MP:      // 4MP
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_4MP_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_4MP_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_4MP_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_4MP_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_5MP:     // 5MP
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_5MP_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_5MP_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_5MP_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_5MP_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_9MP:      // 9MP
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_9MP_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_9MP_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_9MP_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_9MP_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
             case UTILS_ENCDEC_RESOLUTION_CLASS_16MP:     // 16MP
                 pFormat->width =
                     UTILS_ENCDEC_GET_PADDED_WIDTH
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_16MP_WIDTH);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_16MP_WIDTH, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->height =
                     UTILS_ENCDEC_GET_PADDED_HEIGHT
    -                (UTILS_ENCDEC_RESOLUTION_CLASS_16MP_HEIGHT);
    +                (VpsUtils_align(UTILS_ENCDEC_RESOLUTION_CLASS_16MP_HEIGHT, UTILS_ENCDEC_IVAHD_ALIGN));
                 pFormat->pitch[0] =
                     VpsUtils_align(pFormat->width, VPS_BUFFER_ALIGNMENT);
                 break;
    diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c b/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    index 08ce0be..2bf410e 100755
    --- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    +++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_h264.c
    @@ -177,6 +177,10 @@ Int32 DecLinkH264_codecFlush(DecLink_ChObj *pChObj,
                   }
     
             } while(retValue == XDM_EOK);
    +        
    +        /*Codec expects I or IDR frame after XDM_FLUSH*/        
    +        pChObj->isFirstIDRFrameFound = FALSE;
    +
         }       
         if(needReset == TRUE)
         {