Switch to the lowmem tremor branch

in addition to using slightly less memory, this branch also doesn't seem
to have the same issues with `-O2` builds that the main branch has.
This commit is contained in:
jacqueline
2024-02-14 12:21:33 +11:00
parent b31bc07555
commit 7ec0ff2589
51 changed files with 5712 additions and 7148 deletions
+47 -56
View File
@@ -1,12 +1,12 @@
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
* THIS FILE IS PART OF THE TremorOggVorbis 'TREMOR' CODEC SOURCE CODE. *
* *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* THE TremorOggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
* *
********************************************************************
@@ -26,8 +26,6 @@ extern "C"
#include <stdio.h>
#include "ivorbiscodec.h"
#define CHUNKSIZE 65535
#define READSIZE 1024
/* The function prototypes for the callbacks are basically the same as for
* the stdio functions fread, fseek, fclose, ftell.
* The one difference is that the FILE * arguments have been replaced with
@@ -40,86 +38,79 @@ extern "C"
*/
typedef struct {
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
int (*seek_func) (void *datasource, tremor_ogg_int64_t offset, int whence);
int (*close_func) (void *datasource);
long (*tell_func) (void *datasource);
} ov_callbacks;
#define NOTOPEN 0
#define PARTOPEN 1
#define OPENED 2
#define STREAMSET 3
#define INITSET 4
typedef struct OggVorbis_File {
typedef struct TremorOggVorbis_File {
void *datasource; /* Pointer to a FILE *, etc. */
int seekable;
ogg_int64_t offset;
ogg_int64_t end;
ogg_sync_state oy;
tremor_ogg_int64_t offset;
tremor_ogg_int64_t end;
tremor_ogg_sync_state *oy;
/* If the FILE handle isn't seekable (eg, a pipe), only the current
stream appears */
int links;
ogg_int64_t *offsets;
ogg_int64_t *dataoffsets;
ogg_uint32_t *serialnos;
ogg_int64_t *pcmlengths;
vorbis_info *vi;
vorbis_comment *vc;
tremor_ogg_int64_t *offsets;
tremor_ogg_int64_t *dataoffsets;
tremor_ogg_uint32_t *serialnos;
tremor_ogg_int64_t *pcmlengths;
vorbis_info vi;
vorbis_comment vc;
/* Decoding working state local storage */
ogg_int64_t pcm_offset;
tremor_ogg_int64_t pcm_offset;
int ready_state;
ogg_uint32_t current_serialno;
tremor_ogg_uint32_t current_serialno;
int current_link;
ogg_int64_t bittrack;
ogg_int64_t samptrack;
tremor_ogg_int64_t bittrack;
tremor_ogg_int64_t samptrack;
ogg_stream_state os; /* take physical pages, weld into a logical
tremor_ogg_stream_state *os; /* take physical pages, weld into a logical
stream of packets */
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
vorbis_block vb; /* local working space for packet->PCM decode */
vorbis_dsp_state *vd; /* central working state for the packet->PCM decoder */
ov_callbacks callbacks;
} OggVorbis_File;
} TremorOggVorbis_File;
extern int ov_clear(OggVorbis_File *vf);
extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_clear(TremorOggVorbis_File *vf);
extern int ov_open(FILE *f,TremorOggVorbis_File *vf,char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, TremorOggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);
extern int ov_test(FILE *f,TremorOggVorbis_File *vf,char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, TremorOggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(TremorOggVorbis_File *vf);
extern long ov_bitrate(OggVorbis_File *vf,int i);
extern long ov_bitrate_instant(OggVorbis_File *vf);
extern long ov_streams(OggVorbis_File *vf);
extern long ov_seekable(OggVorbis_File *vf);
extern long ov_serialnumber(OggVorbis_File *vf,int i);
extern long ov_bitrate(TremorOggVorbis_File *vf,int i);
extern long ov_bitrate_instant(TremorOggVorbis_File *vf);
extern long ov_streams(TremorOggVorbis_File *vf);
extern long ov_seekable(TremorOggVorbis_File *vf);
extern long ov_serialnumber(TremorOggVorbis_File *vf,int i);
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
extern ogg_int64_t ov_time_total(OggVorbis_File *vf,int i);
extern tremor_ogg_int64_t ov_raw_total(TremorOggVorbis_File *vf,int i);
extern tremor_ogg_int64_t ov_pcm_total(TremorOggVorbis_File *vf,int i);
extern tremor_ogg_int64_t ov_time_total(TremorOggVorbis_File *vf,int i);
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
extern int ov_raw_seek(TremorOggVorbis_File *vf,tremor_ogg_int64_t pos);
extern int ov_pcm_seek(TremorOggVorbis_File *vf,tremor_ogg_int64_t pos);
extern int ov_pcm_seek_page(TremorOggVorbis_File *vf,tremor_ogg_int64_t pos);
extern int ov_time_seek(TremorOggVorbis_File *vf,tremor_ogg_int64_t pos);
extern int ov_time_seek_page(TremorOggVorbis_File *vf,tremor_ogg_int64_t pos);
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
extern ogg_int64_t ov_time_tell(OggVorbis_File *vf);
extern tremor_ogg_int64_t ov_raw_tell(TremorOggVorbis_File *vf);
extern tremor_ogg_int64_t ov_pcm_tell(TremorOggVorbis_File *vf);
extern tremor_ogg_int64_t ov_time_tell(TremorOggVorbis_File *vf);
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
extern vorbis_info *ov_info(TremorOggVorbis_File *vf,int link);
extern vorbis_comment *ov_comment(TremorOggVorbis_File *vf,int link);
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
extern long ov_read(TremorOggVorbis_File *vf,void *buffer,int length,
int *bitstream);
#ifdef __cplusplus