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.

Multi-channel encoding with JPEG encoder on DM365/DM368

Hello all,

 

I wonder if it's possible to create more than one instance of JPEG encoder on DM365/DM368 to encode several image streams? I suppose the multi-channel JPEG encoding is possible using single JPEG encoder instance to encode each image channel by setting each channel's individual parameters with XDM_SETPARAMS for each encode frame operation, but what about several concurrent instances (to avoid too much XDM_SETPARAMS overhead)? When I try to create a second instance, ALG2_create() fails.

 

With best regards,

 

-- Valery

  • From a general standpoint it's certainly possible to create multiple instances of a given encoder.  However, there are resource requirements for each created instance, from a limited pool of resources.  In order to determine what  you need to change to allow successful creation of a 2nd encoder, it would help to see the output from Codec Engine (CE) and/or Framework Components (FC), to see why the ALG2_create() is failing.

    To see CE debug, set environment variable CE_DEBUG:
        % export CE_DEBUG=3
        % ./encode ...
    or
        % CE_DEBUG=3 ./encode ...

    To set FC trace, see here: http://processors.wiki.ti.com/index.php/Trace_in_Framework_Components

    Regards,

    - Rob

  • I tried to get CE/FC debug logs using CE_DEBUG and FC trace enabling method described on the page you mentioned (for FC v2.24), but got only "CODEC_DEBUG_ENABLE:" prefix for all messages output by the application and no additional trace from CE/FC. Perhaps, there's something I do wrong? Here're the changes in .cfg file for the application:

    added

    var GT = xdc.useModule("ti.sdo.utils.trace.GT");
    var GTINFRA = xdc.useModule("ti.sdo.fc.utils.gtinfra.GTINFRA");
    GTINFRA.runtimeEnv = GTINFRA.NONE;
    GT.MALLOCFXN = "myMalloc";
    GT.PRINTFXN = "printfCaller";

    and

    xdc.useModule('ti.sdo.fc.global.Settings').profile = "debug_trace";

  • Hi,

     

    Can you please share the log ? CODEC_DEBUG_ENABLE gets printed from H.264 debug library. You are currently talking of Jpeg. I see some inconsistency,

    regards

    Yashwant

  • Valery Anisimovsky said:
    I tried to get CE/FC debug logs using CE_DEBUG and FC trace enabling method described on the page you mentioned (for FC v2.24), but got only "CODEC_DEBUG_ENABLE:" prefix for all messages output by the application and no additional trace from CE/FC. Perhaps, there's something I do wrong?

    How are you setting CE_DEBUG?  I always do:
        % export CE_DEBUG=3
        % ./app ...
    instead of:
        % CE_DEBUG=3 ./app ...

    Does your application call GT_set() at all?  If so, you might be disabling the GT settings performed by CE and/or FC.

    Regards,

    - Rob

  • Yes,  you're right, it's h264enc test application (for historical reasons I use it for simple experiments like this one, so that my main application does not get code-garbaged). So, I try to get CE/FC debug trace working at least in h264enc and then use the tested code in the main application. Here's the log of what I do:

    REC58C0# export CE_DEBUG=3
    REC58C0# ./h264venc-r
    CODEC_DEBUG_ENABLE: ADDRSPACE Protocol Registration Success
    CODEC_DEBUG_ENABLE: MEMTCM Protocol Registration Success
    CODEC_DEBUG_ENABLE: Reading Configuration file ../../../test/testvecs/config/testparams.cfg...
    CODEC_DEBUG_ENABLE: Reading Configuration file ../../../test/testvecs/config/ROIparams.cfg...
    CODEC_DEBUG_ENABLE: Running in Output Dump Mode

    memTab[0].size = 1788
    memTab[1].size = 4312
    memTab[2].size = 4312
    memTab[3].size = 20480
    memTab[4].size = 2048
    memTab[5].size = 13305600
    memTab[6].size = 896
    memTab[7].size = 51492
    memTab[8].size = 51492
    memTab[9].size = 64896
    memTab[10].size = 32768
    memTab[11].size = 65536
    memTab[12].size = 512
    memTab[13].size = 49152CODEC_DEBUG_ENABLE: First Encoder Creation Done

    CODEC_DEBUG_ENABLE: Unsupported Param Error: IH264VENC_WARN_RATECONTROLPRESET
    CODEC_DEBUG_ENABLE: 2nd Library Version @(#)Id:H264VENC_TI Ver:02.00.00.09 Released by:DEV_210_V_H264_E_HP_DM365_02_00_00_09 Built:Jun 28 2010 17:06:33
    CODEC_DEBUG_ENABLE: Size of I/P buffer:101376
    CODEC_DEBUG_ENABLE: Size of I/P buffer:50688
    CODEC_DEBUG_ENABLE: Output stream buffer size:152064
    CODEC_DEBUG_ENABLE: Starting Encode...
    CODEC_DEBUG_ENABLE: Reading Input Frame -
    CODEC_DEBUG_ENABLE: Input Frame Read Done
    CODEC_DEBUG_ENABLE: PROCESS LEVEL FRAME CYCLES = 4619
    CODEC_DEBUG_ENABLE: Frame : 0 Encoded: Bytes Generated : 8327
    CODEC_DEBUG_ENABLE: Number of Packets = 0
    CODEC_DEBUG_ENABLE: Writing encoded frame to file
    CODEC_DEBUG_ENABLE: Reading Input Frame -
    CODEC_DEBUG_ENABLE: Input Frame Read Done
    CODEC_DEBUG_ENABLE: PROCESS LEVEL FRAME CYCLES = 3516
    CODEC_DEBUG_ENABLE: Frame : 1 Encoded: Bytes Generated : 1704
    CODEC_DEBUG_ENABLE: Number of Packets = 0
    CODEC_DEBUG_ENABLE: Writing encoded frame to file
    CODEC_DEBUG_ENABLE: Reading Input Frame -
    CODEC_DEBUG_ENABLE: Input Frame Read Done
    CODEC_DEBUG_ENABLE: PROCESS LEVEL FRAME CYCLES = 3506
    CODEC_DEBUG_ENABLE: Frame : 2 Encoded: Bytes Generated : 1508
    CODEC_DEBUG_ENABLE: Number of Packets = 0
    CODEC_DEBUG_ENABLE: Writing encoded frame to file
    CODEC_DEBUG_ENABLE: Reading Input Frame -
    CODEC_DEBUG_ENABLE: Input Frame Read Done
    CODEC_DEBUG_ENABLE: PROCESS LEVEL FRAME CYCLES = 3603
    CODEC_DEBUG_ENABLE: Frame : 3 Encoded: Bytes Generated : 2027
    CODEC_DEBUG_ENABLE: Number of Packets = 0
    CODEC_DEBUG_ENABLE: Writing encoded frame to file
    CODEC_DEBUG_ENABLE: Reading Input Frame -
    CODEC_DEBUG_ENABLE: Input Frame Read Done
    CODEC_DEBUG_ENABLE: PROCESS LEVEL FRAME CYCLES = 3549
    CODEC_DEBUG_ENABLE: Frame : 4 Encoded: Bytes Generated : 1797
    CODEC_DEBUG_ENABLE: Number of Packets = 0
    CODEC_DEBUG_ENABLE: Writing encoded frame to file

    -------------- SUMMARY --------------------
    CODEC_DEBUG_ENABLE: Total number of Frames = 5
    CODEC_DEBUG_ENABLE: Encoded: 5, Skipped: 0
    CODEC_DEBUG_ENABLE: Bit Rate at 30 frames/Sec = 737 Kbps
    CODEC_DEBUG_ENABLE: Width and Height = 352, 288
    -------------- END --------------------

  • I set CE_DEBUG just the same way:

    % export CE_DEBUG=3
    % ./app ...


     and use GT_set() in CERuntime_init():

     /* if CE_DEBUG is set, turn on tracing and DSP auto trace collection */
    if (Global_getenv("CE_DEBUG") != NULL) {
        extern Bool Engine_alwaysCollectDspTrace;
        extern String Engine_ceDebugDspTraceMask;
        Engine_alwaysCollectDspTrace = TRUE;
        if (Global_getenv("CE_DEBUG")[0] == '1') {
           GT_set("*+67,CE-3,GT_time=0,GT_prefix=1235");
           Engine_ceDebugDspTraceMask = "*+67,GT_prefix=1235,GT_time=3";
        }
        else if (Global_getenv("CE_DEBUG")[0] == '2') {
           GT_set(    "*+01234567,CE-3,ti.sdo.ce.osal.SemMP=67,OG=467,OM=4567,OC=67,GT_time=0,GT_prefix=1235");
           Engine_ceDebugDspTraceMask ="*+01234567,CR=67,ti.sdo.fc.dman3-2,ti.sdo.fc.dskt2-2,GT_prefix=1235,GT_time=3";
        } else {
           GT_set("*+01234567,CE-3,GT_time=0,GT_prefix=12345");
           Engine_ceDebugDspTraceMask = "*+01234567,GT_prefix=12345,GT_time=3";
       }
    }

    That  code has been actually taken from configuro-generated C file.

  • We try to work "h264enc test application". but it dose not work well in this bellow.

    please show "loadmodules_h264enc.sh"

    -----

     memTab[0].size = 1808

     memTab[1].size = 5272

     memTab[2].size = 5272

     memTab[3].size = 20480

     memTab[4].size = 2048

     memTab[5].size = 13305600

     memTab[6].size = 896

     memTab[7].size = 52628

     memTab[8].size = 52628

     memTab[9].size = 67072

     memTab[10].size = 131072

     memTab[11].size = 262144

     memTab[12].size = 640

     memTab[13].size = 49152

     memTab[14].size = 38912CODEC_DEBUG_ENABLE: ERROR! - Encoder Creation FailedCODEC_DEBUG_ENABLE: Free Resource Failed

    root@dm368-evm:~/h264enc/apps/client/build/arm926#

  • Hello,

    It looks like encoder creation has failed. H.264 package comes with a debug library (h264venc_ti_arm926_debug.a) Please build the test application using this debug library and run the application. Please share the encoder log generated using this library.