Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
d9c14342
Commit
d9c14342
authored
Mar 02, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_resample: use 24 bit resampling code for 32 bit samples
Resampling 32 bit samples is the same as resampling 24 bit samples - both are stored in the int32_t type.
parent
1b31f522
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
pcm_resample.h
src/pcm_resample.h
+29
-2
pcm_resample_fallback.c
src/pcm_resample_fallback.c
+1
-1
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+1
-1
No files found.
src/pcm_resample.h
View file @
d9c14342
...
...
@@ -86,7 +86,7 @@ pcm_resample_16(struct pcm_resample_state *state,
size_t
*
dest_size_r
);
/**
* Resamples
24
bit PCM data.
* Resamples
32
bit PCM data.
*
* @param state an initialized pcm_resample_state object
* @param channels the number of channels
...
...
@@ -98,11 +98,38 @@ pcm_resample_16(struct pcm_resample_state *state,
* @return the destination buffer
*/
const
int32_t
*
pcm_resample_
24
(
struct
pcm_resample_state
*
state
,
pcm_resample_
32
(
struct
pcm_resample_state
*
state
,
uint8_t
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
);
/**
* Resamples 24 bit PCM data.
*
* @param state an initialized pcm_resample_state object
* @param channels the number of channels
* @param src_rate the source sample rate
* @param src the source PCM buffer
* @param src_size the size of #src in bytes
* @param dest_rate the requested destination sample rate
* @param dest_size_r returns the number of bytes of the destination buffer
* @return the destination buffer
*/
static
inline
const
int32_t
*
pcm_resample_24
(
struct
pcm_resample_state
*
state
,
uint8_t
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
)
{
/* reuse the 32 bit code - the resampler code doesn't care if
the upper 8 bits are actually used */
return
pcm_resample_32
(
state
,
channels
,
src_rate
,
src_buffer
,
src_size
,
dest_rate
,
dest_size_r
);
}
#endif
src/pcm_resample_fallback.c
View file @
d9c14342
...
...
@@ -70,7 +70,7 @@ pcm_resample_16(struct pcm_resample_state *state,
}
const
int32_t
*
pcm_resample_
24
(
struct
pcm_resample_state
*
state
,
pcm_resample_
32
(
struct
pcm_resample_state
*
state
,
uint8_t
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
G_GNUC_UNUSED
size_t
src_size
,
...
...
src/pcm_resample_libsamplerate.c
View file @
d9c14342
...
...
@@ -186,7 +186,7 @@ src_float_to_int_array (const float *in, int *out, int len)
#endif
const
int32_t
*
pcm_resample_
24
(
struct
pcm_resample_state
*
state
,
pcm_resample_
32
(
struct
pcm_resample_state
*
state
,
uint8_t
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
...
...
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