Displaying 12 results from an estimated 12 matches for "flac__int16".
2014 Mar 08
2
16 bits FLAC file data to 32 bit float buffer for CPU processing
...ta.WriteAddress + i ] = ( 1.0f + ( float ) sin ( ( ( double ) ( FloatFLACDecodingData.WriteAddress + i ) / ( double ) TABLE_SIZE ) * M_PI * 2.0 * 1.0 ) ) * 0.4f;
//FloatFLACDecodingData.LOut [ FloatFLACDecodingData.WriteAddress + i ] = float ( ( FLAC__int16 ) buffer [ 0 ] [ i ] ) * 65535.0f;
//FloatFLACDecodingData.LOut [ FloatFLACDecodingData.WriteAddress + i ] = ( float ( ( FLAC__int16 ) buffer [ 0 ] [ i ] ) / 65535.0f - 0.5f ) * 2.0f;
//FloatFLACDecodingData.LOut [ FloatFLACDecodingData.WriteAddress + i ]...
2014 Jun 29
6
FIxed rest of cast-align warnings
Hi all,
In commit 3eb4094b859 I think I have fixed all the cast-align warnings.
I have tested this in amd64/Linux (little endian) and powerpc64/Linux
(big endian) and it passed all tests (including the new MD5 tests).
I also did a little performance testing on amd64/Linux with a one
hour long stereo WAV file and could not find any mesasurable difference
between the old and the new code.
I
2014 Aug 14
1
Encoder example for 24-bit files
...nt argc, char *argv[])
/* convert the packed little-endian 16-bit PCM samples from WAVE
into an interleaved FLAC__int32 buffer for libFLAC */
size_t i;
for(i = 0; i < need*channels; i++) {
- /* inefficient but simple and works on big- or little-endian machines */
- pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8)
| (FLAC__int16)buffer[2*i]);
+ if (bps == 16) {
+ /* inefficient but simple and works on big- or little-endian machines */
+ pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8)
| (FLAC__int16)buffer[2*i]);
+ } else if (bps == 24) {
+ pcm[...
2004 Sep 10
2
Using libFLAC++
samples in FLAC are always signed. they must be signed going
into the encoder (flac converts unsigned samples to signed)
and they come out of the decoder signed.
Josh
--- David Bishop <tech@bishop.dhs.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Followup to original question: how do I determine if a particular
> flac file is
> signed (and then, if
2014 Jun 30
1
FIxed rest of cast-align warnings
lvqcl wrote:
> Erik de Castro Lopo wrote:
>
> >> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int16)];
> >>
> >> instead of
> >>
> >> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int16)];
> >
> > Really? Would you also write...
2014 Aug 14
6
Encoder example for 24-bit files
...ffer[43] << 8) | buffer[42]) << 8)
| buffer[41]) << 8) | buffer[40]) / 4;
/* allocate the encoder */
@@ -137,10 +139,17 @@
size_t i;
for(i = 0; i < need*channels; i++) {
/* inefficient but simple and works on big- or little-endian machines */
- pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8)
| (FLAC__int16)buffer[2*i]);
+ if (bps == 16)
+ pcm[i] = (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8)
| (FLAC__int16)buffer[2*i]);
+ else if (bps == 24)
+ pcm[i] = (((FLAC__int32)(buffer[2*i+2] << 16))
|((FLAC__int32)(buffer[2*i+1] &l...
2014 Mar 08
0
16 bits FLAC file data to 32 bit float buffer for CPU processing
...] = ( 1.0f + ( float ) sin ( ( ( double ) (
> FloatFLACDecodingData.WriteAddress + i ) / ( double ) TABLE_SIZE ) * M_PI *
> 2.0 * 1.0 ) ) * 0.4f;
> //FloatFLACDecodingData.LOut [ FloatFLACDecodingData.WriteAddress +
> i ] = float ( ( FLAC__int16 ) buffer [ 0 ] [ i ] )
> * 65535.0f;
> //FloatFLACDecodingData.LOut [ FloatFLACDecodingData.WriteAddress +
> i ] = ( float ( ( FLAC__int16 ) buffer [ 0 ] [ i ]
> ) / 65535.0f - 0.5f ) * 2.0f;
> //FloatFLACDecodingData.LOut [ FloatFLACDecodingData.W...
2004 Sep 10
0
Using libFLAC++
...ripped almost directly from decode.c in flac/,
just heavily cut down to deal with only 1 type of file (i.e., I'm not
dealing with differing endianess right now).
[this code is in my write callback]
static FLAC__int8 s8buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)];
FLAC__int16 *s16buffer = (FLAC__int16 *)s8buffer;
if( wide_samples > 0 ) {
for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) {
for(channel = 0; channel < channels; channel++, sample++) {
s16buffer[sample] = (FLAC__int16)(buffer[channel][wide_sample]);...
2004 Sep 10
1
trying to write encoder - need help!
Hi all,
I'm attempting to encode raw audio data using libFLAC++. My audio data
is 16 bit, mono, 16000Hz. I set all the appropriate parameters on the
encoder and then call init(). Everything appears to be ok.
I don't know how to properly convert from char *data to the FLAC__int32
*[] requested by the process function. I think this is where my problem
is.
If I call process() like this:
2006 Jan 27
0
patch for bugs in vorbis-tools-1.1.1
...uf_start]);
+ buf8[(j+realsamples)*audio_fmt->channels+i] = (FLAC__int8) (0xFF & priv->buf[i][j+priv->buf_start]);
} else if (audio_fmt->word_size == 2) {
for (i = 0; i < priv->channels; i++)
for (j = 0; j < copy; j++)
- buf16[(j+realsamples)*2+i] = (FLAC__int16) (0xFFFF & priv->buf[i][j+priv->buf_start]);
+ buf16[(j+realsamples)*audio_fmt->channels+i] = (FLAC__int16) (0xFFFF & priv->buf[i][j+priv->buf_start]);
}
priv->buf_start += copy;
diff -u -r X/VORBIS-TOOLS-1.1.1/OGG123/OGG123.C VORBIS-TOOLS-1.1.1/OGG123...
2012 Feb 07
2
[PATCH] Remove even more CPP hackery
...stdint.h>
+#endif
+
typedef signed char FLAC__int8;
typedef unsigned char FLAC__uint8;
@@ -46,13 +54,6 @@ typedef __int64 FLAC__int64;
typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
-#elif defined(__EMX__)
-typedef short FLAC__int16;
-typedef long FLAC__int32;
-typedef long long FLAC__int64;
-typedef unsigned short FLAC__uint16;
-typedef unsigned long FLAC__uint32;
-typedef unsigned long long FLAC__uint64;
#else
typedef int16_t FLAC__int16;
typedef int32_t FLAC__int32;
diff --git a/src/flac/main.c b/src/flac/main.c
index e6...
2008 May 19
1
Memory leaks due to Metadata object vorbis comment API ???
...an interleaved FLAC__int32 buffer for libFLAC */
> size_t i;
> for(i = 0; i < need*channels; i++) {
> /* inefficient but simple and works on big- or
> little-endian machines */
> pcm[i] =
> (FLAC__int32)(((FLAC__int16)(FLAC__int8)buffer[2*i+1] << 8) |
> (FLAC__int16)buffer[2*i]);
> }
> /* feed samples to encoder */
> ok = FLAC__stream_encoder_process_interleaved(encoder, pcm,
> need);
> }
> left -= need;
>...