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.

How to test the performance of MJPEG encoder of YUV422I

hi all,

I am working on DVRRDK_03.00.01.03, the usecase which I use is multich_progressive_4d1_vcap_venc_vdec_vdis.c

I want to test the performance of MJPEG encoder of YUV422I

My goal include:

1) get three(Primary, Secondary, Tertiary) kind of encoded stream with MJPEG;

2) let MJPEG working with YUV422 input

goal 1) is completed, how to get goal 2)?

Thanks!

Jack

  • In DVR RDK, encoder link expects YUV420 input. Though MJPEG encoder datasheet says that YUV422 is supported, its not possible to test at RDK level due encoder link limitation. This limitation is because of the main input is H.264 for the use cases and H.264 encoder is still only YUV420 aware.

  • Hi Sivagamy,

    I already have modified the usecase to let it just use mjpeg encoder(it produced there kind of streams whose encode type is all mjpeg).

    I am sorry for I am not quite understanding the meaning of "This limitation is because of the main input is H.264 for the use cases and H.264 encoder is still only YUV420 aware."

    Jack

  • Even with the modified use case, the input to the encoder is YUV 420 - is that correct? Your requirement is to test performance with YUV422.

    Encoder link doesnt support YUV422I input in current code, though MJPEG encoder library supports this. You might get assert in encoder link if you try to feed in YUV422 input to encoder. That is the limitation right now and encoder link should be modified to handle YUV422I input.

  • Thanks for your reply!

    You are right! I get the assert failed:(from encLink_common.c), but I get encoder failed after I change it to:

        pChAlgCreatePrm->inputChromaFormat  =
    #if 1
            XDM_YUV_422IBE; // XDM_YUV_422ILE;
    #else
            Utils_encdecMapFVID2XDMChromaFormat(pInChInfo->dataFormat);
    #endif
        pChAlgCreatePrm->profile            = pChCreatePrm->profile;


    Utils_encdecMapFVID2XDMChromaFormat assert:

        UTILS_assert((chromaFormat == FVID2_DF_YUV420SP_UV) ||
                     (chromaFormat == FVID2_DF_YUV420SP_VU));
        return (XDM_YUV_420SP);

    encoder error:(from Enclink_jpegEncodeFrame)

       error =  handle->fxns->ividenc.process((IVIDENC2_Handle) handle,
                                          inputBufDesc, outputBufDesc,
                                          (IVIDENC2_InArgs *) inArgs,
                                          (IVIDENC2_OutArgs *) outArgs);

    So I want to know how to modify encoder link to handle YUV422I input.

  • As Sivagamy mentioned encoder with 422I input is not tested. You may end up debugging many issues. Anyhow you can try the following changes:

    1./dvr_rdk/mcfw/src_bios6/links_m3video/codec_utils/utils_encdec.h

    Change

    static inline UInt32 Utils_encdecMapFVID2XDMChromaFormat(UInt32 chromaFormat)
    {
        UTILS_assert((chromaFormat == FVID2_DF_YUV420SP_UV) ||
                     (chromaFormat == FVID2_DF_YUV420SP_VU));
        return (XDM_YUV_420SP);
    }

    to support YUV422I format as below:

    static inline UInt32 Utils_encdecMapFVID2XDMChromaFormat(UInt32 chromaFormat)
    {
        UInt32 xdmChromaFormat;

        UTILS_assert((chromaFormat == FVID2_DF_YUV420SP_UV) ||
                     (chromaFormat == FVID2_DF_YUV420SP_VU) ||
                     (chromaFormat == FVID2_DF_YUV422I_YUYV) ||
                     (chromaFormat == FVID2_DF_YUV422I_UYVY));
        if ((chromaFormat == FVID2_DF_YUV420SP_UV)
            ||
            (chromaFormat == FVID2_DF_YUV420SP_VU))
        {
            xdmChromaFormat = XDM_YUV_420SP;
        }
        else
        {
            xdmChromaFormat = XDM_YUV_422IBE;
        }
        return xdmChromaFormat;
    }

     

     2./dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_jpeg.c

    Change

    inputBufDesc->numPlanes = 2;                           /* status.videnc2Status.bufInfo.minNumInBufs;

    to

    inputBufDesc->numPlanes = status.videnc2Status.bufInfo.minNumInBufs;