Initial commit of the rocJPEG library (#1)
* rocJPEG initial commit
* Add gitignore file
* clean up
* code clean up
* CMakeLists update
* Update README
* Update readme and setup script
* add docs folder
* update rocjepg headers
* update the rocjepg header
* update the copyright year
* Add nullptr check for all APIs
* update the hip kernels execution
* follow google c++ style guide
* code clean up
* use google c++ style guide for hip kernels
* add support for rocJpegGetErrorName API
* Add ParseCommandLine function
* update the rocjpeg sample
* Update the readme, LIBVA instructions
* udate the rocJPEG script
* Update CMAKE and libdrm
* Add support for ROCJPEG_OUTPUT_UNCHANGED and SaveImage function
* code clean up
* update the drm dependencies
* remove the unused hipstream
* code clean up
* add -fmt option for selection the output format
* update the GetImageInfo API
* update the sample
* update the save image function based onn the surface and putput format
* add new sample images
* Put hip interop mem into separate functions and some code clean up
* Add support for CopyLuma and CopyChroma
* Add support for the yuv output format for NV12 surface
* Update HIP kernels
* add support for rgbi format conversion for NV12 and YUv444
* Update the status
* Add support for converting YUYV to RGB
* Add support for unpacking YUYV format
* Fix unpacking Y fron YUYV hip kernel
* Add suppoort for extractign packed YUYV to YUV planar
* hip code clean up
* code clean up
* Update the headers
* code clean up
* change hip kernel names
* hip kernel clean up
* hip clean up
* code clean up
* code clean up
* code clean up
* code clean up
* code clean up
* code clean up for jpege decoder class
* code clean up
* code clean up
* code clean up
* code clean up
* update the dockers
* code clean up
* code clean up
* hip kernels clean up
* remove unused hip kernels
* add additional test cases
* update the APIs
* add new hip yuv400torgbi kernel
* update yuv400torgbi kernel
* restructure files
* code clean up
* code clean up
* add jenkins
* code clean up
* code clean up
* update readme
* update docker's README
* make changes based on the reviewers comments
* make changes based on the reviewers comments
* return ROCJPEG_STATUS_JPEG_NOT_SUPPORTED if the resolution of the jpeg is not supported for HW decoding
[ROCm/rocjpeg commit: 6ad4a76177]
这个提交包含在:
+202
-2
@@ -1,2 +1,202 @@
|
||||
# rocJPEG
|
||||
rocJPEG is a high-performance jpeg decode SDK for decoding images using a hardware-accelerated jpeg decoder on AMD’s GPUs.
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
|
||||
<p align="center"><img width="70%" src="docs/data/AMD_rocJPEG_Logo.png" /></p>
|
||||
|
||||
rocJPEG is a high performance JPEG decode SDK for AMD GPUs. Using the rocJPEG API, you can access the JPEG decoding features available on your GPU.
|
||||
|
||||
## Supported JPEG chroma subsampling
|
||||
|
||||
* YUV 4:4:4
|
||||
* YUV 4:2:2
|
||||
* YUV 4:2:0
|
||||
* YUV 4:0:0
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Linux distribution
|
||||
* Ubuntu - `20.04` / `22.04`
|
||||
* RHEL - `8` / `9`
|
||||
* SLES - `15-SP5`
|
||||
|
||||
* [ROCm supported hardware](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html)
|
||||
> [!IMPORTANT]
|
||||
> `gfx908` or higher GPU required
|
||||
|
||||
* Install ROCm `6.1.0` or later with [amdgpu-install](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/amdgpu-install.html): Required usecase - rocm
|
||||
> [!IMPORTANT]
|
||||
> `sudo amdgpu-install --usecase=rocm`
|
||||
|
||||
* AMD Multimedia packages
|
||||
```shell
|
||||
sudo apt install libva-amdgpu-dev libdrm-amdgpu1 mesa-amdgpu-va-drivers
|
||||
```
|
||||
> [!NOTE]
|
||||
> RPM Packages for `RHEL`/`SLES` - `libva-amdgpu-devel libdrm-amdgpu mesa-amdgpu-dri-drivers`
|
||||
|
||||
* CMake `3.5` or later
|
||||
|
||||
```shell
|
||||
sudo apt install cmake
|
||||
```
|
||||
|
||||
* [pkg-config](https://en.wikipedia.org/wiki/Pkg-config)
|
||||
|
||||
```shell
|
||||
sudo apt install pkg-config
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
> * If using Ubuntu 22.04, you must install `libstdc++-12-dev`
|
||||
>
|
||||
> ```shell
|
||||
> sudo apt install libstdc++-12-dev
|
||||
> ```
|
||||
|
||||
>[!NOTE]
|
||||
> * All package installs are shown with the `apt` package manager. Use the appropriate package manager for your operating system.
|
||||
> * To install rocDecode with minimum requirements, follow the [quick-start](./docs/install/quick-start.rst) instructions
|
||||
|
||||
|
||||
#### Prerequisites setup script for Linux
|
||||
For your convenience, we provide the setup script,
|
||||
[rocJPEG-setup.py](rocJPEG-setup.py) which installs all required dependencies. Run this script only once.
|
||||
|
||||
**Usage:**
|
||||
|
||||
```shell
|
||||
python rocJPEG-setup.py --rocm_path [ ROCm Installation Path - optional (default:/opt/rocm)]
|
||||
--developer [ Setup Developer Options - optional (default:ON) [options:ON/OFF]]
|
||||
```
|
||||
|
||||
**NOTE:** This script only needs to be executed once.
|
||||
|
||||
## Installation instructions
|
||||
|
||||
The installation process uses the following steps:
|
||||
|
||||
* [ROCm-supported hardware](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html) install verification
|
||||
|
||||
* Install ROCm `6.1.0` or later with [amdgpu-install](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/amdgpu-install.html) with `--usecase=rocm`
|
||||
|
||||
* Use either [Package install](#package-install) or [Source install](#source-install) as described below.
|
||||
|
||||
### Package install
|
||||
|
||||
Install rocJPEG runtime, development, and test packages.
|
||||
|
||||
* Runtime package - `rocjpeg` only provides the rocjpeg library `librocjpeg.so`
|
||||
* Development package - `rocjpeg-dev`/`rocjpeg-devel` provides the library, header files, and samples
|
||||
* Test package - `rocjpeg-test` provides CTest to verify installation
|
||||
|
||||
#### Ubuntu
|
||||
|
||||
```shell
|
||||
sudo apt install rocjpeg rocjpeg-dev rocjpeg-test
|
||||
```
|
||||
|
||||
#### RHEL
|
||||
|
||||
```shell
|
||||
sudo yum install rocjpeg rocjpeg-devel rocjpeg-test
|
||||
```
|
||||
|
||||
#### SLES
|
||||
|
||||
```shell
|
||||
sudo zypper install rocjpeg rocjpeg-devel rocjpeg-test
|
||||
```
|
||||
>[!NOTE]
|
||||
> Package install auto installs all dependencies.
|
||||
|
||||
### Source install
|
||||
|
||||
```shell
|
||||
git clone https://github.com/ROCm/rocJPEG.git
|
||||
cd rocJPEG
|
||||
mkdir build && cd build
|
||||
cmake ../
|
||||
make -j8
|
||||
sudo make install
|
||||
```
|
||||
|
||||
#### Run tests
|
||||
|
||||
```shell
|
||||
make test
|
||||
```
|
||||
|
||||
**NOTE:** run tests with verbose option `make test ARGS="-VV"`
|
||||
|
||||
#### Make package
|
||||
|
||||
```shell
|
||||
sudo make package
|
||||
```
|
||||
|
||||
## Verify installation
|
||||
|
||||
The installer will copy
|
||||
|
||||
* Libraries into `/opt/rocm/lib`
|
||||
* Header files into `/opt/rocm/include/rocjpeg`
|
||||
* Samples folder into `/opt/rocm/share/rocjpeg`
|
||||
* Documents folder into `/opt/rocm/share/doc/rocjpeg`
|
||||
|
||||
### Using sample application
|
||||
|
||||
To verify your installation using a sample application, run:
|
||||
|
||||
```shell
|
||||
mkdir rocjpeg-sample && cd rocjpeg-sample
|
||||
cmake /opt/rocm/share/rocjpeg/samples/jpegDecode/
|
||||
make -j8
|
||||
./videodecode -i /opt/rocm/share/rocjpeg/image/mug_420.jpg
|
||||
```
|
||||
|
||||
### Using test package
|
||||
|
||||
To verify your installation using the `rocjpeg-test` package, run:
|
||||
|
||||
```shell
|
||||
mkdir rocjpeg-test && cd rocjpeg-test
|
||||
cmake /opt/rocm/share/rocjpeg/test/
|
||||
ctest -VV
|
||||
```
|
||||
|
||||
## Samples
|
||||
|
||||
The tool provides a few samples to decode JPEG images [here](samples/). Please refer to the individual folders to build and run the samples.
|
||||
You can access samples to decode your images in our
|
||||
[GitHub repository](https://github.com/ROCm/rocJPEG/tree/develop/samples). Refer to the
|
||||
individual folders to build and run the samples.
|
||||
|
||||
## Docker
|
||||
|
||||
You can find rocDecode Docker containers in our
|
||||
[GitHub repository](https://github.com/ROCm/rocJPEG/tree/develop/docker).
|
||||
|
||||
## Documentation
|
||||
|
||||
Run the following code to build our documentation locally.
|
||||
|
||||
```shell
|
||||
cd docs
|
||||
pip3 install -r sphinx/requirements.txt
|
||||
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
|
||||
```
|
||||
|
||||
For more information on documentation builds, refer to the
|
||||
[Building documentation](https://rocm.docs.amd.com/en/latest/contribute/building.html)
|
||||
page.
|
||||
|
||||
## Tested configurations
|
||||
|
||||
* Linux
|
||||
* Ubuntu - `20.04` / `22.04`
|
||||
* RHEL - `8` / `9`
|
||||
* SLES - `15-SP5`
|
||||
* ROCm:
|
||||
* rocm-core - `6.1.0.60100-62`
|
||||
* amdgpu-core - `1:6.1.60100-1741643`
|
||||
* rocJPEG Setup Script - `V1.0`
|
||||
在新工单中引用
屏蔽一个用户