Commit d1f7303e authored by Michael Smith's avatar Michael Smith

Convert tabs to spaces. Remove accidently committed debug line

svn path=/trunk/vorbis-tools/; revision=11665
parent 5d3fdcfa
This diff is collapsed.
......@@ -14,41 +14,41 @@ void clear_scaler(oe_enc_opt *opt);
typedef struct
{
int (*id_func)(unsigned char *buf, int len); /* Returns true if can load file */
int id_data_len; /* Amount of data needed to id whether this can load the file */
int (*open_func)(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen);
void (*close_func)(void *);
char *format;
char *description;
int (*id_func)(unsigned char *buf, int len); /* Returns true if can load file */
int id_data_len; /* Amount of data needed to id whether this can load the file */
int (*open_func)(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen);
void (*close_func)(void *);
char *format;
char *description;
} input_format;
typedef struct {
short format;
short channels;
int samplerate;
int bytespersec;
short align;
short samplesize;
short format;
short channels;
int samplerate;
int bytespersec;
short align;
short samplesize;
} wav_fmt;
typedef struct {
short channels;
short samplesize;
long totalsamples;
long samplesread;
FILE *f;
short bigendian;
short channels;
short samplesize;
long totalsamples;
long samplesread;
FILE *f;
short bigendian;
int *channel_permute;
} wavfile;
typedef struct {
short channels;
int totalframes;
short samplesize;
int rate;
int offset;
int blocksize;
short channels;
int totalframes;
short samplesize;
int rate;
int offset;
int blocksize;
} aiff_fmt;
typedef wavfile aifffile; /* They're the same */
......
This diff is collapsed.
......@@ -91,16 +91,16 @@ typedef void (*EasyFLAC__StreamDecoderMetadataCallback)(const EasyFLAC__StreamDe
typedef void (*EasyFLAC__StreamDecoderErrorCallback)(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
struct EasyFLAC__StreamDecoder {
FLAC__bool is_oggflac;
FLAC__StreamDecoder *flac;
OggFLAC__StreamDecoder *oggflac;
struct {
EasyFLAC__StreamDecoderReadCallback read;
EasyFLAC__StreamDecoderWriteCallback write;
EasyFLAC__StreamDecoderMetadataCallback metadata;
EasyFLAC__StreamDecoderErrorCallback error;
void *client_data;
} callbacks;
FLAC__bool is_oggflac;
FLAC__StreamDecoder *flac;
OggFLAC__StreamDecoder *oggflac;
struct {
EasyFLAC__StreamDecoderReadCallback read;
EasyFLAC__StreamDecoderWriteCallback write;
EasyFLAC__StreamDecoderMetadataCallback metadata;
EasyFLAC__StreamDecoderErrorCallback error;
void *client_data;
} callbacks;
};
......
This diff is collapsed.
......@@ -7,9 +7,9 @@
typedef void TIMER;
typedef long (*audio_read_func)(void *src, float **buffer, int samples);
typedef void (*progress_func)(char *fn, long totalsamples,
long samples, double time);
long samples, double time);
typedef void (*enc_end_func)(char *fn, double time, int rate,
long samples, long bytes);
long samples, long bytes);
typedef void (*enc_start_func)(char *fn, char *outfn, int bitrate,
float quality, int qset, int managed, int min_br, int max_br);
typedef void (*error_func)(char *errormessage);
......@@ -28,9 +28,9 @@ void start_encode_full(char *fn, char *outfn, int bitrate, float quality, int qs
void start_encode_null(char *fn, char *outfn, int bitrate, float quality, int qset,
int managed, int min, int max);
void final_statistics(char *fn, double time, int rate, long total_samples,
long bytes);
long bytes);
void final_statistics_null(char *fn, double time, int rate, long total_samples,
long bytes);
long bytes);
void encode_error(char *errmsg);
typedef struct {
......@@ -40,89 +40,89 @@ typedef struct {
typedef struct
{
char **title;
int title_count;
char **artist;
int artist_count;
char **album;
int album_count;
char **comments;
int comment_count;
char **tracknum;
int track_count;
char **dates;
int date_count;
char **genre;
int genre_count;
char **title;
int title_count;
char **artist;
int artist_count;
char **album;
int album_count;
char **comments;
int comment_count;
char **tracknum;
int track_count;
char **dates;
int date_count;
char **genre;
int genre_count;
adv_opt *advopt;
int advopt_count;
int copy_comments;
int copy_comments;
int quiet;
int quiet;
int rawmode;
int raw_samplesize;
int raw_samplerate;
int raw_channels;
int rawmode;
int raw_samplesize;
int raw_samplerate;
int raw_channels;
int raw_endianness;
char *namefmt;
char *namefmt;
char *namefmt_remove;
char *namefmt_replace;
char *outfile;
char *outfile;
/* All 3 in kbps */
/* All 3 in kbps */
int managed;
int min_bitrate;
int nominal_bitrate;
int max_bitrate;
int min_bitrate;
int nominal_bitrate;
int max_bitrate;
/* Float from 0 to 1 (low->high) */
float quality;
/* Float from 0 to 1 (low->high) */
float quality;
int quality_set;
int resamplefreq;
int downmix;
float scale;
unsigned int serial;
unsigned int serial;
int fixedserial;
} oe_options;
typedef struct
{
vorbis_comment *comments;
unsigned int serialno;
audio_read_func read_samples;
progress_func progress_update;
enc_end_func end_encode;
enc_start_func start_encode;
error_func error;
void *readdata;
long total_samples_per_channel;
int channels;
long rate;
int samplesize;
vorbis_comment *comments;
unsigned int serialno;
audio_read_func read_samples;
progress_func progress_update;
enc_end_func end_encode;
enc_start_func start_encode;
error_func error;
void *readdata;
long total_samples_per_channel;
int channels;
long rate;
int samplesize;
int endianness;
int resamplefreq;
int copy_comments;
int copy_comments;
/* Various bitrate/quality options */
/* Various bitrate/quality options */
int managed;
int bitrate;
int min_bitrate;
int max_bitrate;
float quality;
int bitrate;
int min_bitrate;
int max_bitrate;
float quality;
int quality_set;
adv_opt *advopt;
int advopt_count;
FILE *out;
char *filename;
char *infilename;
FILE *out;
char *filename;
char *infilename;
} oe_enc_opt;
......
This diff is collapsed.
......@@ -8,27 +8,27 @@
#include "easyflac.h"
typedef struct {
EasyFLAC__StreamDecoder *decoder;
short channels;
int rate;
long totalsamples; /* per channel, of course */
EasyFLAC__StreamDecoder *decoder;
short channels;
int rate;
long totalsamples; /* per channel, of course */
FLAC__StreamMetadata *comments;
FLAC__StreamMetadata *comments;
FILE *in; /* Cache the FILE pointer so the FLAC read callback can use it */
int eos; /* End of stream read */
FILE *in; /* Cache the FILE pointer so the FLAC read callback can use it */
int eos; /* End of stream read */
/* Buffer for decoded audio */
float **buf; /* channels by buf_len array */
int buf_len;
int buf_start; /* Offset to start of audio data */
int buf_fill; /* Number of bytes of audio data in buffer */
/* Buffer for decoded audio */
float **buf; /* channels by buf_len array */
int buf_len;
int buf_start; /* Offset to start of audio data */
int buf_fill; /* Number of bytes of audio data in buffer */
/* Buffer for input data we already read in the id phase */
unsigned char *oldbuf;
int oldbuf_len;
int oldbuf_start;
/* Buffer for input data we already read in the id phase */
unsigned char *oldbuf;
int oldbuf_len;
int oldbuf_start;
} flacfile;
......
This diff is collapsed.
......@@ -27,21 +27,21 @@
void setbinmode(FILE *f)
{
_setmode( _fileno(f), _O_BINARY );
_setmode( _fileno(f), _O_BINARY );
}
#endif /* win32 */
#ifdef __EMX__
void setbinmode(FILE *f)
{
_fsetmode( f, "b");
_fsetmode( f, "b");
}
#endif
#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)
void setbinmode(FILE *f)
{
setmode(fileno(f), O_BINARY);
setmode(fileno(f), O_BINARY);
}
#endif
......@@ -49,18 +49,18 @@ void setbinmode(FILE *f)
#if defined(_WIN32) || defined(__EMX__) || defined(__WATCOMC__)
void *timer_start(void)
{
time_t *start = malloc(sizeof(time_t));
time(start);
return (void *)start;
time_t *start = malloc(sizeof(time_t));
time(start);
return (void *)start;
}
double timer_time(void *timer)
{
time_t now = time(NULL);
time_t start = *((time_t *)timer);
time_t now = time(NULL);
time_t start = *((time_t *)timer);
if(now-start)
return (double)(now-start);
return (double)(now-start);
else
return 1; /* To avoid division by zero later, for very short inputs */
}
......@@ -68,7 +68,7 @@ double timer_time(void *timer)
void timer_clear(void *timer)
{
free((time_t *)timer);
free((time_t *)timer);
}
#else /* unix. Or at least win32 */
......@@ -78,25 +78,25 @@ void timer_clear(void *timer)
void *timer_start(void)
{
struct timeval *start = malloc(sizeof(struct timeval));
gettimeofday(start, NULL);
return (void *)start;
struct timeval *start = malloc(sizeof(struct timeval));
gettimeofday(start, NULL);
return (void *)start;
}
double timer_time(void *timer)
{
struct timeval now;
struct timeval start = *((struct timeval *)timer);
struct timeval now;
struct timeval start = *((struct timeval *)timer);
gettimeofday(&now, NULL);
gettimeofday(&now, NULL);
return (double)now.tv_sec - (double)start.tv_sec +
((double)now.tv_usec - (double)start.tv_usec)/1000000.0;
return (double)now.tv_sec - (double)start.tv_sec +
((double)now.tv_usec - (double)start.tv_usec)/1000000.0;
}
void timer_clear(void *timer)
{
free((time_t *)timer);
free((time_t *)timer);
}
#endif
......
This diff is collapsed.
......@@ -7,14 +7,14 @@
* A resampler
*
* reference:
* 'Digital Filters', third edition, by R. W. Hamming ISBN 0-486-65088-X
* 'Digital Filters', third edition, by R. W. Hamming ISBN 0-486-65088-X
*
* history:
* 2002-05-31 ready for the world (or some small section thereof)
* 2002-05-31 ready for the world (or some small section thereof)
*
*
* TOOD:
* zero-crossing clipping in coefficient table
* zero-crossing clipping in coefficient table
*/
#ifndef _RESAMPLE_H_INCLUDED
......@@ -24,22 +24,22 @@ typedef float SAMPLE;
typedef struct
{
unsigned int channels, infreq, outfreq, taps;
float *table;
SAMPLE *pool;
unsigned int channels, infreq, outfreq, taps;
float *table;
SAMPLE *pool;
/* dynamic bits */
int poolfill;
int offset;
/* dynamic bits */
int poolfill;
int offset;
} res_state;
typedef enum
{
RES_END,
RES_GAIN, /* (double)1.0 */
RES_CUTOFF, /* (double)0.80 */
RES_TAPS, /* (int)45 */
RES_BETA /* (double)16.0 */
RES_END,
RES_GAIN, /* (double)1.0 */
RES_CUTOFF, /* (double)0.80 */
RES_TAPS, /* (int)45 */
RES_BETA /* (double)16.0 */
} res_parameter;
int res_init(res_state *state, int channels, int outfreq, int infreq, res_parameter op1, ...);
......
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