Skip to content

feat[mpp_dec]: Export raw decoder COLMV metadata - #969

Open
Robolightning wants to merge 1 commit into
rockchip-linux:developfrom
Robolightning:pr/decoder-colmv-export
Open

feat[mpp_dec]: Export raw decoder COLMV metadata#969
Robolightning wants to merge 1 commit into
rockchip-linux:developfrom
Robolightning:pr/decoder-colmv-export

Conversation

@Robolightning

Copy link
Copy Markdown
Contributor

Summary

Add opt-in raw decoder COLMV export for RK3588 H.264/H.265 decode on the VDPU34x path.

The decoder config adds:

  • base:enable_colmv — disabled by default
  • KEY_DEC_COLMV — raw hardware COLMV MppBuffer
  • KEY_DEC_COLMV_FMT — hardware layout identifier
  • KEY_DEC_COLMV_SIZE — valid payload size for the current frame

The exported buffer is retained for the lifetime of the output MppFrame.

Semantics

This exposes the decoder's existing hardware-generated COLMV buffer. It is raw, hardware-specific data; this is not a portable or already-decoded motion-vector API.

When base:enable_colmv is disabled, the HAL export path is skipped and performs no COLMV metadata access, buffer copy, or cache synchronization.

When enabled:

  • no COLMV payload copy is performed
  • no implicit CPU cache synchronization is performed
  • CPU consumers should use mpp_buffer_sync_ro_begin() / mpp_buffer_sync_ro_end() around reads
  • DMA consumers can use the exported buffer without a CPU readback
  • the buffer remains owned by the output frame; consumers that need it beyond the frame lifetime must retain their own reference

Initial format identifiers cover:

  • VDPU34x H.264 compressed COLMV
  • VDPU34x H.264 uncompressed COLMV
  • VDPU34x H.265 compressed COLMV

The export is currently gated to RK3588.

mpi_dec_test can enable and inspect the path with mpi_dec_colmv=1.

Validation

Validated on OrangePi 5 / RK3588 using the exact Git tree:

14cd9c6c64ee07ec100e2020fd829d0923f03b63

with commit:

cbf19a9e70a41cda2e417318c14efa6703d1002e

Validation included:

  • full Release build with WARNINGS_AS_ERRORS=ON
  • mpp_info_test
  • mpp_dec_cfg_test
  • mpp_sys_cfg_test
  • H.264 decode with COLMV disabled: 90 frames
  • H.264 with COLMV enabled: 90/90 non-zero COLMV frames, 89 unique payload hashes
  • H.265 decode with COLMV disabled: 90 frames
  • H.265 with COLMV enabled: 90/90 non-zero COLMV frames, 90 unique payload hashes
  • no new matching decoder/IOMMU kernel faults

The enabled validation path intentionally performs CPU cache sync and hashes the COLMV bytes to verify the hardware output; that diagnostic readback is not part of the normal disabled path.

Add opt-in base:enable_colmv support for RK3588 VDPU34x
H.264/H.265 decode.

Expose the existing hardware COLMV buffer, layout and valid byte
count on output frame metadata without copying or implicit cache
sync. Retain the buffer for the output frame lifetime and add
mpi_dec_test hardware validation.

Signed-off-by: Robolightning <89173189+Robolightning@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant