Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
6817dc84
Commit
6817dc84
authored
Jan 18, 2020
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange some function parameters.
parent
f22ad849
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
research/ma_resampler.h
research/ma_resampler.h
+18
-18
No files found.
research/ma_resampler.h
View file @
6817dc84
...
@@ -89,7 +89,7 @@ It is an error for [pFramesOut] to be non-NULL and [pFrameCountOut] to be NULL.
...
@@ -89,7 +89,7 @@ It is an error for [pFramesOut] to be non-NULL and [pFrameCountOut] to be NULL.
It is an error for both [pFrameCountOut] and [pFrameCountIn] to be NULL.
It is an error for both [pFrameCountOut] and [pFrameCountIn] to be NULL.
*/
*/
ma_result
ma_resampler_process
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
);
ma_result
ma_resampler_process
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
);
#endif
/* ma_resampler_h */
#endif
/* ma_resampler_h */
...
@@ -202,7 +202,7 @@ void ma_resampler_uninit(ma_resampler* pResampler)
...
@@ -202,7 +202,7 @@ void ma_resampler_uninit(ma_resampler* pResampler)
#endif
#endif
}
}
static
ma_result
ma_resampler_process__seek__linear
(
ma_resampler
*
pResampler
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__seek__linear
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
ma_uint64
*
pFrameCountOut
)
{
{
MA_ASSERT
(
pResampler
!=
NULL
);
MA_ASSERT
(
pResampler
!=
NULL
);
...
@@ -227,13 +227,13 @@ static ma_result ma_resampler_process__seek__linear(ma_resampler* pResampler, ma
...
@@ -227,13 +227,13 @@ static ma_result ma_resampler_process__seek__linear(ma_resampler* pResampler, ma
return
MA_SUCCESS
;
return
MA_SUCCESS
;
}
}
static
ma_result
ma_resampler_process__seek__linear_lpf
(
ma_resampler
*
pResampler
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__seek__linear_lpf
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
ma_uint64
*
pFrameCountOut
)
{
{
/* TODO: Proper linear LPF implementation. */
/* TODO: Proper linear LPF implementation. */
return
ma_resampler_process__seek__linear
(
pResampler
,
pFrame
CountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__seek__linear
(
pResampler
,
pFrame
sIn
,
pFrameCountIn
,
pFrameCountOut
);
}
}
static
ma_result
ma_resampler_process__seek
(
ma_resampler
*
pResampler
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__seek
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
ma_uint64
*
pFrameCountOut
)
{
{
MA_ASSERT
(
pResampler
!=
NULL
);
MA_ASSERT
(
pResampler
!=
NULL
);
...
@@ -241,19 +241,19 @@ static ma_result ma_resampler_process__seek(ma_resampler* pResampler, ma_uint64*
...
@@ -241,19 +241,19 @@ static ma_result ma_resampler_process__seek(ma_resampler* pResampler, ma_uint64*
{
{
case
ma_resample_algorithm_linear
:
case
ma_resample_algorithm_linear
:
{
{
return
ma_resampler_process__seek__linear
(
pResampler
,
pFrame
CountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__seek__linear
(
pResampler
,
pFrame
sIn
,
pFrameCountIn
,
pFrameCountOut
);
}
break
;
}
break
;
case
ma_resample_algorithm_linear_lpf
:
case
ma_resample_algorithm_linear_lpf
:
{
{
return
ma_resampler_process__seek__linear_lpf
(
pResampler
,
pFrame
CountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__seek__linear_lpf
(
pResampler
,
pFrame
sIn
,
pFrameCountIn
,
pFrameCountOut
);
}
break
;
}
break
;
default:
return
MA_INVALID_ARGS
;
/* Should never hit this. */
default:
return
MA_INVALID_ARGS
;
/* Should never hit this. */
}
}
}
}
static
ma_result
ma_resampler_process__read__linear
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__read__linear
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
)
{
{
ma_uint64
frameCountOut
;
ma_uint64
frameCountOut
;
ma_uint64
frameCountIn
;
ma_uint64
frameCountIn
;
...
@@ -390,7 +390,7 @@ static ma_result ma_resampler_process__read__linear(ma_resampler* pResampler, vo
...
@@ -390,7 +390,7 @@ static ma_result ma_resampler_process__read__linear(ma_resampler* pResampler, vo
return
MA_SUCCESS
;
return
MA_SUCCESS
;
}
}
static
ma_result
ma_resampler_process__read__linear_lpf
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__read__linear_lpf
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
)
{
{
/* To do this we just read using the non-filtered linear pipeline, and then do an in-place filter on the output buffer. */
/* To do this we just read using the non-filtered linear pipeline, and then do an in-place filter on the output buffer. */
ma_result
result
;
ma_result
result
;
...
@@ -401,7 +401,7 @@ static ma_result ma_resampler_process__read__linear_lpf(ma_resampler* pResampler
...
@@ -401,7 +401,7 @@ static ma_result ma_resampler_process__read__linear_lpf(ma_resampler* pResampler
MA_ASSERT
(
pFramesIn
!=
NULL
);
MA_ASSERT
(
pFramesIn
!=
NULL
);
MA_ASSERT
(
pFrameCountIn
!=
NULL
);
MA_ASSERT
(
pFrameCountIn
!=
NULL
);
result
=
ma_resampler_process__read__linear
(
pResampler
,
pFrames
Out
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
result
=
ma_resampler_process__read__linear
(
pResampler
,
pFrames
In
,
pFrameCountIn
,
pFramesOut
,
pFrameCountOut
);
if
(
result
!=
MA_SUCCESS
)
{
if
(
result
!=
MA_SUCCESS
)
{
return
result
;
return
result
;
}
}
...
@@ -415,7 +415,7 @@ static ma_result ma_resampler_process__read__linear_lpf(ma_resampler* pResampler
...
@@ -415,7 +415,7 @@ static ma_result ma_resampler_process__read__linear_lpf(ma_resampler* pResampler
}
}
#if defined(MA_HAS_SPEEX_RESAMPLER)
#if defined(MA_HAS_SPEEX_RESAMPLER)
static
ma_result
ma_resampler_process__read__speex
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__read__speex
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
)
{
{
/* To do this we just read using the non-filtered linear pipeline, and then do an in-place filter on the output buffer. */
/* To do this we just read using the non-filtered linear pipeline, and then do an in-place filter on the output buffer. */
int
speexErr
;
int
speexErr
;
...
@@ -480,7 +480,7 @@ static ma_result ma_resampler_process__read__speex(ma_resampler* pResampler, voi
...
@@ -480,7 +480,7 @@ static ma_result ma_resampler_process__read__speex(ma_resampler* pResampler, voi
}
}
#endif
#endif
static
ma_result
ma_resampler_process__read
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
static
ma_result
ma_resampler_process__read
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
)
{
{
MA_ASSERT
(
pResampler
!=
NULL
);
MA_ASSERT
(
pResampler
!=
NULL
);
MA_ASSERT
(
pFramesOut
!=
NULL
);
MA_ASSERT
(
pFramesOut
!=
NULL
);
...
@@ -499,18 +499,18 @@ static ma_result ma_resampler_process__read(ma_resampler* pResampler, void* pFra
...
@@ -499,18 +499,18 @@ static ma_result ma_resampler_process__read(ma_resampler* pResampler, void* pFra
{
{
case
ma_resample_algorithm_linear
:
case
ma_resample_algorithm_linear
:
{
{
return
ma_resampler_process__read__linear
(
pResampler
,
pFrames
Out
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__read__linear
(
pResampler
,
pFrames
In
,
pFrameCountIn
,
pFramesOut
,
pFrameCountOut
);
}
break
;
}
break
;
case
ma_resample_algorithm_linear_lpf
:
case
ma_resample_algorithm_linear_lpf
:
{
{
return
ma_resampler_process__read__linear_lpf
(
pResampler
,
pFrames
Out
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__read__linear_lpf
(
pResampler
,
pFrames
In
,
pFrameCountIn
,
pFramesOut
,
pFrameCountOut
);
}
break
;
}
break
;
case
ma_resample_algorithm_speex
:
case
ma_resample_algorithm_speex
:
{
{
#if defined(MA_HAS_SPEEX_RESAMPLER)
#if defined(MA_HAS_SPEEX_RESAMPLER)
return
ma_resampler_process__read__speex
(
pResampler
,
pFrames
Out
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__read__speex
(
pResampler
,
pFrames
In
,
pFrameCountIn
,
pFramesOut
,
pFrameCountOut
);
#endif
#endif
}
break
;
}
break
;
...
@@ -522,7 +522,7 @@ static ma_result ma_resampler_process__read(ma_resampler* pResampler, void* pFra
...
@@ -522,7 +522,7 @@ static ma_result ma_resampler_process__read(ma_resampler* pResampler, void* pFra
return
MA_INVALID_ARGS
;
return
MA_INVALID_ARGS
;
}
}
ma_result
ma_resampler_process
(
ma_resampler
*
pResampler
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
)
ma_result
ma_resampler_process
(
ma_resampler
*
pResampler
,
const
void
*
pFramesIn
,
ma_uint64
*
pFrameCountIn
,
void
*
pFramesOut
,
ma_uint64
*
pFrameCountOut
)
{
{
if
(
pResampler
==
NULL
)
{
if
(
pResampler
==
NULL
)
{
return
MA_INVALID_ARGS
;
return
MA_INVALID_ARGS
;
...
@@ -534,10 +534,10 @@ ma_result ma_resampler_process(ma_resampler* pResampler, void* pFramesOut, ma_ui
...
@@ -534,10 +534,10 @@ ma_result ma_resampler_process(ma_resampler* pResampler, void* pFramesOut, ma_ui
if
(
pFramesOut
!=
NULL
)
{
if
(
pFramesOut
!=
NULL
)
{
/* Reading. */
/* Reading. */
return
ma_resampler_process__read
(
pResampler
,
pFrames
Out
,
pFrameCountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__read
(
pResampler
,
pFrames
In
,
pFrameCountIn
,
pFramesOut
,
pFrameCountOut
);
}
else
{
}
else
{
/* Seeking. */
/* Seeking. */
return
ma_resampler_process__seek
(
pResampler
,
pFrame
CountOut
,
pFramesIn
,
pFrameCountIn
);
return
ma_resampler_process__seek
(
pResampler
,
pFrame
sIn
,
pFrameCountIn
,
pFrameCountOut
);
}
}
}
}
#endif
/* MINIAUDIO_IMPLEMENTATION */
#endif
/* MINIAUDIO_IMPLEMENTATION */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment