search for: flac__streamencoder

Displaying 19 results from an estimated 19 matches for "flac__streamencoder".

2013 Aug 20
0
sf bug 256 - Virtual functions in destructor
...Hello! Sorry, english is not my best language. I use libFLAC++ API. I have some problems. In libFLAC API all OK. Unhandled exception at 0x00000000 in Test.exe: 0xC0000005: Access violation reading location 0x00000000. Call stack 00000000() Test.exe!FLAC::Encoder::File::progress_callback_(const FLAC__StreamEncoder * encoder=0x003571f8, unsigned __int64 bytes_written=2156194, unsigned __int64 samples_written=845544, unsigned int frames_written=734, unsigned int total_frames_estimate=0, void * client_data=0x0012fe1c) Line 507 + 0x2a bytes C++ Test.exe!file_write_callback_(const FLAC__StreamEncoder * encoder=0x...
2007 Jul 14
2
PATCH : Fix missing protoypes
...int32 *length, FLAC__uint32 length_len) { FLAC__byte buffer[sizeof(FLAC__uint32)]; --- src/libFLAC/stream_encoder.c 2007-07-14 08:45:49 +0000 +++ src/libFLAC/stream_encoder.c 2007-07-15 00:50:25 +0000 @@ -1417,6 +1417,7 @@ return true; } +FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) ; FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) { FLAC__ASSERT(0 != encoder); @@ -1744,6 +1745,7 @@ * These three functions are not static, but not publically exposed in * include/FLAC/ either. They are used...
2012 Apr 05
2
[PATCH 2/2] V2: Use a single definition of MIN and MAX in sources
...undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - /* Exact Rice codeword length calculation is off by default. The simple * (and fast) estimation (of how many bits a residual value will be * encoded with) in this encoder is very good, almost always yielding @@ -691,7 +682,7 @@ static FLAC__StreamEncoderInitStatus init_stream_internal_( if(encoder->protected_->bits_per_sample < 16) { /* @@@ need some data about how to set this here w.r.t. blocksize and sample rate */ /* @@@ until then we'll make a guess */ - encoder->protected_->qlp_coeff_precision = max(FLAC__MIN_QL...
2006 Jun 17
3
Assistance with an encoding plugin
...king on writing a FLAC encoding plugin for a personal cd ripping project of mine which uses paranoia for the raw audio extraction. My basic setup which follows gets me oddly high pitched audio with lots of noise (although the music IS somewhat recognizable). #include <FLAC/stream_encoder.h> FLAC__StreamEncoder *encoder; FILE *output_file_descriptor; encoder = FLAC__stream_encoder_new(); FLAC__stream_encoder_set_write_callback(plugin->encoder, write_callback); FLAC__stream_encoder_set_metadata_callback(plugin->encoder, metadata_callback); FLAC__stream_encoder_set_client_data(plugin->encoder, ou...
2005 May 25
0
[PATCH] Fix fuction prototypes/definitions with void argument
...f(FLAC__StreamMetadata_CueSheet_Track)); } --- src/libFLAC/stream_encoder.c-dist 2005-05-25 16:07:23.000000000 +0200 +++ src/libFLAC/stream_encoder.c 2005-05-25 16:07:27.000000000 +0200 @@ -454,7 +454,7 @@ FLAC_API const char * const FLAC__Stream * Class constructor/destructor * */ -FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new() +FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void) { FLAC__StreamEncoder *encoder; unsigned i; --- src/libFLAC/stream_decoder.c-dist 2005-05-25 16:07:23.000000000 +0200 +++ src/libFLAC/stream_decoder.c 2005-05-25 16:07:27.000000000 +0200 @@ -180,7 +180,7...
2010 Feb 08
0
Use FLAC__stream_encoder_init_FILE instead of FLAC__stream_encoder_init_file
Hi, I use the libflac to encoder wav files to flac, my code: FLAC__StreamEncoder *encoder = 0; > > >> if((encoder = FLAC__stream_encoder_new()) == NULL) > > { > > printf(_T("ERROR: allocating encoder")); > > return; > > } > > >> FLAC__stream_encoder_set_channels ( encoder, 2 ); > > FLAC__stream_encoder_set_bits_per...
2014 Sep 26
2
Disk fragmentation
...roblem? IMHO it's better to move setvbuf() out of libFLAC/stream_encoder.c into flac/encode.c. I can see two ways to do this: 1) Add a new function to libFLAC API that have access to encoder->private_->file and can call setvbuf: FLAC_API FLAC__bool FLAC__stream_encoder_set_buffer_size(FLAC__StreamEncoder *encoder, unsigned size); 2) Rewrite EncoderSession_init_encoder() in flac/encode.c so that it opens the file, calls setvbuf and then uses FLAC__stream_encoder_init[_ogg]_stream() instead of FLAC__stream_encoder_init[_ogg]_file(). It's more difficult, but doesn't require API change.
2008 May 19
1
Memory leaks due to Metadata object vorbis comment API ???
...bum[] = {"Album"}; > static const unsigned char FLAC_tagYear[] = {"2008"}; > static const unsigned char FLAC_tagGenre[] = {"Audio Track"}; > static const unsigned char defFileName[16] = {"encAUDIO.flac"}; > > static void progress_callback(const FLAC__StreamEncoder *encoder, > FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned > frames_written, unsigned total_frames_estimate, void *client_data); > > #define READSIZE 1024 > > static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE > size limitations */ &gt...
2004 Sep 10
0
new checkins
...encoder.h 6 May 2002 15:07:22 -0000 @@ -22,6 +22,11 @@ #include "format.h" +#ifdef __cplusplus +extern "C" { +#endif + + typedef enum { FLAC__STREAM_ENCODER_OK = 0, FLAC__STREAM_ENCODER_INVALID_CALLBACK, @@ -189,5 +194,9 @@ */ FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 *buf[], unsigned samples); FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buf[], unsigned samples); + +#ifdef __cplusplus +} +#endif #endif
2004 Sep 10
3
new checkins
FYI, I have checked in a few interesting things. One is a speedup to the decoder (about 15% improvement in overall decode time). Another is a new interface to FLAC file metadata. If you're curious look at include/FLAC/metadata.h. It is basically a collection of object manipulation routines and iterators that make it pretty easy to add/edit/delete FLAC metadata in files efficiently. The
2014 Aug 14
1
Encoder example for 24-bit files
...he final diff I used to use the example to convert the 24bps file: diff --git a/examples/c/encode/file/main.c b/examples/c/encode/file/main.c index e3bdea8..b1cf374 100644 --- a/examples/c/encode/file/main.c +++ b/examples/c/encode/file/main.c @@ -40,8 +40,10 @@ static void progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 b #define READSIZE 1024 +#define BPS 24 /* Bits per sample */ + static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */ -static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data i...
2012 May 05
5
[PATCH] Optionally, allow distros to use openssl for MD5 verification
...+#else +????FLAC__MD5Init(&decoder->private_->md5context); +#endif return true; } diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c index 7e102a5..787366e 100644 --- a/src/libFLAC/stream_encoder.c +++ b/src/libFLAC/stream_encoder.c @@ -570,7 +570,9 @@ FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void) FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_extra[i]); encoder->protected_->state = FLAC__STREAM_ENCODER_UNINITIALIZED; - +#if defined(HAVE_OPENSSL) + if(encoder->protect...
2014 May 27
1
Streaming silence with flac
On 27.05.2014 19:07, Martijn van Beurden wrote: >> Is there a way to output small blocks/chunks/ogg pages instead >> run-length encoding such silent passages into a single page? > The official FLAC encoder has an option > --disable-constant-subframes, which does exactly that. Great. Then I'll take a crawl into the sources... Thanks for this first pointer
2014 Sep 24
2
Disk fragmentation
Miroslav Lichvar wrote: > Hm, does this mean that every process encoding FLAC files will now > need extra 10MB of memory? Is that ok for small devices with limited > memory? What small device do you have in mind? The smallest device I could possibly imagine *encoding* FLAC on is Rasberry Pi which has 512Meg of RAM. If you really are concerned about this (and knowing that it has little
2014 Sep 27
0
Disk fragmentation
..._encoder.c > into flac/encode.c. Why do you thing that is better? > I can see two ways to do this: > > 1) Add a new function to libFLAC API that have access to > encoder->private_->file and can call setvbuf: > > FLAC_API FLAC__bool FLAC__stream_encoder_set_buffer_size(FLAC__StreamEncoder *encoder, unsigned size); Not real keen on changing the API just for this issue. > 2) Rewrite EncoderSession_init_encoder() in flac/encode.c so that it > opens the file, calls setvbuf and then uses FLAC__stream_encoder_init[_ogg]_stream() > instead of FLAC__stream_encoder_init[_ogg]_file...
2006 Jun 19
0
Assistance with an encoding plugin
...ing plugin for a personal cd ripping >project of mine which uses paranoia for the raw audio extraction. My >basic setup which follows gets me oddly high pitched audio with lots of >noise (although the music IS somewhat recognizable). > >#include <FLAC/stream_encoder.h> > >FLAC__StreamEncoder *encoder; >FILE *output_file_descriptor; > >encoder = FLAC__stream_encoder_new(); > >FLAC__stream_encoder_set_write_callback(plugin->encoder, write_callback); >FLAC__stream_encoder_set_metadata_callback(plugin->encoder, >metadata_callback); >FLAC__stream_encoder_set_cl...
2004 Nov 02
1
Basic Encoder Help
Hello all, I've been writing a basic encoder using libFLAC++. It seems to work fine, as in the resultant file is playable in any FLAC compatible player, however the compression ratio is very small - the main example being a 60MB file compressing to 54MB, i guess there's an option i've missed, but i cannot track it down. I was hoping someone could point it out for me:
2014 Nov 10
0
[PATCH] Update documentation for new compression presets
...</td> </tr> <tr> diff --git a/include/FLAC/stream_encoder.h b/include/FLAC/stream_encoder.h index dbfee63..8a9b1b7 100644 --- a/include/FLAC/stream_encoder.h +++ b/include/FLAC/stream_encoder.h @@ -830,28 +830,28 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *en * The actual values set for each level are: * <table> * <tr> - * <td><b>level</b><td> - * <td>do mid-side stereo<td> - * <td>loose mid-side stereo<td> - * <td>apodization<td> - * <td>max lpc order<td>...
2014 Aug 14
6
Encoder example for 24-bit files
...t32)(buffer[2*i]))); } /* feed samples to encoder */ ok = FLAC__stream_encoder_process_interleaved(encoder, pcm, need); + if (!ok) { + fprintf(stderr, "encoding: process_interleaved %s\n", ok? "succeeded" : "FAILED"); + fprintf(stderr, " state: %s\n", FLAC__StreamEncoderStateString[FLAC__stream_encoder_get_state(encoder)]); + } } left -= need; } After running this I get: encoding: process_interleaved FAILED state: FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA encoding: FAILED state: FLAC__STREAM_ENCODER_UNINITIALIZED Several runs to process_inte...