Gráfico de commits

86 Commits

Autor SHA1 Mensaje Fecha
jeffqjiangNew 395a1249c1 Added initial AVC parser. (#176)
* * rocDecode/AVC: Added initial AVC parser.
 - Added AVC SPS, PPS and slice header parsing functions.
 - Merged common parsing code from AVC and HEVC parsers to their super class.

* * rocDecode/AVC: Formating changes. No functional changes.
2024-01-16 20:57:40 -05:00
Aryan Salmanpour fb953b4366 Add support to correctly detect the gfx name for gfx940/gfx941/gfx942 (#178) 2024-01-16 14:49:54 -05:00
Aryan Salmanpour 3d28911453 Remove unsupported GPUs (#175) 2024-01-15 10:50:34 -08:00
Aryan Salmanpour 28c00cb354 Add support for gfx1101 and gfx1102 (#165) 2024-01-10 14:17:04 -05:00
jeffqjiangNew 2a4026470f * rocDecode/HEVC: Code clean up. (#163)
- Moved HEVC standard specific defines out of HevcVideoParser class to a new file.
 - Changed some namings to be more specification compliant.
 - No functional changes.
2024-01-10 11:44:07 -05:00
jeffqjiangNew 04fe74f390 * rocDecode: Updated Copyright message for 2024. (#160) 2024-01-09 20:47:16 -05:00
Aryan Salmanpour 224e98ab2d code cleanup - remove unused hipstream from the RocDecoder class (#155) 2024-01-08 14:54:28 -05:00
jeffqjiangNew c5483c751e Fixed a couple of errors in long term reference picture set parsing and long term reference picture list construction. (#151)
* * rocDecode/HEVC: Fixed a couple of errors in long term reference picture set parsing and long term reference picture list construction.

* * rocDecode/HEVC: Coding format change: removed newline in front of else statements. No functional changes.
2024-01-05 09:15:33 -05:00
jeffqjiangNew 33d6b37ddb * rocDecode/HEVC: Fixed a bug in destroy data buffer function in VAAPI layer. (#150)
- We have to clear the buffer id after destroying it. Without this clearing, we will encounter VAAPI buffer destroy failure on certain conformance streams where scaling list is signaled dynamically. In this case, we create different number of data buffers on different frames. If we do not clear the buffer id when destroying it, a dummy scaling list buffer id will have the same value as another buffer, resulting double destroy.
2024-01-02 15:56:18 -05:00
jeffqjiangNew 6db0b79144 * rocDecode/HEVC: Fixed an issue in reference list reconstruction. (#149)
- Removed a size check which was put in in early bring up stage and causes some conformance stream failures.
  - Also capped the DPB buffer size to 16 when we increase it from the spec value.
2024-01-02 15:55:52 -05:00
Aryan Salmanpour 6c07e53614 Check va_display_ to be valid before calling any VA APIs (#148) 2023-12-21 08:16:24 -08:00
jeffqjiangNew 1cdbac7d70 Fixed a POC calculation error in some corner cases. (#145)
* * rocDecode/HEVC: Fixed a POC calculation error in some corner cases.

* * rocDecode/HEVC: Added a newline between two functions. No functional changes.
2023-12-18 08:20:55 -05:00
jeffqjiangNew c9cfcde12d Fixed a bug in reference picture list modification parsing. (#143)
* * rocDecode/HEVC: Fixed the random crash associated with undecodable RASL pictures.
  - When a CRA picutre occurs, all the pictures in the DPB are emptied. However, the following RASL (Random Access Skipped Leading) picture can still reference these emptied pictures, making them undecodeble.
  - We initialized the reference picture lists with (0xFF), representing invalid picture index. Normally these invalid indices are replaced by valid values during RPS decoding. However, on undecodable RASL pictures, we can not find an existing reference picture in DPB, leaving the invalid index untouched and resulting invalid indexing later on.
  - Now we initialize the reference picture lists with a valid value 0. Also we add index range check on reference buffer at VA-API layer to avoid invalid memory access.

* * rocDecode/HEVC: Fixed a typo in sampel app message.

* *rocDecode/HEVC: Fixed a bug in reference picture list modification parsing.
  - This fixed the test failure of two conformance streams.
2023-12-15 16:08:19 -05:00
jeffqjiangNew 0fbd030b5d Fixed the random crash associated with undecodable RASL pictures. (#141)
* * rocDecode/HEVC: Fixed the random crash associated with undecodable RASL pictures.
  - When a CRA picutre occurs, all the pictures in the DPB are emptied. However, the following RASL (Random Access Skipped Leading) picture can still reference these emptied pictures, making them undecodeble.
  - We initialized the reference picture lists with (0xFF), representing invalid picture index. Normally these invalid indices are replaced by valid values during RPS decoding. However, on undecodable RASL pictures, we can not find an existing reference picture in DPB, leaving the invalid index untouched and resulting invalid indexing later on.
  - Now we initialize the reference picture lists with a valid value 0. Also we add index range check on reference buffer at VA-API layer to avoid invalid memory access.

* * rocDecode/HEVC: Fixed a typo in sampel app message.
2023-12-15 15:54:43 -05:00
Aryan Salmanpour 9a78101d22 return the correct rocdec_status if DestroyDataBuffers fails (#137) 2023-12-13 10:57:14 -05:00
jeffqjiangNew 42f109369e * rocDecode/HEVC: Fixed the decode failure of the conformance stream BUMPING_A_ericsson_1.bit. (#133)
- This stream tests output order conformance, in particular the bumping process. Four temporal layers are used and IRAP pictures with no_output_of_prior_pics_flag equal to 1 are present in the bitstream.
2023-12-13 09:48:15 -05:00
jeffqjiangNew 7240ee8973 * rocDecode/HEVC: Added frame rate info report when it is available, from the parser. (#130) 2023-12-12 13:47:19 -05:00
Aryan Salmanpour b8a8b66b91 Don't call DestroyDataBuffers during the reconfiguration - this function will be called during SubmitDecode (#131) 2023-12-11 17:10:10 -05:00
Aryan Salmanpour b77d00e38e Fix perf drop on some MI250 nodes - create VABuffers for every submission, and don't use vaMapBuffer/vaUnmapBuffer (#129)
* create VABuffers for every submission, and don't use vaMapBuffer/vaUnmapBuffer

* code clean up

* address review comments
2023-12-11 15:40:50 -05:00
jeffqjiangNew a2dfa8bc26 * rocDecode: Fix for the performance regression introduced by PR#114. (#128)
- Skip the additional buffer bumping specified in process C.5.2.2., to avoid synchronous job submission in some cases.
  - Increase DPB buffer size now by 2 to avoid overwriting pictures to be output.
2023-12-08 17:53:01 -05:00
Lakshmi Kumar f221d78258 adding support for MI300A A1 - gfx942 (#124) 2023-12-07 09:31:44 -05:00
jeffqjiangNew fcd63b9358 * rocDecode/HEVC: In flush DPB function, added a check for any buffers that need for output before any actions. This prevents any potential issues. (#121) 2023-12-06 09:39:49 -05:00
Aryan Salmanpour 9257cd6fcf Add nullptr parameters check for all decoder/parser APIs and some code clean up (#120) 2023-12-05 13:06:34 -05:00
Aryan Salmanpour 875994bb4f Add support for rocDecReconfigureDecoder API (#116)
* Add support for rocDecReconfigureDecoder API

* adrress reviewer's comemnts

* Add doxygen comment for ReconfigureDecoder function
2023-12-05 11:16:32 -05:00
jeffqjiangNew 5e65788bdd * rocDecode/HEVC: Fix for decode errors on a few conformance streams. (#114)
- Re-wrote short term RPS parsing function. The previous code generates incorrect results on some conformance streams.
  - No longer skip the additional buffer bumping specified in process C.5.2.2. This avoids the situation where the current frame overwrites the previously decoded buffer that is being output/displayed.
2023-12-04 11:53:26 -05:00
Aryan Salmanpour ae63fbacab Chamne the return type of FillSeqCallbackFn to int and check to see if it returns any error (#112) 2023-12-01 14:50:33 -05:00
jeffqjiangNew a878a106fb * rocDecode/HEVC: When video size changes, set new SPS activation flag. This takes care of the case where a new SPS replaces the old SPS with the same id but with different dimensions. (#110) 2023-11-30 18:32:25 -05:00
Aryan Salmanpour c1a8ac48b4 use std::max to avoid compilation issue (#107) 2023-11-30 11:29:39 -05:00
Aryan Salmanpour 48474fdad9 clean up - use google style guide for the RocDecoder class (#101)
* clean up - use google style guide for the RocDecoder class

* make other files/classes to follow the google style guides
2023-11-29 13:50:38 -05:00
jeffqjiangNew 2d14eb61b2 * rocDecode/HEVC: Fixed corruptions in RASL (Random Access Skipped Leading) pictures of an associated CRA picture. (#96)
- It appears that the root cause of the corruption is the loss of some reference info of the RASL pictures at VA-API driver level.
  - For reasons that are not documented in VA-API, or simply implementation limitations, the DPB buffer status when a CRA picture is decoded, needs to be sent to VA-API driver to the correct decoding of the associated RASL pictures. The info is stored in PocStFoll and PocLtFoll and is not needed for CRA picture decode, which is an intra picture. Without this info, the following RASL picture decode will run into problem even when its reference picture info is correctly specified.
  - Note this appears to be a VA-API specific issue because it did not occur on other platforms.
2023-11-29 08:33:00 -05:00
Aryan Salmanpour 3625829546 Improve logging errors for VAAPI and HIP by including the API names and the status in the logs (#95)
* Improve logging errors for VAAPI and HIP by including the API names and the status in the logs

* clean up
2023-11-28 16:52:27 -05:00
jeffqjiangNew 27d28dd5f4 * rocDecode/HEVC: Fixed a method name typo. (#92) 2023-11-28 14:03:13 -05:00
jeffqjiangNew 09da68790c * rocDecode/HEVC: Fixed the missing output picture issue on certain streams. (#89)
- When we hit IRAP (Intra Random Access Point) picture and need to bump all remaining decoded pictures from DPB, call display callback immediately, instead of delaying the callback to the IRAP decode process.
2023-11-27 19:54:49 -05:00
Aryan Salmanpour e5d5bd4abb Return an error if the ExportSurface function fails. Add extra error logging in the destructor of the VaapiVideoDecoder class (#87) 2023-11-27 13:08:34 -05:00
jeffqjiangNew 624c3c0f09 End of stream flush (#86)
* * rocDecode/HEVC: Added picture output operation in DPB and display callback function.
  - To avoid serialization of decode submissions and/or display callback in certain cases, increased DPB buffer size by 1 and tweaked picture bumping procedure.

* * rocDecode/HEVC: Added flushing of the remaining pictures from DPB at the end of decode session.

* * rocDecode/HEVC: Changed output_pic_num to num_output_pics to void some confusion. Set top_field_first to 1.

* * rocDecode/HEVC: Added a few return error checks.
2023-11-27 13:03:26 -05:00
jeffqjiangNew 57c040eff8 Added picture output operation in DPB and display callback function. (#83)
* * rocDecode/HEVC: Added picture output operation in DPB and display callback function.
  - To avoid serialization of decode submissions and/or display callback in certain cases, increased DPB buffer size by 1 and tweaked picture bumping procedure.

* * rocDecode/HEVC: Added a few error checks and minor format changes.
2023-11-27 11:04:01 -05:00
jeffqjiangNew ad186a90da Re-enabled SEI message processing. (#79)
* * rocDecode/HEVC: Re-enabled SEI message processing.
  - Added "-sei" command option to extract SEI messages from stream.
  - Added support for SEI info parsing for multiple SEI NAL units with multiple payloads.
  - Fixed a SEI syntax parsing issue and several procssing issues.
  - Fixed a double free memory issue in SEI data buffer handling in HandlePictureDisplay().

* * rocDecode/HEVC: Coding format changes.

* * rocDecode/HEVC: Minor format changes.
2023-11-21 14:33:15 -05:00
Rajy Rawther 012f96c8c5 Rr/check sei function pointer (#78)
* commending out ParseSeiMessage because it is causing segfault

* CMake changes for valgrind

* added function pointer validity for sei callback

* fix review comments
2023-11-21 11:23:47 -05:00
Rajy Rawther 210976616f commending out ParseSeiMessage because it is causing segfault (#76) 2023-11-17 20:56:05 -05:00
Rajy Rawther cbf6857f74 Rr/parser clean up (#75)
* minor clean_up on parser struct allocation

* minor clean_up

* address review comments
2023-11-17 20:55:53 -05:00
Rajy Rawther 81abe58fb4 Rr/vaapi decoder mem check (#74)
* add some checks for buffer requirements

* address review comments
2023-11-17 17:33:12 -05:00
jeffqjiangNew c528f46843 * rocDecode/HEVC: Removed parsing of entry_point_offset_minus1[] and beyond in slice header since these syntax elements are not used by HW decode. (#73) 2023-11-17 15:59:29 -05:00
jeffqjiangNew b6d0c41a59 * rocDecode/HEVC: Fixed the segmentation fault at the end of decode session on stream chimei_demo_1080p_h265_60fps.mp4 or similar streams. (#72)
Root cause: num_entry_point_offsets in the slice header of frame #2164 is 674, exceeding the entry_point_offset_minus1[440] array size. Parser writes beyond the array boundary, corrupting memory. Frame #2164 is not in conformance of the HEVC spec.

We need to put the constraint from the spec on the num_entry_point_offsets parsed from the stream. Also need to change the array size to the max possible for 8K.
2023-11-17 12:57:19 -05:00
Aryan Salmanpour 5d5db9a017 Add additional debug info if we couldn't find the matching pic in reference list and return error (#69)
* Add additional debug info if we couldn't find the matching pic in refrence list and return error

* Correct the debug info message
2023-11-16 12:39:23 -05:00
jeffqjiangNew 69c2243c9c IRAP POC calculation fix. (#66)
* * rocDecode/HEVC: Fixed a bug in IRAP picture order count calculation. Added a few picture type check utilities.

* * rocDecode/HEVC: Minor coding style changes. No functional changes.
2023-11-15 16:07:18 -05:00
jeffqjiangNew 1d4f038695 Do not set up slice ref list for intra frames for VAAPI calls. (#62)
* * rocDecode/HEVC: Do not set up slice ref list for intra frames.

* *rocDecode/HEVC: Condensed slice type check code. No functionaly changes.
2023-11-14 15:44:35 -05:00
jeffqjiangNew 3357aba104 * rocDecode/HEVC: Fixed a few issues in reference list setup. Also looks like we need to use VA surface IDs on all buffers including the reference (need to confirm with VA driver team). (#61) 2023-11-14 11:42:13 -05:00
Aryan Salmanpour eb5614d250 Add support for the rocDecUnMapVideoFrame API (#58) 2023-11-13 12:54:32 -05:00
Aryan Salmanpour 730b80b600 Close fds after importing the surVAAPI face to HIP memory (#55) 2023-11-10 18:24:21 -05:00
jeffqjiangNew 3c7f29dab4 Added picture decode submission to VA-API driver. (#54)
* * rocDeocde/HEVC: Added several "reserved" fields to structs to match the corresponding VA-API structs.

* * rocDecode/HEVC: Added decode submission to VA-API driver.

* * rocDecode/HEVC: Corrected data buffer id type.
2023-11-10 17:15:47 -05:00