diff options
author | wm4 <wm4@nowhere> | 2013-11-13 19:19:57 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-13 20:10:17 +0100 |
commit | 933fbf733362eee9db15dd2671c263781abd5635 (patch) | |
tree | c204671f5da9fecb369d1ac3f1d21726b029118b /audio/reorder_ch.c | |
parent | 95ed81c32902899168709e0f12d55936ee3cae5f (diff) | |
download | mpv-933fbf733362eee9db15dd2671c263781abd5635.tar.bz2 mpv-933fbf733362eee9db15dd2671c263781abd5635.tar.xz |
ao_lavc: support non-interleaved audio
Diffstat (limited to 'audio/reorder_ch.c')
-rw-r--r-- | audio/reorder_ch.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/audio/reorder_ch.c b/audio/reorder_ch.c index b99731e6bf..e7bdaaccff 100644 --- a/audio/reorder_ch.c +++ b/audio/reorder_ch.c @@ -27,42 +27,6 @@ #include "chmap.h" #include "reorder_ch.h" -static inline void reorder_to_planar_(void *restrict out, const void *restrict in, - size_t size, size_t nchan, size_t nmemb) -{ - size_t i, c; - char *outptr = (char *) out; - size_t instep = nchan * size; - - for (c = 0; c < nchan; ++c) { - const char *inptr = ((const char *) in) + c * size; - for (i = 0; i < nmemb; ++i, inptr += instep, outptr += size) { - memcpy(outptr, inptr, size); - } - } -} - -void reorder_to_planar(void *restrict out, const void *restrict in, - size_t size, size_t nchan, size_t nmemb) -{ - // special case for mono (nothing to do...) - if (nchan == 1) - memcpy(out, in, size * nchan * nmemb); - // these calls exist to insert an inline copy of to_planar_ here with known - // value of size to help the compiler replace the memcpy calls by mov - // instructions - else if (size == 1) - reorder_to_planar_(out, in, 1, nchan, nmemb); - else if (size == 2) - reorder_to_planar_(out, in, 2, nchan, nmemb); - else if (size == 4) - reorder_to_planar_(out, in, 4, nchan, nmemb); - // general case (calls memcpy a lot, should actually never happen, but - // stays here for correctness purposes) - else - reorder_to_planar_(out, in, size, nchan, nmemb); -} - #define MAX_SAMPLESIZE 8 static void reorder_channels_(uint8_t *restrict data, int *restrict ch_order, |