search for: flac__int8

Displaying 12 results from an estimated 12 matches for "flac__int8".

2014 Aug 14
6
Encoder example for 24-bit files
...< 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] << 8)) |...
2014 Aug 14
1
Encoder example for 24-bit files
...*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[i] = (FLAC__...
2014 Jun 26
1
Lets work towards a new version
...Fri, > 05 Apr 2013 08:25:10 +0200, to be specific), compiling on > Raspbian (Debian Wheezy, GCC 4.6) returns quite some warnings of > the type -Wcast-align. What happens if you change the definitions of s8buffer[] and ucbuffer_[] arrays as follows: static __attribute__((__aligned__(4))) FLAC__int8 s8buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)]; static __attribute__((__aligned__(4))) unsigned char ucbuffer_[CHUNK_OF_SAMPLES*FLAC__MAX_CHANNELS*((FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE+7)/8)]; ?
2006 Jan 27
0
patch for bugs in vorbis-tools-1.1.1
...C 2005-06-03 11:15:09.000000000 +0100 +++ VORBIS-TOOLS-1.1.1/OGG123/FLAC_FORMAT.C 2006-01-21 01:11:21.000000000 +0100 @@ -229,11 +229,11 @@ if (audio_fmt->word_size == 1) { for (i = 0; i < priv->channels; i++) for (j = 0; j < copy; j++) - buf8[(j+realsamples)*2+i] = (FLAC__int8) (0xFF & priv->buf[i][j+priv->buf_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;...
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
2004 Sep 10
0
Using libFLAC++
...roximately the right format, or do I have to do some sort of conversion? This code is 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++, sa...
2012 Feb 08
0
[PATCH] Remove even more CPP hackery
...) || defined(__EMX__)) +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#if !(defined(_MSC_VER) || defined(__BORLANDC__)) #include <inttypes.h> #endif +#if HAVE_STDINT_H +#include <stdint.h> +#endif + typedef signed char FLAC__int8; typedef unsigned char FLAC__uint8; rely on "config.h" which is only available when FLAC is compiled, not when this file is installed in /usr/include/FLAC or whereever. I'll accept the rest of the patch. For the problem of this file, I think the best solution is to just remove...
2014 Jun 27
2
Fixed first cast-align warning
...irst cast-align warning in this commit: commit 40e817dc526d1d41e900bb0f54d1a4451bda01ed Author: Erik de Castro Lopo <erikd at mega-nerd.com> Date: Fri Jun 27 21:58:26 2014 +1000 src/flac/decode.c : Fix a cast-align warning from GCC. The old code was creating an array of FLAC__int8, and then casting that to a set of signed and unsigned 16 and 32 bit integers. This was replaced with a single union containing all the requred array. This solution means that there are fewer pointer casts and actually gives the compiler more information with which to generate...
2012 Feb 07
2
[PATCH] Remove even more CPP hackery
...S_H -#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__)) +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#if !(defined(_MSC_VER) || defined(__BORLANDC__)) #include <inttypes.h> #endif +#if HAVE_STDINT_H +#include <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...
2012 Feb 07
5
[PATCH] Remove even more CPP hackery
On 02/07/12 12:03 am, Erik de Castro Lopo wrote: > Dave Yeo wrote: > >> This commit will break OS/2's EMX 0.9d library (GCC 2.8.1) which has been >> been replaced by klibc. Considering the age of EMX and lack of testing >> and that klibc contains so many improvements I think this is exceptable. > > Sorry Dave, I can't do that. Or rather sorry, the patch
2008 May 19
1
Memory leaks due to Metadata object vorbis comment API ???
...ed 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; > } >...
2014 Jun 19
10
Lets work towards a new version
Hi all, It sees that the most serious bug in the flac bug tracker: https://sourceforge.net/p/flac/bugs/413/ has been fixed in git. This fix alone is worth a new release so its time to work towards one. Things I need to do for this new release: * Deal with all current patches on the mailing list. * Review all bugs reported against 1.3.0 on the sf.net. * Testing and coordination of testing