110 کامیت‌ها

مولف SHA1 پیام تاریخ
Pavel Tcherniaev a9a75f088d added md5 checksum with changes that Aryan and Rajy requested (#333)
Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>

[ROCm/rocdecode commit: 12fa766973]
2024-05-02 08:49:46 -04:00
Lakshmi Kumar 97be0bb3ca Seek - Bug Fixes + Sample Update (#327)
* adds seek to videodecode and seek bug fixes

* fixes both frames & timestamp with prev_key_frame option

* switch to exact key frame and bug fix

* fix decoded_frame_number from seek

* fix out_frame_duration

* clean up + exact fram fix

[ROCm/rocdecode commit: 2d50d685f7]
2024-05-01 17:03:27 -04:00
Rajy Rawther 7aaef29eb7 videodemuxer: added seek functionality (#311)
* demux add seek functionality

* addressed review comments

[ROCm/rocdecode commit: 77e4c3150a]
2024-04-11 08:21:50 -04:00
Lakshmi Kumar 2fa48d1f1d move getEnvVar function to common (#299)
[ROCm/rocdecode commit: d5b5a31881]
2024-03-26 19:07:13 -04:00
Rajy Rawther 5ac584fad5 rocDecode resize sample implementation (#285)
* WIP: resize kernels

* hipified kernels for scaling from cuda

* updated videodecodeRGB sample for scaling

* added stream parameter to kernels

* add scale kernels using tex2d and NN

* enable tex2D kernels

* add NN resize kernels

* fixed scaling kernels

* fixed tex2D scaling kernel for UV scaling

* minor formatting

* address review comments

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>

[ROCm/rocdecode commit: 39e274d02d]
2024-03-18 08:32:19 -04:00
jeffqjiangNew 9e64945bdf Fixed several issues with cropping. (#275)
* * rocDecode: Fixed several issues with cropping.
  - Fixed the pixel start offset error on streams with non-zero top/left cropping in MD5 calculation.
  - Fixed the pixel start offset error on streams with non-zero top/left cropping, and/or with user specified cropping in YUV frame output.
  - Sorted out code which deals with cropping area specifiied by the bitstream, and cropping area specified by the user.

* * rocDecode: Additional changes after discussion.
 - Set display rect for decoder create/reconfig to displayable area or user specified ROI area.
 - Do not set target rect for decoder create/reconfig. Leave it for future use.
 - Unified naming of display rect in decoder create/reconfig structs.

* * rocDecode: Put back the extra rounding to target width/height specifiied by the coded stream, for peace of mind, based on code review.

* * rocDecode: Added the missing stream specified cropping offset to the starting pixel pointer for none-internal memory modes.

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>

[ROCm/rocdecode commit: e4614de461]
2024-03-11 22:35:11 -04:00
Lakshmi Kumar 9b71383de8 Samples - Multi Threaded Multi FIles (#255)
* adding new sample for decoding mulitple files on multiple threads

* threads work ; no decoding yet

* working version

* code clean up

* review comments

* removing spaces

* review comments

* fps cal + name changes for files

* code clean up

* update readme

* update readme

* remove spaces

* change to lambda functions

* changes for using reconfig

* adding dumping of yuv frames + review comments

* review comments

* remove extra lines/spaces

* adding struct for decoder info

* make separate decoders for 8 & 10bit

* code clean up

* addign reset for Saving frames

* review comments

* fixes dump issue for new file

* cmake update for threads

* support for avc

* name change for sample

* cmake soource name change

* readme update

* fixing typo in readme

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>

[ROCm/rocdecode commit: ce3ebadaab]
2024-03-07 20:29:14 -05:00
Kiriti Gowda cabcb78825 FFMPEG - Multi-version support (#270)
* FFMPEG 5.X - Support

* FFMPEG 5.X - Support

* FFMPEG - Multiversion support

* FFMPEG - Support FFMPEG AVCODEC > 58.134.X

[ROCm/rocdecode commit: ca067ae6ec]
2024-03-05 08:34:05 -05:00
Aryan Salmanpour 65d64404a7 Add support to demuxer to get additional info from the stream (#271)
* Add support to demuxer to get additional info from the stream

* Add support to get frame rate

* avoid a potential division by zero

[ROCm/rocdecode commit: 983571c58f]
2024-02-29 11:05:55 -05:00
Aryan Salmanpour 6f80f7e81c Revert "FFMPEG 5.X - Support (#268)" (#269)
This reverts commit 11abd055ed.

[ROCm/rocdecode commit: 6317b9f22b]
2024-02-28 14:31:07 -05:00
Kiriti Gowda 11abd055ed FFMPEG 5.X - Support (#268)
[ROCm/rocdecode commit: 4f2bf945a9]
2024-02-28 12:37:33 -05:00
Rajy Rawther 972b7af079 fix copy buffer for memory modes 1 and 2 (#238)
[ROCm/rocdecode commit: 79184aeacc]
2024-02-12 14:32:50 -05:00
Aryan Salmanpour 881d06a244 Enhance logging error in rocDecode library - let the upper level class prints the correct error code string instead of integer code from lower levels (#223)
[ROCm/rocdecode commit: 15526253c7]
2024-02-06 13:35:41 -05:00
Aryan Salmanpour c7f7a7c0e8 rename roDecMapVideoFrame to rocDecoGetVideoFrame and some other minor code cleanups (#222)
[ROCm/rocdecode commit: 38f50a1a10]
2024-02-06 11:38:54 -05:00
Aryan Salmanpour 18f165e424 Fix the performance issue introduced after PR#192 (#220)
* Fix the performance issue introduced after PR#192

* Destroy the current interop memories before reconfiguration

* initialize the interop to 0 after unmapping a surface

* code clean up

* check the mapped device mem/ext mem to be valid before destrying them

* code cleanup - add some comments

* make changes based on the reviewer comments

[ROCm/rocdecode commit: 929123abff]
2024-02-05 17:12:39 -05:00
Lakshmi Kumar 96b71ddd2c Samples - Clean up and bug fixes (#203)
* clean up samples

* fixes error seen in videoDecodeMem app with big files

[ROCm/rocdecode commit: 43481ce36b]
2024-01-29 12:58:00 -05:00
jeffqjiangNew a0e7d3c29f Changed rocDecode API header variable naming to Google C++ style. (#196)
* * rocDecode: Changed rocDecode API header variable naming to Google C++ style.

* * rocDecode: Unified AVC/H264 naming to AVC. Minor naming changes on HEVC related names.

* * rocDecode: Minor comment fix based on code review.

[ROCm/rocdecode commit: cd6401750e]
2024-01-24 18:03:46 -05:00
Lakshmi Kumar 55213cfb35 fixes missing variable (#193)
[ROCm/rocdecode commit: 6ae9ba8be2]
2024-01-22 15:18:02 -05:00
Lakshmi Kumar dbd9d466cc fixes mesa warning/error (#192)
* fixes mesa warning/error

* merge conflicts

[ROCm/rocdecode commit: 1393311656]
2024-01-22 12:00:06 -08:00
Rajy Rawther 9afce4a03a fix for hipOutOfMem bug when decoding large videos (#189)
* fix for issue 441908

[ROCm/rocdecode commit: 51ecd8fccf]
2024-01-19 09:46:02 -08:00
Lakshmi Kumar a186a42593 Adding support for reading Environmental variable for samples (#186)
* check if env var set and choose device

* clean up for env var

* app modification

* move getEnvVar function to header

* fork example

* spacing adjust

* review comments

* use hipGetErrorName to throw errors

[ROCm/rocdecode commit: 8ec38d2d24]
2024-01-17 22:57:31 -05:00
Aryan Salmanpour e723871cba Add support for rocDecGetErrorName for getting the rocDecStatus error string (#185)
* Add support for rocDecGetErrorName for getting the rocDecStatus error string

* Add description of the API

[ROCm/rocdecode commit: f7997b716d]
2024-01-17 14:00:54 -05:00
Aryan Salmanpour 5cd81b0a5b Remove unnecessary device id check (#180)
[ROCm/rocdecode commit: b188989f3f]
2024-01-17 10:27:06 -05:00
jeffqjiangNew 40408ce2b3 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.

[ROCm/rocdecode commit: 395a1249c1]
2024-01-16 20:57:40 -05:00
kiritigowda 496740fd34 Documentation - Updates
[ROCm/rocdecode commit: cce46982a5]
2024-01-10 12:14:41 -08:00
jeffqjiangNew 4c9a35a6a8 * rocDecode: Updated Copyright message for 2024. (#160)
[ROCm/rocdecode commit: 04fe74f390]
2024-01-09 20:47:16 -05:00
jeffqjiangNew 8c8904761d Decoder reconfigure fixes. (#157)
* * rocDecode/HEVC: Fixed a couple of issues with reconfiguration of decoder when video size is changed.
  - Picture width and height variables were interchangeably used to represent coded picture size and display size, resulting reconfiguration errors. Now we use different variables to represent coded and display sizes.
  - Fixed a file overwriting issue in video size change case, where the display size can remain the same when coded size changes with specific cropping offsets.

* * rocDecode/HEVC: Added some fixes to decoder reconfiguration.
  - Added support for MD5 calculation in reconfigure flush callback. This fixed MD5 check failure on conformance streams with size changes.
  - Fixed total decoded frame number report with reconfigure when file dump or MD5 is not enabled. We need to call flush with reconfigure unconditionally (but with different actions).
  - Added the missing reconfigure flush when coded size is not changed but display size is changed.

* * rocDecode/HEVC: Corrected an error in GetDecodedWidth() method. Should use coded_width_, instead of disp_width_.

[ROCm/rocdecode commit: ccd813a2da]
2024-01-09 10:51:30 -05:00
Aryan Salmanpour af09e155f8 Use a dedicated hip stream for launching hip kernels for color space conversion (#152)
[ROCm/rocdecode commit: dd738aef48]
2024-01-05 12:55:46 -05:00
Rajy Rawther d55324bcf9 Add mechanism to flush last frames during reconfigure (#142)
* add mechanism to flush last frames during reconfigure

* reconfig mode updated support

* addressed review comments

* addressed review comments

* change condition according to review comment

[ROCm/rocdecode commit: a5211189f5]
2023-12-19 08:49:17 -05:00
jeffqjiangNew 7cd5d6c0ee * rocDecode/HEVC: Added frame rate info report when it is available, from the parser. (#130)
[ROCm/rocdecode commit: 7240ee8973]
2023-12-12 13:47:19 -05:00
Rajy Rawther e651268fab added release of copied buffers in host and hip (#126)
* added release of copied buffers in host and hip

* address review comments

* addressed review comment

[ROCm/rocdecode commit: 1dc5a9d798]
2023-12-08 17:29:00 -05:00
jeffqjiangNew 5044e65de3 Changed MD5 calculation of 10 bit to match reference MD5. (#127)
* * rocDecode/HEVC: Changed MD5 calculation of 10 bit to match reference MD5.
  - Need to convert P010 YUV to little endian.

* * rocDecode/HEVC: Convert to C++ type cast style.

[ROCm/rocdecode commit: 5d45ac6d92]
2023-12-07 17:06:51 -05:00
Aryan Salmanpour babefe67a9 Don't save frames into a single file if decoder reconfigure is detected for resolution changes - save into separate files for each resolution (#123)
[ROCm/rocdecode commit: bbd2fa5916]
2023-12-06 14:35:10 -05:00
Aryan Salmanpour 70a18314d5 Add support for rocDecReconfigureDecoder API (#116)
* Add support for rocDecReconfigureDecoder API

* adrress reviewer's comemnts

* Add doxygen comment for ReconfigureDecoder function

[ROCm/rocdecode commit: 875994bb4f]
2023-12-05 11:16:32 -05:00
Rajy Rawther 20defa76e5 Samples - Add a sample for decoding a video and converting the raw decoded YUV frames to RGB format using HIP kernels (#108)
* WIP: class implementation

* add more definitions

* rocvideodecode implementation

* formatting fixes

* address review comments

* rocvideodecode class update

* videodec sample app-enable all apis

* video_dec_rgb_sample implementation

* fix issue with release mode execution and other clean_up

* add copyright block

* address review comments

* sync with tot and addressed review comments

* convert to snake_case

[ROCm/rocdecode commit: 15fb3e0b91]
2023-12-01 13:26:30 -05:00
Aryan Salmanpour 88dd09c011 remove the b_low_latency_ from the RocVideoDecoder class (#111)
[ROCm/rocdecode commit: e001d78859]
2023-11-30 22:09:13 -05:00
jeffqjiangNew 67c5b77806 MD5 digest generation support (#109)
* * rocDecode/HEVC: Added support for MD5 message digest generation.
  - Command option "-md5" triggers MD5 calculation and output.

* * rocDecode/HEVC: Changed C type casting to C++ type casting.

[ROCm/rocdecode commit: ad20961c4a]
2023-11-30 17:40:45 -05:00
Aryan Salmanpour e6e296dd8c Increase the avioc_buffer_size for AVIOContext creation - this is needed for videoDecodeMem sample (#100)
[ROCm/rocdecode commit: f8b01f3d1a]
2023-11-29 13:37:44 -05:00
Lakshmi Kumar 18d82d1f2b Samples - adding a sample to illustrate StreamProvider for demuxer (#99)
* mem sample

* changes to match c++ style

* ffmpeg log

* readme update

* readme clean up

[ROCm/rocdecode commit: 22de4fbc6f]
2023-11-29 11:22:21 -05:00
Aryan Salmanpour ff9432f879 Fix a perf issue where we didn't pass the device id correctly to rocDecCreateDecoder API (#91)
[ROCm/rocdecode commit: 72bfa50c21]
2023-11-28 11:26:34 -05:00
jeffqjiangNew 7035965722 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.

[ROCm/rocdecode commit: 624c3c0f09]
2023-11-27 13:03:26 -05:00
Aryan Salmanpour 049100d761 D not fuse - zwhen runnnin gthesmake test. Don't force b_force_latency ofr Perf/Fork sample (#85)
[ROCm/rocdecode commit: 8898af78a6]
2023-11-27 12:33:28 -05:00
jeffqjiangNew 67c9ea1983 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.

[ROCm/rocdecode commit: ad186a90da]
2023-11-21 14:33:15 -05:00
Rajy Rawther 6918fb07c4 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

[ROCm/rocdecode commit: 012f96c8c5]
2023-11-21 11:23:47 -05:00
Aryan Salmanpour 4bfd23aa13 Code clean up - remove unused headers from demuxer, unused ffmpeg dependencies, and redundent info from videodecode sample (#71)
[ROCm/rocdecode commit: 071b37b3bd]
2023-11-17 12:46:27 -05:00
Aryan Salmanpour 0a166ff271 code cleanup - use google style for videodecode sample and RocVideoDecoder class - no functional change (#65)
* code cleanup - use google style for videodecode sample and RocVideoDecoder class - no functional change

* rename SaveSurfToFile to SaveFrameToFile

[ROCm/rocdecode commit: 851c537904]
2023-11-15 15:49:16 -05:00
Rajy Rawther c15be83df5 Rr/fix output surface dims (#64)
* fix output surface dimensions

* fix bug

[ROCm/rocdecode commit: a4652d6a53]
2023-11-15 13:46:37 -05:00
Aryan Salmanpour 64441167c4 Fix a seg fault when saving a frame in SaveSurfToFile (#60)
[ROCm/rocdecode commit: 592426595e]
2023-11-13 14:38:29 -05:00
Rajy Rawther 4c7210745f Rr/add low latency (#59)
* added picture_index associated with frame and fixed bug

* added option to force low_latency display

* add force_zero_latency option for videodecode sample

[ROCm/rocdecode commit: d163eb1764]
2023-11-13 13:53:19 -05:00
Aryan Salmanpour e86c9487b5 Add support for the rocDecUnMapVideoFrame API (#58)
[ROCm/rocdecode commit: eb5614d250]
2023-11-13 12:54:32 -05:00