Updated on 2022-03-13 GMT+08:00

JPEGD Function

Function Description

The JPEGD module is used to decode .jpg, .jpeg, .JPG, and .JPEG images. For the image formats not supported by the hardware, software decoding is used.

After decoding, the images are output in the following formats:

JPEG(444) -> YUV444 / YUV420 semi-planar with the V component before the U component

JPEG(422) -> YUV422 / YUV420 semi-planar with the V component before the U component

JPEG(420) -> YUV420 / YUV420 semi-planar with the V component before the U component

JPEG(400) -> YUV420/ UV data is padded by 0x80.

  • The JPEGD uses the camel-case naming style due to the requirements of the programming standards. However, the original kernel-style input parameters and output parameters are also supported. Therefore, the JPEGD supports two sets of parameters. The camel-case naming style is recommended.
  • If user-defined data exists after the end of image (EOI) flag 0XFFD9, the JPEGD clears the 8-byte data after the EOI during decoding. If you want to retain the user-defined data, read it to the buffer and back it up before sending it to the JPEGD.

    To check whether user-defined data exists after the EOI flag in an image, use the binary viewing tool to open the image. For example, user-defined data exists after the EOI flag FFD9 in the following figure.

Restriction

  • Restrictions on the input image:
    • Maximum resolution: 8192 x 8192; minimum resolution: 32 x 32
    • Only Huffman encoding is supported. The color space of the stream is YUV, and the subsample of the stream is 444, 422, 420, or 400.
    • Arithmetic coding is not supported.
    • The progressive JPEG format is not supported.
    • The JPEG2000 format is not supported.
  • Hardware restrictions:
    • Only a maximum of four Huffman tables are supported, including two direct coefficient (DC) tables and two alternating coefficient (AC) tables.
    • Only a maximum of three quantization tables are supported.
    • Only 8-bit sampling precision is supported.
    • Only images after sequential encoding can be decoded.
    • Only JPEG decoding based on discrete cosine transform (DCT) is supported.
    • Only one start of scan (SOS) flag is supported for image decoding.
  • Software restrictions:
    • A maximum of three SOS flags are supported for image decoding.
    • Abnormal image decoding with insufficient minimum coded unit (MCU) data is supported.
  • Buffer restrictions:
    • The start address of the buffer must be 128-byte aligned.
    • In the same task, the virtual addresses of the input and output buffers must respectively be in the same 4 GB space.

Performance Specifications

The performance specifications of the JPEGD are based on the hardware decoding performance. The JPEGD hardware decoding does not support the image decoding with three SOS flags. For the image formats that are not supported by the hardware, software decoding is used. The software decoding performance for reference is 1080p x 1 channel at 15 fps.

Scenario

Total Frame Rate

1080p x 1 channel

128 fps

1080p x n channels (n ≥ 2)

256 fps

4K x 1 channel

32 fps

4K x n channels (n ≥ 2)

64 fps