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.

mpscalar from(x, y)

hi, all!

       My Ver: DM8168, DVRRDK_04.

       I can convert YUV420SP 2464*2048 to 1080p using MpScalar, now My task is :

       1. crop 2464*2048 to 1600*1200 from start(x,y);

       2. scal 1600*1200 to 400*300.

       My quesion is how to crop it ?

  • MpSclr doesn't support cropping. If you are using decode_display usecase  you could set MpSclr to MP_SCLR_LINK_CMD_SET_HMPCH_FORWARD to forward  2464*2048 to SWMS without scaling and then configure SwMs using SYSTEM_SW_MS_LINK_CMD_SET_HMPCH_INPUT_CROP to crop the input to 1600x1200.

  • Hi,

    Please allocate and fill the crop parameters "srcCropCfg". You fill all the parameters cropStartX, cropStartY, cropWidth and cropHeight with appropriate value. Please let me know if you have any query in usage.

     

    Regards,

    Murali

  • Hi,

     Thank you for your reply.

     I use Scalar Link to complete task,

    Scalar config:

    172     SclrLink_CreateParams_Init(&sclrPrm);
    173     sclrPrm.inQueParams.prevLinkId             = gVcapModuleContext.captureId;
    174     sclrPrm.inQueParams.prevLinkQueId          = 0;
    175     sclrPrm.outQueParams.nextLink              = gVcapModuleContext.nsfId[0];
    176     sclrPrm.tilerEnable                        = FALSE;
    177     sclrPrm.enableLineSkipSc                   = TRUE;//FALSE;
    178     //sclrPrm.inputFrameRate                     = 9;
    179     //sclrPrm.outputFrameRate                    = 9;
    180     sclrPrm.numBufsPerCh                       = 2;
    181     sclrPrm.outDataFormat                      = SYSTEM_DF_YUV422I_YUYV;
    182     sclrPrm.scaleMode                          = DEI_SCALE_MODE_ABSOLUTE;
    183     sclrPrm.outScaleFactor.absoluteResolution.outWidth = 400;
    184     sclrPrm.outScaleFactor.absoluteResolution.outHeight= 320;

     mcfw/src_bios6/links_m3vpss/sclr/sclrLink_drv.c

     464     pChObj->scCropConfig.cropStartX = 700; //0;
     465     pChObj->scCropConfig.cropWidth = 1600; //pInChInfo->width;
     466     pChObj->scCropConfig.cropStartY = 700; //0;
     467     pChObj->scCropConfig.cropHeight = 1200; //pInChInfo->height;

    But it doesn't work. cropStartX/cropStarY is 0 or 700, crop or not , result is same. 

  • Hi,

     

    As Badri said, Cropping is not supported in the mpsclr link..

    What is your input frame format? If it is YUV420, it is not possible to crop from this frame size.. You will have to do it in the application. You could provide an offset in the buffer to the driver to scale it to required resolution.

     

    Regards,

    Brijesh

  • Thanks!

    I tried to use SwMsLink to crop my frame, but failed.

     swMsPrm.swMsInstId[0]        = SYSTEM_SW_MS_SC_INST_DEI_SC_NO_DEI;
    217     swMsPrm.numSwMsInst          = 1;
    218     swMsPrm.swMsInstStartWin[0]  = 0;
    219     swMsPrm.enableProcessTieWithDisplay = FALSE;
    220     swMsPrm.inQueParams.prevLinkId     = gVcapModuleContext.sclrId[0];
    221     swMsPrm.inQueParams.prevLinkQueId  = 0;
    222     swMsPrm.outQueParams.nextLink      = gVcapModuleContext.nsfId[0];
    223     swMsPrm.numOutBuf                 = 7;
    224     swMsPrm.maxOutRes              = VSYS_STD_1080P_60;
    225     swMsPrm.initOutRes             = VSYS_STD_1080P_60;
    226     swMsPrm.lineSkipMode           = FALSE;
    227     swMsPrm.enableLayoutGridDraw = FALSE;
    228     swMsPrm.outDataFormat = SYSTEM_DF_YUV422I_YUYV;
    229     nsfPrm.inQueParams.prevLinkId    = gVdisModuleContext.swMsId[0]

    error:

    [m3vpss ] 8906:ERR::linkID:20000036::channelID:-1::errorCode:-3::FileName:links_m3vpss/avsync/avsync_m3vpss.c::linuNum:1236::errorCondition:((avsync_map_linkid)

     [m3vpss ] AVSYNC:WARNING!!!.AVSYNC config invalid for linkID[20000030]:chId[0] Will Default to AVSYNC disabled

    what happed?

  • The warning indicates your application isn't configuring avsync correctly (Not setting syncLinkId correctly). You can ignore the error.It will not cause any issue.Use SYSTEM_SW_MS_LINK_CMD_SET_HMPCH_INPUT_CROP link cmd in SWMS I mentioned previously to do mega pixel frame cropping