Skip to content

staging: media: cedrus: add VP9 decoding for H616

Jernej Skrabec linux-arm-kernel linux-media linux-staging linux-sunxi lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3staging: media: cedrus: take the output line stride from the capture formatdrivers/staging/media/sunxi/cedrus/cedrus_hw.c+4 -40 replies
2/3staging: media: cedrus: factor out the format checkdrivers/staging/media/sunxi/cedrus/cedrus_video.c+13 -60 replies
3/3staging: media: cedrus: add VP9 decoding supportdrivers/staging/media/sunxi/cedrus/Makefile drivers/staging/media/sunxi/cedrus/cedrus.c drivers/staging/media/sunxi/cedrus/cedrus.h +6 more+1531 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] staging: media: cedrus: add VP9 decoding for H616

This series adds VP9 decoding to the Cedrus driver for the H616 video engine, which runs VP9 in its H.265 engine.

The backward probability adaptation is done in the driver with the v4l2 VP9 helpers, using the symbol counts the hardware writes back.

Patches 1 and 2 are preparation: the output line stride is taken from the capture format, and the format check is moved into a helper.

Patch 3 adds VP9 decoding. Like H.265, 10-bit frames are output with 8 bits per sample for now. P010 output for 10-bit VP9 and H.265 will follow in a separate series. The decoder core is reset after every VP9 frame, as an H.265 picture of another context decoded next fails otherwise.

The series is based on my Cedrus fixes series [1], which it depends on. It doesn't depend on any other pending Cedrus work.

Testing
-------

All testing was done on an H616 board (T95 Max, 4 GiB DDR3, VE at 600 MHz) with FFmpeg's v4l2-request hwaccel. Hardware output was compared per frame with the libvpx MD5 files or with FFmpeg's software decoder; the other capture formats were compared plane by plane against NV12 output, using an LD_PRELOAD shim that forces the capture format. The 10-bit decoding itself was also checked with the P010 output of the follow-up series, which matches the libvpx MD5 files.

Results:
- libvpx test vectors (303 profile 0, the profile 2 4:2:0 10-bit one):
275 match the libvpx MD5 files frame by frame, the failures are listed below.
- fluster VP9-TEST-VECTORS: 242/305, the same vectors fail with FFmpeg's software decoder (FFmpeg rescales frames after a size change, so the stream MD5 of resized vectors can't match).
VP9-TEST-VECTORS-HIGH: 5/6, the 10-bit 4:2:0 vector fails as its output has 8 bits per sample, the others are 4:2:2, 4:4:4 or 12-bit and decoded in software.
- fluster JCT-VC-HEVC_V1 (129/147), JVT-AVC_V1 (130/135), VP8-TEST-VECTORS (59/61) and MPEG2_VIDEO-MAIN (7/43): same results as without this series.
- v4l2-compliance: 49 tests, 0 failures, 0 warnings. A test program for invalid VP9 controls, formats and jobs (57 cases) passes.
- NV21, YU12, YV12 and, for 8-bit, ST12 output of 12 8-bit and 10-bit VP9 streams (66x66 to 1920x1080) match NV12 output.
- Decoding VP9 and H.265 streams in parallel instances, in 46 combinations with each other and with H.264 and MPEG-2, gives the same output as decoding them alone. Heavier parallel loads need the decoder reset before every picture from a follow-up series.
- No IOMMU faults or timeouts in any of the above.

Known failures:
- vp92-2-20-10bit-yuv420: the output has 8 bits per sample.
- resize vectors (vp90-2-21-resize_inter_*, vp90-2-05-resize, vp90-2-18-resize): FFmpeg reallocates the capture buffers on the frame size change and then refers to frames of a different size, which the hardware can't scale with this buffer layout.
- vp90-2-13-largescaling: not supported by the hardware.
- vp90-2-22-svc_1280x720_3: inter-layer prediction from a different size, for the same reason as the resize vectors. FFmpeg's software decoder fails it as well.

[1] https://lore.kernel.org/r/[email protected]

Please take a look.

Best regards,
Jernej

Jernej Skrabec (3):
staging: media: cedrus: take the output line stride from the capture
format
staging: media: cedrus: factor out the format check
staging: media: cedrus: add VP9 decoding support

 drivers/staging/media/sunxi/cedrus/Makefile   |    2 +-
 drivers/staging/media/sunxi/cedrus/cedrus.c   |   53 +-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |   35 +
 .../staging/media/sunxi/cedrus/cedrus_dec.c   |    7 +
 .../staging/media/sunxi/cedrus/cedrus_hw.c    |   28 +-
 .../staging/media/sunxi/cedrus/cedrus_hw.h    |    1 +
 .../staging/media/sunxi/cedrus/cedrus_regs.h  |  131 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |   50 +-
 .../staging/media/sunxi/cedrus/cedrus_vp9.c   | 1253 +++++++++++++++++
 9 files changed, 1548 insertions(+), 12 deletions(-)
 create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_vp9.c

base-commit: 27285b099fbc5cb2ae3aef20f3bbd7b3c88b3005
prerequisite-patch-id: 032ac086f7ba6944b648a3581a1c287ee06c42c9
prerequisite-patch-id: 30e6f5a647b929dcf501225d403dc1f68436079f
prerequisite-patch-id: 309f0f4b5228ee3b0d3e3b80426429a67e238d53
prerequisite-patch-id: a448a9c72886221eb9b1aea1778a88e163d96309
prerequisite-patch-id: c49f2932a2258bcf000e0e4907e9636b2958b350
prerequisite-patch-id: 3c5110c4b6f13079a09733b972de4cbf38d3119a
prerequisite-patch-id: 78a7e370ba08a94aaaf4cbce49f89432151a9089
prerequisite-patch-id: f62f865eccdab559e9effea5b002b227fc0e3bbf
prerequisite-patch-id: 9a09dbecbbba3731dd2518606a02e12d58e433a6
prerequisite-patch-id: a952ffa6ed148ba0f6b9f5253848b7c8fb2f89a8
prerequisite-patch-id: 9879769cc1ed540f2739c2bf8b43b42a41c6ad8b

Signature · 1 line
2.43.0