Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ec3df8f4
Commit
ec3df8f4
authored
Dec 29, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: add deinterleave helper for doing packet->planar for audio samples
parent
6d6342b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
include/vlc_aout.h
include/vlc_aout.h
+2
-0
src/audio_output/common.c
src/audio_output/common.c
+36
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
No files found.
include/vlc_aout.h
View file @
ec3df8f4
...
...
@@ -214,6 +214,8 @@ VLC_API void aout_ChannelReorder(void *, size_t, unsigned, const uint8_t *, vlc_
VLC_API
void
aout_Interleave
(
void
*
dst
,
const
void
*
src
,
unsigned
samples
,
unsigned
channels
,
vlc_fourcc_t
fourcc
);
VLC_API
void
aout_Deinterleave
(
void
*
dst
,
const
void
*
src
,
unsigned
samples
,
unsigned
channels
,
vlc_fourcc_t
fourcc
);
/**
* This fonction will compute the extraction parameter into pi_selection to go
...
...
src/audio_output/common.c
View file @
ec3df8f4
...
...
@@ -376,6 +376,42 @@ do { \
#undef INTERLEAVE_TYPE
}
/**
* Deinterleaves audio samples within a block of samples.
* \param dst destination buffer for planar samples
* \param src source buffer with interleaved samples
* \param samples number of samples (per channel/per plane)
* \param chans channels/planes count
* \param fourcc sample format (must be a linear sample format)
* \note The samples must be naturally aligned in memory.
* \warning Destination and source buffers MUST NOT overlap.
*/
void
aout_Deinterleave
(
void
*
restrict
dst
,
const
void
*
restrict
src
,
unsigned
samples
,
unsigned
chans
,
vlc_fourcc_t
fourcc
)
{
#define DEINTERLEAVE_TYPE(type) \
do { \
type *d = dst; \
const type *s = src; \
for( size_t i = 0; i < chans; i++ ) { \
for( size_t j = 0, k = 0; j < samples; j++, k += chans ) \
*(d++) = s[k]; \
s++; \
} \
} while(0)
switch
(
fourcc
)
{
case
VLC_CODEC_U8
:
DEINTERLEAVE_TYPE
(
uint8_t
);
break
;
case
VLC_CODEC_S16N
:
DEINTERLEAVE_TYPE
(
uint16_t
);
break
;
case
VLC_CODEC_FL32
:
DEINTERLEAVE_TYPE
(
float
);
break
;
case
VLC_CODEC_S32N
:
DEINTERLEAVE_TYPE
(
int32_t
);
break
;
case
VLC_CODEC_FL64
:
DEINTERLEAVE_TYPE
(
double
);
break
;
default:
assert
(
0
);
}
#undef DEINTERLEAVE_TYPE
}
/*****************************************************************************
* aout_ChannelExtract:
*****************************************************************************/
...
...
src/libvlccore.sym
View file @
ec3df8f4
...
...
@@ -6,6 +6,7 @@ aout_ChannelReorder
aout_CheckChannelExtraction
aout_CheckChannelReorder
aout_Interleave
aout_Deinterleave
aout_filter_RequestVout
aout_FormatPrepare
aout_FormatPrint
...
...
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