* * rocDecode: Initial check in for decode buffer pool. * * rocDecode: All 135 streams pass. * * rocDecode: Fixed a build error in debug mode. * * rocDecode/HEVC: Removed two workaround in HEVC DPB management, after decode buffer pool implementa tion. - WR 1: Conditional bumping (when max_num_reorder_pics > 0) to avoid synchronous job submission in C.5.2.3. - WR 2: Add two more buffers in DPB to avoid buffer over-writing. * * rocDecode/HEVC: Added display delay feature. * * rocDecode/HEVC: Fixed the -z option issue within the context of the new decode buffer pool implementation. * * rocDecode/HEVC: Removed redundent code. * * rocDecode/AVC: Added decode buffer pool implementation for AVC. * * rocDecode: Added a few changes. - Added display delay feature to AVC. - Removed a workaround for AVC: AVC_MAX_DPB_FRAMES was increased to 18. Now it is back to 16. - Removed a workaround for AVC: increased DPB buffer size by 2. Now it is back to normal. - Code format changes for HEVC. * * rocDecode/AVC: Fixed the -z option issue within the context of the new decode buffer pool implementation. * * rocDecode: Merged OutputDecodedPictures() method to upper class RocVideoParser. * * rocDecode: Code cleanup. No functional changes. * * rocDecode: Made decode buffer pool size adaptive. - Removed the hard coded decode buffer pool size set in the decoder. - Exposed the display delay parameter from RocVideoDecoder class to the user. - Now the decoder buffer pool size is determined from the DPB buffer size and display delay parameter. * * rocDecode: Several changes based on code review. - Merged decode and display use status into one parameter. - Removed the surface index from DecodeFrameBuffer, which is now implicitly referred by the array index. - Changed a function name for better clarity. * * rocDecode: Added a comment.
rocDecode is a high-performance video decode SDK for AMD GPUs. Using the rocDecode API, you can access the video decoding features available on your GPU.
Supported codecs
- H.265 (HEVC) - 8 bit, and 10 bit
- H.264 (AVC) - 8 bit
Prerequisites
-
Linux distribution
- Ubuntu -
20.04/22.04 - RHEL -
8/9
- Ubuntu -
Important
gfx908or higher GPU required
- Install ROCm
6.1.0or later with amdgpu-install: Required usecase - rocm
Important
sudo amdgpu-install --usecase=rocm
- Video Acceleration API Version
1.5.0+-Libvais an implementation for VA-APIsudo apt install libva-dev
Note
RPM Packages for
RHEL/SLES-libva-devel
-
AMD VA Drivers
sudo apt install mesa-amdgpu-va-drivers -
CMake
3.5or latersudo apt install cmake -
sudo apt install pkg-config -
FFmpeg runtime and headers - for tests and samples
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev
Important
- On
Ubuntu 22.04- Additional package required:libstdc++-12-devsudo apt install libstdc++-12-dev
- On
RHEL/SLES- Additional packages required:libdrm-amdgpuandmesa-amdgpu-dri-driverssudo yum install libdrm-amdgpu mesa-amdgpu-dri-drivers
Note
- All package installs are shown with the
aptpackage manager. Use the appropriate package manager for your operating system.- To install rocDecode with minimum requirements, follow the quick-start instructions
Prerequisites setup script
For your convenience, we provide the setup script, rocDecode-setup.py, which installs all required dependencies. Run this script only once.
python3 rocDecode-setup.py --rocm_path [ ROCm Installation Path - optional (default:/opt/rocm)]
--developer [ Setup Developer Options - optional (default:OFF) [options:ON/OFF]]
Installation instructions
The installation process uses the following steps:
-
ROCm-supported hardware install verification
-
Install ROCm
6.1.0or later with amdgpu-install with--usecase=rocm -
Use either package install or source install as described below.
Package install
To install rocDecode runtime, development, and test packages, run the line of code for your operating system.
- Runtime package -
rocdecodeonly provides the rocdecode librarylibrocdecode.so - Development package -
rocdecode-dev/rocdecode-develprovides the library, header files, and samples - Test package -
rocdecode-testprovides CTest to verify installation
Ubuntu
sudo apt install rocdecode rocdecode-dev rocdecode-test
RHEL
sudo yum install rocdecode rocdecode-devel rocdecode-test
SLES
sudo zypper install rocdecode rocdecode-devel rocdecode-test
Note
Package install auto installs all dependencies.
Important
RHEL/SLESpackage install requires manualFFMPEGdev install
Source install
To build rocDecode from source and install, run:
git clone https://github.com/ROCm/rocDecode.git
cd rocDecode
python3 rocDecode-setup.py
mkdir build && cd build
cmake ../
make -j8
sudo make install
Run tests
make test
Important
make test requires
FFMPEGdev install
Note
To run tests with verbose option, use
make test ARGS="-VV".
Make package
sudo make package
Verify installation
The installer copies:
- Libraries into
/opt/rocm/lib - Header files into
/opt/rocm/include/rocdecode - Samples folder into
/opt/rocm/share/rocdecode - Documents folder into
/opt/rocm/share/doc/rocdecode
Using sample application
To verify your installation using a sample application, run:
mkdir rocdecode-sample && cd rocdecode-sample
cmake /opt/rocm/share/rocdecode/samples/videoDecode/
make -j8
./videodecode -i /opt/rocm/share/rocdecode/video/AMD_driving_virtual_20-H265.mp4
Using test package
To verify your installation using the rocdecode-test package, run:
mkdir rocdecode-test && cd rocdecode-test
cmake /opt/rocm/share/rocdecode/test/
ctest -VV
Samples
You can access samples to decode your videos in our GitHub repository. Refer to the individual folders to build and run the samples.
FFmpeg is required for sample applications and make test. To install
FFmpeg, refer to the instructions listed for your operating system:
-
Ubuntu:
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev -
RHEL/SLES:
Install ffmpeg development packages manually or use
rocDecode-setup.pyscript
Docker
You can find rocDecode Docker containers in our GitHub repository.
Documentation
Run the following code to build our documentation locally.
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 page.
Tested configurations
- Linux
- Ubuntu -
20.04/22.04 - RHEL -
8/9
- Ubuntu -
- ROCm:
- rocm-core -
6.1.0.60100-64 - amdgpu-core -
1:6.1.60100-1741643
- rocm-core -
- libva-dev -
2.7.0-2/2.14.0-1 - mesa-amdgpu-va-drivers -
1:24.1.0 - mesa-amdgpu-dri-drivers -
24.1.0.60200 - FFmpeg -
4.2.7/4.4.2-0 - rocDecode Setup Script -
V2.0.0
