Commit 4ed8eacd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: drop support for S8

parent 132af4a3
...@@ -178,17 +178,6 @@ static block_t *Filter(filter_t *filter, block_t *block) ...@@ -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) static block_t *S16toU8(filter_t *filter, block_t *b)
{ {
VLC_UNUSED(filter); VLC_UNUSED(filter);
...@@ -200,17 +189,7 @@ static block_t *S16toU8(filter_t *filter, block_t *b) ...@@ -200,17 +189,7 @@ static block_t *S16toU8(filter_t *filter, block_t *b)
b->i_buffer /= 2; b->i_buffer /= 2;
return b; 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) static block_t *U16toU8(filter_t *filter, block_t *b)
{ {
VLC_UNUSED(filter); VLC_UNUSED(filter);
...@@ -245,26 +224,6 @@ static block_t *U16toS16(filter_t *filter, block_t *b) ...@@ -245,26 +224,6 @@ static block_t *U16toS16(filter_t *filter, block_t *b)
return 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) static block_t *S24toS16(filter_t *filter, block_t *b)
{ {
VLC_UNUSED(filter); VLC_UNUSED(filter);
...@@ -387,13 +346,7 @@ static void X8toX16(block_t *bdst, const block_t *bsrc) ...@@ -387,13 +346,7 @@ static void X8toX16(block_t *bdst, const block_t *bsrc)
for (int i = bsrc->i_buffer; i--;) for (int i = bsrc->i_buffer; i--;)
*dst++ = (*src++) << 8; *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) static void U8toS16(block_t *bdst, const block_t *bsrc)
{ {
uint8_t *src = (uint8_t *)bsrc->p_buffer; uint8_t *src = (uint8_t *)bsrc->p_buffer;
...@@ -474,16 +427,12 @@ static const struct { ...@@ -474,16 +427,12 @@ static const struct {
{ VLC_CODEC_S32N, VLC_CODEC_S32N, S32toS16 }, { VLC_CODEC_S32N, VLC_CODEC_S32N, S32toS16 },
{ VLC_CODEC_FL32, VLC_CODEC_S16N, Fl32toS16 }, { 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_U8, S16toU8 },
{ VLC_CODEC_S16N, VLC_CODEC_U16N, S16toU16 }, { 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_U8, U16toU8 },
{ VLC_CODEC_U16N, VLC_CODEC_S16N, U16toS16 }, { VLC_CODEC_U16N, VLC_CODEC_S16N, U16toS16 },
{ VLC_CODEC_U8, VLC_CODEC_S8, U8toS8 },
{ VLC_CODEC_S8, VLC_CODEC_U8, S8toU8 },
{ 0, 0, NULL } { 0, 0, NULL }
}; };
...@@ -498,9 +447,6 @@ static const struct { ...@@ -498,9 +447,6 @@ static const struct {
{ VLC_CODEC_S16N, VLC_CODEC_S32N, S16toS32 }, { VLC_CODEC_S16N, VLC_CODEC_S32N, S16toS32 },
{ VLC_CODEC_S16N, VLC_CODEC_FL32, S16toFl32 }, { 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_U16N, X8toX16 },
{ VLC_CODEC_U8, VLC_CODEC_S16N, U8toS16 }, { VLC_CODEC_U8, VLC_CODEC_S16N, U8toS16 },
{ 0, 0, NULL } { 0, 0, NULL }
......
...@@ -348,9 +348,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -348,9 +348,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
case VLC_CODEC_U16L: case VLC_CODEC_U16L:
pcm_format = SND_PCM_FORMAT_U16_LE; pcm_format = SND_PCM_FORMAT_U16_LE;
break; break;
case VLC_CODEC_S8:
pcm_format = SND_PCM_FORMAT_S8;
break;
case VLC_CODEC_U8: case VLC_CODEC_U8:
pcm_format = SND_PCM_FORMAT_U8; pcm_format = SND_PCM_FORMAT_U8;
break; break;
......
...@@ -87,11 +87,10 @@ static void Flush ( audio_output_t *, bool ); ...@@ -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 " \ #define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
"header to the file.") "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", "s16_le", "u16_be", "s16_be",
"float32", "spdif" }; "float32", "spdif" };
static const int format_int[] = { VLC_CODEC_U8, static const int format_int[] = { VLC_CODEC_U8,
VLC_CODEC_S8,
VLC_CODEC_U16N, VLC_CODEC_S16N, VLC_CODEC_U16N, VLC_CODEC_S16N,
VLC_CODEC_U16L, VLC_CODEC_U16L,
VLC_CODEC_S16L, VLC_CODEC_S16L,
......
...@@ -130,7 +130,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -130,7 +130,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
case VLC_CODEC_S16L: case VLC_CODEC_S16L:
format = AFMT_S16_LE; format = AFMT_S16_LE;
break; break;
case VLC_CODEC_S8:
case VLC_CODEC_U8: case VLC_CODEC_U8:
format = AFMT_U8; format = AFMT_U8;
break; break;
...@@ -155,7 +154,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -155,7 +154,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
switch (format) switch (format)
{ {
case AFMT_S8: fmt->i_format = VLC_CODEC_S8; break;
case AFMT_U8: fmt->i_format = VLC_CODEC_U8; 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_BE: fmt->i_format = VLC_CODEC_S16B; break;
case AFMT_S16_LE: fmt->i_format = VLC_CODEC_S16L; break; case AFMT_S16_LE: fmt->i_format = VLC_CODEC_S16L; break;
......
...@@ -684,8 +684,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -684,8 +684,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
case VLC_CODEC_S16L: case VLC_CODEC_S16L:
ss.format = PA_SAMPLE_S16LE; ss.format = PA_SAMPLE_S16LE;
break; break;
case VLC_CODEC_S8:
fmt->i_format = VLC_CODEC_U8;
case VLC_CODEC_U8: case VLC_CODEC_U8:
ss.format = PA_SAMPLE_U8; ss.format = PA_SAMPLE_U8;
break; break;
......
...@@ -101,7 +101,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt) ...@@ -101,7 +101,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
switch (par.bits) switch (par.bits)
{ {
case 8: case 8:
fmt->i_format = par.sig ? VLC_CODEC_S8 : VLC_CODEC_U8; fmt->i_format = VLC_CODEC_U8;
break; break;
case 16: case 16:
fmt->i_format = par.sig fmt->i_format = par.sig
......
...@@ -243,7 +243,6 @@ static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf, ...@@ -243,7 +243,6 @@ static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf,
wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
break; break;
case VLC_CODEC_S8:
case VLC_CODEC_U8: case VLC_CODEC_U8:
audio->i_format = VLC_CODEC_S16N; audio->i_format = VLC_CODEC_S16N;
case VLC_CODEC_S16N: case VLC_CODEC_S16N:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment