H264 VPU IPU FB - fastest path?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

H264 VPU IPU FB - fastest path?

1,173 Views
damiansurma
Contributor I

Hello,

I've got H.264 movie that i need to resize and play on linux framebuffer (i.mx6 quad). For now i am using vpu to decode and rotate 180 deg. Rotate buffer is an input to 4 ipu tasks that copy the image directly to FB (fbfix.smem_start).

Decode 720p and display rotated 1080p:

1. VPU - decode 2-5 ms, rotate 2-5 ms -> 4-10ms

2. IPU task 1 - resize - 8-10 ms

3. IPU task 2 - resize - 8-10 ms

4. IPU task 3 - resize - 8-10 ms

5. IPU task 4 - resize - 8-10 ms

As you can see it takes max 50ms for one frame. For normal movies 25 fps its to high value. Is it my calculation correct? How can i check ipu clock frequency? How to achieve smooth 30fps mp4 rotated and resized to 1080p?

Tags (1)
0 Kudos
2 Replies

571 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Below are some comments regarding rotation :

The framebuffer can be rotate in 180 degree using

$ echo 1 > /sys/class/graphic/fb0/rotate

Using Gstreamer (depends on Linux release):

$ gst-launch uri=file://SOME_VIDEO video-sink="mfw_v4lsink rotate=180"

Also, i.MX6 GPU (2D) supports rotation. You may try to use Option "Rotate" of X11

(in xorg.conf file) or xrand. In order to use hardware accelerated features by X11 it is

needed to add corresponding NXP GPU modules to system. Please refer to documentation

of NXP BSP regarding GPU support.

 

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

571 Views
damiansurma
Contributor I

Thank you for quick answer but my problem is not how to do rotation (it can be done in VPU, IPU or FB), but how can i speed up 1080p movie player (h264 different sizes input, 1080p rotated FB output).

Now i have single thread application in c++ that is running in IMX6 Quad environment and data flow is as follows:

1. VPU initialization - codec, buffers etc.

2. IPU initialization - prepaer ipu_task structures

3. UDP listener - listen incoming packets (h264 frames)

4. Main loop:

a) receive UDP data with h264 frame (or few packets that are join in one h264 frame)

b) vpu_DecUpdateBitstreamBuffer() with h264 frame

c) vpu_DecUpdateBitstreamBuffer() with NULL to flush decoder

d) DecParam set to {0}

e) vpu_DecStartOneFrame()

f) vpu_DecGetOutputInfo()

g) if (!DecOutputInfo.decodingSuccess or DecOutputInfo.indexFrameDisplay < 0) then skip to (a)

h) put decoded frame physical address to ipu tasks

i) run 4 ipu tasks sequentially that resize frame to 1080p with output directly to framebuffer with yoffset that is not visible now (double buffer)

j) switch framebuffer yoffset

5. UDP, IPU, VPU deinitialization

I don't know if it can be done with better performance because now i cant even play 1920x768@30 (data incoming faster then decoding+mosaic+switch time).

0 Kudos