* * 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]
Этот коммит содержится в:
jeffqjiangNew
2023-11-27 13:03:26 -05:00
коммит произвёл GitHub
родитель 049100d761
Коммит 7035965722
4 изменённых файлов: 89 добавлений и 51 удалений
+6 -1
Просмотреть файл
@@ -130,6 +130,7 @@ int main(int argc, char **argv) {
int n_video_bytes = 0, n_frame_returned = 0, n_frame = 0;
uint8_t *pvideo = nullptr;
int pkg_flags = 0;
uint8_t *pframe = nullptr;
int64_t pts = 0;
OutputSurfaceInfo *surf_info;
@@ -139,7 +140,11 @@ int main(int argc, char **argv) {
do {
auto start_time = std::chrono::high_resolution_clock::now();
demuxer.Demux(&pvideo, &n_video_bytes, &pts);
n_frame_returned = viddec.DecodeFrame(pvideo, n_video_bytes, 0, pts);
// Treat 0 bitstream size as end of stream indicator
if (n_video_bytes == 0) {
pkg_flags |= ROCDEC_PKT_ENDOFSTREAM;
}
n_frame_returned = viddec.DecodeFrame(pvideo, n_video_bytes, pkg_flags, pts);
auto end_time = std::chrono::high_resolution_clock::now();
auto time_per_frame = std::chrono::duration<double, std::milli>(end_time - start_time).count();
total_dec_time += time_per_frame;