-
Notifications
You must be signed in to change notification settings - Fork 15
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
Audio PR - rocAL Audio decoder support #118
Merged
Merged
Changes from all commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
be883dc
Audio Decoder PR 1
b180b78
channge image_info to sample_info to maintain a generic name for all …
3863a62
Merge branch 'generic-name-change' into swbs/audio/pr1
swetha097 853ea8e
Change the copyright year from 2023 to 2024
3bdcf8e
formatting the files
bc34817
Resolve PR comments
a6c5727
Resolve PR comments
89fd4cb
Change decoded_img_info to decoded_video_info
5f627b2
Change the file_path() function to virtual from pure virtual
97d0628
Minor change
6d53e57
Minor changes
e79cc06
Add the unit test file
9b7e839
Revert "Add the unit test file"
a52ae62
Introduce CMake for sndfile
fiona-gladwin 2d6eaa5
Resolve 1st set of PR commenst
d248676
Merge remote-tracking branch 'swe_fork/swbs/audio/pr1' into swbs/audi…
eac59e3
Remove commented code for last batch polices and unsued imports
ab165ee
ROI related changes - change from xy to wh to use for samples and cha…
e2fe45c
Fix seg fault with ROI
e5ff5e4
Remove opencv usage from the unit test
3988643
Resolve the PR comments
8790f57
Remove instances of the audio_*_time - use the existing variables fro…
8134705
Formatting changes in rocal_api_data_loader.cpp and add the opencl an…
e37bcad
Resolve the internal PR comments
760ba3a
Reformatting the file_source_reader.cpp
2534ca9
Remove _input_path from audio_source_evaluator and audio_read_and_dec…
73f8a31
Change the header formatting
6feedda
Changes in copy_data() for audio samples
c3babe0
Initialize the status at the beginning
3d1bbc0
Cmake related changes for audio
a0c3b9e
Resolve PR comments
ca06049
Add condition check to eliminate any other file extensions other than…
5527cc0
Update audio_read_and_decode.cpp
swetha097 0b058bb
Revert file source reader changes
fiona-gladwin 18a8a83
Update master_graph.cpp
swetha097 e5f3840
Update tensor.cpp - Remove a commented line of code
swetha097 a8507bf
Introduce ROCAL_AUDIO flag
fiona-gladwin 421cc29
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
fiona-gladwin ea6158b
Minor changes
fiona-gladwin 4874e4f
Minor changes
fiona-gladwin 75c360f
Add output comparision for Audio outputs
swetha097 38dc894
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
swetha097 13ea715
Minor changes
fiona-gladwin 033f967
Minor changes to unit test
fiona-gladwin f4bf553
Remove max_frames and max_channels args
fiona-gladwin 1e6240a
Remove max_frames, max_channels and sample rate from unit test
fiona-gladwin d6f60ac
Minor change
fiona-gladwin b9a39a9
Add python script to run audio unittests
swetha097 6018273
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
swetha097 08cf352
Clean up C++ audio unit test
fiona-gladwin 7789333
Modify rocal audio unit test
fiona-gladwin 741a677
Minor change
fiona-gladwin 2150bbc
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin e1eda57
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
fiona-gladwin ebb6212
Minor change
fiona-gladwin db7f126
Minor variable name change
fiona-gladwin 87ab2c3
Minor changes
fiona-gladwin e21d617
Update C++ unit test
fiona-gladwin c9a6dbb
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin ca6f311
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin 8d34902
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin ffb284d
Name change from sample to data
ff12843
Merge branch 'generic-name-change' of https://github.com/swetha097/ro…
e53388f
Change from decoded_data_info to DecodedDataInfo
0774f69
Remove audio_decoder_factory.cpp file
fiona-gladwin 90b9d83
Minor change
fiona-gladwin 531e5fb
Change variable name
fiona-gladwin 98ce527
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin 7d4c1fd
Update the struct variable name in audio files
fiona-gladwin a9e6497
Minor changes
fiona-gladwin 85d21e6
Change ROCAL_DATA_PATH to exclude rocal_data
fiona-gladwin 3a86507
Use Pascal case for function names in audio decoder
fiona-gladwin 7f46a25
Modify cmake to have SNDFILE in all capital
fiona-gladwin 70aa700
Minor changes
fiona-gladwin 0693605
Add struct for audio info in AudioReadAndDecode
fiona-gladwin 44e654d
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin c77140c
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin f96a92b
Fix merge conflict
fiona-gladwin 91d0615
Renaming crop_image_info to CropImageInfo
swetha097 bb4e5a5
Remove - actual_host_buffers - Unused
swetha097 50829f6
Rename TimingDBG to TimingDbg
swetha097 d0a456b
Move the instances of DecodedDataInfo to its base class LoaderModule
swetha097 a80a3a6
Fix a WRN msg in master_graph.cpp
swetha097 f648feb
Remove a dangling comment
swetha097 6146bac
Rename _circ_data_info to _circ_buff_data_info
swetha097 47263d9
Add Glob to CMakeLists.txt
fiona-gladwin 8623be3
Rename SndFileDecoder to GenericAudioDecoder
fiona-gladwin c4af22c
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin 5b9be3d
Merge branch 'generic-name-change' of https://github.com/swetha097/ro…
fiona-gladwin 47dea85
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin 660071b
Fix build issues
fiona-gladwin 4f9ab6b
Minor change
fiona-gladwin 0f0be88
Update audio unit test README
fiona-gladwin e496f3a
Revert "Add Glob to CMakeLists.txt"
fiona-gladwin 5df0055
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin 7dc7092
Fix include headers for Audio files
fiona-gladwin 19e30cf
Fix copy data 2D
fiona-gladwin 4c02dfb
Minor changes
fiona-gladwin e3f350f
Pass decoded data info to load routine instead of separate vectors
fiona-gladwin 67cda83
Update CHANGELOG.md
fiona-gladwin 8b1c59f
Change swap_handle_time variable name in loader
fiona-gladwin 91fed39
Formatting changes
fiona-gladwin 6a80714
Update doxygen comments
fiona-gladwin 689985d
Move file source reader from readers/image to readers folder
fiona-gladwin d000af0
Update README for audio test
fiona-gladwin 7415447
Minor fix
fiona-gladwin f6bffef
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin 689c55f
Minor changes shard_count argument name
fiona-gladwin 1079d50
Rename set and get functions of data_info to decoded_data_info
fiona-gladwin d928c48
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin df5c0d3
Merge branch 'develop' into swbs/audio/pr1
rrawther File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
################################################################################ | ||
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2024 Advanced Micro Devices, Inc. | ||
# | ||
# 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. | ||
# | ||
################################################################################ | ||
find_path(SNDFILE_INCLUDE_DIRS | ||
NAMES sndfile.h | ||
HINTS | ||
$ENV{SNDFILE_PATH}/include | ||
PATHS | ||
/usr/local/include | ||
/usr/include | ||
) | ||
mark_as_advanced(SNDFILE_INCLUDE_DIRS) | ||
|
||
find_library(SNDFILE_LIBRARIES | ||
NAMES sndfile libsndfile | ||
HINTS | ||
$ENV{SNDFILE_PATH}/lib | ||
$ENV{SNDFILE_PATH}/lib64 | ||
PATHS | ||
${CMAKE_SYSTEM_PREFIX_PATH} | ||
${SNDFILE_PATH} | ||
/usr/local/ | ||
PATH_SUFFIXES lib lib64 | ||
) | ||
mark_as_advanced(SNDFILE_LIBRARIES) | ||
|
||
if(SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS) | ||
set(SNDFILE_FOUND TRUE) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(SndFile | ||
FOUND_VAR SNDFILE_FOUND | ||
REQUIRED_VARS | ||
SNDFILE_LIBRARIES | ||
SNDFILE_INCLUDE_DIRS | ||
) | ||
|
||
set(SNDFILE_FOUND ${SNDFILE_FOUND} CACHE INTERNAL "") | ||
set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARIES} CACHE INTERNAL "") | ||
set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIRS} CACHE INTERNAL "") | ||
|
||
if(SNDFILE_FOUND) | ||
message("-- ${White}Using SndFile -- \n\tLibraries:${SNDFILE_LIBRARIES} \n\tIncludes:${SNDFILE_INCLUDE_DIRS}${ColourReset}") | ||
else() | ||
message( "-- ${Yellow}NOTE: FindSndFile failed to find -- SndFile${ColourReset}" ) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright (c) 2024 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 <cstddef> | ||
#include <vector> | ||
|
||
#ifdef ROCAL_AUDIO | ||
#include "sndfile.h" | ||
LakshmiKumar23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
class AudioDecoder { | ||
public: | ||
enum class Status { | ||
OK = 0, | ||
HEADER_DECODE_FAILED, | ||
CONTENT_DECODE_FAILED, | ||
UNSUPPORTED, | ||
FAILED, | ||
NO_MEMORY | ||
}; | ||
virtual AudioDecoder::Status Initialize(const char* src_filename) = 0; | ||
virtual AudioDecoder::Status Decode(float* buffer) = 0; | ||
virtual AudioDecoder::Status DecodeInfo(int* samples, int* channels, float* sample_rates) = 0; | ||
virtual void Release() = 0; | ||
virtual ~AudioDecoder() = default; | ||
|
||
protected: | ||
SF_INFO _sfinfo; | ||
LakshmiKumar23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SNDFILE* _sf_ptr; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright (c) 2024 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 "decoders/audio/audio_decoder.h" | ||
#include "decoders/audio/generic_audio_decoder.h" | ||
|
||
#ifdef ROCAL_AUDIO | ||
static std::shared_ptr<AudioDecoder> create_audio_decoder(DecoderConfig config) { | ||
switch (config.type()) { | ||
case DecoderType::AUDIO_SOFTWARE_DECODE: | ||
return std::make_shared<GenericAudioDecoder>(); | ||
default: | ||
THROW("Unsupported decoder type " + TOSTR(config.type())); | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Copyright (c) 2024 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 "decoders/audio/audio_decoder.h" | ||
|
||
#ifdef ROCAL_AUDIO | ||
class GenericAudioDecoder : public AudioDecoder { | ||
public: | ||
//! Default constructor | ||
GenericAudioDecoder(); | ||
AudioDecoder::Status Initialize(const char* src_filename) override; | ||
AudioDecoder::Status Decode(float* buffer) override; | ||
AudioDecoder::Status DecodeInfo(int* samples, int* channels, float* sample_rates) override; | ||
void Release() override; | ||
~GenericAudioDecoder() override; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
Copyright (c) 2024 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 <string> | ||
#include <thread> | ||
#include <vector> | ||
|
||
#include "loaders/audio/audio_read_and_decode.h" | ||
#include "loaders/circular_buffer.h" | ||
#include "pipeline/commons.h" | ||
#include "meta_data/meta_data_reader.h" | ||
|
||
#ifdef ROCAL_AUDIO | ||
|
||
// AudioLoader runs an internal thread for loading and decoding of audios asynchronously | ||
// It uses a circular buffer to store decoded audios for the user | ||
class AudioLoader : public LoaderModule { | ||
public: | ||
explicit AudioLoader(void* dev_resources); | ||
~AudioLoader() override; | ||
LoaderModuleStatus load_next() override; | ||
LakshmiKumar23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
void initialize(ReaderConfig reader_cfg, DecoderConfig decoder_cfg, RocalMemType mem_type, unsigned batch_size, bool keep_orig_size = false) override; | ||
void set_output(Tensor* output_audio) override; | ||
size_t remaining_count() override; // returns number of remaining items to be loaded | ||
void reset() override; // Resets the loader to load from the beginning of the media | ||
Timing timing() override; | ||
void start_loading() override; | ||
LoaderModuleStatus set_cpu_affinity(cpu_set_t cpu_mask); | ||
LoaderModuleStatus set_cpu_sched_policy(struct sched_param sched_policy); | ||
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. Are we using these functions in audio? 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. Yes, They are being used here link |
||
std::vector<std::string> get_id() override; | ||
DecodedDataInfo get_decode_data_info() override; | ||
void set_prefetch_queue_depth(size_t prefetch_queue_depth) override; | ||
void set_gpu_device_id(int device_id); | ||
void shut_down() override; | ||
void feed_external_input(const std::vector<std::string>& input_images_names, const std::vector<unsigned char*>& input_buffer, | ||
const std::vector<ROIxywh>& roi_xywh, unsigned int max_width, unsigned int max_height, unsigned int channels, | ||
ExternalSourceFileMode mode, bool eos) override { THROW("external source feed is not supported in audio loader") } | ||
|
||
private: | ||
bool is_out_of_data(); | ||
void de_init(); | ||
void stop_internal_thread(); | ||
LoaderModuleStatus update_output_audio(); | ||
LoaderModuleStatus load_routine(); | ||
std::shared_ptr<AudioReadAndDecode> _audio_loader; | ||
Tensor* _output_tensor; | ||
std::vector<std::string> _output_names; // audio file name/ids that are stored in the _output_audio | ||
MetaDataBatch* _meta_data = nullptr; // The output of the meta_data_graph | ||
bool _internal_thread_running; | ||
size_t _output_mem_size, _batch_size, _max_decoded_samples, _max_decoded_channels; | ||
std::thread _load_thread; | ||
RocalMemType _mem_type; | ||
DecodedDataInfo _decoded_audio_info; | ||
DecodedDataInfo _output_decoded_audio_info; | ||
CircularBuffer _circ_buff; | ||
TimingDbg _swap_handle_time; | ||
bool _is_initialized; | ||
bool _stopped = false; | ||
bool _loop; // If true the reader will wrap around at the end of the media (files/audios/...) and wouldn't stop | ||
size_t _prefetch_queue_depth = 0; // Used for circular buffer's internal buffer allocation | ||
size_t _audio_counter = 0; // How many audios have been loaded already | ||
size_t _remaining_audio_count; // How many audios are there yet to be loaded | ||
int _device_id; | ||
}; | ||
#endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can the shard_count be greater than 1? This function is singleShard
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.
The reader requires the num of shards in the pipeline to split dataset.
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 the shard_count used without shard_id?
We used to use internal_shard_count before which is not used anymore. So shard_count is not needed for this API