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.

MPEG4_HDVICP CMEM error

Hello,

I'm using the MPEG4_HDVICP encoder (v2.00.00) from the DVSDK 3.10 on a DM368. The implementation was strait forward and finally I succeeded creating a MPG4 stream.

But now I observe two problems were I need help. Maybe this problems are related to each other.

 

First of all I get an annoying CMEM error each time I encode an image i.e. when calling VIDENC1_Process().

...
CMEM Error: getPhys: Failed to get physical address of 0
@3,910,672us: [+5 T:0x43163460 S:0x4316279c] CV - VISA_exit(visa=0x2d6510): algHandle = 0x2d6478
@3,910,897us: [+0 T:0x43163460 S:0x4316278c] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x2d6478)
@3,911,086us: [+0 T:0x43163460 S:0x4316276c] ti.sdo.ce.osal.SemMP - Entered SemMP_post> sem[0x2b4e28]
@3,911,268us: [+0 T:0x43163460 S:0x4316276c] ti.sdo.ce.osal.SemMP - Leaving SemMP_post> sem[0x2b4e28]
@3,911,424us: [+0 T:0x43163460 S:0x4316279c] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
@3,911,570us: [+0 T:0x43163460 S:0x431627b4] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x2d6510, retVal=0x0)
@3,913,660us: [+0 T:0x43163460 S:0x431627b4] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x2d6510, inBufs=0x43162858, outBufs=0x43162a30, inArgs=0x43162a1c, outArgs=0x43162928)
@3,913,906us: [+5 T:0x43163460 S:0x43162794] CV - VISA_enter(visa=0x2d6510): algHandle = 0x2d6478
@3,914,074us: [+0 T:0x43163460 S:0x43162784] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x2d6478)
@3,914,236us: [+0 T:0x43163460 S:0x4316274c] ti.sdo.ce.osal.SemMP - Entered SemMP_pend> sem[0x2b4e28] timeout[0xffffffff]
@3,914,415us: [+0 T:0x43163460 S:0x4316274c] ti.sdo.ce.osal.SemMP - Leaving SemMP_pend> sem[0x2b4e28] status[0]
@3,916,694us: [+0 T:0x43163460 S:0x43162794] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
CMEM Error: getPhys: Failed to get physical address of 0
...

All prior calls like VIDENC1_create(...) or VIDENC1_control(..) succeed without any error or warning. I checked the buffers that I pass to the codec but there is no NULL pointer. The generated MPEG streams looks OK.

 

My other problem is the low performance of the codec. Currently it takes 58ms to encode an image of 1280x960 so I can achieve 17fps only  . But maybe this is related to the CMEM error.

 

Here are my parameters:

########################################################################

// set defaults
    MPEG4Para.videncParams.size = sizeof(IMP4HDVICPENC_Params);         
    MPEG4Para.videncParams.encodingPreset = XDM_HIGH_SPEED; 
    MPEG4Para.videncParams.rateControlPreset = IVIDEO_LOW_DELAY;
    MPEG4Para.videncParams.maxHeight = 1280;
    MPEG4Para.videncParams.maxWidth = 980;
    MPEG4Para.videncParams.maxFrameRate = 30000;   
    MPEG4Para.videncParams.maxBitRate = 20000000;   
    MPEG4Para.videncParams.dataEndianness = XDM_BYTE;
    MPEG4Para.videncParams.maxInterFrameInterval = 1;
    MPEG4Para.videncParams.inputChromaFormat = XDM_YUV_420SP;
    MPEG4Para.videncParams.inputContentType = IVIDEO_PROGRESSIVE;
    MPEG4Para.videncParams.reconChromaFormat = XDM_CHROMA_NA;
    MPEG4Para.MPEG4_mode = 1;       
    MPEG4Para.levelIdc = IMP4HDVICPENC_SP_LEVEL_5;          
    MPEG4Para.useVOS = 1;
    MPEG4Para.useGOV = 0;
    MPEG4Para.useDataPartition = 0;
    MPEG4Para.useRVLC =0;          
    MPEG4Para.aspectRatio = IMP4HDVICPENC_AR_DEFAULT;
    MPEG4Para.pixelRange = IMP4HDVICPENC_PR_DEFAULT;
    MPEG4Para.timerResolution = 30000;
    MPEG4Para.ME_Type = 0;           
    MPEG4Para.UMV = 1;               
    MPEG4Para.EncQuality_mode = 0;
    MPEG4Para.hdvicpHandle = NULL;

    ///////////////////////////////////////////////////////////////////////////
    // Dynamic Parameter
    ///////////////////////////////////////////////////////////////////////////


    MPEG4dynPara.videncDynamicParams.size = sizeof(IMP4HDVICPENC_DynamicParams);        
    MPEG4dynPara.videncDynamicParams.inputHeight = MPEG4Para.videncParams.maxHeight;  
    MPEG4dynPara.videncDynamicParams.inputWidth = MPEG4Para.videncParams.maxWidth;    
    MPEG4dynPara.videncDynamicParams.refFrameRate = MPEG4Para.videncParams.maxFrameRate;
    MPEG4dynPara.videncDynamicParams.targetFrameRate = MPEG4dynPara.videncDynamicParams.refFrameRate;
    MPEG4dynPara.videncDynamicParams.targetBitRate = 2000000;
    MPEG4dynPara.videncDynamicParams.intraFrameInterval = 30;
    MPEG4dynPara.videncDynamicParams.generateHeader = XDM_ENCODE_AU;
    MPEG4dynPara.videncDynamicParams.captureWidth =0;
    MPEG4dynPara.videncDynamicParams.forceFrame = IVIDEO_NA_FRAME;     
    MPEG4dynPara.videncDynamicParams.interFrameInterval = 0;
    MPEG4dynPara.videncDynamicParams.mbDataFlag =0;     
    MPEG4dynPara.Four_MV_mode = 0;
    MPEG4dynPara.PacketSize =0; 
    MPEG4dynPara.qpIntra = 8;     
    MPEG4dynPara.qpInter = 8;    
    MPEG4dynPara.airRate = 0;   
    MPEG4dynPara.useHEC = 0;  
    MPEG4dynPara.useGOBSync = 0;
    MPEG4dynPara.RcAlgo = IMP4HDVICPENC_RC_CBR;
    MPEG4dynPara.QPMax = 31;      
    MPEG4dynPara.QPMin = 2;       
    MPEG4dynPara.maxDelay = 1000;
    MPEG4dynPara.qpInit = 8;      
    MPEG4dynPara.PerceptualRC = 0;
    MPEG4dynPara.reset_vIMCOP_every_frame = 1;
    MPEG4dynPara.mvSADoutFlag = 0;

#####################################################################

My config file looks like this:

utils.importFile("../common.cfg");
utils.importFile("../fc_common.cfg");

/*
 *  ======== Engine Configuration ========
 */

var H264ENC  = xdc.useModule('ti.sdo.codecs.h264enc.ce.H264ENC');
var MPEG4ENC = xdc.useModule('ti.sdo.codecs.mpeg4enc_hdvicp.ce.MPEG4ENC_HDVICP');
var JPEGENC = xdc.useModule('ti.sdo.codecs.jpegenc.ce.JPEGENC');

var Engine = xdc.useModule('ti.sdo.ce.Engine');

var myEngine = Engine.create("encode", [
    {name: "jpegenc", mod: JPEGENC, local: true, groupId: 1},
    {name: "h264enc", mod: H264ENC, local: true, groupId: 1},
    {name: "mpeg4enc", mod: MPEG4ENC, local: true, groupId: 1},
]);

var MEMTCM = xdc.useModule('ti.sdo.fc.ires.memtcm.MEMTCM');
MEMTCM.cmemBlockId = 1;

var FC = xdc.useModule('ti.sdo.fc.global.Settings')


var EDMA3 = xdc.useModule('ti.sdo.fc.edma3.Settings');

EDMA3.maxQdmaChannels = [10,10,10,10];
EDMA3.maxRequests = 128

######################################################################

Thanks for any help

 

 

Frank

  • Hi,

    1. To get rid of the CMEM error, you should append the following in the CMEM pool list - "allowOverlap=1 phys_start_1=0x00001000 phys_end_1=0x00008000 pools_1=1x28672"

    2. Regarding the performance, can you pease make MPEG4Para.ME_Type = 1.

    regards

    Yashwant