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
9716c3a3
Commit
9716c3a3
authored
Oct 19, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_{channels,resample}: pass channel count as integer, not uint8_t
Reduces number of implicit integer conversions.
parent
c4c44c44
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
27 deletions
+27
-27
pcm_channels.c
src/pcm_channels.c
+6
-6
pcm_channels.h
src/pcm_channels.h
+6
-6
pcm_resample.c
src/pcm_resample.c
+2
-2
pcm_resample.h
src/pcm_resample.h
+4
-4
pcm_resample_fallback.c
src/pcm_resample_fallback.c
+2
-2
pcm_resample_internal.h
src/pcm_resample_internal.h
+4
-4
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+3
-3
No files found.
src/pcm_channels.c
View file @
9716c3a3
...
...
@@ -71,8 +71,8 @@ pcm_convert_channels_16_n_to_2(int16_t *dest,
const
int16_t
*
pcm_convert_channels_16
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int16_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int16_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
)
{
assert
(
src_size
%
(
sizeof
(
*
src
)
*
src_channels
)
==
0
);
...
...
@@ -144,8 +144,8 @@ pcm_convert_channels_24_n_to_2(int32_t *dest,
const
int32_t
*
pcm_convert_channels_24
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int32_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int32_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
)
{
assert
(
src_size
%
(
sizeof
(
*
src
)
*
src_channels
)
==
0
);
...
...
@@ -212,8 +212,8 @@ pcm_convert_channels_32_n_to_2(int32_t *dest,
const
int32_t
*
pcm_convert_channels_32
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int32_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int32_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
)
{
assert
(
src_size
%
(
sizeof
(
*
src
)
*
src_channels
)
==
0
);
...
...
src/pcm_channels.h
View file @
9716c3a3
...
...
@@ -38,8 +38,8 @@ struct pcm_buffer;
*/
const
int16_t
*
pcm_convert_channels_16
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int16_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int16_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
);
/**
...
...
@@ -56,8 +56,8 @@ pcm_convert_channels_16(struct pcm_buffer *buffer,
*/
const
int32_t
*
pcm_convert_channels_24
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int32_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int32_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
);
/**
...
...
@@ -73,8 +73,8 @@ pcm_convert_channels_24(struct pcm_buffer *buffer,
*/
const
int32_t
*
pcm_convert_channels_32
(
struct
pcm_buffer
*
buffer
,
u
int8_t
dest_channels
,
u
int8_t
src_channels
,
const
int32_t
*
src
,
u
nsigned
dest_channels
,
u
nsigned
src_channels
,
const
int32_t
*
src
,
size_t
src_size
,
size_t
*
dest_size_r
);
#endif
src/pcm_resample.c
View file @
9716c3a3
...
...
@@ -78,7 +78,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state)
const
int16_t
*
pcm_resample_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
GError
**
error_r
)
...
...
@@ -100,7 +100,7 @@ pcm_resample_16(struct pcm_resample_state *state,
const
int32_t
*
pcm_resample_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
GError
**
error_r
)
...
...
src/pcm_resample.h
View file @
9716c3a3
...
...
@@ -45,7 +45,7 @@ struct pcm_resample_state {
struct
{
unsigned
src_rate
;
unsigned
dest_rate
;
u
int8_t
channels
;
u
nsigned
channels
;
}
prev
;
int
error
;
...
...
@@ -82,7 +82,7 @@ void pcm_resample_deinit(struct pcm_resample_state *state);
*/
const
int16_t
*
pcm_resample_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
@@ -102,7 +102,7 @@ pcm_resample_16(struct pcm_resample_state *state,
*/
const
int32_t
*
pcm_resample_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
@@ -122,7 +122,7 @@ pcm_resample_32(struct pcm_resample_state *state,
*/
static
inline
const
int32_t
*
pcm_resample_24
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
src/pcm_resample_fallback.c
View file @
9716c3a3
...
...
@@ -37,7 +37,7 @@ pcm_resample_fallback_deinit(struct pcm_resample_state *state)
/* resampling code blatantly ripped from ESD */
const
int16_t
*
pcm_resample_fallback_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
...
...
@@ -78,7 +78,7 @@ pcm_resample_fallback_16(struct pcm_resample_state *state,
const
int32_t
*
pcm_resample_fallback_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
...
...
src/pcm_resample_internal.h
View file @
9716c3a3
...
...
@@ -43,7 +43,7 @@ pcm_resample_lsr_deinit(struct pcm_resample_state *state);
const
int16_t
*
pcm_resample_lsr_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
@@ -51,7 +51,7 @@ pcm_resample_lsr_16(struct pcm_resample_state *state,
const
int32_t
*
pcm_resample_lsr_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
G_GNUC_UNUSED
size_t
src_size
,
...
...
@@ -68,7 +68,7 @@ pcm_resample_fallback_deinit(struct pcm_resample_state *state);
const
int16_t
*
pcm_resample_fallback_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
...
...
@@ -76,7 +76,7 @@ pcm_resample_fallback_16(struct pcm_resample_state *state,
const
int32_t
*
pcm_resample_fallback_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
G_GNUC_UNUSED
size_t
src_size
,
...
...
src/pcm_resample_libsamplerate.c
View file @
9716c3a3
...
...
@@ -106,7 +106,7 @@ pcm_resample_lsr_deinit(struct pcm_resample_state *state)
static
bool
pcm_resample_set
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
unsigned
src_rate
,
unsigned
dest_rate
,
u
nsigned
channels
,
unsigned
src_rate
,
unsigned
dest_rate
,
GError
**
error_r
)
{
int
error
;
...
...
@@ -159,7 +159,7 @@ lsr_process(struct pcm_resample_state *state, GError **error_r)
const
int16_t
*
pcm_resample_lsr_16
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int16_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
@@ -223,7 +223,7 @@ src_float_to_int_array (const float *in, int *out, int len)
const
int32_t
*
pcm_resample_lsr_32
(
struct
pcm_resample_state
*
state
,
u
int8_t
channels
,
u
nsigned
channels
,
unsigned
src_rate
,
const
int32_t
*
src_buffer
,
size_t
src_size
,
unsigned
dest_rate
,
size_t
*
dest_size_r
,
...
...
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