Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
videolan
vlc-gpu
Commits
f521d69d
Commit
f521d69d
authored
Sep 30, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linear resampler: fixed-point support (disabled)
parent
ab151ef1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
modules/audio_filter/resampler/linear.c
modules/audio_filter/resampler/linear.c
+16
-1
No files found.
modules/audio_filter/resampler/linear.c
View file @
f521d69d
...
...
@@ -35,6 +35,7 @@
#include <vlc_aout.h>
#include <vlc_filter.h>
#include <vlc_block.h>
#include <vlc_cpu.h>
/*****************************************************************************
* Local prototypes
...
...
@@ -43,7 +44,13 @@ static int OpenFilter ( vlc_object_t * );
static
void
CloseFilter
(
vlc_object_t
*
);
static
block_t
*
Resample
(
filter_t
*
,
block_t
*
);
#if 1
typedef
float
sample_t
;
# define VLC_CODEC_NATIVE VLC_CODEC_FL32
#else
typedef
int32_t
sample_t
;
# define VLC_CODEC_NATIVE VLC_CODEC_FI32
#endif
/*****************************************************************************
* Local structures
...
...
@@ -130,7 +137,11 @@ static block_t *Resample( filter_t *p_filter, block_t *p_in_buf )
for
(
unsigned
i
=
0
;
i
<
i_nb_channels
;
i
++
)
{
p_out
[
i
]
=
p_prev_sample
[
i
];
#if CPU_CAPABILITY_FPU
p_out
[
i
]
+=
(
p_in
[
i
]
-
p_prev_sample
[
i
])
#else
p_out
[
i
]
+=
(
int64_t
)(
p_in
[
i
]
-
p_prev_sample
[
i
])
#endif
*
p_sys
->
i_remainder
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
}
p_out
+=
i_nb_channels
;
...
...
@@ -149,7 +160,11 @@ static block_t *Resample( filter_t *p_filter, block_t *p_in_buf )
for
(
unsigned
i
=
0
;
i
<
i_nb_channels
;
i
++
)
{
p_out
[
i
]
=
p_in
[
i
];
#if CPU_CAPABILITY_FPU
p_out
[
i
]
+=
(
p_in
[
i
+
i_nb_channels
]
-
p_in
[
i
])
#else
p_out
[
i
]
+=
(
int64_t
)(
p_in
[
i
+
i_nb_channels
]
-
p_in
[
i
])
#endif
*
p_sys
->
i_remainder
/
p_filter
->
fmt_out
.
audio
.
i_rate
;
}
p_out
+=
i_nb_channels
;
...
...
@@ -194,7 +209,7 @@ static int OpenFilter( vlc_object_t *p_this )
int
i_out_rate
=
p_filter
->
fmt_out
.
audio
.
i_rate
;
if
(
p_filter
->
fmt_in
.
audio
.
i_rate
==
p_filter
->
fmt_out
.
audio
.
i_rate
||
p_filter
->
fmt_in
.
i_codec
!=
VLC_CODEC_
FL32
)
p_filter
->
fmt_in
.
i_codec
!=
VLC_CODEC_
NATIVE
)
{
return
VLC_EGENERIC
;
}
...
...
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