Skip to content

Commit

Permalink
Revert "Audio PR - Augmentation support [ Spectrogram ] (#1319)"
Browse files Browse the repository at this point in the history
This reverts commit fccd77d.
  • Loading branch information
kiritigowda authored May 17, 2024
1 parent 4f75f11 commit 1305aff
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 332 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Documentation for MIVisionX is available at

* Support for advanced GPUs
* Support for PreEmphasis Filter augmentation in openVX extensions
* Support for Spectrogram augmentation in openVX extensions

### Optimizations

Expand Down
1 change: 0 additions & 1 deletion amd_openvx_extensions/amd_rpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ list(APPEND SOURCES
source/tensor/Saturation.cpp
source/tensor/SequenceRearrange.cpp
source/tensor/Snow.cpp
source/tensor/Spectrogram.cpp
source/tensor/Vignette.cpp
source/tensor/WarpAffine.cpp
source/tensor/SequenceRearrange.cpp
Expand Down
16 changes: 7 additions & 9 deletions amd_openvx_extensions/amd_rpp/include/internal_publishKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ vx_status Snow_Register(vx_context);
vx_status Vignette_Register(vx_context);
vx_status WarpAffine_Register(vx_context);
vx_status SequenceRearrange_Register(vx_context);
vx_status Spectrogram_Register(vx_context);

// kernel names
#define VX_KERNEL_RPP_NOPBATCHPD_NAME "org.rpp.NopbatchPD"
Expand Down Expand Up @@ -275,13 +274,12 @@ vx_status Spectrogram_Register(vx_context);
#define VX_KERNEL_RPP_PIXELATE_NAME "org.rpp.Pixelate"
#define VX_KERNEL_RPP_VIGNETTE_NAME "org.rpp.Vignette"
#define VX_KERNEL_RPP_WARPAFFINE_NAME "org.rpp.WarpAffine"
#define VX_KERNEL_RPP_BRIGHTNESS_NAME "org.rpp.Brightness"
#define VX_KERNEL_RPP_COPY_NAME "org.rpp.Copy"
#define VX_KERNEL_RPP_CROPMIRRORNORMALIZE_NAME "org.rpp.CropMirrorNormalize"
#define VX_KERNEL_RPP_NOP_NAME "org.rpp.Nop"
#define VX_KERNEL_RPP_RESIZE_NAME "org.rpp.Resize"
#define VX_KERNEL_RPP_SEQUENCEREARRANGE_NAME "org.rpp.SequenceRearrange"
#define VX_KERNEL_RPP_PREEMPHASISFILTER_NAME "org.rpp.PreemphasisFilter"
#define VX_KERNEL_RPP_SPECTROGRAM_NAME "org.rpp.Spectrogram"
#define VX_KERNEL_RPP_BRIGHTNESS_NAME "org.rpp.Brightness"
#define VX_KERNEL_RPP_COPY_NAME "org.rpp.Copy"
#define VX_KERNEL_RPP_CROPMIRRORNORMALIZE_NAME "org.rpp.CropMirrorNormalize"
#define VX_KERNEL_RPP_NOP_NAME "org.rpp.Nop"
#define VX_KERNEL_RPP_RESIZE_NAME "org.rpp.Resize"
#define VX_KERNEL_RPP_SEQUENCEREARRANGE_NAME "org.rpp.SequenceRearrange"
#define VX_KERNEL_RPP_PREEMPHASISFILTER_NAME "org.rpp.PreemphasisFilter"

#endif //_AMDVX_EXT__PUBLISH_KERNELS_H_
3 changes: 1 addition & 2 deletions amd_openvx_extensions/amd_rpp/include/kernels_rpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ extern "C"
VX_KERNEL_RPP_SNOW = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x71,
VX_KERNEL_RPP_VIGNETTE = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x72,
VX_KERNEL_RPP_WARPAFFINE = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x73,
VX_KERNEL_RPP_PREEMPHASISFILTER = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x74,
VX_KERNEL_RPP_SPECTROGRAM = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x75
VX_KERNEL_RPP_PREEMPHASISFILTER = VX_KERNEL_BASE(VX_ID_AMD, VX_LIBRARY_RPP) + 0x74
};

#ifdef __cplusplus
Expand Down
20 changes: 0 additions & 20 deletions amd_openvx_extensions/amd_rpp/include/vx_ext_rpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1876,26 +1876,6 @@ extern "C"
* \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 vxExtRppPreemphasisFilter(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_array pPreemphCoeff, vx_scalar borderType);

/*! \brief [Graph] Produces a spectrogram from a 1D signal.
* \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/ltrb 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 output tensor in xywh/ltrb format.
* \param [in] windowFunction The input array in <tt>\ref VX_TYPE_FLOAT32</tt> format containing the samples of the window function that will be multiplied to each extracted window when calculating the STFT.
* \param [in] centerWindow The input scalar in <tt>\ref VX_TYPE_BOOL</tt> format indicates whether extracted windows should be padded so that the window function is centered at multiples of window_step.
* \param [in] reflectPadding The input scalar in <tt>\ref VX_TYPE_BOOL</tt> format indicates the padding policy when sampling outside the bounds of the signal.
* \param [in] spectrogramLayout The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the Output spectrogram layout.
* \param [in] power The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the exponent of the magnitude of the spectrum.
* \param [in] nfft The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing the size of the FFT.
* \param [in] windowLength The input scalar in <tt>\ref VX_TYPE_INT32</tt> format containing Window size in number of samples.
* \param [in] windowStep The input array in <tt>\ref VX_TYPE_INT32</tt> format containing the step between the STFT windows in number of samples.
* \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 vxExtRppSpectrogram(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_array windowFunction, vx_scalar centerWindow, vx_scalar reflectPadding, vx_scalar spectrogramLayout, vx_scalar power, vx_scalar nfft, vx_scalar windowLength, vx_scalar windowStep);

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ vx_status get_kernels_to_publish()
STATUS_ERROR_CHECK(ADD_KERNEL(Snow_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(Vignette_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(WarpAffine_Register));
STATUS_ERROR_CHECK(ADD_KERNEL(Spectrogram_Register));

return status;
}
Expand Down
34 changes: 4 additions & 30 deletions amd_openvx_extensions/amd_rpp/source/kernel_rpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2558,32 +2558,6 @@ VX_API_ENTRY vx_node VX_API_CALL vxExtRppPreemphasisFilter(vx_graph graph, vx_te
return node;
}

VX_API_ENTRY vx_node VX_API_CALL vxExtRppSpectrogram(vx_graph graph, vx_tensor pSrc, vx_tensor pSrcRoi, vx_tensor pDst, vx_tensor pDstRoi, vx_array windowFunction, vx_scalar centerWindows, vx_scalar reflectPadding, vx_scalar spectrogramLayout,
vx_scalar power, vx_scalar nfft, vx_scalar windowLength, vx_scalar windowStep) {
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)windowFunction,
(vx_reference)centerWindows,
(vx_reference)reflectPadding,
(vx_reference)spectrogramLayout,
(vx_reference)power,
(vx_reference)nfft,
(vx_reference)windowLength,
(vx_reference)windowStep,
(vx_reference)deviceType};
node = createNode(graph, VX_KERNEL_RPP_SPECTROGRAM, params, 13);
}
return node;
}

RpptDataType getRpptDataType(vx_enum vxDataType) {
switch(vxDataType) {
case vx_type_e::VX_TYPE_FLOAT32:
Expand Down Expand Up @@ -2653,10 +2627,10 @@ void fillDescriptionPtrfromDims(RpptDescPtr &descPtr, vxTensorLayout layout, siz
}
}

void fillAudioDescriptionPtrFromDims(RpptDescPtr &descPtr, size_t *maxTensorDims) {
descPtr->n = maxTensorDims[0];
descPtr->h = maxTensorDims[1];
descPtr->w = maxTensorDims[2];
void fillAudioDescriptionPtrFromDims(RpptDescPtr &descPtr, size_t *tensorDims) {
descPtr->n = tensorDims[0];
descPtr->h = tensorDims[2];
descPtr->w = tensorDims[1];
descPtr->c = 1;
descPtr->strides.nStride = descPtr->c * descPtr->w * descPtr->h;
descPtr->strides.hStride = descPtr->c * descPtr->w;
Expand Down
Loading

0 comments on commit 1305aff

Please sign in to comment.