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.

TMS320DM368: significance of resizer clock

Part Number: TMS320DM368

Hi,

I am using IPNCRDK version 3.8, sensor ARO330.

I had an issue of frame rate loss by half in triple stream and dual stream, I made resizerClkdivN =25 from 70 on triple stream and dual stream mode and fps got increased to 30.

Can you please explain me the significance of this variable and what was actually happened when i changed clk from 70 to 25.

Do it have any other effects by this change on video?

case AVSERVER_UI_CAPTURE_MODE_TRI_STREAM:

if(platform==PLATFORM_DM365)
config->resizerClkdivN = 50;
else
config->resizerClkdivN = gAVSERVER_UI_config.vsEnable ? 60:25;
config->sensorMode = DRV_IMGS_SENSOR_MODE_1920x1080;
config->sensorFps = 30;

in "file av_capture/application/ipnc/av_server/src/common/avServerUi.c".

D you have any other suggestion for me to increase fps other than.

Thank you.

  • Hi,

    Jishana Shaji said:
    I am using IPNCRDK version 3.8,

    IPNC RDK doesn't work with DM365. RDK 3.8/3.9 is for DM38x/dm8127, RDK 5.1/5.2 will work for DM365.

    Jishana Shaji said:
    case AVSERVER_UI_CAPTURE_MODE_TRI_STREAM:

    Can you tell me your use case? and elaborate more on your triple stream combination and their resolution.

  • Hi,

    case AVSERVER_UI_CAPTURE_MODE_TRI_STREAM:

    if(platform==PLATFORM_DM365)
    config->resizerClkdivN = 50;
    else
    config->resizerClkdivN = gAVSERVER_UI_config.vsEnable ? 60:25;
    config->sensorMode = DRV_IMGS_SENSOR_MODE_1920x1080;
    config->sensorFps = 30;
    config->aewb_config.aewbBinEnable = TRUE;

    config->vstabTskEnable = gAVSERVER_UI_config.vsEnable;
    config->ldcTskEnable = gAVSERVER_UI_config.ldcEnable;
    config->vnfTskEnable = gAVSERVER_UI_config.snfEnable|gAVSERVER_UI_config.tnfEnable;
    config->encryptTskEnable = FALSE;

    config->captureRawInMode = AVSERVER_CAPTURE_RAW_IN_MODE_DDR_IN;
    config->captureSingleResize = FALSE;
    config->captureYuvFormat = DRV_DATA_FORMAT_YUV420;

    config->numCaptureStream = 3;

    if(numEncodes > config->numCaptureStream)
    numEncodes = config->numCaptureStream;

    config->numEncodeStream = numEncodes;

    config->faceDetectConfig.captureStreamId = 1;
    config->faceDetectConfig.fdEnable = gAVSERVER_UI_config.fdEnable;

    config->displayConfig.captureStreamId = 1;
    config->displayConfig.width = 720;
    config->displayConfig.height = 480;
    config->displayConfig.expandH = TRUE;

    i=0;

    k=0;
    SetCaptureConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->captureConfig[i].ldcEnable = gAVSERVER_UI_config.ldcEnable;
    config->captureConfig[i].snfEnable = gAVSERVER_UI_config.snfEnable;
    config->captureConfig[i].tnfEnable = gAVSERVER_UI_config.tnfEnable;
    config->captureConfig[i].vsEnable = gAVSERVER_UI_config.vsEnable;

    if(numEncodes>0)
    config->captureConfig[i].numEncodes = 1;

    config->captureConfig[i].encodeStreamId[k++]= 0;
    config->captureConfig[i].frameSkipMask = 0x3FFFFFFF;
    i++;

    k=0;
    SetCaptureConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->captureConfig[i].ldcEnable = gAVSERVER_UI_config.ldcEnable;
    config->captureConfig[i].snfEnable = (numEncodes>1)?gAVSERVER_UI_config.snfEnable:FALSE;
    config->captureConfig[i].tnfEnable = (numEncodes>1)?gAVSERVER_UI_config.tnfEnable:FALSE;
    config->captureConfig[i].vsEnable = gAVSERVER_UI_config.vsEnable;

    if(numEncodes>1)
    config->captureConfig[i].numEncodes = 1;

    config->captureConfig[i].encodeStreamId[k++]= 1;

    if( gAVSERVER_UI_config.mode == AVSERVER_UI_CAPTURE_MODE_720P_VGA)
    config->captureConfig[i].frameSkipMask = 0x1AAAAAAA;
    else
    config->captureConfig[i].frameSkipMask = 0x3FFFFFFF;

    i++;
    k=0;
    SetCaptureConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->captureConfig[i].ldcEnable = gAVSERVER_UI_config.ldcEnable;
    config->captureConfig[i].snfEnable = (numEncodes>2)?gAVSERVER_UI_config.snfEnable:FALSE;
    config->captureConfig[i].tnfEnable = (numEncodes>2)?gAVSERVER_UI_config.tnfEnable:FALSE;
    config->captureConfig[i].vsEnable = gAVSERVER_UI_config.vsEnable;

    if(numEncodes>2)
    config->captureConfig[i].numEncodes = 1;

    config->captureConfig[i].encodeStreamId[k++]= 2;

    if( gAVSERVER_UI_config.mode == AVSERVER_UI_CAPTURE_MODE_720P_VGA)
    config->captureConfig[i].frameSkipMask = 0x1AAAAAAA;
    else
    config->captureConfig[i].frameSkipMask = 0x3FFFFFFF;
    i++;

    i=0;
    config->encodeConfig[i].captureStreamId = 0;
    SetEncodeConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->encodeConfig[i].frameRateBase = config->sensorFps*1000;
    config->encodeConfig[i].frameSkipMask = 0x3FFFFFFF;
    config->encodeConfig[i].codecType = gAVSERVER_UI_config.codecType[i];
    config->encodeConfig[i].codecBitrate = gAVSERVER_UI_config.codecBitrate[i];
    config->encodeConfig[i].encryptEnable = FALSE;
    config->encodeConfig[i].fileSaveEnable = FALSE;
    config->encodeConfig[i].motionVectorOutputEnable = FALSE;
    config->encodeConfig[i].qValue = gAVSERVER_UI_config.codecBitrate[i];
    i++;

    config->encodeConfig[i].captureStreamId = 1;
    SetEncodeConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->encodeConfig[i].frameRateBase = config->sensorFps*1000;
    config->encodeConfig[i].frameSkipMask = 0x3FFFFFFF;
    config->encodeConfig[i].codecType = gAVSERVER_UI_config.codecType[i];
    config->encodeConfig[i].codecBitrate = gAVSERVER_UI_config.codecBitrate[i];
    config->encodeConfig[i].encryptEnable = FALSE;
    config->encodeConfig[i].fileSaveEnable = FALSE;
    config->encodeConfig[i].motionVectorOutputEnable = FALSE;
    config->encodeConfig[i].qValue = gAVSERVER_UI_config.codecBitrate[i];
    i++;

    config->encodeConfig[i].captureStreamId = 1;
    SetEncodeConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->encodeConfig[i].frameRateBase = config->sensorFps*1000;
    config->encodeConfig[i].frameSkipMask = 0x3FFFFFFF;
    config->encodeConfig[i].codecType = gAVSERVER_UI_config.codecType[i];
    config->encodeConfig[i].codecBitrate = gAVSERVER_UI_config.codecBitrate[i];
    config->encodeConfig[i].encryptEnable = FALSE;
    config->encodeConfig[i].fileSaveEnable = FALSE;
    config->encodeConfig[i].motionVectorOutputEnable = FALSE;
    config->encodeConfig[i].qValue = gAVSERVER_UI_config.codecBitrate[i];
    i++;

    config->encodeConfig[i].captureStreamId = 2;
    SetEncodeConfigRes(i, gAVSERVER_UI_config.codecResolution[i], &gAVSERVER_UI_ctrl.avserverConfig);
    config->encodeConfig[i].frameRateBase = config->sensorFps*1000;
    config->encodeConfig[i].frameSkipMask = 0x3FFFFFFF;
    config->encodeConfig[i].codecType = gAVSERVER_UI_config.codecType[i];
    config->encodeConfig[i].codecBitrate = gAVSERVER_UI_config.codecBitrate[i];
    config->encodeConfig[i].encryptEnable = FALSE;
    config->encodeConfig[i].fileSaveEnable = FALSE;
    config->encodeConfig[i].motionVectorOutputEnable = FALSE;
    config->encodeConfig[i].qValue = gAVSERVER_UI_config.codecBitrate[i];
    i++;

    break;


    This is the triple stream configuration.
    My issue is that we changed config->sensorMode = DRV_IMGS_SENSOR_MODE_1280x960; to config->sensorMode = DRV_IMGS_SENSOR_MODE_1920x1080; for FOV fix both in dual and triple stream. Then FPS got halved. For all the resolution issue was there for dual and triple stream.

    For single stream it there was no issue since config->sensorMode not changed for single stream.

    I changed the config->resizerClkdivN = gAVSERVER_UI_config.vsEnable ? 60:70;
    to config->resizerClkdivN = gAVSERVER_UI_config.vsEnable ? 60:25;

    Then fps improved to 25 , actually the configured fps was 30 for both the stream. If I change exposure from 1/25 to 1/50 fps got as 30.

    My question is that what actually happened when resizer clk changed. How the FPS increased. And the significance of this resizerClkdivN and resizerClkdivM variables.
  • Hi ,

    Please refer to this link , I am not sure of whole RDK pipeline .

    https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/7756

    Upto my knowledge from above thread , changing DIV_M and DIV_N shouldn't have any effect on framerate if it is continuous mode.

    But , in Single Shot mode when you increase M/N that is proportion of DDR . Then your resizer would operate in that speed , that is treated is CLK.

    If you don't have M/N portion of DDR then it is possible that is partial resizing of frame happens , partial output is updated in detail below.

    Observation ,

    1 ) Color defects (If resizer involves colour conversion)

    2) Partial frame updated (if no colour conversion).

    please go through VPFE (www.ti.com/.../sprufg8c.pdf) user guide that will help you .

    Thanks & Regards,

    Vishwanath Patil

  • An additional information please go through IPIPEIF register(6.2.17) configuration .
  • Hi,

     

    Thank you for the reply.

     

    Colour conversion is doing.

    will the change of M/N=10/70 to M/N=10/25 (using 340 MHz DDR and dm368) make any defect in colour.  

    Can you please make it clear and also about partial re-sizing? 

    When I am checking about the resolution in vlc am getting proper resolution.

    Do we have any other option for checking resolution?

  • Hi,

    We were taking using single shot mode with a resolution of 2176x1296.
    DDR is 340 Mhz, M/N=1/2.5.
    So as per john whittington (e2e.ti.com/.../7756)time time taken to dump the whole frame and dump out the data will be 20.736 ms.

    Triple stream, 30fps,

    In my console i am getting

    1.With exposure 1/25

    Module | Avg Time/Frame | Frame-rate | Total time | Total Frames |
    CAPTURE | 39.88 | 25.08 | 35928 | 901 |
    IPIPE | 27.59 | 36.25 | 24856 | 901 |
    RESIZE | 4.63 | 216.12 | 4169 | 901 |
    ENCODE0 | 24.11 | 41.48 | 21698 | 900 |
    ENCODE1 | 7.91 | 126.40 | 4921 | 622 |
    ENCODE2 | 3.05 | 327.65 | 1465 | 480 |
    STREAM | 0.17 | 5722.89 | 332 | 1900 |
    OSD0 | 0.11 | 9333.33 | 90 | 840 |
    OSD1 | 0.18 | 5526.32 | 152 | 840 |
    OSD2 | 0.18 | 5675.68 | 148 | 840 |
    AEWB | 2.31 | 431.97 | 2146 | 927 |

    2.With exposure 1/50

    Module | Avg Time/Frame | Frame-rate | Total time | Total Frames |
    CAPTURE | 35.42 | 28.23 | 31914 | 901 |
    IPIPE | 25.02 | 39.96 | 22545 | 901 |
    RESIZE | 4.81 | 208.04 | 4331 | 901 |
    ENCODE0 | 25.84 | 38.69 | 23286 | 901 |
    ENCODE1 | 8.38 | 119.32 | 5037 | 601 |
    ENCODE2 | 3.14 | 318.25 | 1414 | 450 |
    STREAM | 0.23 | 4345.21 | 449 | 1951 |
    OSD0 | 0.11 | 9193.88 | 98 | 901 |
    OSD1 | 0.18 | 5427.71 | 166 | 901 |
    OSD2 | 0.17 | 5888.89 | 153 | 901 |
    AEWB | 2.05 | 487.43 | 1949 | 950 |



    How will you relate this with resizer timing?

  • Hi,

    will the change of M/N=10/70 to M/N=10/25 (using 340 MHz DDR and dm368) make any defect in colour.

    It does depend on the load on your DDR in current usecase you will be able to observe if any defect.

    Can you please make it clear and also about partial re-sizing?

    In video you would see half of the frame not at all updated , what ever buffer holds previously that's what you will observe

    , this you might be able to observe with fast movements in video.

    Thanks & Regards,

    Vishwanath Patil

  • Hi ,

    Refer to Anshuman Saxena 's replay in this link

    e2e.ti.com/.../7756

    It explains well regarding the clock division.

  • Hi,

    I went through that link already, from where I got the method to calculate resizer clock.

    Still I want clarification regarding resizer timing, because I got time taken to dump the whole frame and dump out the data will be 20.736 ms and from where I will get the resizer timing other than the print from the console so that I can make a confirmation of this value.

    console print I have shared already on the above reply.


    when M/N ratio was 1/7 avarage time per frame was around 67ms now it is around 35ms.
    I think frame rate increased becaue the average time per frame is halved when M/N ratio changed to 1/2.5, is that so?
    I just want to know what made this change?

    It is very urgent for me now.