-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rocAL - Video_pipeline Support #640
Changes from all commits
42280c0
4049b86
8d24bc3
b3569ff
6753da2
04494a4
832562a
33130da
5ef2d4a
5320bdb
eea3dc4
8650764
1eb7a1e
20d1b5b
cba6494
31b52cf
a0cc89b
8c675bd
766ffe3
d866fe4
ede4f0f
568af0d
889abea
63c4b9e
eba7944
f32037e
d983468
ecc0cea
770f3a7
ee7d2c5
f77d351
e12103b
6939c2a
244829d
7e05dd9
2cf4902
2c1d214
b073050
727f303
429da03
b9c9ae7
5048205
223241a
772acb2
c603152
d7e667d
2d55f7c
a28a343
56f1b1c
a3ca3c5
eb5d4c9
2552de6
8e6ef85
70ff1cc
613234d
f035d59
6155cff
c5302be
20da49b
b852143
118b0b9
17cc8ab
bdbe391
49fff6a
b4c7466
b3e4a0d
5165dc1
5a97fc8
95ea0b3
a1edb0e
359452c
c87c9e9
11659fd
d7f9c11
22ec9c8
4a2f361
fe1d0d4
48aa9a1
2290e8e
190b547
624220e
34914fb
f802a6d
e693832
5c9a548
781c993
a2d4542
b390134
83df371
3ebf762
2e394c5
aa07881
ce60ac6
160b579
0872dae
7e5509d
ac78570
e08a24f
e200cbd
6e48e03
1587ea0
e8e8b6c
40c1ada
ec9856a
9940a98
4d1fbbf
153c9f9
83befc6
79b3a7b
afe2497
9a42e95
1f1066a
abe1b19
0eb3461
65d8334
b40a726
4441a27
949641a
7742f32
44365ec
7baaaca
e48da65
8653c5e
ffff76f
d647cd2
151902c
cdce56f
54f7d2e
376800f
1adc8cc
71fdf34
877e7fd
fdcdfc0
7c8704a
8d33cf6
ba846a0
8349d86
de7d0ad
81c0c49
481afa1
fbba2af
4fc318a
aa88882
4c58d5c
eb1d32a
946184f
7100c36
3424ac8
863b74c
3a25b2a
25ea280
0473568
d23ed98
0fc09f3
3741440
0a18033
1b6121b
9466220
823f67f
4b730e7
092547a
2bd22ff
c2d6c99
c401f60
a84e796
ce84689
5706cb4
0002848
ee5c1d0
90956bf
65177fe
677015a
f40840f
2ed52cd
8584e05
f55f69b
ecb6671
4ede0fe
ffd680e
20d8e98
c7a48fb
5076ae3
525ff6b
5e21f5d
ee1e125
7ea9220
a9fe050
e4101ec
33e7a86
00911bd
46d9174
25e2e19
1427a98
75aaf82
669cbc7
09a53cb
4f69536
20f1bbc
52c4a31
7081864
03fc7d6
0011e82
b42dca3
18a5e98
841bf8b
468868b
e42499f
695f308
e5aa79a
061ba33
78938ac
a62094e
c342ac7
9fea304
bb1551a
07a8f5d
006fb55
762651b
fffa626
518be50
626e014
d70f88b
7c5e03e
7896306
f4f947f
3193ccd
f4a996d
04e9b76
b2e0149
e7697b5
9dd92c4
61f5f5e
1a71876
9e25147
a8adb05
bc8752d
1861a88
6465f74
e7cee59
0c84b02
e5087ec
ee9eefd
bdc3556
3f19b9a
1755d7d
b3deef6
bfacaa2
7e27d90
ce9cc71
8d08eb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
build* | ||
docker_build* | ||
hip_build* | ||
.vscode* | ||
opencv-3.4.0/* | ||
openvx_test_results* | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,6 @@ if(GPU_SUPPORT) | |
find_package(AMDRPP QUIET) | ||
find_package(TurboJpeg QUIET) | ||
find_package(Protobuf QUIET) | ||
# If FFMPEG is found, vx_amd_media is expected to be built as well | ||
find_package(FFmpeg QUIET) | ||
find_package(OpenCV QUIET) | ||
else() | ||
|
@@ -155,7 +154,19 @@ if(${BUILD_RALI}) | |
include/rali_api_meta_data.h | ||
DESTINATION ./include | ||
) | ||
if(FFMPEG_FOUND) | ||
find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h) | ||
find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h) | ||
find_path(SWSCALE_INCLUDE_DIR libswscale/swscale.h) | ||
find_path(AVFORMAT_INCLUDE_DIR libavformat/avformat.h) | ||
endif() | ||
include_directories( | ||
${OpenCL_INCLUDE_DIRS} | ||
${OpenCL_INCLUDE_DIRS}/Headers | ||
${AVUTIL_INCLUDE_DIR} | ||
${AVCODEC_INCLUDE_DIR} | ||
${SWSCALE_INCLUDE_DIR} | ||
${AVFORMAT_INCLUDE_DIR} | ||
${CMAKE_CURRENT_BINARY_DIR} | ||
${TurboJpeg_INCLUDE_DIRS} | ||
${PROTOBUF_INCLUDE_DIRS} | ||
|
@@ -203,17 +214,17 @@ if(${BUILD_RALI}) | |
else() | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC ENABLE_OPENCV=0) | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fopenmp -msse4.2 -mavx2 -Wall -fPIC -pg -pthread -std=c++14") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fopenmp -msse4.2 -mavx2 -Wall -fPIC -pg -pthread -std=c++14 -Wno-deprecated-declarations") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need to use "wno-depracated-.." compile flag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This flag is used to suppress the warnings related to ffmpeg libraries. It was removed unknowingly while resolving merge conflicts. So reverted back. |
||
message("-- ${Green}rocAL - CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}") | ||
|
||
if(NOT FFMPEG_FOUND) | ||
message("-- ${Yellow}rocAL library is going to be built without video decode functionality ${ColourReset}") | ||
target_link_libraries(${PROJECT_NAME} -fPIC ${PROTOBUF_LIBRARIES} lmdb boost_system boost_filesystem turbojpeg openvx vx_rpp ) | ||
target_link_libraries(${PROJECT_NAME} -fPIC ${PROTOBUF_LIBRARIES} lmdb boost_system boost_filesystem turbojpeg openvx vx_rpp) | ||
else() | ||
message("-- ${Green}rocAL library is going to be built with video decode functionality ${ColourReset}") | ||
target_link_libraries(${PROJECT_NAME} -DRALI_VIDEO -fPIC ${PROTOBUF_LIBRARIES} lmdb turbojpeg openvx vx_rpp ) | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC -DRALI_VIDEO) | ||
target_link_libraries(${PROJECT_NAME} -fPIC ${PROTOBUF_LIBRARIES} ${FFMPEG_LIBRARIES} lmdb turbojpeg openvx vx_rpp) | ||
endif() | ||
|
||
if("${BACKEND}" STREQUAL "HIP" AND HIP_FOUND) | ||
target_link_libraries(${PROJECT_NAME} $<TARGET_OBJECTS:rocAL_hip>) | ||
endif() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright (c) 2019 - 2021 Advanced Micro Devices, Inc. All rights reserved. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "video_decoder.h" | ||
|
||
#ifdef RALI_VIDEO | ||
class FFmpegVideoDecoder : public VideoDecoder | ||
{ | ||
public: | ||
//! Default constructor | ||
FFmpegVideoDecoder(); | ||
VideoDecoder::Status Initialize(const char *src_filename) override; | ||
VideoDecoder::Status Decode(unsigned char *output_buffer, unsigned seek_frame_number, size_t sequence_length, size_t stride, int out_width, int out_height, int out_stride, AVPixelFormat out_format) override; | ||
int seek_frame(AVRational avg_frame_rate, AVRational time_base, unsigned frame_number) override; | ||
void release() override; | ||
~FFmpegVideoDecoder() override; | ||
private: | ||
const char *_src_filename = NULL; | ||
AVFormatContext *_fmt_ctx = NULL; | ||
AVCodecContext *_video_dec_ctx = NULL; | ||
AVCodec *_decoder = NULL; | ||
AVStream *_video_stream = NULL; | ||
int _video_stream_idx = -1; | ||
AVPixelFormat _dec_pix_fmt; | ||
int _codec_width, _codec_height; | ||
}; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this file modified for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back.