Этот коммит содержится в:
Kiriti Gowda
2024-02-09 10:31:44 -08:00
коммит произвёл GitHub
родитель 9e6f2111c4
Коммит 5e5c92abb5
12 изменённых файлов: 55 добавлений и 49 удалений
+3 -3
Просмотреть файл
@@ -3,7 +3,7 @@
<p align="center"><img width="70%" src="docs/data/AMD_rocDecode_Logo.png" /></p>
rocDecode is a high performance video decode SDK for AMD GPUs. rocDecode API lets developers access the video decoding features available on the GPU.
rocDecode is a high-performance video decode SDK for AMD GPUs. rocDecode API lets developers access the video decoding features available on the GPU.
## Supported codecs
@@ -44,7 +44,7 @@ sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev
**NOTE:**
* All package install shown with `apt` package manager, use appropriate package manager depending on the OS.
* All package installs are shown with the `apt` package manager, use the appropriate package manager depending on the OS.
* Ubuntu 22.04 - Install `libstdc++-12-dev`
@@ -142,7 +142,7 @@ make -j8
### Verify with rocdecode-test package
Test package will install ctest module to test rocdecode. Follow below steps to test packge install
The test package will install the ctest module to test the rocdecode. Follow the below steps to test the package install
```shell
mkdir rocdecode-test && cd rocdecode-test
+2 -2
Просмотреть файл
@@ -12,7 +12,7 @@ Steps in decoding video content for applications (available in rocDecode Toolkit
3. Decode compressed video frames into YUV frames using rocDecode API.
4. Wait for the decoding to finish.
5. Map the decoded YUV frame from amd-gpu context to HIP (using VAAPI-HIP under ROCm)
6. Execute HIP kernels in the mapped YUV frame (e.g., format conversion, scaling, object detection, classification etc.)
6. Execute HIP kernels in the mapped YUV frame (e.g., format conversion, scaling, object detection, classification, etc.)
7. Un-map decoded HIP YUV frame.
The above steps are demonstrated in the [sample applications](../samples/README.md) included in the repository.
The above steps are demonstrated in the sample applications included in the repository.
+1 -3
Просмотреть файл
@@ -1,6 +1,6 @@
# rocDecode hardware capabilities
Table 1 shows the codec support and capabilities of the VCN for each GPU architecture supported by rocDecode.
The table below shows the codec support and capabilities of the VCN for each GPU architecture supported by rocDecode.
| GPU Architecture | VCN Generation | Number of VCNs | H.265/HEVC | Max width, Max height - H.265 | H.264/AVC | Max width, Max height - H.264 |
| :--------------------------------- | :------------- | :------------- | :--------- | :---------------------------- | :-------- | :---------------------------- |
@@ -11,5 +11,3 @@ Table 1 shows the codec support and capabilities of the VCN for each GPU archite
| gfx1030, gfx1031, gfx1032 - Navi2x | VCN 3.x | 2 | Yes | 7680, 4320 | No | 4096, 2176 |
| gfx1100, gfx1102 - Navi3x | VCN 4.0 | 2 | Yes | 7680, 4320 | No | 4096, 2176 |
| gfx1101 - Navi3x | VCN 4.0 | 1 | Yes | 7680, 4320 | No | 4096, 2176 |
Table 1: Hardware video decoder capabilities
+3 -3
Просмотреть файл
@@ -1,7 +1,7 @@
# rocDecode overview
AMD GPUs contain one or more media engines (VCNs) that provide fully accelerated hardware based video decoding. Hardware decoders consume lower power than CPU based decoders. Dedicated hardware decoders offload decoding tasks from the CPU, boosting overall decoding throughput. And with proper power management, decoding on hardware decoders can lower the overall system power consumption and improve decoding performance.
AMD GPUs contain one or more media engines (VCNs) that provide fully accelerated hardware-based video decoding. Hardware decoders consume lower power than CPU-based decoders. Dedicated hardware decoders offload decoding tasks from the CPU, boosting overall decoding throughput. With proper power management, decoding on hardware decoders can lower the overall system power consumption and improve decoding performance.
This document describes AMD's rocDecode SDK library which provides APIs, utilities and samples, allowing the developers to access the video decoding features of VCNs easily. Further more, it allows interoperability with other compute engines on the GPU using VA-API/HIP interop. rocDecode API facilitates decoding of the compressed video streams and keeps the resulting YUV frames in video memory. With decoded frames in video memory, video post processing can be executed using ROCm HIP, thereby avoiding unnecessary data copies via PCIe bus. The video frames can further be post-processed using scaling/color-conversion and augmentation kernels (on GPU or host) and be in a format for GPU/CPU accelerated inferencing/training.
This document describes AMD's rocDecode SDK library which provides APIs, utilities, and samples, allowing the developers to access the video decoding features of VCNs easily. Furthermore, it allows interoperability with other compute engines on the GPU using VA-API/HIP interop. rocDecode API facilitates decoding of the compressed video streams and keeps the resulting YUV frames in video memory. With decoded frames in video memory, video post-processing can be executed using ROCm HIP, thereby avoiding unnecessary data copies via PCIe bus. The video frames can further be post-processed using scaling/color-conversion and augmentation kernels (on GPU or host) and be in a format for GPU/CPU accelerated inferencing/training.
In addition, rocDecode API can be used to create multiple instances of video decoder based on the number of available VCN engines in a GPU device . By configuring the decoder for a device, all the available engines can be used seamlessly for decoding a batch of video streams in parallel.
In addition, rocDecode API can be used to create multiple instances of video decoder based on the number of available VCN engines in a GPU device. By configuring the decoder for a device, all the available engines can be used seamlessly for decoding a batch of video streams in parallel.
+32 -24
Просмотреть файл
@@ -1,29 +1,37 @@
# Using rocDecode API
All rocDecode APIs are exposed in the two header files: `rocdecode.h` and `rocparser.h`. These headers can be found under `api` folder in this repository. \
All rocDecode APIs are exposed in the two header files: `rocdecode.h` and `rocparser.h`. These headers can be found under the `api` folder in this repository.
The samples use the `RocVideoDecoder` user class provided in `roc_video_dec.h` under the `utils` folder in this repository.
## Video parser (defined in [rocparser.h](../../api/))
Video Parser is needed to required to extract and decode headers from the bitstream to organize the data into a structured format required for the hardware decoder. Parser plays an important role in the video decoding as it controls the decoding and display of the individual frames/fields of a bitstream.
The parser object in rocparser.h has 3 main apis as described below
## Video parser (defined in rocparser.h)
A Video Parser is needed to extract and decode headers from the bitstream to organize the data into a structured format required for the hardware decoder. The parser plays an important role in video decoding as it controls the decoding and display of the individual frames/fields of a bitstream.
The parser object in `rocparser.h` has 3 main apis as described below
## Creating parser object using rocDecCreateVideoParser()
This API creates a video parser object for the Codec specified by the user. The api takes "max_num_decode_surfaces" which determines the DPB (Decoded Picture Buffer) size for decoding. When creating a parser object, application must register certain callback functions with the driver which will be called from the parser during the decode.
- pfn_sequence_callback will be called when the parser encounters a new sequence header. The parser informs the user with the minimum number of surfaces needed by parser's DPB for successful decoding of the bitstream. In addition, the caller can set additional parameters like "max_display_delay" to control the decoding and displaying of the frames.
- "pfn_decode_picture" callback function will be triggered when a picture is ready to be decoded.
- "pfn_display_picture" callback function will be triggered when a frame in display order is ready to be consumed by the caller.
- "pfn_get_sei_msg" callback function will be triggered when a user SEI message is parsed by the parser and send back to the caller.
This API creates a video parser object for the Codec specified by the user. The API takes `max_num_decode_surfaces` which determines the DPB (Decoded Picture Buffer) size for decoding. When creating a parser object, the application must register certain callback functions with the driver which will be called from the parser during the decode.
* `pfn_sequence_callback` will be called when the parser encounters a new sequence header. The parser informs the user of the minimum number of surfaces needed by the parser's DPB for successful decoding of the bitstream. In addition, the caller can set additional parameters like `max_display_delay` to control the decoding and displaying of the frames.
* `pfn_decode_picture` callback function will be triggered when a picture is ready to be decoded.
* `pfn_display_picture` callback function will be triggered when a frame in display order is ready to be consumed by the caller.
* `pfn_get_sei_msg` callback function will be triggered when a user SEI message is parsed by the parser and sent back to the caller.
## Parsing video data using rocDecParseVideoData()
Elementary stream video packets extracted from the demultiplexer are fed into the parser using the "rocDecParseVideoData()" API. During this call, the parser triggers the above callbacks as it encounters a new sequence header, got a compressed frame/field data ready to be decoded, or when it is ready to display a frame. If any of the callbacks returns failure, it will be propagated back to the application so the decoding can be termiated gracefully.
Elementary stream video packets extracted from the demultiplexer are fed into the parser using the `rocDecParseVideoData()` API. During this call, the parser triggers the above callbacks as it encounters a new sequence header, gets a compressed frame/field data ready to be decoded, or when it is ready to display a frame. If any of the callbacks returns failure, it will be propagated back to the application so the decoding can be terminated gracefully.
## Destroying the parser using rocDecDestroyVideoParser()
The user needs to call rocDecDestroyVideoParser() to destroy parser object and free up all allocated resources at the end of video decoding.
## Querying decode capabilities using rocDecGetDecoderCaps() (defined in [rocdecode.h](../../api/))
rocDecGetDecoderCaps() Allows users to query the capabilities of underlying hardware video decoder as different hardware will have different capabilities. Caps usually informs the user of the supported codecs, max. resolution, bit-depth etc.[See Table 1]
The user needs to call `rocDecDestroyVideoParser()` to destroy the parser object and free up all allocated resources at the end of video decoding.
The following pseudo-code illustrates the use of this API. If any of the decoder caps is not supported, the application is supposed to handle the error appropriately.
## Querying decode capabilities using rocDecGetDecoderCaps() (defined in rocdecode.h)
`rocDecGetDecoderCaps()` Allows users to query the capabilities of underlying hardware video decoder as different hardware will have different capabilities. Caps usually inform the user of the supported codecs, max. resolution, bit-depth, etc.
The following pseudo-code illustrates the use of this API. If any of the decoder caps are not supported, the application is supposed to handle the error appropriately.
RocdecDecodeCaps decode_caps;
memset(&decode_caps, 0, sizeof(decode_caps));
@@ -53,14 +61,14 @@ The following pseudo-code illustrates the use of this API. If any of the decoder
}
## Creating a Decoder using rocDecCreateDecoder()
Creates an instance of the hardware video decoder object and gives a handle to the user on successful creation. Refer to RocDecoderCreateInfo [structure](../../api/rocdecode.h) for information about parameters which are passed for creating the decoder. For e.g. RocDecoderCreateInfo::codec_type represents the codec type of the video. The decoder handle returned by the rocDecCreateDecoder() must be retained for the entire session of the decode because the handle is passed along with the other decoding apis. In addition, user can inform display or crop dimensions along with this API.
Creates an instance of the hardware video decoder object and gives a handle to the user on successful creation. Refer to `RocDecoderCreateInfo` structure for information about parameters that are passed for creating the decoder. E.g. `RocDecoderCreateInfo::codec_type` represents the codec type of the video. The decoder handle returned by the `rocDecCreateDecoder()` must be retained for the entire session of the decode because the handle is passed along with the other decoding APIs. In addition, users can inform display or crop dimensions along with this API.
## Decoding the frame using rocDecDecodeFrame()
After de-muxing and parsing, the next step is to decode bitstream data contaiing a frame/field using hardware. rocDecDecodeFrame()API is to submit a new frame for hardware decoding. Underneath the driver VA-API is used to submit compressed picture data to the driver. The parser extracts all the necessary information from the bitstream and fill "RocdecPicParams" struct which is appropriate for the codec used. The high level [RocVideoDecoder](../../utils/rocvideodecode/) class connects the parser and decoder which is used for all the sample applications.
The rocDecDecodeFrame() call takes decoder handle and the pointer to RocdecPicParams structure and kicks off video decoding using VA-API.
After de-muxing and parsing, the next step is to decode bitstream data containing a frame/field using hardware. `rocDecDecodeFrame()` API is to submit a new frame for hardware decoding. Underneath the driver, VA-API is used to submit compressed picture data to the driver. The parser extracts all the necessary information from the bitstream and fills the "RocdecPicParams" struct which is appropriate for the codec used. The high-level `RocVideoDecoder` class connects the parser and decoder which is used for all the sample applications.
The `rocDecDecodeFrame()` call takes the decoder handle and the pointer to RocdecPicParams structure and kicks off video decoding using VA-API.
## Preparing the decoded frame for further processing
The decoded frames can be used further postprocessing using the rocDecGetVideoFrame() API call. The successful completion of rocDecGetVideoFrame() indicates that the decoding process is completed and the device memory pointer is interopped to ROCm HIP address space for further processing of the decoded frame in device memory. The caller will get all the necessary information of the output surface like YUV format, dimensions, pitch etc. from this call. In the high level [RocVideoDecoder](../../utils/rocvideodecode/) class, we provide 4 different surface type modes for the mapped surface as specified in OutputSurfaceMemoryType as explained below.
The decoded frames can be used for further postprocessing using the `rocDecGetVideoFrame()` API call. The successful completion of `rocDecGetVideoFrame()` indicates that the decoding process is completed and the device memory pointer is inter-opped into ROCm HIP address space for further processing of the decoded frame in device memory. The caller will get all the necessary information on the output surface like YUV format, dimensions, pitch, etc. from this call. In the high-level `RocVideoDecoder` class, we provide 4 different surface type modes for the mapped surface as specified in OutputSurfaceMemoryType as explained below.
typedef enum OutputSurfaceMemoryType_enum {
OUT_SURFACE_MEM_DEV_INTERNAL = 0, /**< Internal interopped decoded surface memory **/
@@ -69,17 +77,17 @@ The decoded frames can be used further postprocessing using the rocDecGetVideoFr
OUT_SURFACE_MEM_NOT_MAPPED = 3 /**< decoded output is not available (interop won't be used): useful for decode only performance app*/
} OutputSurfaceMemoryType;
If the mapped surface type is "OUT_SURFACE_MEM_DEV_INTERNAL", the direct pointer to the decoded surface is given to the user. The user is supposed to trigger rocDecUnMapVideoFrame() using "ReleaseFrame()" call of RocVideoDecoder class. If the requested surface type OUT_SURFACE_MEM_DEV_COPIED or OUT_SURFACE_MEM_HOST_COPIED, the internal decoded frame will be copied to another buffer either in device memory or host memory. After that it is immediately unmapped for re-use by the RocVideoDecoder class.
In all the cases, the user needs to call rocDecUnMapVideoFrame() to indicate that the frame is ready to be used for decoding again.
Please refer to RocVideoDecoder class and [samples](../samples/) for detailed use of these APIs.
If the mapped surface type is `OUT_SURFACE_MEM_DEV_INTERNAL`, the direct pointer to the decoded surface is given to the user. The user is supposed to trigger `rocDecUnMapVideoFrame()` using the `ReleaseFrame()` call of the RocVideoDecoder class. If the requested surface type `OUT_SURFACE_MEM_DEV_COPIED` or `OUT_SURFACE_MEM_HOST_COPIED`, the internal decoded frame will be copied to another buffer either in device memory or host memory. After that, it is immediately unmapped for re-use by the RocVideoDecoder class.
In all the cases, the user needs to call `rocDecUnMapVideoFrame()` to indicate that the frame is ready to be used for decoding again.
Please refer to the RocVideoDecoder class and samples for detailed use of these APIs.
## Querying the decoding status
The `rocDecGetDecodeStatus()` can be called at any time to query the status of the decoding for given frame. A struct pointer `RocdecDecodeStatus*` will be filled and returned to the user.
The `rocDecGetDecodeStatus()` can be called at any time to query the status of the decoding for a given frame. A struct pointer `RocdecDecodeStatus*` will be filled and returned to the user.
The inputs to the API are:
* decoder_handle: A rocdec decoder handler `rocDecDecoderHandle`.
* pic_idx: An int value for the picIdx for which the user wants a status.
* decode_status: A pointer to `RocdecDecodeStatus` as return value.
* decode_status: A pointer to `RocdecDecodeStatus` as a return value.
The API returns one of the following statuses:
* Invalid (0): Decode status is not valid.
@@ -90,7 +98,7 @@ The API returns one of the following statuses:
* Displaying (10): Decode is completed, displaying in progress.
## Reconfiguring the decoder
The `rocDecReconfigureDecoder()` can be called to reuse a single decoder for multiple clips or when the video resolution changes during the decode. The API currently supports resolution changes, resize parameter changes, target area parameter changes for the same codec without having to destroy the ongoing decoder instance and creating a new one. This can improve performance and reduces the overall latency.
The `rocDecReconfigureDecoder()` can be called to reuse a single decoder for multiple clips or when the video resolution changes during the decode. The API currently supports resolution changes, resize parameter changes, and target area parameter changes for the same codec without having to destroy the ongoing decoder instance and create a new one. This can improve performance and reduce the overall latency.
The inputs to the API are:
* decoder_handle: A rocdec decoder handler `rocDecDecoderHandle`.
+7 -7
Просмотреть файл
@@ -4,34 +4,34 @@ rocDecode samples
## [Video decode](videoDecode)
The video decode sample illustrates decoding a single packetized video stream using FFMPEG demuxer, video parser, and rocDecoder to get the individual decoded frames in YUV format. This sample cab ne configured with a device ID and optionally able to dump the output to a file. This sample uses the high level RocVideoDecoder class which connects both the video parser and Rocdecoder. This process repeats in a loop until all frames have been decoded.
The video decode sample illustrates decoding a single packetized video stream using FFMPEG demuxer, video parser, and rocDecoder to get the individual decoded frames in YUV format. This sample can be configured with a device ID and optionally able to dump the output to a file. This sample uses the high-level RocVideoDecoder class which connects both the video parser and Rocdecoder. This process repeats in a loop until all frames have been decoded.
## [Video decode fork](videoDecodeFork)
The video decode fork sample creates multiple processes which demux and decode the same video in parallel. The demuxer uses FFMPEG to get the individual frames which are then sent to the decoder APIs. The sample uses shared memory to keep count of the number of frames decoded in the different processes. Each child process needs to exit successfully for the sample to complete successfully.
The video decode fork sample creates multiple processes that demux and decode the same video in parallel. The demuxer uses FFMPEG to get the individual frames which are then sent to the decoder APIs. The sample uses shared memory to keep count of the number of frames decoded in the different processes. Each child process needs to exit successfully for the sample to complete successfully.
This sample shows scaling in performance for `N` VCN engines as per GPU architecture.
## [Video decode memory](videoDecodeMem)
The video decode memory sample illustrates a way to pass the data chunk-by-chunk sequentially to the FFMPEG demuxer which are then decoded on AMD hardware using rocDecode library.
The video decode memory sample illustrates a way to pass the data chunk-by-chunk sequentially to the FFMPEG demuxer which is then decoded on AMD hardware using rocDecode library.
The sample provides a user class `FileStreamProvider` derived from the existing `VideoDemuxer::StreamProvider` to read a video file and fill the buffer owned by the demuxer. It then takes frames from this buffer for further parsing and decoding.
## [Video decode multi files](videoDecodeMultiFiles)
The video decode multiple files sample illustrates the use of providing a list of files as input to showcase the reconfigure option in rocDecode library. The input video files have to be of the same codec type to use the reconfigure option but can have different resolution or resize parameters.
The video decodes multiple files sample illustrates the use of providing a list of files as input to showcase the reconfigure option in the rocDecode library. The input video files have to be of the same codec type to use the reconfigure option but can have different resolutions or resize parameters.
The reconfigure option can be disabled by the user if needed. The input file is parsed line by line and data is stored in a queue. The individual video files are demuxed and decoded one after the other in a loop. Outpuot for each individual input file can also be stored if needed.
The reconfigure option can be disabled by the user if needed. The input file is parsed line by line and data is stored in a queue. The individual video files are demuxed and decoded one after the other in a loop. Output for each input file can also be stored if needed.
## [Video decode performance](videoDecodePerf)
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded on AMD hardware using rocDecode library.
This sample uses multiple threads to decode the same input video parallely.
This sample uses multiple threads to decode the same input video parallelly.
## [Video decode RGB](videoDecodeRGB)
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded using rocDecode API and optionally color-converted using custom HIP kernels on AMD hardware. This sample converts decoded YUV output to one of the RGB or BGR formats(24bit, 32bit, 464bit) in a separate thread allowing to run both VCN hardware and compute engine in parallel.
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded using rocDecode API and optionally color-converted using custom HIP kernels on AMD hardware. This sample converts decoded YUV output to one of the RGB or BGR formats(24bit, 32bit, 464bit) in a separate thread allowing it to run both VCN hardware and compute engine in parallel.
This sample uses HIP kernels to showcase the color conversion. Whenever a frame is ready after decoding, the `ColorSpaceConversionThread` is notified and can be used for post-processing.
+1 -1
Просмотреть файл
@@ -1,6 +1,6 @@
# Video decode sample
The video decode sample illustrates decoding a single packetized video stream using FFMPEG demuxer, video parser, and rocDecoder to get the individual decoded frames in YUV format. This sample cab ne configured with a device ID and optionally able to dump the output to a file. This sample uses the high level RocVideoDecoder class which connects both the video parser and Rocdecoder. This process repeats in a loop until all frames have been decoded.
The video decode sample illustrates decoding a single packetized video stream using FFMPEG demuxer, video parser, and rocDecoder to get the individual decoded frames in YUV format. This sample can be configured with a device ID and optionally able to dump the output to a file. This sample uses the high-level RocVideoDecoder class which connects both the video parser and Rocdecoder. This process repeats in a loop until all frames have been decoded.
## Prerequisites:
+1 -1
Просмотреть файл
@@ -1,6 +1,6 @@
# Video decode fork sample
The video decode fork sample creates multiple processes which demux and decode the same video in parallel. The demuxer uses FFMPEG to get the individual frames which are then sent to the decoder APIs. The sample uses shared memory to keep count of the number of frames decoded in the different processes. Each child process needs to exit successfully for the sample to complete successfully.
The video decode fork sample creates multiple processes that demux and decode the same video in parallel. The demuxer uses FFMPEG to get the individual frames which are then sent to the decoder APIs. The sample uses shared memory to keep count of the number of frames decoded in the different processes. Each child process needs to exit successfully for the sample to complete successfully.
This sample shows scaling in performance for `N` VCN engines as per GPU architecture.
+1 -1
Просмотреть файл
@@ -1,6 +1,6 @@
# Video decode memory sample
The video decode memory sample illustrates a way to pass the data chunk-by-chunk sequentially to the FFMPEG demuxer which are then decoded on AMD hardware using rocDecode library.
The video decode memory sample illustrates a way to pass the data chunk-by-chunk sequentially to the FFMPEG demuxer which is then decoded on AMD hardware using rocDecode library.
The sample provides a user class `FileStreamProvider` derived from the existing `VideoDemuxer::StreamProvider` to read a video file and fill the buffer owned by the demuxer. It then takes frames from this buffer for further parsing and decoding.
+2 -2
Просмотреть файл
@@ -1,8 +1,8 @@
# Video decode multi files sample
The video decode multiple files sample illustrates the use of providing a list of files as input to showcase the reconfigure option in rocDecode library. The input video files have to be of the same codec type to use the reconfigure option but can have different resolution or resize parameters.
The video decodes multiple files sample illustrates the use of providing a list of files as input to showcase the reconfigure option in the rocDecode library. The input video files have to be of the same codec type to use the reconfigure option but can have different resolutions or resize parameters.
The reconfigure option can be disabled by the user if needed. The input file is parsed line by line and data is stored in a queue. The individual video files are demuxed and decoded one after the other in a loop. Outpuot for each individual input file can also be stored if needed.
The reconfigure option can be disabled by the user if needed. The input file is parsed line by line and data is stored in a queue. The individual video files are demuxed and decoded one after the other in a loop. Output for each input file can also be stored if needed.
## Prerequisites:
+1 -1
Просмотреть файл
@@ -2,7 +2,7 @@
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded on AMD hardware using rocDecode library.
This sample uses multiple threads to decode the same input video parallely.
This sample uses multiple threads to decode the same input video parallelly.
## Prerequisites:
+1 -1
Просмотреть файл
@@ -1,6 +1,6 @@
# Video decode RGB sample
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded using rocDecode API and optionally color-converted using custom HIP kernels on AMD hardware. This sample converts decoded YUV output to one of the RGB or BGR formats(24bit, 32bit, 464bit) in a separate thread allowing to run both VCN hardware and compute engine in parallel.
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded using rocDecode API and optionally color-converted using custom HIP kernels on AMD hardware. This sample converts decoded YUV output to one of the RGB or BGR formats(24bit, 32bit, 464bit) in a separate thread allowing it to run both VCN hardware and compute engine in parallel.
This sample uses HIP kernels to showcase the color conversion. Whenever a frame is ready after decoding, the `ColorSpaceConversionThread` is notified and can be used for post-processing.