mbox series

[v8,0/3] media: rkvdec: Add H.264 High 10 and 4:2:2 profile support

Message ID 20250417-b4-rkvdec_h264_high10_and_422_support-v8-0-423fe0a2ee7e@collabora.com (mailing list archive)
Headers show
Series media: rkvdec: Add H.264 High 10 and 4:2:2 profile support | expand

Message

Nicolas Dufresne April 17, 2025, 5:14 p.m. UTC
This series add H.264 High 10 and 4:2:2 profile support to the Rockchip
Video Decoder driver.

Patch 1 limits the minimum profile to constrained baseline due to
unsupported features in the full baseline profile.

Patch 2 refactors code to support filtering of CAPTURE formats based
on the image format returned from a new get_image_fmt() ops.

Patch 3 adds final bits to support H.264 High 10 and 4:2:2 profiles.

Tested with Fluster on a Libre Computer Renegade Elite (RK3399).

Decoder:                        GStreamer
Commit:                         8c7ad20e4e82296ed9916f53c201e110c629f0f5
JVT-AVC_V1:                     129/135
JVT-FR-EXT:                     65/69
JVT-Professional_profiles:      12/38
JVT-MVC:                        0/20 (not supported)
JVT-SCV:                        38/185 (temporal only)

In summary, all tests that are 4:2:2 sub-sampled are now passing with
the exception of the following that display some unexplained artifacts.

 - Hi422FREXT17_SONY_A
 - Hi422FREXT19_SONY_A

This score also includes 4:2:0 10bit tests, that may have been reported
as failing due to lack of userspace support for NV15 format. It also
includes results from test suite that did not exists before (Pro, MVC
and SVC).

Changes in v8:
- Removed patches that got applied from v7
- Move the constrained-baseline fix first
- Move the format checks into s_ctrl only
- Simplify the checks
- Retest against a newer GStreamer version with NV16 and NV20 support.
- Test against the new fluster suite Professions, SVC and MVC.
Link to v7: https://lore.kernel.org/linux-media/20250225-rkvdec_h264_high10_and_422_support-v7-0-7992a68a4910@collabora.com/

Changes in v7:
- Split out the change with the minimum profile
- s/v4l2_format_plane_width/v4l2_format_plane_stride/
- Move V4L2_PIX_FMT_NV15/V4L2_PIX_FMT_NV20 documentation as suggested
- Change return value from int to bool on rkvdec_image_fmt_match
- Add reviewed-by tags
Link to v6: https://lore.kernel.org/linux-media/20240909192522.1076704-1-jonas@kwiboo.se/

Changes in v6:
- Change to use fmt_idx instead of j++ tucked inside a condition (Dan)
- Add patch to fix enumerated frame sizes returned to userspace (Alex)
- Fluster test score is same as v4 and v5, see [4] and [5]
Link to v5: https://lore.kernel.org/linux-media/20240618194647.742037-1-jonas@kwiboo.se/

Changes in v5:
- Drop Remove SPS validation at streaming start patch
- Move buffer align from rkvdec_fill_decoded_pixfmt to min/step_width
- Use correct profiles for V4L2_CID_MPEG_VIDEO_H264_PROFILE
- Collect r-b and t-b tags
- Fluster test score is same as v4, see [4] and [5]
Link to v4: https://lore.kernel.org/linux-media/20231105165521.3592037-1-jonas@kwiboo.se/

Changes in v4:
- Fix failed v4l2-compliance tests related to CAPTURE queue
- Rework CAPTURE format filter anv validate to use an image format
- Run fluster test suite JVT-FR-EXT [4] and JVT-AVC_V1 [5]
Link to v3: https://lore.kernel.org/linux-media/20231029183427.1781554-1-jonas@kwiboo.se/

Changes in v3:
- Drop merged patches
- Use bpp and bpp_div instead of prior misuse of block_w/block_h
- New patch to use values from SPS/PPS control to configure the HW
- New patch to remove an unnecessary call to validate sps at streaming start
- Reworked pixel format validation
Link to v2: https://lore.kernel.org/linux-media/20200706215430.22859-1-jonas@kwiboo.se/

Changes in v2:
- Collect r-b tags
- SPS pic width and height in mbs validation moved to rkvdec_try_ctrl
- New patch to not override output buffer sizeimage
- Reworked pixel format validation
- Only align decoded buffer instead of changing frmsize step_width
Link to v1: https://lore.kernel.org/linux-media/20200701215616.30874-1-jonas@kwiboo.se/

To fully runtime test this series you may need FFmpeg patches from [1]
and fluster patches from [2], this series is also available at [3].

[1] https://github.com/Kwiboo/FFmpeg/commits/v4l2request-2024-v2-rkvdec/
[2] https://github.com/Kwiboo/fluster/commits/ffmpeg-v4l2request-rkvdec/
[3] https://github.com/Kwiboo/linux-rockchip/commits/linuxtv-rkvdec-high-10-v6/
[4] https://gist.github.com/Kwiboo/f4ac15576b2c72887ae2bc5d58b5c865
[5] https://gist.github.com/Kwiboo/459a1c8f1dcb56e45dc7a7a29cc28adf

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
Jonas Karlman (2):
      media: rkvdec: Add get_image_fmt ops
      media: rkvdec: h264: Support High 10 and 4:2:2 profiles

Sebastian Fricke (1):
      media: rkvdec: h264: Limit minimum profile to constrained baseline

 drivers/staging/media/rkvdec/rkvdec-h264.c | 37 +++++++++----
 drivers/staging/media/rkvdec/rkvdec.c      | 84 +++++++++++++++++++++++++-----
 drivers/staging/media/rkvdec/rkvdec.h      |  5 ++
 3 files changed, 105 insertions(+), 21 deletions(-)
---
base-commit: 14423fc3a4a21fb436dda85450339ec2bf191b36
change-id: 20250416-b4-rkvdec_h264_high10_and_422_support-381a74151162

Best regards,