mirror of
https://github.com/google/liblc3.git
synced 2026-06-12 05:42:26 +00:00
Introduce float and 24 bits packed input/output formats
This commit is contained in:
+2
-2
@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
||||
error(EINVAL, "Samplerate %d Hz", srate_hz);
|
||||
|
||||
int pcm_sbits = p.bitdepth;
|
||||
int pcm_sbytes = 2 + 2*(pcm_sbits > 16);
|
||||
int pcm_sbytes = pcm_sbits / 8;
|
||||
|
||||
int pcm_srate_hz = !p.srate_hz ? srate_hz : p.srate_hz;
|
||||
int pcm_samples = !p.srate_hz ? nsamples :
|
||||
@@ -195,7 +195,7 @@ int main(int argc, char *argv[])
|
||||
uint8_t in[nch * LC3_MAX_FRAME_BYTES];
|
||||
int8_t alignas(int32_t) pcm[nch * frame_samples * pcm_sbytes];
|
||||
enum lc3_pcm_format pcm_fmt =
|
||||
pcm_sbits == 24 ? LC3_PCM_FORMAT_S24 : LC3_PCM_FORMAT_S16;
|
||||
pcm_sbits == 24 ? LC3_PCM_FORMAT_S24_3LE : LC3_PCM_FORMAT_S16;
|
||||
|
||||
for (int ich = 0; ich < nch; ich++)
|
||||
dec[ich] = lc3_setup_decoder(frame_us, srate_hz, p.srate_hz,
|
||||
|
||||
+4
-2
@@ -177,7 +177,8 @@ int main(int argc, char *argv[])
|
||||
if (pcm_sbits != 16 && pcm_sbits != 24)
|
||||
error(EINVAL, "Bitdepth %d", pcm_sbits);
|
||||
|
||||
if (pcm_sbytes != (pcm_sbits == 16 ? 2 : 4))
|
||||
if ((pcm_sbits == 16 && pcm_sbytes != 16/8) ||
|
||||
(pcm_sbits == 24 && pcm_sbytes != 24/8 && pcm_sbytes != 32/8))
|
||||
error(EINVAL, "Sample storage on %d bytes", pcm_sbytes);
|
||||
|
||||
if (nch < 1 || nch > 2)
|
||||
@@ -199,7 +200,8 @@ int main(int argc, char *argv[])
|
||||
lc3_encoder_t enc[nch];
|
||||
int8_t alignas(int32_t) pcm[nch * frame_samples * pcm_sbytes];
|
||||
enum lc3_pcm_format pcm_fmt =
|
||||
pcm_sbits == 24 ? LC3_PCM_FORMAT_S24 : LC3_PCM_FORMAT_S16;
|
||||
pcm_sbytes == 32/8 ? LC3_PCM_FORMAT_S24 :
|
||||
pcm_sbytes == 24/8 ? LC3_PCM_FORMAT_S24_3LE : LC3_PCM_FORMAT_S16;
|
||||
uint8_t out[nch][frame_bytes];
|
||||
|
||||
for (int ich = 0; ich < nch; ich++)
|
||||
|
||||
Reference in New Issue
Block a user