Fix some whitespace in files changed in following commit.

Change-Id: Ie3f43e43076e0dcae9a10f1b0b9e4698b398acee
Reviewed-on: http://gerrit.rockbox.org/492
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
Michael Sevakis 2013-06-22 16:39:40 -04:00
parent bc3a079522
commit a9ea1a4269
9 changed files with 80 additions and 80 deletions

View file

@ -787,7 +787,7 @@ static void audio_reset_buffer_noalloc(
allocsize = ALIGN_UP(allocsize, sizeof (intptr_t)); allocsize = ALIGN_UP(allocsize, sizeof (intptr_t));
if (allocsize > filebuflen) if (allocsize > filebuflen)
goto bufpanic; goto bufpanic;
filebuflen -= allocsize; filebuflen -= allocsize;
/* Scratch memory */ /* Scratch memory */

View file

@ -99,7 +99,7 @@ static int num_channels; /* Current number of channels */
static int rec_mono_mode; /* how mono is created */ static int rec_mono_mode; /* how mono is created */
static struct encoder_config enc_config; /* Current encoder configuration */ static struct encoder_config enc_config; /* Current encoder configuration */
static unsigned long pre_record_ticks; /* pre-record time in ticks */ static unsigned long pre_record_ticks; /* pre-record time in ticks */
/**************************************************************************** /****************************************************************************
use 2 circular buffers: use 2 circular buffers:
pcm_buffer=DMA output buffer: chunks (8192 Bytes) of raw pcm audio data pcm_buffer=DMA output buffer: chunks (8192 Bytes) of raw pcm audio data
@ -166,7 +166,7 @@ static size_t enc_chunk_size; /* maximum encoder chunk size */
static unsigned long enc_sample_rate; /* sample rate used by encoder */ static unsigned long enc_sample_rate; /* sample rate used by encoder */
static bool pcmrec_context = false; /* called by pcmrec thread? */ static bool pcmrec_context = false; /* called by pcmrec thread? */
static bool pcm_buffer_empty; /* all pcm chunks processed? */ static bool pcm_buffer_empty; /* all pcm chunks processed? */
/** file flushing **/ /** file flushing **/
static int low_watermark; /* Low watermark to stop flush */ static int low_watermark; /* Low watermark to stop flush */
static int high_watermark; /* max chunk limit for data flush */ static int high_watermark; /* max chunk limit for data flush */
@ -259,7 +259,7 @@ static void pcmrec_raise_warning_status(unsigned long w)
{ {
warnings |= w; warnings |= w;
} }
/* Callback for when more data is ready - called in interrupt context */ /* Callback for when more data is ready - called in interrupt context */
static void pcm_rec_have_more(void **start, size_t *size) static void pcm_rec_have_more(void **start, size_t *size)
{ {
@ -457,7 +457,7 @@ void audio_pause_recording(void)
/** /**
* Resume current recording if paused * Resume current recording if paused
*/ */
void audio_resume_recording(void) void audio_resume_recording(void)
{ {
logf("audio_resume_recording"); logf("audio_resume_recording");
@ -466,11 +466,11 @@ void audio_resume_recording(void)
} /* audio_resume_recording */ } /* audio_resume_recording */
/** /**
* Note that microphone is mono, only left value is used * Note that microphone is mono, only left value is used
* See audiohw_set_recvol() for exact ranges. * See audiohw_set_recvol() for exact ranges.
* *
* @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN * @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN
* *
*/ */
void audio_set_recording_gain(int left, int right, int type) void audio_set_recording_gain(int left, int right, int type)
{ {
@ -503,7 +503,7 @@ unsigned long audio_num_recorded_bytes(void)
return num_rec_bytes; return num_rec_bytes;
} /* audio_num_recorded_bytes */ } /* audio_num_recorded_bytes */
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* Functions that execute in the context of audio thread */ /* Functions that execute in the context of audio thread */
@ -559,14 +559,14 @@ static inline void pcmrec_fnq_set_empty(void)
{ {
fnq_rd_pos = fnq_wr_pos; fnq_rd_pos = fnq_wr_pos;
} /* pcmrec_fnq_set_empty */ } /* pcmrec_fnq_set_empty */
/* returns true if the queue is full */ /* returns true if the queue is full */
static bool pcmrec_fnq_is_full(void) static bool pcmrec_fnq_is_full(void)
{ {
ssize_t size = fnq_wr_pos - fnq_rd_pos; ssize_t size = fnq_wr_pos - fnq_rd_pos;
if (size < 0) if (size < 0)
size += fnq_size; size += fnq_size;
return size >= fnq_size - MAX_PATH; return size >= fnq_size - MAX_PATH;
} /* pcmrec_fnq_is_full */ } /* pcmrec_fnq_is_full */
@ -575,7 +575,7 @@ static bool pcmrec_fnq_add_filename(const char *filename)
{ {
strlcpy(fn_queue + fnq_wr_pos, filename, MAX_PATH); strlcpy(fn_queue + fnq_wr_pos, filename, MAX_PATH);
fnq_wr_pos = FNQ_NEXT(fnq_wr_pos); fnq_wr_pos = FNQ_NEXT(fnq_wr_pos);
if (fnq_rd_pos != fnq_wr_pos) if (fnq_rd_pos != fnq_wr_pos)
return true; return true;
@ -607,7 +607,7 @@ static bool pcmrec_fnq_get_filename(char *filename)
if (filename) if (filename)
strlcpy(filename, fn_queue + fnq_rd_pos, MAX_PATH); strlcpy(filename, fn_queue + fnq_rd_pos, MAX_PATH);
fnq_rd_pos = FNQ_NEXT(fnq_rd_pos); fnq_rd_pos = FNQ_NEXT(fnq_rd_pos);
return true; return true;
} /* pcmrec_fnq_get_filename */ } /* pcmrec_fnq_get_filename */
@ -683,7 +683,7 @@ static void pcmrec_start_file(void)
logf("start file: file already open"); logf("start file: file already open");
pcmrec_raise_error_status(PCMREC_E_FNQ_DESYNC); pcmrec_raise_error_status(PCMREC_E_FNQ_DESYNC);
} }
if (errors != 0) if (errors != 0)
rec_fdata.chunk->flags |= CHUNKF_ERROR; rec_fdata.chunk->flags |= CHUNKF_ERROR;
@ -709,7 +709,7 @@ static void pcmrec_start_file(void)
{ {
pcmrec_update_sizes(enc_size, num_pcm); pcmrec_update_sizes(enc_size, num_pcm);
} }
rec_fdata.chunk->flags &= ~CHUNKF_START_FILE; rec_fdata.chunk->flags &= ~CHUNKF_START_FILE;
} /* pcmrec_start_file */ } /* pcmrec_start_file */
@ -893,7 +893,7 @@ static void pcmrec_flush(unsigned flush_num)
logf("writing:%d(%d):%s%s", num_ready, flush_num, logf("writing:%d(%d):%s%s", num_ready, flush_num,
interruptable ? "i" : "", interruptable ? "i" : "",
flush_num == PCMREC_FLUSH_MINI ? "m" : ""); flush_num == PCMREC_FLUSH_MINI ? "m" : "");
cpu_boost(true); cpu_boost(true);
remaining = flush_num; remaining = flush_num;
@ -1077,7 +1077,7 @@ static void pcmrec_new_stream(const char *filename, /* next file name */
logf("stream prerecord start"); logf("stream prerecord start");
start = data.pre_chunk = GET_ENC_CHUNK(pre_index); start = data.pre_chunk = GET_ENC_CHUNK(pre_index);
start->flags &= CHUNKF_START_FILE | CHUNKF_PRERECORD; start->flags &= CHUNKF_START_FILE | CHUNKF_PRERECORD;
} }
else else
{ {
logf("stream normal start"); logf("stream normal start");
@ -1145,7 +1145,7 @@ static void pcmrec_new_stream(const char *filename, /* next file name */
pcmrec_flush(PCMREC_FLUSH_ALL); pcmrec_flush(PCMREC_FLUSH_ALL);
did_flush = true; did_flush = true;
} }
fnq_add_fn(path); fnq_add_fn(path);
} }
@ -1271,7 +1271,7 @@ static void pcmrec_record(const char *filename)
num_rec_bytes = 0; num_rec_bytes = 0;
num_rec_samples = 0; num_rec_samples = 0;
if (!is_recording) if (!is_recording)
{ {
#if 0 #if 0
accum_rec_bytes = 0; accum_rec_bytes = 0;
@ -1371,7 +1371,7 @@ static void pcmrec_record(const char *filename)
static void pcmrec_stop(void) static void pcmrec_stop(void)
{ {
logf("pcmrec_stop"); logf("pcmrec_stop");
if (is_recording) if (is_recording)
{ {
dma_lock = true; /* lock dma write position */ dma_lock = true; /* lock dma write position */
@ -1401,7 +1401,7 @@ static void pcmrec_stop(void)
{ {
logf("fnq: not empty!"); logf("fnq: not empty!");
pcmrec_fnq_set_empty(); pcmrec_fnq_set_empty();
} }
/* be absolutely sure the file is closed */ /* be absolutely sure the file is closed */
if (errors != 0) if (errors != 0)
@ -1446,7 +1446,7 @@ static void pcmrec_pause(void)
static void pcmrec_resume(void) static void pcmrec_resume(void)
{ {
logf("pcmrec_resume"); logf("pcmrec_resume");
if (!is_recording) if (!is_recording)
{ {
logf("not recording"); logf("not recording");
@ -1593,7 +1593,7 @@ void enc_set_parameters(struct enc_parameters *params)
enc_num_chunks = bufsize / enc_chunk_size; enc_num_chunks = bufsize / enc_chunk_size;
logf("num chunks:%d", enc_num_chunks); logf("num chunks:%d", enc_num_chunks);
/* get real amount used by encoder chunks */ /* get real amount used by encoder chunks */
bufsize = enc_num_chunks*enc_chunk_size; bufsize = enc_num_chunks*enc_chunk_size;
logf("enc size:%lu", bufsize); logf("enc size:%lu", bufsize);
@ -1674,7 +1674,7 @@ struct enc_chunk_hdr * enc_get_chunk(void)
return chunk; return chunk;
} /* enc_get_chunk */ } /* enc_get_chunk */
/* releases the current chunk into the available chunks - /* releases the current chunk into the available chunks -
NOTE: can be called by pcmrec thread when splitting streams */ NOTE: can be called by pcmrec thread when splitting streams */
void enc_finish_chunk(void) void enc_finish_chunk(void)
{ {

View file

@ -280,7 +280,7 @@ static void set_gain(void)
{ {
if (global_settings.rec_mic_gain > sound_max(SOUND_MIC_GAIN)) if (global_settings.rec_mic_gain > sound_max(SOUND_MIC_GAIN))
global_settings.rec_mic_gain = sound_max(SOUND_MIC_GAIN); global_settings.rec_mic_gain = sound_max(SOUND_MIC_GAIN);
if (global_settings.rec_mic_gain < sound_min(SOUND_MIC_GAIN)) if (global_settings.rec_mic_gain < sound_min(SOUND_MIC_GAIN))
global_settings.rec_mic_gain = sound_min(SOUND_MIC_GAIN); global_settings.rec_mic_gain = sound_min(SOUND_MIC_GAIN);
@ -301,7 +301,7 @@ static void set_gain(void)
if (global_settings.rec_right_gain < sound_min(SOUND_RIGHT_GAIN)) if (global_settings.rec_right_gain < sound_min(SOUND_RIGHT_GAIN))
global_settings.rec_right_gain = sound_min(SOUND_RIGHT_GAIN); global_settings.rec_right_gain = sound_min(SOUND_RIGHT_GAIN);
/* AUDIO_SRC_LINEIN, AUDIO_SRC_FMRADIO, AUDIO_SRC_SPDIF */ /* AUDIO_SRC_LINEIN, AUDIO_SRC_FMRADIO, AUDIO_SRC_SPDIF */
audio_set_recording_gain(global_settings.rec_left_gain, audio_set_recording_gain(global_settings.rec_left_gain,
global_settings.rec_right_gain, global_settings.rec_right_gain,
@ -327,7 +327,7 @@ static bool read_peak_levels(int *peak_l, int *peak_r, int *balance)
return false; return false;
if (*peak_r > *peak_l) if (*peak_r > *peak_l)
balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_l ? balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_l ?
MIN((10000 * *peak_r) / *peak_l - 10000, 15118) : 15118); MIN((10000 * *peak_r) / *peak_l - 10000, 15118) : 15118);
else else
balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_r ? balance_mem[peak_time % BAL_MEM_SIZE] = (*peak_r ?
@ -394,7 +394,7 @@ static void change_recording_gain(bool increment, bool left, bool right)
} }
} }
/* /*
* Handle automatic gain control (AGC). * Handle automatic gain control (AGC).
* Change recording gain if peak_x levels are above or below * Change recording gain if peak_x levels are above or below
* target volume for specified timeouts. * target volume for specified timeouts.
@ -645,7 +645,7 @@ int rec_create_directory(void)
{ {
while (action_userabort(HZ) == false) while (action_userabort(HZ) == false)
{ {
splashf(0, "%s %s", splashf(0, "%s %s",
str(LANG_REC_DIR_NOT_WRITABLE), str(LANG_REC_DIR_NOT_WRITABLE),
str(LANG_OFF_ABORT)); str(LANG_OFF_ABORT));
} }
@ -1050,7 +1050,7 @@ bool recording_screen(bool no_source)
int trig_ypos[NB_SCREENS]; /* trigger bar y pos */ int trig_ypos[NB_SCREENS]; /* trigger bar y pos */
int trig_width[NB_SCREENS]; /* trigger bar width */ int trig_width[NB_SCREENS]; /* trigger bar width */
int top_height_req[NB_SCREENS]; /* required height for top half */ int top_height_req[NB_SCREENS]; /* required height for top half */
/* tweak layout tiny screens / big fonts */ /* tweak layout tiny screens / big fonts */
bool compact_view[NB_SCREENS] = { false }; bool compact_view[NB_SCREENS] = { false };
struct gui_synclist lists; /* the list in the bottom vp */ struct gui_synclist lists; /* the list in the bottom vp */
#if defined(HAVE_AGC) #if defined(HAVE_AGC)
@ -1445,7 +1445,7 @@ bool recording_screen(bool no_source)
#ifdef HAVE_MIC_REC #ifdef HAVE_MIC_REC
if(global_settings.rec_source == AUDIO_SRC_MIC) if(global_settings.rec_source == AUDIO_SRC_MIC)
{ {
global_settings.rec_mic_gain -= global_settings.rec_mic_gain -=
sound_steps(SOUND_MIC_GAIN); sound_steps(SOUND_MIC_GAIN);
} }
else else

View file

@ -77,7 +77,7 @@ void audio_beep(int duration);
/* Required call when audio buffer is required for some other purpose */ /* Required call when audio buffer is required for some other purpose */
/* implemented in apps but called from firmware(!) */ /* implemented in apps but called from firmware(!) */
unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size); unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size);
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
void audio_next_dir(void); void audio_next_dir(void);
@ -257,29 +257,29 @@ void audio_register_event_handler(AUDIO_EVENT_HANDLER handler, unsigned short ma
/***********************************************************************/ /***********************************************************************/
/* handler return codes */ /* handler return codes */
#define AUDIO_EVENT_RC_IGNORED 200 #define AUDIO_EVENT_RC_IGNORED 200
/* indicates that no action was taken or the event was not recognized */ /* indicates that no action was taken or the event was not recognized */
#define AUDIO_EVENT_RC_HANDLED 201 #define AUDIO_EVENT_RC_HANDLED 201
/* indicates that the event was handled and some action was taken which renders /* indicates that the event was handled and some action was taken which renders
the original event invalid; USE WITH CARE!; this return code aborts all further the original event invalid; USE WITH CARE!; this return code aborts all further
processing of the given event */ processing of the given event */
/***********************************************************************/ /***********************************************************************/
/* audio event IDs */ /* audio event IDs */
#define AUDIO_EVENT_POS_REPORT (1<<0) #define AUDIO_EVENT_POS_REPORT (1<<0)
/* sends a periodic song position report to handlers; a report is sent on /* sends a periodic song position report to handlers; a report is sent on
each kernal tick; the number of ticks per second is defined by HZ; on each each kernal tick; the number of ticks per second is defined by HZ; on each
report the current song position is passed in 'data'; if a handler takes an report the current song position is passed in 'data'; if a handler takes an
action that changes the song or the song position it must return action that changes the song or the song position it must return
AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */ AUDIO_EVENT_RC_HANDLED which suppresses the event for any remaining handlers */
#define AUDIO_EVENT_END_OF_TRACK (1<<1) #define AUDIO_EVENT_END_OF_TRACK (1<<1)
/* generated when the end of the currently playing track is reached; no /* generated when the end of the currently playing track is reached; no
data is passed; if the handler implements some alternate end-of-track data is passed; if the handler implements some alternate end-of-track
processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the processing it should return AUDIO_EVENT_RC_HANDLED which suppresses the
event for any remaining handlers as well as the normal end-of-track event for any remaining handlers as well as the normal end-of-track
processing */ processing */
#endif #endif

View file

@ -145,7 +145,7 @@ struct encoder_config
struct mp3_enc_config mp3_enc; struct mp3_enc_config mp3_enc;
struct wavpack_enc_config wavpack_enc; struct wavpack_enc_config wavpack_enc;
struct wav_enc_config wav_enc; struct wav_enc_config wav_enc;
}; };
}; };
/** Encoder chunk macros and definitions **/ /** Encoder chunk macros and definitions **/
@ -218,7 +218,7 @@ struct enc_file_event_data
unsigned long new_num_pcm; /* New number of pcm in chunk */ unsigned long new_num_pcm; /* New number of pcm in chunk */
const char *filename; /* filename to open if ENC_START_FILE */ const char *filename; /* filename to open if ENC_START_FILE */
int rec_file; /* Current file or < 0 if none */ int rec_file; /* Current file or < 0 if none */
unsigned long num_pcm_samples; /* Current pcm sample count written to unsigned long num_pcm_samples; /* Current pcm sample count written to
file so far. */ file so far. */
}; };

View file

@ -107,13 +107,13 @@ enum codec_command_action {
struct codec_api { struct codec_api {
off_t filesize; /* Total file length */ off_t filesize; /* Total file length */
off_t curpos; /* Current buffer position */ off_t curpos; /* Current buffer position */
struct mp3entry *id3; /* TAG metadata pointer */ struct mp3entry *id3; /* TAG metadata pointer */
int audio_hid; /* Current audio handle */ int audio_hid; /* Current audio handle */
/* The dsp instance to be used for audio output */ /* The dsp instance to be used for audio output */
struct dsp_config *dsp; struct dsp_config *dsp;
/* Returns buffer to malloc array. Only codeclib should need this. */ /* Returns buffer to malloc array. Only codeclib should need this. */
void* (*codec_get_buffer)(size_t *size); void* (*codec_get_buffer)(size_t *size);
/* Insert PCM data into audio buffer for playback. Playback will start /* Insert PCM data into audio buffer for playback. Playback will start
@ -121,7 +121,7 @@ struct codec_api {
void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count); void (*pcmbuf_insert)(const void *ch1, const void *ch2, int count);
/* Set song position in WPS (value in ms). */ /* Set song position in WPS (value in ms). */
void (*set_elapsed)(unsigned long value); void (*set_elapsed)(unsigned long value);
/* Read next <size> amount bytes from file buffer to <ptr>. /* Read next <size> amount bytes from file buffer to <ptr>.
Will return number of bytes read or 0 if end of file. */ Will return number of bytes read or 0 if end of file. */
size_t (*read_filebuf)(void *ptr, size_t size); size_t (*read_filebuf)(void *ptr, size_t size);
@ -198,7 +198,7 @@ struct codec_api {
void (*profile_func_enter)(void *this_fn, void *call_site); void (*profile_func_enter)(void *this_fn, void *call_site);
void (*profile_func_exit)(void *this_fn, void *call_site); void (*profile_func_exit)(void *this_fn, void *call_site);
#endif #endif
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
void (*enc_get_inputs)(struct enc_inputs *inputs); void (*enc_get_inputs)(struct enc_inputs *inputs);
void (*enc_set_parameters)(struct enc_parameters *params); void (*enc_set_parameters)(struct enc_parameters *params);

View file

@ -185,7 +185,7 @@ static const uint8_t ht_count_const[2][2][16] =
{ {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */ { {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, /* table1 */
{ 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */ { 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 } } }; /* hleng1 */
static const uint8_t t1HB_const[4] = {1,1,1,0}; static const uint8_t t1HB_const[4] = {1,1,1,0};
static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0}; static const uint8_t t2HB_const[9] = {1,2,1,3,1,1,3,2,0};
static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0}; static const uint8_t t3HB_const[9] = {3,2,1,1,1,1,3,2,0};
static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0}; static const uint8_t t5HB_const[16] = {1,2,6,5,3,1,4,4,7,5,7,1,6,1,1,0};
@ -739,11 +739,11 @@ static const short int2idx_const[4096] = /* int2idx[i] = sqrt(i*sqrt(i)); */
509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510, 509,509,509,509,509,509,509,509,509,509,510,510,510,510,510,510,510,510,510,510,
510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 }; 510,511,511,511,511,511,511,511,511,511,511,512,512,512,512,512 };
static const int order[32] = static const int order[32] =
{ 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29, { 0, 1, 16, 17, 8, 9, 24, 25, 4, 5, 20, 21, 12, 13, 28, 29,
2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 }; 2, 3, 18, 19,10,11, 26, 27, 6, 7, 22, 23, 14, 15, 30, 31 };
static const long sampr_index[2][3] = static const long sampr_index[2][3] =
{ { 22050, 24000, 16000 }, /* MPEG 2 */ { { 22050, 24000, 16000 }, /* MPEG 2 */
{ 44100, 48000, 32000 } }; /* MPEG 1 */ { 44100, 48000, 32000 } }; /* MPEG 1 */
@ -765,7 +765,7 @@ static const int ca_const[8] =
static const int cs_const[8] = static const int cs_const[8] =
{ 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 }; { 28098, 28893, 31117, 32221, 32621, 32740, 32765, 32768 };
static const short enwindow_const[15*27+24] = static const short enwindow_const[15*27+24] =
{ 0, 65, 593, 1766, 22228, 2115, 611, 62, { 0, 65, 593, 1766, 22228, 2115, 611, 62,
8, 119, 1419, 10564,-11659,-1635,-154, -9, 8, 119, 1419, 10564,-11659,-1635,-154, -9,
-8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91, -8, -119,-1419,-10564, 11659, 1635, 154, 9, 464, 100, 91,
@ -853,7 +853,7 @@ static void encodeSideInfo( side_info_t si[2][2] )
{ {
int gr, ch, header; int gr, ch, header;
uint32_t cc=0, sz=0; uint32_t cc=0, sz=0;
/* /*
* MPEG header layout: * MPEG header layout:
* AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM * AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM
@ -960,7 +960,7 @@ static void Huffmancodebits( short *ix, char *xr_sign, side_info_t *gi )
if(bigvals > region2) if(bigvals > region2)
bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]); bits += HuffmanCode(ix, xr_sign, region2, bigvals, gi->table_select[2]);
if(count1 > bigvals) if(count1 > bigvals)
bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]); bits += HuffmanCod1(ix, xr_sign, bigvals, count1, gi->table_select[3]);
@ -1158,7 +1158,7 @@ static int choose_table( short *ix, uint32_t begin, uint32_t end, int *bits )
{ {
uint32_t i; uint32_t i;
int max, table0, table1; int max, table0, table1;
for(i=begin,max=0; i<end; i++) for(i=begin,max=0; i<end; i++)
if(ix[i] > max) if(ix[i] > max)
max = ix[i]; max = ix[i];
@ -1315,7 +1315,7 @@ static int calc_runlen( short *ix, side_info_t *si )
int w = ix[i-2]; int w = ix[i-2];
int x = ix[i-3]; int x = ix[i-3];
int y = ix[i-4]; int y = ix[i-4];
if((v | w | x | y) <= 1) if((v | w | x | y) <= 1)
{ {
p = (y<<3) + (x<<2) + (w<<1) + (v); p = (y<<3) + (x<<2) + (w<<1) + (v);
@ -1380,7 +1380,7 @@ static int quantize_int(int *xr, short *ix, side_info_t *si)
static void subdivide(side_info_t *si) static void subdivide(side_info_t *si)
{ {
int scfb, count0, count1; int scfb, count0, count1;
if( !si->address3 ) if( !si->address3 )
{ /* no bigvalue region */ { /* no bigvalue region */
si->region_0_1 = 0; si->region_0_1 = 0;
@ -1442,7 +1442,7 @@ static int quantize_and_count_bits(int *xr, short *ix, side_info_t *si)
/************************************************************************/ /************************************************************************/
/* The code selects the best quantStep for a particular set of scalefacs*/ /* The code selects the best quantStep for a particular set of scalefacs*/
/************************************************************************/ /************************************************************************/
static int inner_loop(int *xr, int max_bits, side_info_t *si) static int inner_loop(int *xr, int max_bits, side_info_t *si)
{ {
int bits; int bits;
@ -1783,7 +1783,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
a[ 7] -= a[ 6]; a[ 7] -= a[ 6];
a[22] -= a[ 7]; a[22] -= a[ 7];
a[23] -= a[22]; a[23] -= a[22];
xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr; xr = a[ 6]; a[ 6] = a[31] - xr; a[31] = a[31] + xr;
xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr; xr = a[ 7]; a[ 7] = a[30] - xr; a[30] = a[30] + xr;
xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr; xr = a[22]; a[22] = a[15] - xr; a[15] = a[15] + xr;
@ -1803,23 +1803,23 @@ void window_subband2(short *x1, int a[SBLIMIT])
xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25]; xr = a[ 1] - a[13]; a[ 1] += a[13]; a[13] = shft9(xr) * wp[ -4*27+25];
xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25]; xr = a[16] - a[28]; a[16] += a[28]; a[28] = shft9(xr) * wp[ -4*27+25];
xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25]; xr =-a[17] + a[29]; a[17] += a[29]; a[29] = shft9(xr) * wp[ -4*27+25];
xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr; xr = SQRT * shft9(a[ 2] - a[10]); a[ 2] += a[10]; a[10] = xr;
xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr; xr = SQRT * shft9(a[ 3] - a[11]); a[ 3] += a[11]; a[11] = xr;
xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18]; xr = SQRT * shft9(a[26] - a[18]); a[18] += a[26]; a[26] = xr - a[18];
xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19]; xr = SQRT * shft9(a[27] - a[19]); a[19] += a[27]; a[27] = xr - a[19];
xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr; xr = a[ 2]; a[19] -= a[ 3]; a[ 3] -= xr; a[ 2] = a[31] - xr; a[31] += xr;
xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr; xr = a[ 3]; a[11] -= a[19]; a[18] -= xr; a[ 3] = a[30] - xr; a[30] += xr;
xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr; xr = a[18]; a[27] -= a[11]; a[19] -= xr; a[18] = a[15] - xr; a[15] += xr;
xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr; xr = a[19]; a[10] -= xr; a[19] = a[14] - xr; a[14] += xr;
xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr; xr = a[10]; a[11] -= xr; a[10] = a[23] - xr; a[23] += xr;
xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr; xr = a[11]; a[26] -= xr; a[11] = a[22] - xr; a[22] += xr;
xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr; xr = a[26]; a[27] -= xr; a[26] = a[ 7] - xr; a[ 7] += xr;
xr = a[27]; a[27] = a[6] - xr; a[6] += xr; xr = a[27]; a[27] = a[6] - xr; a[6] += xr;
xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr; xr = SQRT * shft9(a[ 0] - a[ 4]); a[ 0] += a[ 4]; a[ 4] = xr;
xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr; xr = SQRT * shft9(a[ 1] - a[ 5]); a[ 1] += a[ 5]; a[ 5] = xr;
xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr; xr = SQRT * shft9(a[16] - a[20]); a[16] += a[20]; a[20] = xr;
@ -1828,15 +1828,15 @@ void window_subband2(short *x1, int a[SBLIMIT])
xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9]; xr =-SQRT * shft9(a[ 9] - a[13]); a[ 9] += a[13]; a[13] = xr - a[ 9];
xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25]; xr =-SQRT * shft9(a[25] - a[29]); a[25] += a[29]; a[29] = xr - a[25];
xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24]; xr =-SQRT * shft9(a[24] + a[28]); a[24] -= a[28]; a[28] = xr - a[24];
xr = a[24] - a[16]; a[24] = xr; xr = a[24] - a[16]; a[24] = xr;
xr = a[20] - xr; a[20] = xr; xr = a[20] - xr; a[20] = xr;
xr = a[28] - xr; a[28] = xr; xr = a[28] - xr; a[28] = xr;
xr = a[25] - a[17]; a[25] = xr; xr = a[25] - a[17]; a[25] = xr;
xr = a[21] - xr; a[21] = xr; xr = a[21] - xr; a[21] = xr;
xr = a[29] - xr; a[29] = xr; xr = a[29] - xr; a[29] = xr;
xr = a[17] - a[1]; a[17] = xr; xr = a[17] - a[1]; a[17] = xr;
xr = a[ 9] - xr; a[ 9] = xr; xr = a[ 9] - xr; a[ 9] = xr;
xr = a[25] - xr; a[25] = xr; xr = a[25] - xr; a[25] = xr;
@ -1844,7 +1844,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
xr = a[21] - xr; a[21] = xr; xr = a[21] - xr; a[21] = xr;
xr = a[13] - xr; a[13] = xr; xr = a[13] - xr; a[13] = xr;
xr = a[29] - xr; a[29] = xr; xr = a[29] - xr; a[29] = xr;
xr = a[ 1] - a[0]; a[ 1] = xr; xr = a[ 1] - a[0]; a[ 1] = xr;
xr = a[16] - xr; a[16] = xr; xr = a[16] - xr; a[16] = xr;
xr = a[17] - xr; a[17] = xr; xr = a[17] - xr; a[17] = xr;
@ -1860,7 +1860,7 @@ void window_subband2(short *x1, int a[SBLIMIT])
xr = a[13] - xr; a[13] = xr; xr = a[13] - xr; a[13] = xr;
xr = a[28] - xr; a[28] = xr; xr = a[28] - xr; a[28] = xr;
xr = a[29] - xr; a[29] = xr; xr = a[29] - xr; a[29] = xr;
xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr; xr = a[ 0]; a[ 0] += a[31]; a[31] -= xr;
xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr; xr = a[ 1]; a[ 1] += a[30]; a[30] -= xr;
xr = a[16]; a[16] += a[15]; a[15] -= xr; xr = a[16]; a[16] += a[15]; a[15] -= xr;
@ -1900,7 +1900,7 @@ void mdct_long(int *out, int *in)
ct = (tc1 - tc3 - tc4) * cx[6]; ct = (tc1 - tc3 - tc4) * cx[6];
out[5] = ct + st; out[5] = ct + st;
out[6] = ct - st; out[6] = ct - st;
tc2 = (in[16] - in[10]) * cx[6]; tc2 = (in[16] - in[10]) * cx[6];
ts6 = ts6 * cx[7] + in[4] * cx[8]; ts6 = ts6 * cx[7] + in[4] * cx[8];
@ -1908,12 +1908,12 @@ void mdct_long(int *out, int *in)
st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3]; st = -ts5 * cx[4] + ts6 - ts7 * cx[5] + ts8 * cx[3];
out[1] = ct + st; out[1] = ct + st;
out[2] = ct - st; out[2] = ct - st;
ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0]; ct = tc1 * cx[1] - tc2 - tc3 * cx[2] + tc4 * cx[0];
st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4]; st = -ts5 * cx[5] + ts6 - ts7 * cx[3] + ts8 * cx[4];
out[ 9] = ct + st; out[ 9] = ct + st;
out[10] = ct - st; out[10] = ct - st;
ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1]; ct = tc1 * cx[2] - tc2 + tc3 * cx[0] - tc4 * cx[1];
st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5]; st = ts5 * cx[3] - ts6 + ts7 * cx[4] - ts8 * cx[5];
out[13] = ct + st; out[13] = ct + st;
@ -1966,7 +1966,7 @@ static int find_samplerate_index(long freq, int *mp3_type)
int mpeg = freq >= (32000+24000)/2 ? 1 : 0; int mpeg = freq >= (32000+24000)/2 ? 1 : 0;
int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true); int i = ci->round_value_to_list32(freq, sampr_index[mpeg], 3, true);
*mp3_type = mpeg; *mp3_type = mpeg;
return i; return i;
} }
static bool init_mp3_encoder_engine(int sample_rate, static bool init_mp3_encoder_engine(int sample_rate,
@ -2523,7 +2523,7 @@ static void enc_events_callback(enum enc_events event, void *data)
return; return;
break; break;
case ENC_END_FILE: case ENC_END_FILE:
if (on_end_file((struct enc_file_event_data *)data)) if (on_end_file((struct enc_file_event_data *)data))
return; return;

View file

@ -40,7 +40,7 @@ struct riff_header
uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
/* Not for audio_format=1 (PCM) */ /* Not for audio_format=1 (PCM) */
/* unsigned short extra_param_size; 24h - size of extra data */ /* unsigned short extra_param_size; 24h - size of extra data */
/* unsigned char *extra_params; */ /* unsigned char *extra_params; */
/* data header */ /* data header */
uint8_t data_id[4]; /* 24h - "data" */ uint8_t data_id[4]; /* 24h - "data" */
@ -68,7 +68,7 @@ static const struct riff_header riff_header =
/* "RIFF" header */ /* "RIFF" header */
{ 'R', 'I', 'F', 'F' }, /* riff_id */ { 'R', 'I', 'F', 'F' }, /* riff_id */
0, /* riff_size (*) */ 0, /* riff_size (*) */
/* format header */ /* format header */
{ 'W', 'A', 'V', 'E' }, /* format */ { 'W', 'A', 'V', 'E' }, /* format */
{ 'f', 'm', 't', ' ' }, /* format_id */ { 'f', 'm', 't', ' ' }, /* format_id */
htole32(16), /* format_size */ htole32(16), /* format_size */

View file

@ -47,7 +47,7 @@ struct riff_header
uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */ uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */ uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
/* Not for audio_format=1 (PCM) */ /* Not for audio_format=1 (PCM) */
/* unsigned short extra_param_size; 24h - size of extra data */ /* unsigned short extra_param_size; 24h - size of extra data */
/* unsigned char *extra_params; */ /* unsigned char *extra_params; */
/* data header */ /* data header */
uint8_t data_id[4]; /* 24h - "data" */ uint8_t data_id[4]; /* 24h - "data" */
@ -82,7 +82,7 @@ static const struct riff_header riff_header =
/* "RIFF" header */ /* "RIFF" header */
{ 'R', 'I', 'F', 'F' }, /* riff_id */ { 'R', 'I', 'F', 'F' }, /* riff_id */
0, /* riff_size (*) */ 0, /* riff_size (*) */
/* format header */ /* format header */
{ 'W', 'A', 'V', 'E' }, /* format */ { 'W', 'A', 'V', 'E' }, /* format */
{ 'f', 'm', 't', ' ' }, /* format_id */ { 'f', 'm', 't', ' ' }, /* format_id */
htole32(16), /* format_size */ htole32(16), /* format_size */
@ -234,7 +234,7 @@ static bool on_start_file(struct enc_file_event_data *data)
data->num_pcm_samples = 0; data->num_pcm_samples = 0;
/* write template headers */ /* write template headers */
if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh)) if (ci->write(data->rec_file, &wvpk_mdh, sizeof (wvpk_mdh))
!= sizeof (wvpk_mdh) || != sizeof (wvpk_mdh) ||
ci->write(data->rec_file, &riff_header, sizeof (riff_header)) ci->write(data->rec_file, &riff_header, sizeof (riff_header))
!= sizeof (riff_header)) != sizeof (riff_header))
@ -344,7 +344,7 @@ static bool init_encoder(void)
{ {
struct enc_inputs inputs; struct enc_inputs inputs;
struct enc_parameters params; struct enc_parameters params;
codec_init(); codec_init();
if (ci->enc_get_inputs == NULL || if (ci->enc_get_inputs == NULL ||