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.

Linux/AM5728: Multiple H.264 decoding issue

Part Number: AM5728

Tool/software: Linux

Hi.

I develop two display with ti-processor-sdk-linux-am57xx-evm-03.01.00.06 without gstreamer.

we have performance not good of two display.

When I decode one contents(Full HD), it have 60 FPS. OK.

but, When  I have decoded two different contents(Full HD). it have 58~60 FPS.

I traced libdce, libmmrpc, rpmsg-rpc.ko(drivers\rpmsg\rpmsg_rpc.c).

As soon as A thread send H.264 frame to libdce(VIDDEC3_process), and then B thread send H.264 frame to libdce(VIDDEC3_process). B thread wait for complete(completion of M4(IPU)) of A thread.

I want  A/B thread send H.264 frame to libdce(VIDDEC3_process) without blocking.

VIDDEC_process takes 7~10ms. so, sometimes B thread wait for 14~20ms.

I plan to encode from Camera to H.264 with  VIDENC2_process(pthread_mutex_lock(&ipc_mutex)).

If i have two decode one encode, I think system performance will have more lower.

How do i get 60 fps for  decoding multiple(two) HD contents ?

Thanks.

  • The software team have been notified. They will respond here.
  • AM5728 has hardware accelerator named IVA-HD to do the accelerated video encoding and decoding. There is only one core of IVA-HD on AM57x8 device. It can handle single channel 1080p60 encode or decode or multiple channel of lower resolution/lower frame rate (ex - 2 channels of 1080p30). Since there is only single core of IVA-HD, and it process at frame level, it can handle only one frame at a time, so the behavior that thread B is blocked till thread A gets process is valid behavior.  Since the max processing capability of IVA-HD is 1080p60, it takes around 14 to 16 ms to process one frame, so your observation on thread block time is also valid. 

    If you have need todo  multiple channels of 1080p60 codec processing, you will need to decode one channel on A15 and other on IVA-HD. What's the resolution and framerate requirement for encoder. If it's lower resolution/framerate, IVA-HD might have some headroom to accommodate the encoder, else you will need to use A15 and/or DSP for it. 

  • I will test decoding two 1080p30 with viddec3test(TI exmaple). now viddec3test is died. so, i will trace and modify it.
    Let you know the result.

    Thanks a lot.
  • viddec3test don't is implemented when outArgs->outBufsInUseFlag exist. and then, i test specific contents(1080p30, TS) and viddec3test work properly.

    case1(single h264(1080p30) decode/display) ./viddec3test -s 36:1920x1080 HD-underwater.mpg : ok(good)
    -> VIDDEC3_process takes 8809us ~ 10000us

    case 2(single h264(1080p30) decode/display) ./viddec3test -s 40:1920x1080 HD-underwater.mpg : ok(good)
    -> VIDDEC3_process takes 8809us ~ 10000us

    case3 (two h264(1080p30) decode/display) ./viddec3test -s 36:1920x1080 HD-underwater.mpg -- -s 40:1920x1080 HD-underwater.mpg : not good (one display with connector_id(36) is displayed as color bar. i don't understand it. and the other display with connector_id(40) is displayed not smoothly.

    you comment as below it.
    - It can handle single channel 1080p60 encode or decode or multiple channel of lower resolution/lower frame rate (ex - 2 channels of 1080p30

    but, On Hardware focus, i think performance of IVA-HD supports 2 channels of 1080p30. Two 1080p30 Decoding process with viddec3test application, libdce, rpc msg(omap mailbox driver) driver and etc don't play smoothly.

    Can you support two 1080p30 Decoding play smoothly ?
  • Can you share the test stream? I tried one at my end and it plays well.
  • Hi. I can share contents file.
    I don't know share it. here. so, Do you have FTP site or any methods ?

    Thanks a lot.
  • You can attach the file to the e2e post.

  • Attached 1080p resolution h264 encoded *.mov file that I tried to decode dual channel at my end. Also attached is the log file with time stamps (using teraterm) with and without debug prints. There's total 258 frames in the stream, for dual channel that makes 516 frames to be decoded. Per the log prints, it takes approx 7 min to decode 516 frames, that is around 70 fps, so individual streams are playing at 35 fps. Since the display is running at 60 fps, there can be jitter seen on the display. 

    [Tue Mar 21 12:58:32.755 2017] displayBufsMode: 1 -> begining of the decode
    [Tue Mar 21 12:58:39.746 2017] 0x33350: end of input
    [Tue Mar 21 12:58:39.762 2017] 0x2e008: end of input

    In the second run with debug prints enable, you can see decoder is taking average of around ~13 ms to decode a frame. 

    decode_log.log

  • I Thank you for you kindly answering my question.
    I fully understand performance of IVA HD decoder due to your help.
    1080P30 decoding means that application give H.264 frame to IVA HD per 33ms(30FPS in unit).
    Thanks a lot.