mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 04:45:47 -04:00
Initial community commit
This commit is contained in:
20
Src/nsutil/alpha.h
Normal file
20
Src/nsutil/alpha.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
NSUTIL_EXPORT int nsutil_alpha_Premultiply_RGB32(void *image, size_t image_stride, int width, int height);
|
||||
NSUTIL_EXPORT int nsutil_alpha_PremultiplyValue_RGB8(void *image, size_t image_stride, int width, int height, uint8_t alpha);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
30
Src/nsutil/fft.h
Normal file
30
Src/nsutil/fft.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
nsutil_fft_none = 0,
|
||||
nsutil_fft_fast = 1,
|
||||
nsutil_fft_accurate = 2,
|
||||
};
|
||||
|
||||
typedef void *nsutil_fft_t;
|
||||
NSUTIL_EXPORT int nsutil_fft_Create_F32R(nsutil_fft_t *fft, int order, int accuracy);
|
||||
NSUTIL_EXPORT int nsutil_fft_Forward_F32R_IP(nsutil_fft_t fft, float *signal);
|
||||
NSUTIL_EXPORT int nsutil_fft_Destroy_F32R(nsutil_fft_t *fft);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
70
Src/nsutil/iir.cpp
Normal file
70
Src/nsutil/iir.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include "iir.h"
|
||||
#include <ippi.h>
|
||||
#include <ipps.h>
|
||||
#include <ippcc.h>
|
||||
|
||||
/* 32 bit floating point */
|
||||
int nsutil_iir_Create_F32(const float *coefficients, int order, nsutil_iir_t *out_iir)
|
||||
{
|
||||
IppsIIRState_32f *state;
|
||||
ippsIIRInitAlloc_32f(&state, coefficients, order, 0);
|
||||
*out_iir = state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Filter_F32_IP(nsutil_iir_t *iir, float *samples, int num_samples)
|
||||
{
|
||||
ippsIIR_32f_I(samples, num_samples, (IppsIIRState_32f *)iir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Filter_F32(nsutil_iir_t *iir, const float *input, float *output, int num_samples)
|
||||
{
|
||||
ippsIIR_32f(input, output, num_samples, (IppsIIRState_32f *)iir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Reset_F32(nsutil_iir_t *iir)
|
||||
{
|
||||
ippsIIRSetDlyLine_32f((IppsIIRState_32f *)iir, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Destroy_F32(nsutil_iir_t *iir)
|
||||
{
|
||||
ippsIIRFree_32f((IppsIIRState_32f *)iir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 64 bit floating point */
|
||||
int nsutil_iir_Create_F64(const double *coefficients, int order, nsutil_iir_t *out_iir)
|
||||
{
|
||||
IppsIIRState_64f *state;
|
||||
ippsIIRInitAlloc_64f(&state, coefficients, order, 0);
|
||||
*out_iir = state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Filter_F64_IP(nsutil_iir_t *iir, double *samples, int num_samples)
|
||||
{
|
||||
ippsIIR_64f_I(samples, num_samples, (IppsIIRState_64f *)iir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Filter_642(nsutil_iir_t *iir, const double *input, double *output, int num_samples)
|
||||
{
|
||||
ippsIIR_64f(input, output, num_samples, (IppsIIRState_64f *)iir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Reset_F64(nsutil_iir_t *iir)
|
||||
{
|
||||
ippsIIRSetDlyLine_64f((IppsIIRState_64f *)iir, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_iir_Destroy_F64(nsutil_iir_t *iir)
|
||||
{
|
||||
ippsIIRFree_64f((IppsIIRState_64f *)iir);
|
||||
return 0;
|
||||
}
|
32
Src/nsutil/iir.h
Normal file
32
Src/nsutil/iir.h
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
typedef void *nsutil_iir_t;
|
||||
|
||||
|
||||
NSUTIL_EXPORT int nsutil_iir_Create_F32(const float *coefficients, int order, nsutil_iir_t *out_iir);
|
||||
NSUTIL_EXPORT int nsutil_iir_Reset_F32(nsutil_iir_t *iir);
|
||||
NSUTIL_EXPORT int nsutil_iir_Filter_F32_IP(nsutil_iir_t *iir, float *samples, int num_samples);
|
||||
NSUTIL_EXPORT int nsutil_iir_Filter_F32(nsutil_iir_t *iir, const float *input, float *output, int num_samples);
|
||||
NSUTIL_EXPORT int nsutil_iir_Destroy_F32(nsutil_iir_t *iir);
|
||||
|
||||
NSUTIL_EXPORT int nsutil_iir_Create_F64(const double *coefficients, int order, nsutil_iir_t *out_iir);
|
||||
NSUTIL_EXPORT int nsutil_iir_Reset_F64(nsutil_iir_t *iir);
|
||||
NSUTIL_EXPORT int nsutil_iir_Filter_F64_IP(nsutil_iir_t *iir, double *samples, int num_samples);
|
||||
NSUTIL_EXPORT int nsutil_iir_Filter_F64(nsutil_iir_t *iir, const double *input, double *output, int num_samples);
|
||||
NSUTIL_EXPORT int nsutil_iir_Destroy_F64(nsutil_iir_t *iir);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
26
Src/nsutil/image.h
Normal file
26
Src/nsutil/image.h
Normal file
@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
NSUTIL_EXPORT int nsutil_image_CopyFlipped_U8(uint8_t *destination_image, size_t destination_stride, const uint8_t *source_image, size_t source_stride, uint32_t width, uint32_t height);
|
||||
NSUTIL_EXPORT int nsutil_image_Copy_U8(uint8_t *destination_image, size_t destination_stride, const uint8_t *source_image, size_t source_stride, uint32_t width, uint32_t height);
|
||||
NSUTIL_EXPORT int nsutil_image_Convert_RGB24_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height);
|
||||
NSUTIL_EXPORT int nsutil_image_ConvertFlipped_RGB24_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height);
|
||||
NSUTIL_EXPORT int nsutil_image_Recolor_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t R, uint32_t G, uint32_t B, uint32_t width, uint32_t height);
|
||||
NSUTIL_EXPORT int nsutil_image_Palette_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height, const RGB32 *palette);
|
||||
NSUTIL_EXPORT int nsutil_image_PaletteFlipped_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height, const RGB32 *palette);
|
||||
NSUTIL_EXPORT int nsutil_image_FillRectAlpha_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t width, uint32_t height, RGB32 color, int alpha);
|
||||
NSUTIL_EXPORT int nsutil_image_Convert_YUV420_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t width, uint32_t height, const uint8_t *planes[3], const size_t strides[3]);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
283
Src/nsutil/main.cpp
Normal file
283
Src/nsutil/main.cpp
Normal file
@ -0,0 +1,283 @@
|
||||
#ifdef _WIN64
|
||||
#include "../tools/staticlib/ipp_m7.h"
|
||||
#else
|
||||
#include "../tools/staticlib/ipp_px.h"
|
||||
#endif
|
||||
|
||||
#include <ippi.h>
|
||||
#include <ipps.h>
|
||||
#include <ippcc.h>
|
||||
#include "image.h"
|
||||
#include "iir.h"
|
||||
#include "resize.h"
|
||||
#include "alpha.h"
|
||||
#include "fft.h"
|
||||
#include "window.h"
|
||||
#include "pcm.h"
|
||||
#include "stats.h"
|
||||
|
||||
/* naming convension stuff:
|
||||
|
||||
nsutil_<area>_FunctionName_variant()
|
||||
|
||||
U8 - uint8_t data
|
||||
|
||||
destination pointer comes first
|
||||
*/
|
||||
|
||||
int nsutil_image_CopyFlipped_U8(uint8_t *destination_image, size_t destination_stride, const uint8_t *source_image, size_t source_stride, uint32_t width, uint32_t height)
|
||||
{
|
||||
IppiSize roi = { width, height };
|
||||
ippiMirror_8u_C1R(source_image, source_stride, destination_image, destination_stride, roi, ippAxsHorizontal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_Copy_U8(uint8_t *destination_image, size_t destination_stride, const uint8_t *source_image, size_t source_stride, uint32_t width, uint32_t height)
|
||||
{
|
||||
IppiSize roi = { width, height };
|
||||
ippiCopy_8u_C1R(source_image, source_stride, destination_image, destination_stride, roi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_Convert_RGB24_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height)
|
||||
{
|
||||
IppiSize roi = { width, height };
|
||||
ippiCopy_8u_C3AC4R(source_image, source_stride, (Ipp8u *)destination_image, destination_stride, roi);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_ConvertFlipped_RGB24_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height)
|
||||
{
|
||||
#if 1
|
||||
IppiSize roi = { width, height };
|
||||
ippiCopy_8u_C3AC4R(source_image, source_stride, (Ipp8u *)destination_image + destination_stride*(height-1), -destination_stride, roi);
|
||||
return 0;
|
||||
#else
|
||||
IppiSize roi = { width, 1 };
|
||||
uint8_t *dest = (uint8_t *)destination_image;
|
||||
source_image += source_stride * (height-1);
|
||||
for (uint32_t i = 0;i != height;i++)
|
||||
{
|
||||
ippiCopy_8u_C3AC4R(source_image, source_stride, (Ipp8u *)dest, destination_stride, roi);
|
||||
source_image -= source_stride;
|
||||
dest += destination_stride;
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
struct nsutil_resize_context
|
||||
{
|
||||
int buffer_size;
|
||||
void *buffer;
|
||||
};
|
||||
*/
|
||||
|
||||
static inline void MakeIppiRect(IppiRect &ippi_rect, const nsutil_rect *rect)
|
||||
{
|
||||
ippi_rect.x = rect->left;
|
||||
ippi_rect.y = rect->top;
|
||||
ippi_rect.width = rect->right - rect->left;
|
||||
ippi_rect.height = rect->bottom - rect->top;
|
||||
}
|
||||
/*
|
||||
int nsutil_resize_Init_RGB(nsutil_resize_t *_context, const nsutil_rect *destination_rect, const nsutil_rect *source_rect, int resize_algorithm)
|
||||
{
|
||||
nsutil_resize_context *context = 0;
|
||||
if (_context)
|
||||
{
|
||||
context = (nsutil_resize_context *)(*_context);
|
||||
}
|
||||
if (!context)
|
||||
{
|
||||
context = (nsutil_resize_context *)calloc(1, sizeof(nsutil_resize_context));
|
||||
}
|
||||
|
||||
IppiRect srcRoi, dstRoi;
|
||||
MakeIppiRect(srcRoi, source_rect);
|
||||
MakeIppiRect(dstRoi, destination_rect);
|
||||
int buffer_size=0;
|
||||
ippiResizeGetBufSize(srcRoi, dstRoi, 1, resize_algorithm, &buffer_size);
|
||||
if (buffer_size > context->buffer_size)
|
||||
{
|
||||
_aligned_free(context->buffer);
|
||||
context->buffer = _aligned_malloc(buffer_size, 32);
|
||||
context->buffer_size = buffer_size;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_resize_Filter_RGB(nsutil_resize_t _context, void *destination, size_t destination_stride, const nsutil_rect *destination_rect,
|
||||
const void *source, size_t source_stride, int source_width, int source_height, const nsutil_rect *source_rect,
|
||||
double dx, double dy, double x_offset, double y_offset, int resize_algorithm)
|
||||
{
|
||||
nsutil_resize_context *context = (nsutil_resize_context *)_context;
|
||||
|
||||
IppiSize srcSize = { source_width, source_height };
|
||||
IppiRect srcRoi, dstRoi;
|
||||
MakeIppiRect(srcRoi, source_rect);
|
||||
MakeIppiRect(dstRoi, destination_rect);
|
||||
ippiResizeSqrPixel_8u_C1R((const Ipp8u *)source, srcSize, source_stride, srcRoi,
|
||||
(Ipp8u *)destination, destination_stride, dstRoi,
|
||||
dx, dy, x_offset, y_offset,
|
||||
resize_algorithm, (Ipp8u *)context->buffer);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int nsutil_alpha_Premultiply_RGB32(void *image, size_t image_stride, int width, int height)
|
||||
{
|
||||
IppiSize roiSize = { width, height };
|
||||
ippiAlphaPremul_8u_AC4IR((Ipp8u *)image, image_stride, roiSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_alpha_PremultiplyValue_RGB8(void *image, size_t image_stride, int width, int height, uint8_t alpha)
|
||||
{
|
||||
IppiSize roiSize = { width, height };
|
||||
ippiAlphaPremulC_8u_C1IR(alpha, (Ipp8u *)image, image_stride, roiSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct nsutil_fft_struct_F32R
|
||||
{
|
||||
IppsFFTSpec_R_32f *fft_spec;
|
||||
Ipp8u *work_buffer;
|
||||
};
|
||||
int nsutil_fft_Create_F32R(nsutil_fft_t *fft, int order, int accuracy)
|
||||
{
|
||||
nsutil_fft_struct_F32R *ippi_fft = (nsutil_fft_struct_F32R *)calloc(1, sizeof(nsutil_fft_struct_F32R));
|
||||
|
||||
ippsFFTInitAlloc_R_32f(&ippi_fft->fft_spec, order, IPP_FFT_NODIV_BY_ANY, (IppHintAlgorithm)accuracy);
|
||||
int work_buffer_size;
|
||||
ippsFFTGetBufSize_R_32f(ippi_fft->fft_spec, &work_buffer_size);
|
||||
ippi_fft->work_buffer = (Ipp8u *)_aligned_malloc(work_buffer_size, 32);
|
||||
*fft = ippi_fft;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_fft_Forward_F32R_IP(nsutil_fft_t fft, float *signal)
|
||||
{
|
||||
nsutil_fft_struct_F32R *ippi_fft = (nsutil_fft_struct_F32R *)fft;
|
||||
ippsFFTFwd_RToPerm_32f_I(signal, ippi_fft->fft_spec, ippi_fft->work_buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_fft_Destroy_F32R(nsutil_fft_t fft)
|
||||
{
|
||||
nsutil_fft_struct_F32R *ippi_fft = (nsutil_fft_struct_F32R *)fft;
|
||||
ippsFFTFree_R_32f(ippi_fft->fft_spec);
|
||||
_aligned_free(ippi_fft->work_buffer);
|
||||
free(ippi_fft);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_window_Hann_F32_IP(float *signal, size_t number_of_samples)
|
||||
{
|
||||
ippsWinHann_32f_I(signal, number_of_samples);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_window_FillHann_F32_IP(float *window, size_t number_of_samples)
|
||||
{
|
||||
ippsSet_32f(1.0f, window, number_of_samples);
|
||||
ippsWinHann_32f_I(window, number_of_samples);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_window_FillKaiser_F32_IP(float *window, float alpha, size_t number_of_samples)
|
||||
{
|
||||
ippsSet_32f(1.0f, window, number_of_samples);
|
||||
ippsWinKaiser_32f_I(window, number_of_samples, alpha);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_window_Multiply_F32_IP(float *signal, const float *window, size_t number_of_samples)
|
||||
{
|
||||
ippsMul_32f_I(window, signal, number_of_samples);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_Recolor_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t R, uint32_t G, uint32_t B, uint32_t width, uint32_t height)
|
||||
{
|
||||
const Ipp32f twist[3][4] =
|
||||
{
|
||||
{(float)B / 65536.0f, 0, 0, 0},
|
||||
{0, (float)G / 65536.0f, 0, 0},
|
||||
{0, 0, (float)R / 65536.0f, 0}
|
||||
};
|
||||
IppiSize roiSize = { width, height };
|
||||
ippiColorTwist32f_8u_AC4IR((Ipp8u *)destination_image, destination_stride, roiSize, twist);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_Palette_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height, const RGB32 *palette)
|
||||
{
|
||||
IppiSize roiSize = { width, height };
|
||||
ippiLUTPalette_8u32u_C1R(source_image, source_stride, (Ipp32u *)destination_image, destination_stride, roiSize, (const Ipp32u *)palette, 8);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_PaletteFlipped_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, const uint8_t *source_image, size_t source_stride /* bytes! */, uint32_t width, uint32_t height, const RGB32 *palette)
|
||||
{
|
||||
#if 1
|
||||
IppiSize roiSize = { width, height };
|
||||
ippiLUTPalette_8u32u_C1R(source_image, source_stride, (Ipp32u *) ((uint8_t *)destination_image + destination_stride*(height-1)), -destination_stride, roiSize, (const Ipp32u *)palette, 8);
|
||||
return 0;
|
||||
#else
|
||||
IppiSize roiSize = { width, 1 };
|
||||
uint8_t *dest = (uint8_t *)destination_image;
|
||||
source_image += source_stride * (height-1);
|
||||
for (uint32_t i = 0;i != height;i++)
|
||||
{
|
||||
ippiLUTPalette_8u32u_C1R(source_image, source_stride, (Ipp32u *)dest, destination_stride, roiSize, (const Ipp32u *)palette, 8);
|
||||
source_image -= source_stride;
|
||||
dest += destination_stride;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int nsutil_image_FillRectAlpha_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t width, uint32_t height, RGB32 color, int alpha)
|
||||
{
|
||||
|
||||
IppiSize roiSize = { width, height };
|
||||
|
||||
if (alpha == 255)
|
||||
{
|
||||
uint8_t c[3] = {
|
||||
(color&0xFF0000) >> 16,
|
||||
(color&0xFF00) >> 8,
|
||||
(color&0xFF)
|
||||
};
|
||||
ippiSet_8u_AC4R(c, (uint8_t *)destination_image, destination_stride, roiSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t c[3] = {
|
||||
((color&0xFF0000) * alpha / 255) >> 16,
|
||||
((color&0xFF00) * alpha / 255) >> 8,
|
||||
((color&0xFF) * alpha / 255)
|
||||
};
|
||||
|
||||
ippiAlphaPremulC_8u_AC4IR((255-alpha), (uint8_t *)destination_image, destination_stride, roiSize);
|
||||
ippiAddC_8u_AC4IRSfs(c, (uint8_t *)destination_image, destination_stride, roiSize, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_stats_RMS_F32(const float *buffer, size_t num_samples, float *rms)
|
||||
{
|
||||
ippsNorm_L2_32f(buffer, num_samples, rms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_image_Convert_YUV420_RGB32(RGB32 *destination_image, size_t destination_stride /* bytes! */, uint32_t width, uint32_t height, const uint8_t *planes[3], const size_t strides[3])
|
||||
{
|
||||
IppiSize roiSize = { width, height };
|
||||
int int_strides[3] = {strides[0], strides[1], strides[2] };
|
||||
ippiYUV420ToRGB_8u_P3AC4R(planes, int_strides, (Ipp8u *)destination_image, destination_stride, roiSize);
|
||||
return 0;
|
||||
}
|
1
Src/nsutil/nsutil.h
Normal file
1
Src/nsutil/nsutil.h
Normal file
@ -0,0 +1 @@
|
||||
#pragma once
|
76
Src/nsutil/nsutil.rc
Normal file
76
Src/nsutil/nsutil.rc
Normal file
@ -0,0 +1,76 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""version.rc2""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#include "version.rc2"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
31
Src/nsutil/nsutil.sln
Normal file
31
Src/nsutil/nsutil.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29424.173
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsutil", "nsutil.vcxproj", "{DABE6307-F8DD-416D-9DAC-673E2DECB73F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Release|Win32.Build.0 = Release|Win32
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Debug|x64.Build.0 = Debug|x64
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Release|x64.ActiveCfg = Release|x64
|
||||
{DABE6307-F8DD-416D-9DAC-673E2DECB73F}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FC646532-2050-40A5-A2AB-F699F1C071C4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
297
Src/nsutil/nsutil.vcxproj
Normal file
297
Src/nsutil/nsutil.vcxproj
Normal file
@ -0,0 +1,297 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DABE6307-F8DD-416D-9DAC-673E2DECB73F}</ProjectGuid>
|
||||
<RootNamespace>nsutil</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>16.0.32002.118</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<GenerateManifest>false</GenerateManifest>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnableManifest>false</VcpkgEnableManifest>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgConfiguration>Debug</VcpkgConfiguration>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
<VcpkgConfiguration>Debug</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\Wasabi;..\external_dependencies\intel_ipp_6.1.1.035\ia32\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;_WINDOWS;_USRDLL;NSUTIL_EXPORTS;WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ippcorel.lib;ippsemerged.lib;ippsmerged.lib;ippiemerged.lib;ippimerged.lib;ippccmerged.lib;ippccemerged.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalLibraryDirectories>..\external_dependencies\intel_ipp_6.1.1.035\ia32\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\</Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\Wasabi;..\external_dependencies\intel_ipp_6.1.1.035\em64t\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;_WINDOWS;_USRDLL;NSUTIL_EXPORTS;WIN64;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ippcorel.lib;ippsemerged.lib;ippsmerged.lib;ippiemerged.lib;ippimerged.lib;ippccmerged.lib;ippccemerged.lib;ws2_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalLibraryDirectories>..\external_dependencies\intel_ipp_6.1.1.035\em64t\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\</Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>..\Wasabi;..\external_dependencies\intel_ipp_6.1.1.035\ia32\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;_WINDOWS;_USRDLL;NSUTIL_EXPORTS;WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4244;4146;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ippcorel.lib;ippsemerged.lib;ippsmerged.lib;ippiemerged.lib;ippimerged.lib;ippccmerged.lib;ippccemerged.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\external_dependencies\intel_ipp_6.1.1.035\ia32\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol />
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\</Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>..\Wasabi;..\external_dependencies\intel_ipp_6.1.1.035\em64t\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_UNICODE;UNICODE;_WINDOWS;_USRDLL;NSUTIL_EXPORTS;WIN64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4244;4146;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ippcorel.lib;ippsemerged.lib;ippsmerged.lib;ippiemerged.lib;ippimerged.lib;ippccmerged.lib;ippccemerged.lib;ws2_64.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\external_dependencies\intel_ipp_6.1.1.035\em64t\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>msvcprt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<EntryPointSymbol />
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared\</Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Shared'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="alpha.h" />
|
||||
<ClInclude Include="fft.h" />
|
||||
<ClInclude Include="iir.h" />
|
||||
<ClInclude Include="image.h" />
|
||||
<ClInclude Include="nsutil_types.h" />
|
||||
<ClInclude Include="pcm.h" />
|
||||
<ClInclude Include="resize.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="stats.h" />
|
||||
<ClInclude Include="window.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="iir.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="pcm.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="nsutil.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Wasabi\Wasabi.vcxproj">
|
||||
<Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
63
Src/nsutil/nsutil.vcxproj.filters
Normal file
63
Src/nsutil/nsutil.vcxproj.filters
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{358efad8-76b3-46d3-8069-9063b63be205}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{536220be-78f4-4c7f-a285-1259cd429293}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="alpha.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fft.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="iir.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="image.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="nsutil_types.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pcm.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resize.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stats.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="window.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="iir.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pcm.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="nsutil.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
17
Src/nsutil/nsutil_types.h
Normal file
17
Src/nsutil/nsutil_types.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct __nsutil_rect
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
} nsutil_rect;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
312
Src/nsutil/pcm.cpp
Normal file
312
Src/nsutil/pcm.cpp
Normal file
@ -0,0 +1,312 @@
|
||||
#include "pcm.h"
|
||||
#include <math.h>
|
||||
#include <ipps.h>
|
||||
#include <intrin.h>
|
||||
#include <mmintrin.h>
|
||||
|
||||
#define PA_CLIP_( val, min, max )\
|
||||
{ val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); }
|
||||
|
||||
#if defined(_M_IX86)
|
||||
static __inline long float_to_long(double t)
|
||||
{
|
||||
long r;
|
||||
__asm fld t
|
||||
__asm fistp r
|
||||
return r;
|
||||
}
|
||||
#else
|
||||
#define float_to_long(x) ((long)( x ))
|
||||
#endif
|
||||
|
||||
inline static void clip(double &x, double a, double b)
|
||||
{
|
||||
double x1 = fabs (x - a);
|
||||
double x2 = fabs (x - b);
|
||||
x = x1 + (a + b);
|
||||
x -= x2;
|
||||
x *= 0.5;
|
||||
}
|
||||
|
||||
static void Float32_To_Int32_Clip(void *destinationBuffer, const float *src, size_t count, double gain)
|
||||
{
|
||||
int32_t *dest = (int32_t *)destinationBuffer;
|
||||
|
||||
gain*=65536.*32768.;
|
||||
while ( count-- )
|
||||
{
|
||||
/* convert to 32 bit and drop the low 8 bits */
|
||||
double scaled = *src++ * gain;
|
||||
clip( scaled, -2147483648., 2147483647.);
|
||||
signed long temp = (signed long) scaled;
|
||||
*dest++ = temp;
|
||||
}
|
||||
}
|
||||
|
||||
static void Float32_To_Int24_Clip(void *destinationBuffer, const float *src, size_t count, double gain)
|
||||
{
|
||||
unsigned char *dest = (unsigned char*)destinationBuffer;
|
||||
gain*=65536.*32768.;
|
||||
while ( count-- )
|
||||
{
|
||||
/* convert to 32 bit and drop the low 8 bits */
|
||||
double scaled = *src * gain;
|
||||
clip( scaled, -2147483648., 2147483647.);
|
||||
signed long temp = (signed long) scaled;
|
||||
|
||||
dest[0] = (unsigned char)(temp >> 8);
|
||||
dest[1] = (unsigned char)(temp >> 16);
|
||||
dest[2] = (unsigned char)(temp >> 24);
|
||||
|
||||
src++;
|
||||
dest += 3;
|
||||
}
|
||||
}
|
||||
|
||||
static void Float32_To_Int16_Clip(void *destinationBuffer, const float *src, size_t count, double gain)
|
||||
{
|
||||
int16_t *dest = (signed short*)destinationBuffer;
|
||||
|
||||
gain*=32768.0;
|
||||
while ( count-- )
|
||||
{
|
||||
long samp = float_to_long((*src) * gain/* - 0.5*/);
|
||||
|
||||
PA_CLIP_( samp, -0x8000, 0x7FFF );
|
||||
*dest = (int16_t) samp;
|
||||
|
||||
src ++;
|
||||
dest ++;
|
||||
}
|
||||
}
|
||||
|
||||
static void Float32_To_UInt8_Clip(void *destinationBuffer, const float *src, size_t count, double gain)
|
||||
{
|
||||
uint8_t *dest = (uint8_t *)destinationBuffer;
|
||||
|
||||
gain*=128.0;
|
||||
while ( count-- )
|
||||
{
|
||||
long samp = float_to_long((*src) * gain/* - 0.5*/) + 128;
|
||||
|
||||
PA_CLIP_( samp, 0, 255);
|
||||
*dest = (uint8_t) samp;
|
||||
|
||||
src ++;
|
||||
dest ++;
|
||||
}
|
||||
}
|
||||
|
||||
int nsutil_pcm_FloatToInt_Interleaved_Gain(void *pcm, const float *input, int bps, size_t num_samples, float gain)
|
||||
{
|
||||
switch(bps)
|
||||
{
|
||||
case 8:
|
||||
Float32_To_UInt8_Clip(pcm, input, num_samples, gain);
|
||||
return 0;
|
||||
case 16:
|
||||
Float32_To_Int16_Clip(pcm, input, num_samples, gain);
|
||||
return 0;
|
||||
case 24:
|
||||
Float32_To_Int24_Clip(pcm, input, num_samples, gain);
|
||||
return 0;
|
||||
case 32:
|
||||
Float32_To_Int32_Clip(pcm, input, num_samples, gain);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_pcm_FloatToInt_Interleaved(void *pcm, const float *input, int bps, size_t num_samples)
|
||||
{
|
||||
switch(bps)
|
||||
{
|
||||
case 8:
|
||||
Float32_To_UInt8_Clip(pcm, input, num_samples, 1.0f);
|
||||
return 0;
|
||||
case 16:
|
||||
Float32_To_Int16_Clip(pcm, input, num_samples, 1.0f);
|
||||
return 0;
|
||||
case 24:
|
||||
Float32_To_Int24_Clip(pcm, input, num_samples, 1.0f);
|
||||
return 0;
|
||||
case 32:
|
||||
Float32_To_Int32_Clip(pcm, input, num_samples, 1.0f);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_pcm_IntToFloat_Interleaved(float *output, const void *pcm, int bps, size_t num_samples)
|
||||
{
|
||||
switch (bps)
|
||||
{
|
||||
case 8:
|
||||
{
|
||||
unsigned __int8 *samples8 = (unsigned __int8 *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)(samples8[x]-128) * 0.00390625f /* 1/256 */;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
short *samples16 = (short *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)samples16[x] * 0.000030517578125f /* 1/ 32768 */;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
{
|
||||
unsigned __int8 *samples8 = (unsigned __int8 *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
long temp = (((long)samples8[0]) << 8);
|
||||
temp = temp | (((long)samples8[1]) << 16);
|
||||
temp = temp | (((long)samples8[2]) << 24);
|
||||
output[x] = (float)temp * 4.656612873077393e-10f /* 1/2147483648 */;
|
||||
samples8+=3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
{
|
||||
int32_t *samples32 = (int32_t *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)samples32[x] * 4.656612873077393e-10f /* 1/2147483648 */;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_pcm_IntToFloat_Interleaved_Gain(float *output, const void *pcm, int bps, size_t num_samples, float gain)
|
||||
{
|
||||
switch (bps)
|
||||
{
|
||||
case 8:
|
||||
{
|
||||
gain /= 256.0f;
|
||||
uint8_t *samples8 = (uint8_t *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)(samples8[x]-128) * gain;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
gain /= 32768.0f;
|
||||
int16_t *samples16 = (int16_t *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)samples16[x] * gain;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
{
|
||||
gain /= 2147483648.0f;
|
||||
uint8_t *samples8 = (uint8_t *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
long temp = (((long)samples8[0]) << 8);
|
||||
temp = temp | (((long)samples8[1]) << 16);
|
||||
temp = temp | (((long)samples8[2]) << 24);
|
||||
output[x] = (float)temp * gain;
|
||||
samples8+=3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
{
|
||||
gain /= 2147483648.0f;
|
||||
int32_t *samples32 = (int32_t *)pcm;
|
||||
for (size_t x = 0; x != num_samples; x ++)
|
||||
{
|
||||
output[x] = (float)samples32[x] * gain;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_pcm_S8ToS16_Interleaved(int16_t *output, const int8_t *pcm, size_t num_samples)
|
||||
{
|
||||
//__m64 mmx_zero = _mm_setzero_si64();
|
||||
__m128i sse_zero = _mm_setzero_si128();
|
||||
//while (num_samples>7)
|
||||
while (num_samples > 15)
|
||||
{
|
||||
//__m64 mmx_8 = *(const __m64 *)pcm;
|
||||
__m128i sse_8 = *(const __m128i*)pcm;
|
||||
//pcm+=8;
|
||||
pcm += 16;
|
||||
//__m64 mmx_16 = _mm_unpacklo_pi8(mmx_zero, mmx_8);
|
||||
__m128i sse_16 = _mm_unpacklo_epi8(sse_zero, sse_8);
|
||||
//*(__m64 *)output = mmx_16;
|
||||
*(__m128i*)output = sse_16;
|
||||
//output+=4;
|
||||
output += 8;
|
||||
//mmx_16 = _mm_unpackhi_pi8(mmx_zero, mmx_8);
|
||||
sse_16 = _mm_unpackhi_epi8(sse_zero, sse_8);
|
||||
//*(__m64 *)output = mmx_16;
|
||||
*(__m128i *)output = sse_16;
|
||||
//output+=4;
|
||||
output += 8;
|
||||
//num_samples-=8;
|
||||
num_samples-=16;
|
||||
}
|
||||
while(num_samples--)
|
||||
{
|
||||
*output++ = (*pcm++) << 8;
|
||||
}
|
||||
//_mm_empty();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nsutil_pcm_U8ToS16_Interleaved(int16_t *output, const uint8_t *pcm, size_t num_samples)
|
||||
{
|
||||
//__m64 mmx_zero = _mm_setzero_si64();
|
||||
__m128i sse_zero = _mm_setzero_si128();
|
||||
//__m64 mmx_128 = _mm_set1_pi8(-128);
|
||||
__m128i sse_128 = _mm_set1_epi8(-128);
|
||||
//while (num_samples>7)
|
||||
while (num_samples > 15)
|
||||
{
|
||||
//__m64 mmx_8 = *(const __m64*)pcm;
|
||||
__m128i sse_8 = *(const __m128i *)pcm;
|
||||
|
||||
//mmx_8 = _mm_add_pi8(mmx_8, mmx_128);
|
||||
sse_8 = _mm_add_epi8(sse_8, sse_128);
|
||||
|
||||
//pcm+=8;
|
||||
pcm += 16;
|
||||
//__m64 mmx_16 = _mm_unpacklo_pi8(mmx_zero, mmx_8);
|
||||
__m128i sse_16 = _mm_unpacklo_epi8(sse_zero, sse_8);
|
||||
//*(__m64 *)output = mmx_16;
|
||||
*(__m128i*)output = sse_16;
|
||||
//output+=4;
|
||||
output += 8;
|
||||
//mmx_16 = _mm_unpackhi_pi8(mmx_zero, mmx_8);
|
||||
sse_16 = _mm_unpackhi_epi8(sse_zero, sse_8);
|
||||
//*(__m64 *)output = mmx_16;
|
||||
*(__m128i*)output = sse_16;
|
||||
//output+=4;
|
||||
output += 8;
|
||||
//num_samples-=8;
|
||||
num_samples -= 16;
|
||||
}
|
||||
while(num_samples--)
|
||||
{
|
||||
*output++ = (*pcm++ - 128) << 8;
|
||||
}
|
||||
//_mm_empty();
|
||||
return 0;
|
||||
}
|
27
Src/nsutil/pcm.h
Normal file
27
Src/nsutil/pcm.h
Normal file
@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
// this function is for when input buffer is in range from -1.0 to 1.0
|
||||
NSUTIL_EXPORT int nsutil_pcm_FloatToInt_Interleaved_Gain(void *pcm, const float *input, int bps, size_t num_samples, float gain);
|
||||
NSUTIL_EXPORT int nsutil_pcm_FloatToInt_Interleaved(void *pcm, const float *input, int bps, size_t num_samples);
|
||||
NSUTIL_EXPORT int nsutil_pcm_IntToFloat_Interleaved(float *output, const void *pcm, int bps, size_t num_samples);
|
||||
NSUTIL_EXPORT int nsutil_pcm_IntToFloat_Interleaved_Gain(float *output, const void *pcm, int bps, size_t num_samples, float gain);
|
||||
NSUTIL_EXPORT int nsutil_pcm_S8ToS16_Interleaved(int16_t *output, const int8_t *pcm, size_t num_samples);
|
||||
NSUTIL_EXPORT int nsutil_pcm_U8ToS16_Interleaved(int16_t *output, const uint8_t *pcm, size_t num_samples);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
30
Src/nsutil/resize.h
Normal file
30
Src/nsutil/resize.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
#include "nsutil_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
nsutil_resize_nearest_neighbour = 1,
|
||||
nsutil_resize_linear = 2,
|
||||
nsutil_resize_cubic = 4,
|
||||
nsutil_resize_super_sampling = 8,
|
||||
nsutil_resize_edge_subpixel = 0x40000000UL,
|
||||
nsutil_resize_edge_smooth = 0x80000000UL,
|
||||
};
|
||||
typedef void *nsutil_resize_t;
|
||||
//NSUTIL_EXPORT int nsutil_resize_Init_RGB(nsutil_resize_t *_context, const nsutil_rect *destination_rect, const nsutil_rect *source_rect, int resize_algorithm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
14
Src/nsutil/resource.h
Normal file
14
Src/nsutil/resource.h
Normal file
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by nsutil.rc
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
19
Src/nsutil/stats.h
Normal file
19
Src/nsutil/stats.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
NSUTIL_EXPORT int nsutil_stats_RMS_F32(const float *buffer, size_t num_samples, float *rms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
39
Src/nsutil/version.rc2
Normal file
39
Src/nsutil/version.rc2
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
#include "../Winamp/buildType.h"
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION WINAMP_PRODUCTVER
|
||||
PRODUCTVERSION WINAMP_PRODUCTVER
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Winamp SA"
|
||||
VALUE "FileDescription", "Winamp Support Library"
|
||||
VALUE "FileVersion", STR_WINAMP_PRODUCTVER
|
||||
VALUE "InternalName", "nsutil.dll"
|
||||
VALUE "LegalCopyright", "Copyright <20> 2006-2023 Winamp SA"
|
||||
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
|
||||
VALUE "OriginalFilename", "nsutil.dll"
|
||||
VALUE "ProductName", "Winamp Shared Code Library"
|
||||
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
24
Src/nsutil/window.h
Normal file
24
Src/nsutil/window.h
Normal file
@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <bfc/platform/types.h>
|
||||
#include <bfc/platform/export.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef NSUTIL_EXPORTS
|
||||
#define NSUTIL_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define NSUTIL_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
NSUTIL_EXPORT int nsutil_window_Hann_F32_IP(float *signal, size_t number_of_samples);
|
||||
// fills a buffer with multiplier values for a Hann window
|
||||
NSUTIL_EXPORT int nsutil_window_FillHann_F32_IP(float *window, size_t number_of_samples);
|
||||
NSUTIL_EXPORT int nsutil_window_FillKaiser_F32_IP(float *window, float alpha, size_t number_of_samples);
|
||||
NSUTIL_EXPORT int nsutil_window_Multiply_F32_IP(float *signal, const float *window, size_t number_of_samples);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user