RISC OS Developer Forum
Intro for the Raspberry Pi VideoCore Harware Video decoder - Printable Version

+- RISC OS Developer Forum (https://riscosdevforum.com)
+-- Forum: RISC OS - The original OS for ARM CPUs created by Acorn Computers now open source (https://riscosdevforum.com/forumdisplay.php?fid=1)
+--- Forum: Developers Forum (https://riscosdevforum.com/forumdisplay.php?fid=2)
+---- Forum: Raspberry Pi Video hardware decoder (https://riscosdevforum.com/forumdisplay.php?fid=17)
+---- Thread: Intro for the Raspberry Pi VideoCore Harware Video decoder (/showthread.php?tid=6)



Intro for the Raspberry Pi VideoCore Harware Video decoder - Stefan (Cloverleaf) - 07-17-2021

One of the missing important drivers for RISC OS is a hardware video decoder for the Raspberry Pi 3 & 4.
this is specially needed in the age of internet where a majority of content is presented as videos.

I found this content on the Raspberry Forum:

Pi0-3 have hardware accelerated decode for H264, MPEG4, H263, and through optional codec licences for MPEG2 and VC1.
Pi4 has the same hardware accelerated decode for H264, but not the other codecs. It also has a separate block for HEVC.

The block for H264 etc can only be accessed via the VPU firmware, which means either MMAL or IL. That applies to all platforms.
There is a wrapper above MMAL that implements the V4L2 M2M stateful decoder API - https://github.com/raspberrypi/linux/bl ... l2-codec.c. This should appear as /dev/video10 on our downstream kernel builds.

FFmpeg has a client implementation for V4L2 M2M
V..... h263_v4l2m2m V4L2 mem2mem H.263 decoder wrapper (codec h263)
V..... h264_v4l2m2m V4L2 mem2mem H.264 decoder wrapper (codec h264)
V..... mpeg2_v4l2m2m V4L2 mem2mem MPEG2 decoder wrapper (codec mpeg2video)
V..... mpeg4_v4l2m2m V4L2 mem2mem MPEG4 decoder wrapper (codec mpeg4)
It also has a client implementation for MMAL
V..... h264_mmal h264 (mmal) (codec h264)
V..... mpeg2_mmal mpeg2 (mmal) (codec mpeg2video)
V..... mpeg4_mmal mpeg4 (mmal) (codec mpeg4)
V..... vc1_mmal vc1 (mmal) (codec vc1)

GStreamer likewise has components for V4L2 decode as v4l2h264dec, etc.

HEVC decode on the Pi4 is through a separate block that is driven by the Linux kernel. I'm just finishing off PR for that - https://github.com/raspberrypi/linux/pull/3505.


Full thread can be read here:
https://www.raspberrypi.org/forums/viewtopic.php?t=268356

Further information:
https://elinux.org/Raspberry_Pi_VideoCore_APIs
https://en.wikipedia.org/wiki/VideoCore

The task will be two parts:
1. Videoplayer integration into RISC OS that it could be integrated also in web browsers (Iris, NetSurf)
2. Driver to access the hardware video decoder of the VideoCore IV (Raspberry Pi 0 to 3) or VI (Raspberry Pi 4)