CTest updates. (#473)

* * rocDecode: Core test updates.
 - Added VP9 test.
 - Added tests for video decode raw sample.
 - Changed test video streams to raw elementary or IVF formats.

* * rocDecode/CTest: Added back mp4 files.

* * rocDecode/CTest: Minor changes based on review comments.

* * rocDecode/CTest: Added stream file installation.

* * rocDecode/CTest: Changed the file back to mp4.

* Add support for VP9 handling in the videoDecodeBatch sample

* add linking with threads for videodecode app

---------

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
This commit is contained in:
jeffqjiangNew
2024-12-06 14:46:30 -05:00
committed by GitHub
parent 91ab3b1577
commit 597b29a7c9
11 changed files with 147 additions and 55 deletions
+8 -1
View File
@@ -63,8 +63,9 @@ endif()
find_package(HIP QUIET)
find_package(FFmpeg QUIET)
find_package(rocDecode QUIET)
find_package(Threads REQUIRED)
if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND)
if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND AND Threads_FOUND)
# HIP
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)
# FFMPEG
@@ -74,6 +75,9 @@ if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND)
# rocDecode and utils
include_directories (${ROCDECODE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../../utils ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/rocvideodecode ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/ffmpegvideodecode)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCDECODE_LIBRARY})
# threads
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} Threads::Threads)
# sample app exe
list(APPEND SOURCES ${PROJECT_SOURCE_DIR} videodecode.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/rocvideodecode/roc_video_dec.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/ffmpegvideodecode/ffmpeg_video_dec.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
@@ -96,4 +100,7 @@ else()
if (NOT ROCDECODE_FOUND)
message(FATAL_ERROR "-- ERROR!: rocDecode Not Found! - please install rocDecode!")
endif()
if (NOT Threads_FOUND)
message(FATAL_ERROR "-- ERROR!: Threads Not Found! - please insatll Threads!")
endif()
endif()
+31 -3
View File
@@ -307,7 +307,7 @@ int main(int argc, char **argv) {
std::cout << "info: Number of threads: " << n_thread << std::endl;
std::vector<std::unique_ptr<VideoDemuxer>> v_demuxer(num_files);
std::unique_ptr<RocVideoDecoder> dec_8bit_avc(nullptr), dec_8bit_hevc(nullptr), dec_10bit_hevc(nullptr), dec_8bit_av1(nullptr), dec_10bit_av1(nullptr);
std::unique_ptr<RocVideoDecoder> dec_8bit_avc(nullptr), dec_8bit_hevc(nullptr), dec_10bit_hevc(nullptr), dec_8bit_av1(nullptr), dec_10bit_av1(nullptr), dec_8bit_vp9(nullptr), dec_10bit_vp9(nullptr);
std::vector<std::unique_ptr<DecoderInfo>> v_dec_info;
ThreadPool thread_pool(n_thread);
@@ -359,6 +359,12 @@ int main(int argc, char **argv) {
} else if (v_dec_info[i]->rocdec_codec_id == rocDecVideoCodec_AV1) {
std::unique_ptr<RocVideoDecoder> dec_8bit_av1(new RocVideoDecoder(v_dec_info[i]->dec_device_id, mem_type, v_dec_info[i]->rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[i]->viddec = std::move(dec_8bit_av1);
} else if (v_dec_info[i]->rocdec_codec_id == rocDecVideoCodec_VP9) {
std::unique_ptr<RocVideoDecoder> dec_8bit_vp9(new RocVideoDecoder(v_dec_info[i]->dec_device_id, mem_type, v_dec_info[i]->rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[i]->viddec = std::move(dec_8bit_vp9);
} else {
ERR("ERROR: codec type is not supported!");
return -1;
}
} else { //bit depth = 10bit
if (v_dec_info[i]->rocdec_codec_id == rocDecVideoCodec_HEVC) {
@@ -367,6 +373,12 @@ int main(int argc, char **argv) {
} else if (v_dec_info[i]->rocdec_codec_id == rocDecVideoCodec_AV1) {
std::unique_ptr<RocVideoDecoder> dec_10bit_av1(new RocVideoDecoder(v_dec_info[i]->dec_device_id, mem_type, v_dec_info[i]->rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[i]->viddec = std::move(dec_10bit_av1);
} else if (v_dec_info[i]->rocdec_codec_id == rocDecVideoCodec_VP9) {
std::unique_ptr<RocVideoDecoder> dec_10bit_vp9(new RocVideoDecoder(v_dec_info[i]->dec_device_id, mem_type, v_dec_info[i]->rocdec_codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[i]->viddec = std::move(dec_10bit_vp9);
} else {
ERR("ERROR: codec type is not supported!");
return -1;
}
}
@@ -399,13 +411,21 @@ int main(int argc, char **argv) {
} else if (dec_8bit_av1 == nullptr && codec_id == rocDecVideoCodec_AV1) {
std::unique_ptr<RocVideoDecoder> dec_8bit_av1(new RocVideoDecoder(v_dec_info[thread_idx]->dec_device_id, mem_type, codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[thread_idx]->viddec = std::move(dec_8bit_av1);
} else if (dec_8bit_av1 == nullptr && codec_id == rocDecVideoCodec_VP9) {
std::unique_ptr<RocVideoDecoder> dec_8bit_vp9(new RocVideoDecoder(v_dec_info[thread_idx]->dec_device_id, mem_type, codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[thread_idx]->viddec = std::move(dec_8bit_vp9);
} else {
if (codec_id == rocDecVideoCodec_AVC) {
v_dec_info[thread_idx]->viddec.swap(dec_8bit_avc);
} else if (codec_id == rocDecVideoCodec_HEVC) {
v_dec_info[thread_idx]->viddec.swap(dec_8bit_hevc);
} else {
} else if (codec_id == rocDecVideoCodec_AV1) {
v_dec_info[thread_idx]->viddec.swap(dec_8bit_av1);
} else if (codec_id == rocDecVideoCodec_VP9) {
v_dec_info[thread_idx]->viddec.swap(dec_8bit_vp9);
} else {
ERR("ERROR: codec type is not supported!");
return -1;
}
}
v_dec_info[thread_idx]->bit_depth = bit_depth;
@@ -417,11 +437,19 @@ int main(int argc, char **argv) {
} else if (dec_10bit_av1 == nullptr && codec_id == rocDecVideoCodec_AV1) {
std::unique_ptr<RocVideoDecoder> dec_10bit_av1(new RocVideoDecoder(v_dec_info[thread_idx]->dec_device_id, mem_type, codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[thread_idx]->viddec = std::move(dec_10bit_av1);
} else if (dec_10bit_vp9 == nullptr && codec_id == rocDecVideoCodec_VP9) {
std::unique_ptr<RocVideoDecoder> dec_10bit_vp9(new RocVideoDecoder(v_dec_info[thread_idx]->dec_device_id, mem_type, codec_id, b_force_zero_latency, p_crop_rect, b_extract_sei_messages, disp_delay));
v_dec_info[thread_idx]->viddec = std::move(dec_10bit_vp9);
} else {
if (codec_id == rocDecVideoCodec_HEVC) {
v_dec_info[thread_idx]->viddec.swap(dec_10bit_hevc);
} else {
} else if (codec_id == rocDecVideoCodec_AV1) {
v_dec_info[thread_idx]->viddec.swap(dec_10bit_av1);
} else if (codec_id == rocDecVideoCodec_VP9) {
v_dec_info[thread_idx]->viddec.swap(dec_10bit_vp9);
} else {
ERR("ERROR: codec type is not supported!");
return -1;
}
}
v_dec_info[thread_idx]->bit_depth = bit_depth;