RocJpegDecodeCaps Struct Reference

RocJpegDecodeCaps Struct Reference#

3 min read time

Applies to Linux

rocJPEG: RocJpegDecodeCaps Struct Reference

Structure representing the JPEG decode capabilities of a rocJPEG handle. More...

#include <rocjpeg.h>

Public Attributes

uint8_t is_supported
 
uint8_t roi_decode
 
uint8_t hw_roi_decode
 
uint8_t max_components
 
uint32_t num_jpeg_cores
 
uint32_t min_width
 
uint32_t min_height
 
uint32_t max_width
 
uint32_t max_height
 
uint32_t subsampling_mask
 
uint32_t output_format_mask
 
uint32_t hw_rgb_subsampling_mask
 
uint32_t hw_rgb_output_format_mask
 
uint32_t native_surface_format [ROCJPEG_NUM_CHROMA_SUBSAMPLINGS]
 
uint32_t coding_process_mask
 
uint32_t reserved [15]
 

Detailed Description

Structure representing the JPEG decode capabilities of a rocJPEG handle.

This structure is filled by rocJpegGetDecoderCaps(). All fields are output fields; the library zeroes the whole structure before filling it. The capabilities describe the decoder bound to the handle by rocJpegCreate() (backend, GPU device, and on partitioned GPUs the compute partition, together with the environment variables read at creation time) and do not change during the lifetime of the handle.

Bitmask conventions:

  • Chroma subsampling masks use bit (1u << RocJpegChromaSubsampling), e.g. (1u << ROCJPEG_CSS_420).
  • Output format masks use bit (1u << RocJpegOutputFormat), e.g. (1u << ROCJPEG_OUTPUT_RGB).

A chroma subsampling is reported as supported only if the VA-API driver supports the surface format that the VCN JPEG decoder writes for it (see native_surface_format).

Only JPEG streams with either 1 component (grayscale) or 3 components (YCbCr) are decodable; the supported coding processes are reported in coding_process_mask.

The structure size is fixed at 128 bytes. New fields will be carved out of the reserved array, so they read as 0 with library versions that do not report them.

Member Data Documentation

◆ coding_process_mask

uint32_t RocJpegDecodeCaps::coding_process_mask

Supported JPEG coding processes; each bit represents a RocJpegCodingProcess enum.

◆ hw_rgb_output_format_mask

uint32_t RocJpegDecodeCaps::hw_rgb_output_format_mask

Output formats color converted by the VCN JPEG decoder for the chroma subsamplings in hw_rgb_subsampling_mask; 0 if the VCN JPEG decoder color conversion is not used.

◆ hw_rgb_subsampling_mask

uint32_t RocJpegDecodeCaps::hw_rgb_subsampling_mask

Chroma subsamplings for which the output formats in hw_rgb_output_format_mask are color converted by the VCN JPEG decoder. A subset of subsampling_mask; 0 if the VCN JPEG decoder color conversion is not used.

◆ hw_roi_decode

uint8_t RocJpegDecodeCaps::hw_roi_decode

1 if cropping is performed by the VCN JPEG decoder, 0 if it is performed after decoding. Only meaningful when roi_decode is 1.

◆ is_supported

uint8_t RocJpegDecodeCaps::is_supported

1 if the handle can decode JPEG streams (at least one chroma subsampling is supported), 0 otherwise.

◆ max_components

uint8_t RocJpegDecodeCaps::max_components

Maximum number of color components per image.

◆ max_height

uint32_t RocJpegDecodeCaps::max_height

Maximum supported image height in pixels.

◆ max_width

uint32_t RocJpegDecodeCaps::max_width

Maximum supported image width in pixels.

◆ min_height

uint32_t RocJpegDecodeCaps::min_height

Minimum supported image height in pixels.

◆ min_width

uint32_t RocJpegDecodeCaps::min_width

Minimum supported image width in pixels.

◆ native_surface_format

uint32_t RocJpegDecodeCaps::native_surface_format[ROCJPEG_NUM_CHROMA_SUBSAMPLINGS]

RocJpegSurfaceFormat produced by the VCN JPEG decoder for each chroma subsampling, indexed by RocJpegChromaSubsampling. This is the layout of ROCJPEG_OUTPUT_NATIVE. ROCJPEG_SURFACE_FORMAT_NONE for subsamplings not in subsampling_mask.

◆ num_jpeg_cores

uint32_t RocJpegDecodeCaps::num_jpeg_cores

Number of VCN JPEG cores available to the handle (at least 1). On partitioned GPUs this is the number of cores of the selected compute partition. If the number of cores cannot be queried from the driver, 1 is reported. The batched decode APIs submit images to the hardware in groups of this size.

◆ output_format_mask

uint32_t RocJpegDecodeCaps::output_format_mask

Output formats supported for every subsampling in subsampling_mask; each bit represents a RocJpegOutputFormat enum.

◆ reserved

uint32_t RocJpegDecodeCaps::reserved[15]

Reserved for future use. Set to zero by the library.

◆ roi_decode

uint8_t RocJpegDecodeCaps::roi_decode

1 if the crop_rectangle of RocJpegDecodeParams is supported, 0 otherwise.

◆ subsampling_mask

uint32_t RocJpegDecodeCaps::subsampling_mask

Supported chroma subsamplings; each bit represents a RocJpegChromaSubsampling enum.


The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-rocjpeg/checkouts/latest/projects/rocjpeg/api/rocjpeg/rocjpeg.h