From 34cdd7f709cf6f4f051d8eb3039aabdd5e8db198 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:17:52 -0400 Subject: [PATCH] Picture file sample: Bug fix. (#533) * * rocDecode/Picture file sample: Fixed a bug that can result in incorrect output frame count when reconfiguration occurs and with more than one iterations. * * rocDecode: Updated change log. --- CHANGELOG.md | 6 ++++-- samples/videoDecodePicFiles/videodecodepicfiles.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e84d44ae8..07f2e2c343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,13 @@ Full documentation for rocDecode is available at [https://rocm.docs.amd.com/proj * HEVC stream bit depth change handling through decoder reconfiguration. * rocDecode now uses the Cmake CMAKE_PREFIX_PATH directive. -### Changed +### Optimized * Bitstream type detection optimization in bitstream reader. -### Removed +### Resolved issues + +* Fixed a bug in picture files sample "videoDecodePicFiles" that can results in incorrect output frame count. ## rocDecode 0.10.0 for ROCm 6.4 diff --git a/samples/videoDecodePicFiles/videodecodepicfiles.cpp b/samples/videoDecodePicFiles/videodecodepicfiles.cpp index 1cfc636914..aafa706034 100644 --- a/samples/videoDecodePicFiles/videodecodepicfiles.cpp +++ b/samples/videoDecodePicFiles/videodecodepicfiles.cpp @@ -283,6 +283,7 @@ int main(int argc, char **argv) { for (int i = 0; i < num_iterations; i++) { int num_frames_decoded_in_loop = 0; + pkg_flags = 0; for ( const char* file_name : file_names) { std::ifstream in_file(file_name, std::ios::binary); if (!in_file) { @@ -333,8 +334,8 @@ int main(int argc, char **argv) { break; } } - n_frame += viddec->GetNumOfFlushedFrames(); } + n_frame += viddec->GetNumOfFlushedFrames(); std::cout << "info: Total pictures decoded: " << n_pic_decoded << std::endl; std::cout << "info: Total frames output/displayed: " << n_frame << std::endl;