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.

About user-supplied ROI in DM365

Dear all,
I followed the indications on "Smart Codec features in DM365 user guide" about using the Region Of Interest feature on DM365. In particular I changed the following parameters:

.......
IH264VENC_DynamicParams extDynParams;
IH264VENC_InArgs inH264Args;

VIDENC1_InArgs          inArgs;
......

extDynParams.enableROI = 1;

inH264Args.roiParameters.numOfROI = 1;
inH264Args.roiParameters.listROI[0].topLeft.x = 300;
inH264Args.roiParameters.listROI[0].topLeft.y = 500;
inH264Args.roiParameters.listROI[0].bottomRight.x = 700;
inH264Args.roiParameters.listROI[0].bottomRight.y = 719;
inH264Args.roiParameters.roiPriority[0] = 4;
inH264Args.roiParameters.roiType[0] = FOREGROUND_OBJECT;

inArgs.size = sizeof(VIDENC1_InArgs);
inArgs.inputID = GETID(...);
inArgs.topFieldFirstFlag = 1;

inH264Args.videncInArgs = inArgs;
inH264Args.insertUserData = 0;
inH264Args.lengthUserData = 0;
inH264Args.numOutputDataUnits = 0;

then I run the encoder with

VIDENC1_process(<...>, <...>, <...>, (VIDENC1_InArgs *)&(inH264Args), <...>);

but I can't see any difference compared to the situation without ROI. I tried to check also encoding with low bitrate (150 - 200 Kb/s for 1280x720@15fps), but I didn't notice any difference

Did I forget to set or configure something? I really appreciate any suggestion


LL

  • Hi

    ROI params are extended params. I guess you are setting params correctly but for codec you are sayin you are using base params.

    i mean 

    Livio Lima said:
    inArgs.size = sizeof(VIDENC1_InArgs);

    .

    You should pass inArgs.size = sizeof(IH264VENC_InArgs) and same for other params(Dynamic and createtime).

    One debugging option will be running encoder with debug library, it prints more log related param, you can find whats going wrong.

    Thanks,

    Veeranna

  • Thank you Veeranna,

    now using sizeof(IH264VENC_InArgs) seems that it works, even if the ROI has little (but noticeable) quality improvement compared to the background. Probably it depends on the scene features...

    Can you tell me how to view the log information of debug mode?

    Sincerely

    LL

  • Hi,

    You need to build your app with h264venc_ti_arm926_debug.a instead of h264venc_ti_arm926.a codec lib. or just rename h264venc_ti_arm926.a to h264venc_ti_arm926_production.a and h264venc_ti_arm926_debug.a to h264venc_ti_arm926.a

    Thanks,

    Veeranna