Skip to content

Commit

Permalink
Audio PR - Augmentation support [ Mel-Filter Bank and Normalize ] (#1326
Browse files Browse the repository at this point in the history
)

* Bump cryptography from 42.0.0 to 42.0.2 in /docs/sphinx (#1289)

Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.0 to 42.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@42.0.0...42.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add PreEmphasis filter support

* Fix ROI - change from xy to width & height

* Adding openvx changes for downmix node

* Audio Augmentations 1 PR - NSR and Spectrogram

* Revert "Adding openvx changes for downmix node"

This reverts commit d53f81d.

* Merging swbs_m2/audio/pr5 into swbs_m3/audio/pr6

* Fixing build issues

* Adding openvx extensions for to_decibels and normalize augmentations

* Commenting out normalize kernel

* Adding openvx extensions for resample and operator overloading nodes

* PR comments resolution in the PreEmphais Filter

* Minor Changes

* Change the borderType enum to int32 from uint32 dtype

* Fix validation of preemphasis

* Remove the memcopy of the src and dest rois as it can be handled in the rocAL - since the src and dst rois remain same

* Formatting change - minor

* Remove NSR

* Minor formatting changes

* Minor fix

* Minor update - remove the 2nd instance of preemphasis filter

* Add openvx extensions for to_decibels augmentations

* Enum dtype - change from uint to int

* Remove roi_tensor_ptr_dst as its unused after latest changes

* Remove the dst_roi arg from vxExtRppPreemphasisFilter call as its unused

* Add MFB to MIVisisonX

* Revert "Add MFB to MIVisisonX"

This reverts commit dc4200b.

* Fixing issues with src ROI

* Resolve the PR comments

* Resolving review comments

* Resolving review comments

* Change the dims[0] and dims[1] positioning for Spectrogram and AudioFillDescPointers

* Removing dstROI from to_decibels openvx augmentation

* Change function name to camelCase

* Resolving review comments

* Revert "Change the dims[0] and dims[1] positioning for Spectrogram and AudioFillDescPointers"

This reverts commit 886d6af.

* Removing normalize node and adding formatting changes

* Fix Spectrogram

* NWC

* Adding resampling window calculation in openvx

* Merge branch 'swbs_m3/audio/pr8' into swbs_m5/audio/pr7

* Adding mel filter bank openvx extensions

* NSR + SLice

* Updating resample node with latest changes

* Resolving review comments

* Fixing ROI issues with TensorTensorAdd node

* Resolving review comments

* Fix Slice

* Remove commented code in Slice.cpp

* Modifying pSrcROI in Resample openvx

* Resolving review comments

* Change the name NonSilentRegion to NonSilentRegionDetection

* Remove the ND kernel layouts

* Adding comments for tensor tensor add openvx node

* Code clean up

* Resolve PR comments - 1

* Change ENUM from UINT to INT

* Minor change in the name of the desc ptr

* Minor changes - resolve PR comments

* Minor changes to remove width usage

* Resolve PR comments

* Minor changes

* Adding changes to normalize openvx node

* Add debug statements for 2D augs

* Minor fixes for Spectrogram and MFB

* Resolve review comments and remove debug prints

* Fix build issue

* Fix srcDims updation in ToDecibels

* Fix Resample and Slice

* Docs - update TOC for API Ref (#1327)

* Temporary Slice fix

* Fix MelFilterBank srcDims updation

* Bump rocm-docs-core[api_reference] from 0.38.0 to 0.38.1 in /docs/sphinx (#1328)

Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.38.0 to 0.38.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.38.0...v0.38.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update CHANGELOG.md

* Update CHANGELOG.md

* Documents - Bump idna from 3.4 to 3.7 in /docs/sphinx (#1330)

Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](kjd/idna@v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix slice layout issue

* Update changelog

* Update changelog

* Update changelog

* Update changelog

* Update changelog

* Resolve minor PR comments

* Remove comments

* Docs - Bump tqdm from 4.65.0 to 4.66.3 in /docs/sphinx (#1339)

Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.65.0 to 4.66.3.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](tqdm/tqdm@v4.65.0...v4.66.3)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Docs - Bump jinja2 from 3.1.3 to 3.1.4 in /docs/sphinx (#1340)

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Find Half - Fix (#1341)

* MIVisionX Setup - Updates (#1343)

* SWDEV-459739 - Remove the package obsolete setting (#1345)

The package was obsoleting itself and was causing upgrade issues.
Removed the same.

* Fix the layout issue with spec

* Add layouts for Audio in vxTensorLayout

Remove spectrogram layout param and pass layout in descriptor

* Check the validity of pointers

* Validate the pointers for NSR and Slice

* Audio PR - Augmentation support [ Spectrogram ] (#1319)

* Bump rocm-docs-core[api_reference] from 0.34.0 to 0.34.2 in /docs/sphinx (#1286)

Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.34.0 to 0.34.2.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.34.0...v0.34.2)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cryptography from 42.0.0 to 42.0.2 in /docs/sphinx (#1289)

Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.0 to 42.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@42.0.0...42.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add PreEmphasis filter support

* Fix ROI - change from xy to width & height

* Adding openvx changes for downmix node

* Audio Augmentations 1 PR - NSR and Spectrogram

* Revert "Adding openvx changes for downmix node"

This reverts commit d53f81d.

* PR comments resolution in the PreEmphais Filter

* Minor Changes

* Change the borderType enum to int32 from uint32 dtype

* Fix validation of preemphasis

* Remove the memcopy of the src and dest rois as it can be handled in the rocAL - since the src and dst rois remain same

* Formatting change - minor

* Remove NSR

* Minor formatting changes

* Minor fix

* Minor update - remove the 2nd instance of preemphasis filter

* Enum dtype - change from uint to int

* Remove roi_tensor_ptr_dst as its unused after latest changes

* Remove the dst_roi arg from vxExtRppPreemphasisFilter call as its unused

* Add MFB to MIVisisonX

* Revert "Add MFB to MIVisisonX"

This reverts commit dc4200b.

* Resolve the PR comments

* Change the dims[0] and dims[1] positioning for Spectrogram and AudioFillDescPointers

* Change function name to camelCase

* Revert "Change the dims[0] and dims[1] positioning for Spectrogram and AudioFillDescPointers"

This reverts commit 886d6af.

* Fix Spectrogram

* Docs - update TOC for API Ref (#1327)

* Bump rocm-docs-core[api_reference] from 0.38.0 to 0.38.1 in /docs/sphinx (#1328)

Bumps [rocm-docs-core[api_reference]](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.38.0 to 0.38.1.
- [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases)
- [Changelog](https://github.com/ROCm/rocm-docs-core/blob/develop/CHANGELOG.md)
- [Commits](ROCm/rocm-docs-core@v0.38.0...v0.38.1)

---
updated-dependencies:
- dependency-name: rocm-docs-core[api_reference]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update CHANGELOG.md

* Update CHANGELOG.md

* Documents - Bump idna from 3.4 to 3.7 in /docs/sphinx (#1330)

Bumps [idna](https://github.com/kjd/idna) from 3.4 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](kjd/idna@v3.4...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update changelog

* Resolve minor PR comments

* Remove comments

* Fix the layout issue with spec

* Check the validity of pointers

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: root <root@ixt-sjc2-54.local.lan>
Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>
Co-authored-by: SundarRajan28 <sundarrajan@multicorewareinc.com>
Co-authored-by: Swetha B S <swetha@multiocrewareinc.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>

* Introduce API to obtain RPP layout

* Add comments

* Resolving review comments

* Resolving review comments

* Resolving review comments

* Resolving review comments

* Resolving review comments

* Fixing build issues

* Minor changes

* Adding spec layout changes to MFBB

* Adding data validity checks

* Removing if blocks for CPU device checks

* Fix the build issue with merge of pr8 into pr9

* Fix Slice kernel changes wrt recent merge

* Minor change - remove NONE layout from MIVisionX

* Use RPP_AUDIO flag to disable RPP audio calls

* Add RPP_AUDIO flag for RPP audio API

* Add RPP_AUDIO flag for RPP audio API

* Add RPP_AUDIO flag for RPP audio API

* Add RPP_AUDIO flag for slice

* Add RPP_AUDIO flag for MFB

* Add RPP_AUDIO flag for Normalize

* Minor fix

* Add Audio flag for PreEmphasis filter

* Revert "Add RPP_AUDIO flag for slice"

This reverts commit 540735f.

* Minor changes

* Revert "Add RPP_AUDIO flag for Normalize"

This reverts commit c2ad7dd.

* Minor fix

* Change map variable name

* Add audio flag for slice

* Add audio flag

* Remove the exit label

* Modify the redundant lines of fillGenericDescPtrFromDims

* Ad the label exit back

* Add validity checks for HIP

* Make the right Copyright change reverted in previous commit

* Add audio flag for slice

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: root <root@ixt-sjc2-54.local.lan>
Co-authored-by: Swetha B S <swetha@mutlicorewareinc.com>
Co-authored-by: Swetha B S <swetha@multicorewareinc.com>
Co-authored-by: SundarRajan28 <sundarrajan@multicorewareinc.com>
Co-authored-by: Swetha B S <swetha@multiocrewareinc.com>
Co-authored-by: fiona-gladwin <fionagladwin@multicorewareinc.com>
Co-authored-by: randyh62 <42045079+randyh62@users.noreply.github.com>
Co-authored-by: swetha097 <59434434+swetha097@users.noreply.github.com>
Co-authored-by: Kiriti Gowda <kiritigowda@gmail.com>
Co-authored-by: raramakr <91213141+raramakr@users.noreply.github.com>
Co-authored-by: Sundar Rajan Vaithiyanathan <99159823+SundarRajan28@users.noreply.github.com>
Co-authored-by: Lakshmi Kumar <lakshmi.kumar@amd.com>
  • Loading branch information
14 people authored Jun 5, 2024
1 parent 798cd4b commit bace985
Show file tree
Hide file tree
Showing 9 changed files with 700 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Documentation for MIVisionX is available at
* Support for Downmix and ToDecibels augmentations in openVX extensions
* Support for Resample augmentation and Operator overloading nodes in openVX extensions
* Support for NonSilentRegion and Slice augmentations in openVX extensions
* Support for Mel-Filter bank and Normalize augmentations in openVX extensions

### Optimizations

Expand Down
2 changes: 2 additions & 0 deletions amd_openvx_extensions/amd_rpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ list(APPEND SOURCES
source/tensor/Hue.cpp
source/tensor/Jitter.cpp
source/tensor/LensCorrection.cpp
source/tensor/MelFilterBank.cpp
source/tensor/Noise.cpp
source/tensor/NonSilentRegionDetection.cpp
source/tensor/Nop.cpp
source/tensor/Normalize.cpp
source/tensor/Rotate.cpp
source/tensor/Pixelate.cpp
source/tensor/PreemphasisFilter.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ vx_status TensorMulScalar_Register(vx_context);
vx_status TensorAddTensor_Register(vx_context);
vx_status NonSilentRegionDetection_Register(vx_context);
vx_status Slice_Register(vx_context);
vx_status Normalize_Register(vx_context);
vx_status MelFilterBank_Register(vx_context);

// kernel names
#define VX_KERNEL_RPP_NOPBATCHPD_NAME "org.rpp.NopbatchPD"
Expand Down Expand Up @@ -297,5 +299,7 @@ vx_status Slice_Register(vx_context);
#define VX_KERNEL_RPP_TENSORADDTENSOR_NAME "org.rpp.TensorAddTensor"
#define VX_KERNEL_RPP_NONSILENTREGIONDETECTION_NAME "org.rpp.NonSilentRegionDetection"
#define VX_KERNEL_RPP_SLICE_NAME "org.rpp.Slice"
#define VX_KERNEL_RPP_NORMALIZE_NAME "org.rpp.Normalize"
#define VX_KERNEL_RPP_MELFILTERBANK_NAME "org.rpp.MelFilterBank"

#endif //_AMDVX_EXT__PUBLISH_KERNELS_H_
2 changes: 2 additions & 0 deletions amd_openvx_extensions/amd_rpp/include/kernels_rpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ extern "C"
VX_KERNEL_RPP_TENSORADDTENSOR = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x7a,
VX_KERNEL_RPP_NONSILENTREGIONDETECTION = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x7b,
VX_KERNEL_RPP_SLICE = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x7c,
VX_KERNEL_RPP_NORMALIZE = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x7d,
VX_KERNEL_RPP_MELFILTERBANK = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x7e
};

#ifdef __cplusplus
Expand Down
39 changes: 39 additions & 0 deletions amd_openvx_extensions/amd_rpp/include/vx_ext_rpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,45 @@ extern "C"
*/
SHARED_PUBLIC vx_node VX_API_CALL vxExtRppSlice(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_tensor pAnchor, vx_tensor pShape, vx_array pFillValue, vx_scalar policy, vx_scalar inputLayout, vx_scalar roiType);

/*! \brief [Graph] Applies mean-stddev normalization to the input tensor.
* \ingroup group_amd_rpp
* \param [in] graph The handle to the graph.
* \param [in] pSrc The input tensor in <tt>\ref VX_TYPE_FLOAT32</tt> format data.
* \param [in] pSrcRoi The input tensor of batch size in <tt>unsigned int<tt> containing the roi values for the input.
* \param [out] pDst The output tensor in <tt>\ref VX_TYPE_FLOAT32</tt> format data.
* \param [in] pDstRoi The input tensor of batch size in <tt>unsigned int<tt> containing the roi values for the output.
* \param [in] axisMask The input array in <tt>\ref VX_TYPE_INT32</tt> format containing axis along which normalization needs to be done
* \param [in] pMean The input array in <tt>\ref VX_TYPE_FLOAT32</tt> format containing values to be subtracted from input
* \param [in] pStddev The input array in <tt>\ref VX_TYPE_FLOAT32</tt> format containing standard deviation values to scale the input
* \param [in] computeMeanAndStddev The input scalar in <tt>\ref VX_TYPE_UINT8</tt> format containing flag to represent internal computation of mean and std dev
* \param [in] scale The input scalar in <tt>\ref VX_TYPE_FLOAT32</tt> format containing value to be multiplied with data after subtracting from mean
* \param [in] shift The input scalar in <tt>\ref VX_TYPE_FLOAT32</tt> format containing value to be added finally
* \param [in] inputLayout The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the layout of the input tensor.
* \param [in] roiType The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the roi type which can be ltrb/xywh.
* \return A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
*/
SHARED_PUBLIC vx_node VX_API_CALL vxExtRppNormalize(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_scalar axis_mask, vx_array pMean, vx_array pStddev, vx_scalar computeMeanAndStddev, vx_scalar scale, vx_scalar shift, vx_scalar inputLayout, vx_scalar roiType);

/*! \brief [Graph] Produces a mel-spectrogram from spectrogram on applying a bank of triangular filters
* \ingroup group_amd_rpp
* \param [in] graph The handle to the graph.
* \param [in] pSrc The input tensor in <tt>\ref VX_TYPE_FLOAT32</tt> format data.
* \param [in] pSrcRoi The input tensor of batch size in <tt>unsigned int<tt> containing the roi values for the input in xywh (w- samples, h - channels) format.
* \param [out] pDst The output tensor (begin) in <tt>\ref VX_TYPE_FLOAT32</tt> format data.
* \param [in] pDstRoi The input tensor of batch size in <tt>unsigned int<tt> containing the roi values for the input in xywh (w- samples, h - channels) format.
* \param [in] freqHigh The input scalar in <tt>\ref VX_TYPE_FLOAT32</tt> format containing the maximum frequency.
* \param [in] freqLow The input scalar in <tt>\ref VX_TYPE_FLOAT32</tt> format containing the minimum frequency.
* \param [in] melFormula The input scalar in <tt>\ref VX_TYPE_INT32</tt> format indicates the formula used to convert frequencies from hertz to mel and vice versa.
* \param [in] nfilter The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the number of mel filters.
* \param [in] normalize The input scalar in <tt>\ref VX_TYPE_BOOL</tt> format to determine weather to normalize the triangular filter weights by the width of the frequecny bands.
* \param [in] sampleRate The input scalar in <tt>\ref VX_TYPE_FLOAT32</tt> format containing the sampling rate of the audio data.
* \param [in] inputLayout The input layout in <tt>\ref VX_TYPE_INT32</tt> denotes the layout of input tensor.
* \param [in] outputLayout The output layout in <tt>\ref VX_TYPE_INT32</tt> denotes the layout of output tensor.
* \return A node reference <tt>\ref vx_node</tt>. Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
*/
SHARED_PUBLIC vx_node VX_API_CALL vxExtRppMelFilterBank(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_scalar freqHigh, vx_scalar freqLow,
vx_scalar melFormula, vx_scalar nfilter, vx_scalar normalize, vx_scalar sampleRate, vx_scalar inputLayout, vx_scalar outputLayout);

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ vx_status get_kernels_to_publish()
STATUS_ERROR_CHECK(ADD_KERNEL(TensorAddTensor_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(NonSilentRegionDetection_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(Slice_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(Normalize_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(MelFilterBank_Register));
return status;
}

Expand Down
53 changes: 53 additions & 0 deletions amd_openvx_extensions/amd_rpp/source/kernel_rpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2721,6 +2721,59 @@ VX_API_ENTRY vx_node VX_API_CALL vxExtRppTensorAddTensor(vx_graph graph, vx_tens
return node;
}

VX_API_ENTRY vx_node VX_API_CALL vxExtRppNormalize(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi,
vx_scalar axis_mask, vx_array pMean, vx_array pStddev, vx_scalar computeMeanAndStdDev,
vx_scalar scale, vx_scalar shift, vx_scalar inputLayout, vx_scalar roiType) {
vx_node node = NULL;
vx_context context = vxGetContext((vx_reference)graph);
if (vxGetStatus((vx_reference)context) == VX_SUCCESS) {
vx_uint32 devType = getGraphAffinity(graph);
vx_scalar deviceType = vxCreateScalar(vxGetContext((vx_reference)graph), VX_TYPE_UINT32, &devType);
vx_reference params[] = {
(vx_reference)pSrc,
(vx_reference)pSrcRoi,
(vx_reference)pDst,
(vx_reference)pDstRoi,
(vx_reference)axis_mask,
(vx_reference)pMean,
(vx_reference)pStddev,
(vx_reference)computeMeanAndStdDev,
(vx_reference)scale,
(vx_reference)shift,
(vx_reference)inputLayout,
(vx_reference)roiType,
(vx_reference)deviceType};
node = createNode(graph, VX_KERNEL_RPP_NORMALIZE, params, 13);
}
return node;
}

VX_API_ENTRY vx_node VX_API_CALL vxExtRppMelFilterBank(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_scalar freqHigh, vx_scalar freqLow, vx_scalar melFormula,
vx_scalar nfilter, vx_scalar normalize, vx_scalar sampleRate, vx_scalar inputLayout, vx_scalar outputLayout) {
vx_node node = NULL;
vx_context context = vxGetContext((vx_reference)graph);
if (vxGetStatus((vx_reference)context) == VX_SUCCESS) {
vx_uint32 devtype = getGraphAffinity(graph);
vx_scalar deviceType = vxCreateScalar(vxGetContext((vx_reference)graph), VX_TYPE_UINT32, &devtype);
vx_reference params[] = {
(vx_reference)pSrc,
(vx_reference)pSrcRoi,
(vx_reference)pDst,
(vx_reference)pDstRoi,
(vx_reference)freqHigh,
(vx_reference)freqLow,
(vx_reference)melFormula,
(vx_reference)nfilter,
(vx_reference)normalize,
(vx_reference)sampleRate,
(vx_reference)inputLayout,
(vx_reference)outputLayout,
(vx_reference)deviceType};
node = createNode(graph, VX_KERNEL_RPP_MELFILTERBANK, params, 13);
}
return node;
}

RpptDataType getRpptDataType(vx_enum vxDataType) {
switch(vxDataType) {
case vx_type_e::VX_TYPE_FLOAT32:
Expand Down
Loading

0 comments on commit bace985

Please sign in to comment.