[vlc-commits] aout: drop support for S8

Rémi Denis-Courmont git at videolan.org
Tue Dec 18 23:13:47 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 19 00:12:13 2012 +0200| [4ed8eacd2e56a59b95fad64477caa52f574e941a] | committer: Rémi Denis-Courmont

aout: drop support for S8

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ed8eacd2e56a59b95fad64477caa52f574e941a
---

 modules/audio_filter/converter/format.c |   56 +------------------------------
 modules/audio_output/alsa.c             |    3 --
 modules/audio_output/file.c             |    3 +-
 modules/audio_output/oss.c              |    2 --
 modules/audio_output/pulse.c            |    2 --
 modules/audio_output/sndio.c            |    2 +-
 modules/audio_output/wasapi.c           |    1 -
 7 files changed, 3 insertions(+), 66 deletions(-)

diff --git a/modules/audio_filter/converter/format.c b/modules/audio_filter/converter/format.c
index 3ff3f1d..5c74ffa 100644
--- a/modules/audio_filter/converter/format.c
+++ b/modules/audio_filter/converter/format.c
@@ -178,17 +178,6 @@ static block_t *Filter(filter_t *filter, block_t *block)
 }
 
 /* */
-static block_t *S16toS8(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    int16_t *src = (int16_t *)b->p_buffer;
-    int8_t  *dst = (int8_t *)src;
-    for (int i = b->i_buffer / 2; i--;)
-        *dst++ = (*src++) >> 8;
-
-    b->i_buffer /= 2;
-    return b;
-}
 static block_t *S16toU8(filter_t *filter, block_t *b)
 {
     VLC_UNUSED(filter);
@@ -200,17 +189,7 @@ static block_t *S16toU8(filter_t *filter, block_t *b)
     b->i_buffer /= 2;
     return b;
 }
-static block_t *U16toS8(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    uint16_t *src = (uint16_t *)b->p_buffer;
-    int8_t   *dst = (int8_t *)src;
-    for (int i = b->i_buffer / 2; i--;)
-        *dst++ = ((int)(*src++) - 32768) >> 8;
 
-    b->i_buffer /= 2;
-    return b;
-}
 static block_t *U16toU8(filter_t *filter, block_t *b)
 {
     VLC_UNUSED(filter);
@@ -245,26 +224,6 @@ static block_t *U16toS16(filter_t *filter, block_t *b)
     return b;
 }
 
-static block_t *S8toU8(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    int8_t  *src = (int8_t *)b->p_buffer;
-    uint8_t *dst = (uint8_t *)src;
-    for (int i = b->i_buffer; i--;)
-        *dst++ = ((*src++) + 128);
-
-    return b;
-}
-static block_t *U8toS8(filter_t *filter, block_t *b)
-{
-    VLC_UNUSED(filter);
-    uint8_t *src = (uint8_t *)b->p_buffer;
-    int8_t  *dst = (int8_t *)src;
-    for (int i = b->i_buffer; i--;)
-        *dst++ = ((*src++) - 128);
-
-    return b;
-}
 static block_t *S24toS16(filter_t *filter, block_t *b)
 {
     VLC_UNUSED(filter);
@@ -387,13 +346,7 @@ static void X8toX16(block_t *bdst, const block_t *bsrc)
     for (int i = bsrc->i_buffer; i--;)
         *dst++ = (*src++) << 8;
 }
-static void S8toU16(block_t *bdst, const block_t *bsrc)
-{
-    int8_t   *src = (int8_t *)bsrc->p_buffer;
-    uint16_t *dst = (uint16_t *)bdst->p_buffer;
-    for (int i = bsrc->i_buffer; i--;)
-        *dst++ = ((*src++) + 128) << 8;
-}
+
 static void U8toS16(block_t *bdst, const block_t *bsrc)
 {
     uint8_t *src = (uint8_t *)bsrc->p_buffer;
@@ -474,16 +427,12 @@ static const struct {
     { VLC_CODEC_S32N, VLC_CODEC_S32N,   S32toS16 },
     { VLC_CODEC_FL32, VLC_CODEC_S16N,   Fl32toS16 },
 
-    { VLC_CODEC_S16N, VLC_CODEC_S8,     S16toS8 },
     { VLC_CODEC_S16N, VLC_CODEC_U8,     S16toU8 },
     { VLC_CODEC_S16N, VLC_CODEC_U16N,   S16toU16 },
 
-    { VLC_CODEC_U16N, VLC_CODEC_S8,     U16toS8 },
     { VLC_CODEC_U16N, VLC_CODEC_U8,     U16toU8 },
     { VLC_CODEC_U16N, VLC_CODEC_S16N,   U16toS16 },
 
-    { VLC_CODEC_U8,   VLC_CODEC_S8,     U8toS8 },
-    { VLC_CODEC_S8,   VLC_CODEC_U8,     S8toU8 },
     { 0, 0, NULL }
 };
 
@@ -498,9 +447,6 @@ static const struct {
     { VLC_CODEC_S16N, VLC_CODEC_S32N, S16toS32 },
     { VLC_CODEC_S16N, VLC_CODEC_FL32, S16toFl32 },
 
-    { VLC_CODEC_S8,   VLC_CODEC_S16N, X8toX16 },
-    { VLC_CODEC_S8,   VLC_CODEC_U16N, S8toU16 },
-
     { VLC_CODEC_U8,   VLC_CODEC_U16N, X8toX16 },
     { VLC_CODEC_U8,   VLC_CODEC_S16N, U8toS16 },
     { 0, 0, NULL }
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 9d25280..11f1c2f 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -348,9 +348,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_U16L:
             pcm_format = SND_PCM_FORMAT_U16_LE;
             break;
-        case VLC_CODEC_S8:
-            pcm_format = SND_PCM_FORMAT_S8;
-            break;
         case VLC_CODEC_U8:
             pcm_format = SND_PCM_FORMAT_U8;
             break;
diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c
index c4a5e5e..ef9989a 100644
--- a/modules/audio_output/file.c
+++ b/modules/audio_output/file.c
@@ -87,11 +87,10 @@ static void    Flush       ( audio_output_t *, bool );
 #define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
                         "header to the file.")
 
-static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
+static const char *const format_list[] = { "u8", "u16", "s16", "u16_le",
                                      "s16_le", "u16_be", "s16_be",
                                      "float32", "spdif" };
 static const int format_int[] = { VLC_CODEC_U8,
-                                  VLC_CODEC_S8,
                                   VLC_CODEC_U16N, VLC_CODEC_S16N,
                                   VLC_CODEC_U16L,
                                   VLC_CODEC_S16L,
diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c
index c020ff8..60e594c 100644
--- a/modules/audio_output/oss.c
+++ b/modules/audio_output/oss.c
@@ -130,7 +130,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_S16L:
             format = AFMT_S16_LE;
             break;
-        case VLC_CODEC_S8:
         case VLC_CODEC_U8:
             format = AFMT_U8;
             break;
@@ -155,7 +154,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
 
     switch (format)
     {
-        case AFMT_S8:     fmt->i_format = VLC_CODEC_S8;   break;
         case AFMT_U8:     fmt->i_format = VLC_CODEC_U8;   break;
         case AFMT_S16_BE: fmt->i_format = VLC_CODEC_S16B; break;
         case AFMT_S16_LE: fmt->i_format = VLC_CODEC_S16L; break;
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index fbf9a85..af77421 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -684,8 +684,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
         case VLC_CODEC_S16L:
             ss.format = PA_SAMPLE_S16LE;
             break;
-        case VLC_CODEC_S8:
-            fmt->i_format = VLC_CODEC_U8;
         case VLC_CODEC_U8:
             ss.format = PA_SAMPLE_U8;
             break;
diff --git a/modules/audio_output/sndio.c b/modules/audio_output/sndio.c
index a790261..505b70d 100644
--- a/modules/audio_output/sndio.c
+++ b/modules/audio_output/sndio.c
@@ -101,7 +101,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     switch (par.bits)
     {
         case 8:
-            fmt->i_format = par.sig ? VLC_CODEC_S8 : VLC_CODEC_U8;
+            fmt->i_format = VLC_CODEC_U8;
             break;
         case 16:
             fmt->i_format = par.sig
diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 2e290fb..5a32cca 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -243,7 +243,6 @@ static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf,
             wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
             break;
 
-        case VLC_CODEC_S8:
         case VLC_CODEC_U8:
             audio->i_format = VLC_CODEC_S16N;
         case VLC_CODEC_S16N:



More information about the vlc-commits mailing list