GOWIN-logo

GOWIN MJPEG Decoder IP

GOWIN-MJPEG-Decoder-IP-product

Product Information

Specifications

  • Product Name: Gowin MJPEG Decoder IP
  • Trademark: Registered trademark of Guangdong Gowin Semiconductor Corporation
  • Date of Publication: 09/26/2024

Features:

  • Supported image height of 64-1080 pixels
  • Supported image width of 64-1920 pixels
  • Supported dynamic 444, 420, 422 subsampling
  • Supported dynamic De-Huffman Table, with up to 2 DC and 2 AC tables

Product Usage Instructions

About This Guide

The Gowin MJPEG Decoder IP User Guide is designed to assist users in understanding the features and usage of the Gowin MJPEG Decoder IP. It provides descriptions of functions, GUI, and reference design to facilitate quick learning.

Overview

The Gowin MJPEG Decoder IP includes logic resources, design files, and application software. Users can refer to the provided tables for detailed information on the resources and software associated with the product.

Features and Performance

The Gowin MJPEG Decoder IP can dynamically determine input image information through JPEG header data. It supports various image heights and widths, subsampling options, and De-Huffman Tables to enhance image processing capabilities.

FAQ

  • Q: What should I do if I encounter technical issues while using the Gowin MJPEG Decoder IP?
    • A: If you encounter technical issues, please contact Gowin Semiconductor for comprehensive technical support. You can reach out via their website or email provided in the user manual.
  • Q: Can I reproduce or distribute the content of the user manual?
    • A: No, reproduction or transmission of any part of the document is prohibited without prior written consent from GOWINSEMI.

Copyright © 2024 Guangdong Gowin Semiconductor Corporation. All Rights Reserved.
GOWIN-logois a trademark of Guangdong Gowin Semiconductor Corporation and is registered in China, the U.S. Patent and Trademark Office, and other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders. No part of this document may be reproduced or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written consent of GOWINSEMI. Disclaimer GOWINSEMI assumes no liability and provides no warranty (either expressed or implied) and is not responsible for any damage incurred to your hardware, software, data, or property resulting from usage of the materials or intellectual property except as outlined in the GOWINSEMI Terms and Conditions of Sale. GOWINSEMI may make changes to this document at any time without prior notice. Anyone relying on this documentation should contact GOWINSEMI for the current documentation and errata.

Revision History

Date Version Description
09/26/2024 1.0E Initial version published.

About This Guide

Purpose

The purpose of Gowin MJPEG Decoder IP User Guide is to help you learn the features and usage of Gowin MJPEG Decoder IP by providing the descriptions of functions, GUI, and reference design, etc. It helps users quickly learn the features and usage of Gowin MJPEG Decoder IP.

Related Documents

The latest user guides are available on the GOWINSEMI website. You can find the related documents at www.gowinsemi.com:

Terminology and Abbreviations

The terminology and abbreviations used in this manual are as shown in Table 1-1.

Table 1-1 Terminology and Abbreviations

Terminology and Abbreviations Meaning
ALU Arithmetic Logical Unit
BSRAM Block Static Random Access Memory
CSC Color Space Conversion
IDCT Inverse Discrete Cosine Transform
LUT Look-up Table
MJPEG Motion Joint Photographic Experts Group
SSRAM Shadow Static Random Access Memory

Support and Feedback

Gowin Semiconductor provides customers with comprehensive technical support. If you have any questions, comments, or suggestions, please feel free to contact us directly using the information provided below.

Website: www.gowinsemi.com
E-mail: support@gowinsemi.com

Overview

Gowin MJPEG Decoder IP is a dynamic image frame-by-frame decoder that can decompress image data compressed according to the Baseline JPEG standard and convert it into RGB format. By decompressing multiple frames of JPEG-standard images, it enables dynamic video output. Due to the varying characteristics of the images and the compression ratios used, the input and output rates are not fixed. Gowin MJPEG Decoder IP is designed to perform frame-by-frame decoding of images compressed using the Baseline JPEG standard while utilizing minimal logic resources.

Table 2-1 Gowin MJPEG Decoder IP Overview

Gowin MJPEG Decoder IP
Logic Resource Please refer to Table 3-1
Delivered Doc.
Design Files Verilog
Reference Design Verilog
TestBench Verilog
Test and Design Flow
Synthesis Software GowinSynthesis
Application Software Gowin Software

Note!

For the devices supported, you can click here to get the information

Features and Performance

Features

  • The input image information can be determined dynamically through the JPEG header data, including:
    • Supported image height of 64-1080 pixels
    • Supported image width of 64-1920 pixels
    • Supported dynamic 444, 420, 422 subsampling
    • Supported dynamic De-Huffman Table, with up to 2 DC and 2 AC tables
    • Supported dynamic De Quantization Table
  • Supported predefined size (static)
  • The input compressed data bit width is 32 bits
  • The output image data bit width per channel is 8 bits, i.e., 24 bits for RGB
  • The output rate can reach up to 1080P at 30 FPS

Max. Frequency

The max. frequency of Gowin MJPEG Decoder IP is mainly determined by speed grade of the selected devices. When using the GW5A-25 series of devices, a maximum decoding speed of 65 MHz can be achieved.

Latency

The latency of Gowin MJPEG Decoder IP is determined by the configuration parameters.

Resource Utilization

Gowin MJPEG Decoder IP can be implemented by Verilog. Its performance and resource utilization may vary when the design is employed in different devices, or at different densities, speeds, or grades.

Take GW5A-25 FPGA as an example. See Table 3-1 for the resource utilization. For the applications on the other GOWINSEMI devices, please refer to the later release.

Table 3-1 Gowin MJPEG Decoder IP Resource Utilization

Device Speed Grade Resource Name Resource Utilization
 

 

 

GW5A-25

 

 

 

C8/I7

BSRAM 18
SSRAM 0
Registers 15306
LUTs 7363
ALUs 6207
I/O Buf

Functional Description

Gowin MJPEG Decoder IP Structure and Function

Gowin MJPEG Decoder IP can perform continuous decompression of JPEG-standard images. It processes the received compressed image data through various modules, including De-Huffman, De-quantize, De-Zigzag, Inverse Discrete Cosine Transform (IDCT), and color space conversion (YCbCr to RGB), before outputting the image. The system block diagram is as shown in Figure 4-1.

Figure 4-1 Gowin MJPEG Decoder IP Configuration Interface

GOWIN-MJPEG -Decoder-IP -fig-1 (1)

Block Diagram Description

Huffman Decode

Huffman decode refers to the process of restoring data that has been compressed using Huffman Encode. To decode Huffman-encoded data, the corresponding Huffman table is required, which maps characters to their respective Huffman codes. The input data and the codes in the table are then compared one by one until a match is found.

De-Quantization

De-quantization involves multiplying the DCT coefficients by the quantization coefficients. The quantization coefficient table is transmitted along with the JPEG header data. De-quantization involves multiplying non-zero coefficients by their respective quantization factors.

De-Zigzag

De-zigzag refers to the reordering of coefficients that are zigzagged during compression, according to the following index, as shown below.

Figure 4-2 De-Zigzag Table

GOWIN-MJPEG -Decoder-IP -fig-1 (2)

Inverse Discrete Cosine Transform

The IDCT uses the de-quantized DCT coefficients in the IDCT algorithm to convert them from the frequency domain back to the original time domain. The minimum computational unit of JPEG is 8×8. By inputting an 8×8 2D frequency domain IDCT coefficient matrix C, the IDCT can calculate the restored pixel value matrix P using the following formula:

The calculation formula is as follows:

GOWIN-MJPEG -Decoder-IP -fig-1 (3) GOWIN-MJPEG -Decoder-IP -fig-1 (4)

This module is implemented as shown in the figure above. To reduce DSP utilization and increase speed, the IDCT module employs a butterfly transform algorithm in the FPGA to perform the conversion operations. By performing two 1D IDCT operations, the 2D matrix multiplication result is obtained, which is the output of the IDCT module. In Gowin MJPEG Decoder IP, the butterfly transform algorithm is implemented using shifters and adders in the FPGA to simulate multiplication. As a result, the actual outcome may have a slight error compared to the result obtained from the formula, with an error margin of less than 5%.

 Sampling Restoration

The sampling standard for the frame can be obtained from the JPEG header data. During decoding, the image is restored according to the corresponding sampling standard. This IP supports three sampling standards: 4:4:4, 4:2:0, and 4:2:2, as shown in the figure below.

GOWIN-MJPEG -Decoder-IP -fig-1 (5)

Color Space Conversion

Color Space Conversion (CSC) involves converting Y (luminance), Cb (Chrominance), and Cr (Chroma) components into RGB image pixels. The conversion formulas are as follows:

GOWIN-MJPEG -Decoder-IP -fig-1 (6)

To reduce DSP utilization and increase speed, the CSC module in the MJPEG Decoder IP simulates multiplication using shifts and additions based on the above formulas. As a result, the actual output may differ slightly from the calculated values, with an error margin of less than 5%.

Port Description

The IO port descriptions of Gowin MJPEG Decoder IP are as shown in . The port diagram is as shown in Figure 5-1.

Figure 5-1 Port Diagram

GOWIN-MJPEG -Decoder-IP -fig-1 (7)

Table 5-1 I/O List of Gowin MJPEG Decoder IP

Signal Data Width I/O Description
clk 1 Input Input clock signal
clk2 1 Input Output clock signal
rstn 1 Input Reset signal, active-low
In_valid 1 Input Input data valid
In_data 32 Input Input data
In_strb 4 Input Fixed input 4’hF
Signal Data Width I/O Description
In_last 1 Input Temporarily unused signal
Out_in_accept 1 Output Output signal indicating acceptance of next data
Out_valid 1 Output Output pixel valid indicator
Width 16 Output Output image width
Height 16 Output Output image height
Coordinate_x 16 Output Horizontal coordinate of the valid pixel
Coordinate_y 16 Output Vertical coordinate of the valid pixel
R 8 Output Output 8-bit red channel
G 8 Output Output 8-bit green channel
B 8 Output Output 8-bit blue channel

Timing Description

This section describes the timing of Gowin MJPEG Decoder IP. The timing of Gowin MJPEG Decoder IP is as shown in Figure 6-1.

Figure 6-1 Signal Timing

GOWIN-MJPEG -Decoder-IP -fig-1 (8)

As shown in the figure above, assert in_valid and input the compressed image data using the Baseline JPEG standard, and the out_in_accept signal indicates that the next data can be input. out_valid signal is outputted, indicating that the output data is valid.

Interface Configuration

Start “IP Core Generator” from the “Tools” menu in Gowin Software, then you can call and configure MJPEG Decoder in the “Multimedia” type. Toolbar icon is also available as shown in Figure 7-1.

Figure 7-1 Open the IP via Toolbar IconGOWIN-MJPEG -Decoder-IP -fig-1 (9)

MJPEG Decoder IP configuration interface is as shown in Figure 7-2.GOWIN-MJPEG -Decoder-IP -fig-1 (10)

This manual takes the GW2A-55 chip and the GW2A-LV55PG484C8/I7 part number as an example.

  • You can configure the generated IP file name in the “File Name” text box.
  • You can configure the generated IP module name in the “Module Name” text box.
  • You can configure the path of the generated IP core folder in the “Create In” text box.

Reference Design

Please refer to the related test cases in Gowin MJPEG Decoder IP RefDesign.

Documents / Resources

GOWIN MJPEG Decoder IP [pdf] User Guide
MJPEG Decoder IP, Decoder IP

References

Leave a comment

Your email address will not be published. Required fields are marked *