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.

Run h264hpvdec and h264hpvenc on evmk2h borad questions?

Hi,

I want to using one aa6k2h12 to encode 1080p @ 60fps and also using this aa6k2h12  to decode 1080p @60fps.The decode and encode functions are not running on the same time.

I have test h264hpvdec on evmk2h borad successfully and using core 0~7.

Also I have test h264hpvenc on evmk2h borad successfully with using core 0~3.

The above two tests are done in seperate using C66x_h264hpvdec_01.01.06.00_ELF and C66x_h264hpvenc_01_00_03_00_ELF demo.

Now I want to merge the encode and decode function into one applications, and encode function will use core 0~7 and decode function will use core 0~3 and the two functions can't be operating simutaniously (sometime just encoding only or sometime just decoding only ).

Questions:

1. Is this scenario correct?(encode and decode have some cores overlaps --core 0~3)?

2. If it is right, is there any demo or example including encode and decode functions ?

3. If the above two are not fulfilled, can  you give some suggestions.

  • Hi,

    I've forwarded this to the design team. Their feedback should be posted directly here.

    Best Regards,
    Yordan
  • Thank you for responsing me.I will  look forward to the  feedback.

  • Hi,

     
    I found an example in mcsdk_video_2_2_0_46,named "transcode". It includes h264 encode and decode, this is what I need(one example include these two functions).
     
    I compiled the example which is using videoTranscode.c6678, and modified link.cmd file with commented  “/* .shared_mem_SL2_uncached  > MSMC PAGE 0 fill = 0x00*/ “ this line (I know the codec with high version needs much more memory, now I just test if it can compile successfully. So I just commented the line):
     
    It compiled successfully with no err.
     
    Now I changed the platform to ti.platforms.evmTCI6638K2K, and modified the link.cmd :
     
    DATA_SCRATCH        : origin = 0x8EB000,   length = 0x00620   /* Remember to change ggmemmap.h */
        MSG_FIFOS           : origin = 0x8EB620,   length = 0x00010   /* Remember to change ggmemmap.h */   
        DATA_GMP0           : origin = 0x8EB630,   length = 0x00320   /* Remember to change ggmemmap.h */
        DATA_HALHEAP        : origin = 0x8EB950,   length = 0x011C0   /* Remember to change ggmemmap.h & ggswcfg.h; */
        GMAC_NEU_BUFFERS    : origin = 0x8ECB10,   length = 0x00500   /* Remember to change ggmemmap.h */
        NEU_SCRATCH         : origin = 0x8ED010,   length = 0x00800   /* Remember to change ggmemmap.h */
        DATA_CH1            : origin = 0x8ED810,   length = 0x00CC0   /* Remember to change ggmemmap.h */
        DATA_CH2            : origin = 0x8EE4D0,   length = 0x00CC0   /* Remember to change ggmemmap.h */
     
    And  in ggmemmap.h and ggswcfg.h files, I also modified the “start” and “end” addresss.
    When I compiled, there were a lot of errs:
    "../linker.cmd", line 99: error #10264: DATA_SCRATCH memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 100: error #10264: MSG_FIFOS memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 101: error #10264: DATA_GMP0 memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 102: error #10264: DATA_HALHEAP memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 103: error #10264: GMAC_NEU_BUFFERS memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 104: error #10264: NEU_SCRATCH memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 105: error #10264: DATA_CH1 memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 106: error #10264: DATA_CH2 memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 107: error #10264: LL2_HOLE memory range overlaps
       existing memory range L2SRAM
    "../linker.cmd", line 112: error #10264: DIAG_APP memory range overlaps
       existing memory range MSMCSRAM
    "./configPkg/linker.cmd", line 198: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".text" size 0x2bfe50 .  Available memory ranges:
       L2SRAM       size: 0x100000     unused: 0x0          max hole: 0x0      
    "../linker.cmd", line 226: warning #10097: memory range not found: DDR on page 0
    "../linker.cmd", line 226: error #10265: no valid memory range(NULL) available for placement of ".shared_mem_DDR_cached"
    "../linker.cmd", line 226: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".shared_mem_DDR_cached" size 0x7d00010
    "../linker.cmd", line 201: warning #10097: memory range not found: DDR on page 0
    "../linker.cmd", line 201: error #10265: no valid memory range(NULL) available for placement of ".codec_output"
    "../linker.cmd", line 201: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".codec_output" size 0x5989000
     
    …………………………….
     
    So I want change the  variables PDK_ROOT to pdk_keystone2_3_01_03_06, and I cannot find one available pktlib about TCI6638.
    So if this “transcode example” can be modified to run on K2H EVM.
     
    Can experts  help me to solve this problem . I just want encode and decode h264 in one app.
    Thanks a lot.
  • Hi,

    There is a little progress. I modified the link.cmd,and compiled successfully when PDK_ROOT select  pdk_c6678_1_1_2_6 and PDKLIB_ROOT select pdklib_c6678_1_00_00_06.

    You know the .out file cannot run on the k2h evm.

    So I modified , PDK_ROOT  points to pdk_key_stone2_3_01_03_06 and PDKLIB_ROOT points to pdk_key_stone2_3_01_03_06/packages/ti/runtime/pktlib.But there are a lot of errs about macros undefined(for example CSL_GEM_IPC_LOCAL , CLS_CGEM0_5_REG_BASE_ADDRESS_REGS ,CSL_C66X_COREPAC_REG_BASE_ADDRESS_REGS and so on).

    1、I don't know why is macro CSL_C66X_COREPAC_REG_BASE_ADDRESS_REGS undefined ? The platform what i choose is  ti.platforms.evmTCI6638K2K.

    2、CSL_GEM_IPC_LOCAL and CLS_CGEM0_5_REG_BASE_ADDRESS_REGS are defined in C6678. In aa6k2h, what should I use?

    3、PDK_ROOT  ---> pdk_key_stone2_3_01_03_06 and PDKLIB_ROOT ---> pdk_key_stone2_3_01_03_06/packages/ti/runtime/pktlib, is it right?

  • Hi, I am afraid MCSDK video CCS transcoder demo haven't been maintained. One idea is that you could try H.264 encoder and decoder version which fit in memory (links below), so hopefully this would imply minimal changes in your side. Then, when this is working you could try latest codec versions and do the required memory map modifications

    software-dl.ti.com/.../index_FDS.html
    software-dl.ti.com/.../index_FDS.html

    thank you,
    Paula
  • Hi Paula,

    Thank you for responsing me.

    I have already  fixed the memory errors.

    You said MCSDK video CCS transcoder demo haven't been maintained. So I could not get the answers about  flowing questions:

    1、I don't know why is macro CSL_C66X_COREPAC_REG_BASE_ADDRESS_REGS undefined ? The platform what i choose is  ti.platforms.evmTCI6638K2K.

    2、CSL_GEM_IPC_LOCAL and CLS_CGEM0_5_REG_BASE_ADDRESS_REGS are defined in C6678. In aa6k2h, what should I use?

    3、PDK_ROOT  ---> pdk_key_stone2_3_01_03_06 and PDKLIB_ROOT ---> pdk_key_stone2_3_01_03_06/packages/ti/runtime/pktlib, is it right?

    Right? But  It doesn't matter.

    So could you tell me if there is a demo or app which includes h264 enc and dec functions together?

    If there is one, it's wonderful. If not, I am afraid we should use two a66k2h chips, one for enc and another for dec.

    Thanks a lot!

    Chandler

  • Hi Chandler, for 1) I found a similar E2E question. e2e.ti.com/.../351779. Do you have #include <ti/csl/device/k2h/src/cslr_device.h>?
    For questions 2) and 3) I will look for some colleagues support
    About, another transcoder demo, I don't think we have it. If you have 2 A66K2H chips it would be better, at the end, if you use only one chip you have to decode and then encode. Using 2 chips you can start encoding after the first frame is decode.

    thank you,
    Paula
  • Hi Paula,

    Thank you for answering me.

    I'm afraid you misunderstand what I mean.

    Our Application scenarios is:

    video->yuv420p->h264hpenc->flash;(storage)  performance:60fps @1080p

    h.264 file->h264hpdec->display;(playback) performance:60fps @1080p

    So,I need integrate the h264hpenc and h264hpdec these two functions together.By the way, the h264hpenc and h264hpdec  don't run simultaneously.

    I have run C66x_h264hpvdec_01.01.06.00_ELF and C66x_h264hpvenc_01_00_03_00_ELF demo on k2h evm successfully.But they are seperate.

    Last week, I found an example in mcsdk_video_2_2_0_46,named "transcode" which included h264hpenc and h264hpdec.But it is for C6678.

    So I want to migrate it to k2h evm,but it's a little difficult for me.

    Finally, what I want to say is if there is an example can encode yuv420p  to h264 with core0~core7(60fps @1080p) and decode h264 to yuv420 with core0~core3(60fps @1080p) . Not nother transcoder demo.

    Thanks again.

    Chandler

  • Hi Chandler, thanks for your clarifications. About your previous questions, I got some answers, below in case they are still useful:


    CSL_GEM_IPC_LOCAL in C6678:

    #define CSL_GEM_IPC_LOCAL            (0x0000005b)

    This is primary interrupt 91 for IPC_LOCAL. The same one in K2H is primary interrupt 105

    #define CSL_C66X_COREPAC_IPC_GRN (0x00000069) in csl\device\k2h\src\csl_device_interrupt.h

     

    CLS_CGEM0_5_REG_BASE_ADDRESS_REGS in C6678

    #define CSL_CGEM0_5_REG_BASE_ADDRESS_REGS (0x01800000)

    This is the address of DSP corepac. The same address is for K2H.

    #define CSL_C66X_COREPAC_REG_BASE_ADDRESS_REGS   (0x01800000) in csl\device\k2h\src\cslr_device.h

     

    PDK_ROOT  ---> pdk_key_stone2_3_01_03_06 and PDKLIB_ROOT ---> pdk_key_stone2_3_01_03_06/packages/ti/runtime/pktlib, is it right?

    PDK_INSTALL_PATH and PDKLIB_INSTALL_PATH (please check if “INSTALL_PATH” is equivalent to “ROOT” in your case) , ==> they both pointed to pdk_key_stone2_3_01_03_06/packages

    About an example/demo which do H264 encode and then decode, the closest one will be transcoder CCS demo on MCSDK video package, but as you point out migration is not straight forward.. 

    Thank you,

    Paula

  • Hi Paula,

    Thanks a lot for giving me these answers.It's great.

    If transcoder CCS demo is the closest one,I guess I will give up to migrate it on evm k2h.
    There are too many differences between C6678 and TCI6638.

    I have another plan:
    When I need encode the video stream, I wil use mpm(Multiple Processor Manager) to load encoder elf image to dsp from ARM side.
    When I need decode h.264 stream, I wil use mpm(Multiple Processor Manager) to load decoder elf image to dsp from ARM side.

    If the elf image is about 10MB space,I want to load the image to 8 dsp cores, how long will it take ?

    How do you think?


    Thank you,
    Chandler
  • Hi Chandler, I don't think we have benchmark numbers for MPM. FYI, below a wiki link with MPM information in case you haven't seen it.
    processors.wiki.ti.com/.../MCSDK_UG_Chapter_Developing_System_Mgmt
    thank you,
    Paula
  • Hi Chandler, Please see another comment I got, for your reference:
    MPM downloads images through shared memory, but kernel needs to put DSP in reset before and take DSP out of reset after download. This will be more costly than memory access.

    Thank you,
    Paula
  • Hi Paula,
    Thank you for doing so much.
    I already know about the situation.
    I will do some more test. Using two 66aks is the last way we will take.

    Thanks again,
    Chandler