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.

Performance of H264 Decoder in DVRRDK4.0

Hi, 

I add callback function to DecLink and I would get signal when Decoder have output data available. I create multi channels and each channel is 640x480. When the channel num is less than 18, the performance of decoder is all right. I could get the output for all channels through 2 or 3 callback. The following shows the right order.

=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 14 buffers
get 2 buffers
get 5 buffers
get 7 buffers
=================
send 14 buffers
get 2 buffers
get 5 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 8 buffers
get 6 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 6 buffers
get 7 buffers
=================
send 15 buffers
get 2 buffers
get 13 buffers
=================
send 16 buffers
get 2 buffers
get 14 buffers
=================
send 16 buffers
get 2 buffers
get 7 buffers
get 7 buffers
=================
But when the channel num is greater than 18 the decoder callback order will disorder. The following is the result. The bold parts shows that the output channel is not the same as input channel.

=================
send 20 buffers
get 2 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 16 buffers
=================
send 19 buffers
get 4 buffers
get 8 buffers
get 9 buffers
=================
send 19 buffers
get 2 buffers
get 8 buffers
get 9 buffers
=================
send 19 buffers
get 2 buffers
get 8 buffers
get 9 buffers
=================
send 20 buffers
get 2 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 9 buffers
get 9 buffers
=================
send 20 buffers
get 2 buffers
get 16 buffers
=================
send 20 buffers
get 4 buffers
get 16 buffers
=================

I don't quite understand these results. I check the videoM3 load and find it is about 20%. Could someone tell me the reason? 

Thanks in advance! Appreciate for your reply!

  • Hi

    I wonder if it is because in DVRRDK4.0 the program could just get one channel buffer from DecLink and feed one buffer to DecLink each time. When the channel num is large than 18, the former channel buffers have already been processed but the latter channel buffers have not.

  • Hi,

    I attach the decoder output buffer return order in the end. You could see the bold lines  belong to the previous decode  process. The decoder sometimes give 18 output buffers, sometimes give 22 buffers. So, how could I force the decoder give as much output buffers as input?3225.data_order.rtf

  • Does anyone know the reason? I need help.

  • Are you setting correct iva2chmap in your usecase file. Share logs of Vsys_printDetailedStatistics and your application code which is feeding bitstream buffer

  • Hi Badri,

    I set the iva2chmap as below.

    static SystemVideo_Ivahd2ChMap_Tbl systemVid_encDecIvaChMapTbl =
    {
    .isPopulated = 1,
    .ivaMap[0] =
    {
    .EncNumCh = 0,
    .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},

    .DecNumCh = 12,
    .DecChList = {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 0, 0, 0, 0},
    },
    .ivaMap[1] =
    { .EncNumCh = 0,
    .EncChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    .DecNumCh = 12,
    .DecChList = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 0, 0, 0, 0},
    },
    .ivaMap[2] =
    { .EncNumCh = 4,
    .EncChList = {0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    .DecNumCh = 0,
    .DecChList = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0},
    },
    };

    The Vsys_printDetailedStatistics output is as following. The application code is attached in the end.

    IPCBITSOUTLINK:Buffer Statistics
    Num Channels:20
    ChId | TotalBufCnt | FreeBufCnt | BufSize | AppAllocCount
    0| 6| 5| 307200| 0
    1| 6| 5| 307200| 0
    2| 6| 5| 307200| 0
    3| 6| 5| 307200| 0
    4| 6| 5| 307200| 0
    5| 6| 5| 307200| 0
    6| 6| 5| 307200| 0
    7| 6| 5| 307200| 0
    8| 6| 5| 307200| 0
    9| 6| 5| 307200| 0
    10| 6| 5| 307200| 0
    11| 6| 5| 307200| 0
    12| 6| 5| 307200| 0
    13| 6| 5| 307200| 0
    14| 6| 5| 307200| 0
    15| 6| 5| 307200| 0
    16| 6| 5| 307200| 0
    17| 6| 5| 307200| 0
    18| 6| 5| 307200| 0
    19| 6| 5| 307200| 0

    VDEC:Buffer Statistics
    ChId | InBufCnt | OutBufCnt
    0| 0| 4
    1| 0| 4
    2| 0| 4
    3| 0| 4
    4| 0| 4
    5| 0| 4
    6| 0| 4
    7| 0| 4
    8| 0| 4
    9| 0| 4
    10| 0| 4
    11| 0| 4
    12| 0| 4
    13| 0| 4
    14| 0| 4
    15| 0| 4
    16| 0| 4
    17| 0| 4
    18| 0| 4
    19| 0| 4

    [m3video] 57489: HDVICP-ID:0
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :28 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :28 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :30 %
    [m3video] totalAcq2acqDelay :69 %
    [m3video] totalElapsedTime in msec : 50167
    [m3video] numAccessCnt: 9500
    [m3video] IVA-FPS : 190
    [m3video] Average time spent per frame in microsec: 1478
    [m3video] 57489: HDVICP-ID:1
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :28 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :28 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :31 %
    [m3video] totalAcq2acqDelay :68 %
    [m3video] totalElapsedTime in msec : 50069
    [m3video] numAccessCnt: 9500
    [m3video] IVA-FPS : 190
    [m3video] Average time spent per frame in microsec: 1475
    [m3video] 57490: HDVICP-ID:2
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :10 %
    [m3video] totalWait2Isr :90 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :90 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :100 %
    [m3video] totalAcq2acqDelay :0 %
    [m3video] totalElapsedTime in msec : 10
    [m3video] numAccessCnt: 3
    [m3video] IVA-FPS : 0
    [m3video] Average time spent per frame in microsec: 2999
    [m3video]
    [m3video] Multi Channel Encode Average Submit Batch Size
    [m3video] Max Submit Batch Size : 24
    [m3video] IVAHD_0 Average Batch Size : 0
    [m3video] IVAHD_0 Max achieved Batch Size : 0
    [m3video] IVAHD_1 Average Batch Size : 0
    [m3video] IVAHD_1 Max achieved Batch Size : 0
    [m3video] IVAHD_2 Average Batch Size : 0
    [m3video] IVAHD_2 Max achieved Batch Size : 0
    [m3video]
    [m3video] Multi Channel Encode Batch break Stats
    [m3video] Total Number of Batches created: 0
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 0 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video] Total Number of Batches created: 0
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 0 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video] Total Number of Batches created: 0
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 0 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video] 59494: HDVICP-ID:0
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :29 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :29 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :31 %
    [m3video] totalAcq2acqDelay :68 %
    [m3video] totalElapsedTime in msec : 52176
    [m3video] numAccessCnt: 9980
    [m3video] IVA-FPS : 191
    [m3video] Average time spent per frame in microsec: 1516
    [m3video] 59495: HDVICP-ID:1
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :0 %
    [m3video] totalWait2Isr :28 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :28 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :31 %
    [m3video] totalAcq2acqDelay :68 %
    [m3video] totalElapsedTime in msec : 52077
    [m3video] numAccessCnt: 9980
    [m3video] IVA-FPS : 191
    [m3video] Average time spent per frame in microsec: 1461
    [m3video] 59495: HDVICP-ID:2
    [m3video] All percentage figures are based off totalElapsedTime
    [m3video] totalAcquire2wait :10 %
    [m3video] totalWait2Isr :90 %
    [m3video] totalIsr2Done :0 %
    [m3video] totalWait2Done :90 %
    [m3video] totalDone2Release :0 %
    [m3video] totalAcquire2Release :100 %
    [m3video] totalAcq2acqDelay :0 %
    [m3video] totalElapsedTime in msec : 10
    [m3video] numAccessCnt: 3
    [m3video] IVA-FPS : 0
    [m3video] Average time spent per frame in microsec: 2999
    [m3video]
    [m3video] *** DECODE Statistics ***
    [m3video]
    [m3video] Elasped Time : 13 secs
    [m3video]
    [m3video]
    [m3video] CH | In Recv In User Out
    [m3video] Num | FPS Skip FPS FPS
    [m3video] -----------------------------------
    [m3video] 0 | 24 0 24
    [m3video] 1 | 24 0 24
    [m3video] 2 | 24 0 24
    [m3video] 3 | 24 0 24
    [m3video] 4 | 24 0 24
    [m3video] 5 | 24 0 24
    [m3video] 6 | 24 0 24
    [m3video] 7 | 24 0 24
    [m3video] 8 | 24 0 24
    [m3video] 9 | 24 0 24
    [m3video] 10 | 24 0 24
    [m3video] 11 | 24 0 24
    [m3video] 12 | 24 0 24
    [m3video] 13 | 24 0 24
    [m3video] 14 | 24 0 24
    [m3video] 15 | 24 0 24
    [m3video] 16 | 24 0 24
    [m3video] 17 | 24 0 24
    [m3video] 18 | 24 0 24
    [m3video] 19 | 24 0 24
    [m3video]
    [m3video] Multi Channel Decode Average Submit Batch Size
    [m3video] Max Submit Batch Size : 24
    [m3video] IVAHD_0 Average Batch Size : 4
    [m3video] IVAHD_0 Max achieved Batch Size : 9
    [m3video] IVAHD_1 Average Batch Size : 4
    [m3video] IVAHD_1 Max achieved Batch Size : 9
    [m3video] IVAHD_2 Average Batch Size : 0
    [m3video] IVAHD_2 Max achieved Batch Size : 0
    [m3video]
    [m3video] Multi Channel Decode Batch break Stats
    [m3video] Total Number of Batches created: 647
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 100 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video] Total Number of Batches created: 646
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 100 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video] Total Number of Batches created: 0
    [m3video] All numbers are based off total number of Batches created
    [m3video] Batch breaks due to batch sizeexceeding limit: 0 %
    [m3video] Batch breaks due to ReqObj Que being empty: 0 %
    [m3video] Batch breaks due to changed resolution class: 0 %
    [m3video] Batch breaks due to interlace and progressivecontent mix: 0 %
    [m3video] Batch breaks due to channel repeat: 0 %
    [m3video] Batch breaks due to different codec: 0 %
    [m3video]
    [m3video]
    [m3video] *** IpcFramesOutRTOS Statistics ***
    [m3video]
    [m3video] Elasped Time : 13 secs
    [m3video] Total Fields Processed : 6260
    [m3video] Total Fields FPS : 481 FPS
    [m3video]
    [m3video]
    [m3video] CH | In Recv In Process In Skip
    [m3video] Num | FPS FPS FPS
    [m3video] --------------------------------
    [m3video] 0 | 24 24 0
    [m3video] 1 | 24 24 0
    [m3video] 2 | 24 24 0
    [m3video] 3 | 24 24 0
    [m3video] 4 | 24 24 0
    [m3video] 5 | 24 24 0
    [m3video] 6 | 24 24 0
    [m3video] 7 | 24 24 0
    [m3video] 8 | 24 24 0
    [m3video] 9 | 24 24 0
    [m3video] 10 | 24 24 0
    [m3video] 11 | 24 24 0
    [m3video] 12 | 24 24 0
    [m3video] 13 | 24 24 0
    [m3video] 14 | 24 24 0
    [m3video] 15 | 24 24 0
    [m3video] 16 | 24 24 0
    [m3video] 17 | 24 24 0
    [m3video] 18 | 24 24 0
    [m3video] 19 | 24 24 0
    [m3video]
    [m3vpss ]
    [m3vpss ] 64502: LOAD: CPU: 1.5% HWI: 0.5%, SWI:0.9%
    [m3vpss ]
    [m3vpss ] 64503: LOAD: TSK: MISC : 0.1%
    [m3vpss ]
    [m3video]
    [m3video] 65003: LOAD: CPU: 17.5% HWI: 1.1%, SWI:1.4%
    [m3video]
    [m3video] 65003: LOAD: TSK: IPC_FRAMES_OUT0 : 2.5%
    [m3video] 65003: LOAD: TSK: IPC_BITS_IN0 : 1.1%
    [m3video] 65004: LOAD: TSK: ENC0 : 0.9%
    [m3video] 65004: LOAD: TSK: DEC0 : 3.0%
    [m3video] 65004: LOAD: TSK: DEC_PROCESS_TSK_0 : 3.5%
    [m3video] 65004: LOAD: TSK: DEC_PROCESS_TSK_1 : 3.5%
    [m3video] 65004: LOAD: TSK: MISC : 0.5%
    [m3video]
    [c6xdsp ]
    [c6xdsp ] 64845: LOAD: CPU: 15.5% HWI: 0.3%, SWI:0.4%
    [c6xdsp ]
    [c6xdsp ] 64845: LOAD: TSK: MISC : 14.8%
    [c6xdsp ]

     

    static void VdecVenc_bitsRdFillEmptyBuf(VCODEC_BITSBUF_S *pEmptyBuf)
    {
        int statHdr, statData;
        int curCh;
        curCh = pEmptyBuf->chnId;
    
        statHdr  = fscanf(Video_Len[curCh],"%d",&(pEmptyBuf->filledBufSize));
        
        OSA_assert(pEmptyBuf->filledBufSize <= pEmptyBuf->bufSize);
    
        statData = fread(pEmptyBuf->bufVirtAddr,1, pEmptyBuf->filledBufSize, Video_File[curCh]);
    
        if( feof(Video_Len[curCh]) || statData != pEmptyBuf->filledBufSize)
        {
            clearerr(Video_Len[curCh]);
            
            fseek(Video_Len[curCh], 0 ,SEEK_SET);
            fseek(Video_File[curCh], 0, SEEK_SET);
            statHdr = fscanf(Video_Len[curCh],"%d",&(pEmptyBuf->filledBufSize));
            
            OSA_assert(pEmptyBuf->filledBufSize <= pEmptyBuf->bufSize);
            statData = fread(pEmptyBuf->bufVirtAddr,1, pEmptyBuf->filledBufSize, Video_File[curCh]);
        }
    }
    
    static Void VdecVenc_bitsRdReadData(VCODEC_BITSBUF_LIST_S  *emptyBufList)
    {
        VCODEC_BITSBUF_S *pEmptyBuf;
        Int i;
    
        for (i = 0; i < emptyBufList->numBufs; i++)
        {
            pEmptyBuf = &emptyBufList->bitsBuf[i];
            VdecVenc_bitsRdFillEmptyBuf(pEmptyBuf);
            VdecVenc_setFrameTimeStamp(pEmptyBuf);
        }
    }
    
    char *VF_Name[24]=
    {"V1.264","V2.264","V3.264","V4.264","V5.264","V6.264","V7.264","V8.264","V9.264","V10.264","V11.264","V12.264",
    "V13.264","V14.264","V15.264","V16.264","V17.264","V18.264","V19.264","V20.264","V21.264","V22.264","V23.264","V24.264"};
    char *VF_Len[24]=
    {"V1.txt","V2.txt","V3.txt","V4.txt","V5.txt","V6.txt","V7.txt","V8.txt","V9.txt","V10.txt","V11.txt","V12.txt",
    "V13.txt","V14.txt","V15.txt","V16.txt","V17.txt","V18.txt","V19.txt","V20.txt","V21.txt","V22.txt","V23.txt","V24.txt"};
    //��Ƶ֡��ȡ�̣߳����չ̶���ʱ����ӽ���ѭ��buffer�ж�ȡ��Ƶ֡��������������buffer
    static Void *VdecVenc_bitsRdSendFxn(Void * prm)
    {
        VCODEC_BITSBUF_LIST_S emptyBufList;
        int i;
        int res = 0;
        int Period;
        int tmp_num;
        //Period = 1000/Frame_Rate;
        Period = 1000000/Frame_Rate;
        struct timeval tv_begin, tv_end;
        float runtime;
        
        struct itimerval interval, ointerval;
    	interval.it_value.tv_sec = 0;
        interval.it_value.tv_usec = 1000000/Frame_Rate;
        interval.it_interval.tv_sec = 0;
        interval.it_interval.tv_usec = 1000000/Frame_Rate;
        signal(SIGALRM, timefun);
    
        OSA_semWait(&gVdecVenc_obj.thrStartSem,OSA_TIMEOUT_FOREVER);
        
        //setitimer(ITIMER_REAL, &interval, &ointerval);
        while (FALSE == gVdecVenc_obj.thrExit)
        {
            //OSA_semWait(&timer_Sem,OSA_TIMEOUT_FOREVER);
           
            for(i=0;i<CH_NUM;i++)
            {
                VdecVenc_bitsRdGetEmptyBitBufs(&emptyBufList, i);
                if (emptyBufList.numBufs)
                {
                    VdecVenc_bitsRdReadData(&emptyBufList);
                    VdecVenc_bitsRdSendFullBitBufs(&emptyBufList);
                    
                }
                else
                    printf("ch %d unable to get empty buffer\n", i);
            }
            
            //printf("=================\n");
            //OSA_waitMsecs(Period);
            usleep(Period);
        }
        
        return NULL;
    }

  • There seems to be no performance issue. It is showing same fps for all channels. Check if the attached patch helps .

    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 8fba371..9e5e7ca 100755
    --- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
    +++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_common.c
                 pFrameInfo->allocPoolID = chId;
                 pFrameInfo->invalidFrame = FALSE;
                 pFrameInfo->rtChInfoUpdate = FALSE;
    +            pFrameInfo->invalidDataPtr = &(pFrameInfo->invalidFrame);
                 pOutObj->outChObj[chId].outFramesPool[frameId].appData = pFrameInfo;
                 status = Utils_quePut(&pOutObj->outChObj[chId].fvidFrmQue,
                     &pOutObj->outChObj[chId].outFramesPool[frameId], BIOS_NO_WAIT);
    @@ -587,7 +583,6 @@ static Int32 DecLink_codecCreateChObj(DecLink_Obj * pObj, UInt32 chId)
     
         pChObj->totalInFrameCnt = 0;
         pChObj->algCreateStatusLocal = DEC_LINK_ALG_CREATE_STATUS_DONOT_CREATE;
     
         ti_sysbios_knl_Semaphore_Params_init(&semPrms);
         semPrms.mode = ti_sysbios_knl_Semaphore_Mode_BINARY;
    @@ -904,7 +899,8 @@ Int32 DecLink_codecFreeProcessedFrames(DecLink_Obj * pObj,
         FVID2_Frame *origFrame;
         System_FrameInfo *freeFrameInfo;
         UInt cookie;
    -    Bool bufFreeDone = FALSE;
    +    Bool sendDataNotify = FALSE;
    +    UInt32 chNum;
     
         cookie = Hwi_disable();
     
    @@ -930,6 +926,7 @@ Int32 DecLink_codecFreeProcessedFrames(DecLink_Obj * pObj,
             freeFrameInfo->vdecRefCount--;
             if (freeFrameInfo->vdecRefCount == 0)
             {
                 if (freeFrameInfo->invalidFrame == TRUE)
                 {
                     freeFrameInfo->invalidFrame = FALSE;
    @@ -940,21 +937,24 @@ Int32 DecLink_codecFreeProcessedFrames(DecLink_Obj * pObj,
                 }
                 else
                 {
    +                chNum = freeFrameInfo->allocPoolID;
                     status = Utils_bufPutEmptyFrameExt(&pObj->outObj.bufOutQue,
                                                         freeFrame);
                     UTILS_assert(!UTILS_ISERROR(status));
    -                bufFreeDone = TRUE;
    +
    +                if (!Utils_queIsEmpty(&(pObj->chObj[chNum].inQue)))
    +                {
    +                    sendDataNotify = TRUE;
    +                }
                 }
             }
         }
     
         Hwi_restore(cookie);
    -    if ((TRUE == pObj->newDataProcessOnFrameFree)
    -      &&
    -      (bufFreeDone))
    +    if (sendDataNotify)
         {
    -        status = System_sendLinkCmd(pObj->linkId,
    -                                    SYSTEM_CMD_NEW_DATA);
    +        status = Utils_tskSendCmd(&pObj->tsk,
    +                                   SYSTEM_CMD_NEW_DATA);
     
             if (UTILS_ISERROR(status))
             {
    @@ -962,10 +962,6 @@ Int32 DecLink_codecFreeProcessedFrames(DecLink_Obj * pObj,
                            "System_sendLinkCmd SYSTEM_CMD_NEW_DATA failed"
                            "errCode = %d", __FILE__, __LINE__, status);
             }
    -        else
    -        {
    -          pObj->newDataProcessOnFrameFree = FALSE;
    -        }
         }
         return status;
     }
    @@ -1728,11 +1724,6 @@ static Int32 DecLink_codecSubmitData(DecLink_Obj * pObj)
           if (chIdIndex >= pObj->inQueInfo.numCh)
               chIdIndex = 0;
           pChObj = &pObj->chObj[chIdIndex];
    -      if (Utils_queIsEmpty(&pObj->outObj.bufOutQue.
    -                           emptyQue[pChObj->allocPoolID]))
    -      {
    -          pObj->newDataProcessOnFrameFree = TRUE;
    -      }
     
           status =
               Utils_queGet(&pObj->reqQue, (Ptr *) & pReqObj, 1,
    @@ -1836,11 +1827,6 @@ static Int32 DecLink_codecSubmitData(DecLink_Obj * pObj)
               UTILS_assert(status == FVID2_SOK);
               startChID = chIdIndex;
               status = FVID2_EFAIL;
    -          if (Utils_queIsEmpty(&pObj->outObj.bufOutQue.
    -                               emptyQue[pChObj->allocPoolID]))
    -          {
    -              pObj->newDataProcessOnFrameFree = TRUE;
    -          }
           }
         }
     
    @@ -1851,7 +1837,6 @@ Int32 DecLink_codecProcessData(DecLink_Obj * pObj)
     {
         Int32 status;
     
    -    pObj->newDataProcessOnFrameFree = FALSE;
         DecLink_codecQueueBufsToChQue(pObj);
     
         do
    @@ -2512,6 +2498,7 @@ static Int32 DecLink_PrepareBatch  (DecLink_Obj *pObj, UInt32 tskId,
       DecLink_ReqObj *pNewReqObj;
       DecLink_ChObj *pChObj;
       Int32 maxBatchSize;
    +  Int32 bufTrackIdx;
     
       /*Reset the submitted flag at the start of batch preperation*/
       pReqObjBatch->channelSubmittedFlag = 0x0;
    diff --git a/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h b/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    index 256ef20..7e7ea78 100755
    --- a/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    +++ b/mcfw/src_bios6/links_m3video/iva_dec/decLink_priv.h
    @@ -283,8 +280,6 @@ typedef struct DecLink_Obj {
             ti_sysbios_knl_Semaphore_Struct *freeSerializerQueMem[DEC_LINK_MAX_IVASWITCH_SERIALIZERS];
             ti_sysbios_knl_Semaphore_Struct freeSerializerSemMem[DEC_LINK_MAX_IVASWITCH_SERIALIZERS];
         } decIVASwitchSerializeObj;
    -    Bool newDataProcessOnFrameFree;
    -
         UInt32 statsStartTime;
         UInt32 memUsed[UTILS_MEM_MAXHEAPS];
         DecLink_ReqBatch reqObjBatch[NUM_HDVICP_RESOURCES];
    

  • Yes, the decoder do data process with no problem. It seems not all the channels return data in time. I will apply the patch and check the result.

    Thanks very much!

  • I apply the patch and rebuild bios6 part. There are two errors below.

    "links_m3video/iva_dec/decLink_common.c", line 288: error: struct "<unnamed>" has no field "invalidDataPtr"
    "links_m3video/iva_dec/decLink_common.c", line 2440: error: variable "bufTrackIdx" was declared but never referenced
    2 errors detected in the compilation of "links_m3video/iva_dec/decLink_common.c"

    The System_FrameInfo is defined in mcfw/src_bios6/links_common/system/system_priv_common.h, should I add invalidDataPtr to it? What is the type?

  • Hi Badri,

    I add UInt32 *invalidDataPtr to System_FrameInfo and rebuild the biso6 part successfully. But the result is the same. I remember in DVRRDK3.5 the program get the empty buffer for all input channels from DecLink and feed all the input data at one time. I wonder if it is because we do not feed input data synchronously then the decoder give output data out of step.

  • Hi Badri,

    I get the latest DVRRDK4.1. But there is no update about DecLink. So, could you give some advice?