i all,
I am working on a DM368 platform, encoding 1080P video input from a TVP7002. I have seen in a few threads on this forum that the encoder timing of the DM368 at 1080P should be ~27-28 ms. See here for an example:
http://e2e.ti.com/support/embedded/multimedia_software_codecs/f/356/t/99812.aspx
However, I am not able to get below ~29.1 ms for encoding, and this is for a system running nothing else but the encoder in a single thread, encoding an image that has been filled with black. Here is a log, printing out stats gathered across Venc1_process calls. 9000 is the total byte count for 30 frame period, 300 is average byte count. So it is really not doing much work at all.
877 1970/01/01 00:04:48 Info main.cpp (1197) H264 - Queue 0; generated 9000 ( 300 avg) in 873953 us ( 29131 avg)
877 1970/01/01 00:04:49 Info main.cpp (1197) H264 - Queue 0; generated 9000 ( 300 avg) in 873803 us ( 29126 avg)
876 1970/01/01 00:04:50 Info main.cpp (1197) H264 - Queue 0; generated 9000 ( 300 avg) in 873847 us ( 29128 avg)
877 1970/01/01 00:04:50 Info main.cpp (1197) H264 - Queue 0; generated 9000 ( 300 avg) in 873654 us ( 29121 avg)
Here are some notes about my device and test setup.
432Mhz ARM
340Mhz DDR
In VPFE setup code I am setting these registers:
MSTPRI0 = 0x00440022
MSTPRI1 = 0x00000555 // Or default, makes no difference
Edit: I forgot to include notes about RSZ_DMA_RZA. I have tried setting RSZ_DMA_RZA to the recommended value of 0x20, but this results in quite poor encoder performance (i.e. on the order of 32.5ms). I have set it to 0x50 after a lot of testing, which is how I was able to get the 29.1 values above). Though at 0x50, I am experiencing periodic capture loss, which is not surprising. Any suggestions here would be very welcome.
I believe the DDR timings are set up properly, but I am not certain. I do know if I use the default UBL that comes with the DVSDK my results are much worse (~32 ms per frame).
In my .cfg file I am enabling cache usage for the encoder:
var H264ENC = xdc.useModule('ti.sdo.codecs.h264enc.ce.H264ENC');
H264ENC.useCache = true;
H.264 encoder version 02.20.00.05. I have also tried version 02.30.00.04.
Here are the relevent encoder set up parameters. Most other parameters are at their defaults.
encoderParams.videncParams.encodingPreset = XDM_HIGH_SPEED;
encoderParams.encQuality = 2; // tried 3 as well, no difference
encoderParams.transform8x8FlagIntraFrame = 0;
encoderParams.meAlgo = 0;
encoderParams.rcAlgo = 5; // or 0, no difference
encoderParams.videncParams.rateControlPreset = IVIDEO_USER_DEFINED
encoderDynamicParams.resetHDVICPeveryFrame = 0;
encoderDynamicParams.videncDynamicParams.intraFrameInterval = 0;
encoderDynamicParams.idrFrameInterval = 30;
encoderDynamicParams.maxDelay = 1000;
encoderDynamicParams.videncDynamicParams.targetBitRate = 4000000;
encoderDynamicParams.videncDynamicParams.inputWidth = 1920;
encoderDynamicParams.videncDynamicParams.inputHeight = 1088;
Does anybody have any ideas on how to further reduce the time taken for encoding?
Thanks,
Chris