Commit 652d2ed7 authored by Monty's avatar Monty
Browse files

More shuffling of includes to ease codebook integration.  This breaks
the VQ build, but I'll fix that right away.

Monty

svn path=/trunk/vorbis/; revision=223
parent 80ccca87
# vorbis makefile configured for use with gcc on any platform
# $Id: Makefile.in,v 1.1 1999/12/31 12:35:38 xiphmont Exp $
# $Id: Makefile.in,v 1.2 2000/01/05 03:10:23 xiphmont Exp $
###############################################################################
# #
......@@ -27,7 +27,7 @@ AR=@AR@
RANLIB=@RANLIB@
LIBS=@LIBS@ -lm
HFILES = ../include/codec.h ../include/vorbisfile.h
HFILES = ../include/vorbis/codec.h ../include/vorbis/vorbisfile.h
OFILES = encoder_example.o decoder_example.o chaining_example.o
BINFILES = encoder_example decoder_example chaining_example
......
......@@ -12,12 +12,12 @@
********************************************************************
function: illustrate simple use of chained bitstream and vorbisfile.a
last mod: $Id: chaining_example.c,v 1.2 1999/12/30 07:26:26 xiphmont Exp $
last mod: $Id: chaining_example.c,v 1.3 2000/01/05 03:10:24 xiphmont Exp $
********************************************************************/
#include "codec.h"
#include "vorbisfile.h"
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"
int main(){
OggVorbis_File ov;
......
......@@ -12,7 +12,7 @@
********************************************************************
function: simple example decoder
last mod: $Id: decoder_example.c,v 1.2 1999/12/30 07:26:27 xiphmont Exp $
last mod: $Id: decoder_example.c,v 1.3 2000/01/05 03:10:25 xiphmont Exp $
********************************************************************/
......@@ -24,7 +24,7 @@
#include <stdio.h>
#include <math.h>
#include "codec.h"
#include "vorbis/codec.h"
int16_t convbuffer[4096]; /* take 8k out of the data segment, not the stack */
int convsize=4096;
......
......@@ -12,7 +12,7 @@
********************************************************************
function: simple example encoder
last mod: $Id: encoder_example.c,v 1.2 1999/12/30 07:26:28 xiphmont Exp $
last mod: $Id: encoder_example.c,v 1.3 2000/01/05 03:10:26 xiphmont Exp $
********************************************************************/
......@@ -25,7 +25,7 @@
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include "codec.h"
#include "vorbis/codec.h"
#define READ 1024
signed char readbuffer[READ*4+44]; /* out of the data segment, not the stack */
......
/********************************************************************
* *
* THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
* PLEASE READ THESE TERMS DISTRIBUTING. *
* *
* THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
* by Monty <monty@xiph.org> and The XIPHOPHORUS Company *
* http://www.xiph.org/ *
* *
********************************************************************
function: codebook types
last mod: $Id: codebook.h,v 1.1 2000/01/05 03:10:47 xiphmont Exp $
********************************************************************/
#ifndef _V_CODEBOOK_H_
#define _V_CODEBOOK_H_
/* This structure encapsulates huffman and VQ style encoding books; it
doesn't do anything specific to either.
valuelist/quantlist are nonNULL (and q_* significant) only if
there's entry->value mapping to be done.
If encode-side mapping must be done (and thus the entry needs to be
hunted), the auxiliary encode pointer will point to a decision
tree. This is true of both VQ and huffman, but is mostly useful
with VQ.
*/
typedef struct codebook{
long dim; /* codebook dimensions (elements per vector) */
long entries; /* codebook entries */
/* mapping */
long q_min; /* packed 24 bit float; quant value 0 maps to minval */
long q_delta; /* packed 24 bit float; val 1 - val 0 == delta */
int q_quant; /* 0 < quant <= 16 */
int q_sequencep; /* bitflag */
double *valuelist; /* list of dim*entries actual entry values */
long *quantlist; /* list of dim*entries quantized entry values */
/* actual codewords/lengths */
long *codelist; /* list of bitstream codewords for each entry */
long *lengthlist; /* codeword lengths in bits */
struct encode_aux *encode_tree;
struct decode_aux *decode_tree;
} codebook;
typedef struct encode_aux{
/* pre-calculated partitioning tree */
long *ptr0;
long *ptr1;
double *n; /* decision hyperplanes: sum(x_i*n_i)[0<=i<dim]=c */
double *c; /* decision hyperplanes: sum(x_i*n_i)[0<=i<dim]=c */
long *p; /* decision points (each is an entry) */
long *q; /* decision points (each is an entry) */
long aux; /* number of tree entries */
long alloc;
} encode_aux;
typedef struct decode_aux{
long *ptr0;
long *ptr1;
} decode_aux;
#endif
......@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
last mod: $Id: codec.h,v 1.4 2000/01/04 09:04:54 xiphmont Exp $
last mod: $Id: codec.h,v 1.1 2000/01/05 03:10:47 xiphmont Exp $
********************************************************************/
......@@ -32,61 +32,8 @@
# define int16_t size16
#endif
/* lookup structures for various simple transforms *****************/
typedef struct {
int n;
struct vorbis_info *vi;
double *maskthresh;
double *barknum;
} psy_lookup;
typedef struct {
int n;
int log2n;
double *trig;
int *bitrev;
} mdct_lookup;
typedef struct {
int n;
double *trigcache;
int *splitcache;
} drft_lookup;
typedef struct {
int winlen;
double *window;
mdct_lookup mdct;
} envelope_lookup;
typedef struct lpclook{
/* en/decode lookups */
int *linearmap;
double *barknorm;
drft_lookup fft;
int n;
int ln;
int m;
} lpc_lookup;
/* structures for various internal data abstractions ********************/
typedef struct {
long endbyte;
int endbit;
unsigned char *buffer;
unsigned char *ptr;
long storage;
} oggpack_buffer;
#include "vorbis/codebook.h"
#include "vorbis/internal.h"
/* vobis_info contains all the setup information specific to the specific
compression/decompression mode in progress (eg, psychoacoustic settings,
......
/********************************************************************
* *
* THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
* PLEASE READ THESE TERMS DISTRIBUTING. *
* *
* THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
* by Monty <monty@xiph.org> and The XIPHOPHORUS Company *
* http://www.xiph.org/ *
* *
********************************************************************
function: libvorbis codec internal types. These structures are
'visible', but generally uninteresting to the developer
last mod: $Id: internal.h,v 1.1 2000/01/05 03:10:47 xiphmont Exp $
********************************************************************/
#ifndef _vorbis_internal_h_
#define _vorbis_internal_h_
/* lookup structures for various simple transforms *****************/
typedef struct {
int n;
struct vorbis_info *vi;
double *maskthresh;
double *barknum;
} psy_lookup;
typedef struct {
int n;
int log2n;
double *trig;
int *bitrev;
} mdct_lookup;
typedef struct {
int n;
double *trigcache;
int *splitcache;
} drft_lookup;
typedef struct {
int winlen;
double *window;
mdct_lookup mdct;
} envelope_lookup;
typedef struct lpclook{
/* en/decode lookups */
int *linearmap;
double *barknorm;
drft_lookup fft;
int n;
int ln;
int m;
} lpc_lookup;
/* structures for various internal data abstractions ********************/
typedef struct {
long endbyte;
int endbit;
unsigned char *buffer;
unsigned char *ptr;
long storage;
} oggpack_buffer;
#endif
......@@ -12,7 +12,7 @@
********************************************************************
function: predefined encoding modes
last mod: $Id: modes.h,v 1.3 2000/01/04 09:04:55 xiphmont Exp $
last mod: $Id: modes.h,v 1.1 2000/01/05 03:10:47 xiphmont Exp $
********************************************************************/
......@@ -20,7 +20,7 @@
#define _V_MODES_H_
#include <stdio.h>
#include "codec.h"
#include "vorbis/codec.h"
/*
0 1 2 3 4 5 6 7 8 9
......
......@@ -12,7 +12,7 @@
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
last mod: $Id: vorbisfile.h,v 1.2 1999/12/30 07:26:30 xiphmont Exp $
last mod: $Id: vorbisfile.h,v 1.1 2000/01/05 03:10:47 xiphmont Exp $
********************************************************************/
......
# vorbis makefile configured for use with gcc on any platform
# $Id: Makefile.in,v 1.19 2000/01/04 09:04:56 xiphmont Exp $
# $Id: Makefile.in,v 1.20 2000/01/05 03:10:52 xiphmont Exp $
###############################################################################
# #
......@@ -27,7 +27,7 @@ AR=@AR@
RANLIB=@RANLIB@
LIBS=@LIBS@ -lm
HFILES = ../include/codec.h ../include/vorbisfile.h \
HFILES = ../include/vorbis/codec.h ../include/vorbis/vorbisfile.h \
bitwise.h envelope.h lpc.h lsp.h \
psy.h smallft.h window.h scales.h os.h mdct.h
LFILES = framing.o mdct.o smallft.o block.o envelope.o window.o\
......
......@@ -12,15 +12,16 @@
********************************************************************
function: single-block PCM analysis
last mod: $Id: analysis.c,v 1.19 2000/01/04 09:04:57 xiphmont Exp $
last mod: $Id: analysis.c,v 1.20 2000/01/05 03:10:53 xiphmont Exp $
********************************************************************/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vorbis/codec.h"
#include "os.h"
#include "codec.h"
#include "lpc.h"
#include "lsp.h"
#include "envelope.h"
......
......@@ -12,14 +12,14 @@
********************************************************************
function: packing variable sized words into an octet stream
last mod: $Id: bitwise.h,v 1.3 1999/12/30 07:26:34 xiphmont Exp $
last mod: $Id: bitwise.h,v 1.4 2000/01/05 03:10:54 xiphmont Exp $
********************************************************************/
#ifndef _V_BITW_H_
#define _V_BITW_H_
#include "codec.h"
#include "vorbis/codec.h"
extern void _oggpack_writeinit(oggpack_buffer *b);
extern void _oggpack_reset(oggpack_buffer *b);
......
......@@ -12,7 +12,7 @@
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
last mod: $Id: block.c,v 1.20 2000/01/04 09:04:59 xiphmont Exp $
last mod: $Id: block.c,v 1.21 2000/01/05 03:10:55 xiphmont Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
......@@ -26,7 +26,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "codec.h"
#include "vorbis/codec.h"
#include "window.h"
#include "envelope.h"
#include "mdct.h"
......
......@@ -12,7 +12,7 @@
********************************************************************
function: PCM data envelope analysis and manipulation
last mod: $Id: envelope.c,v 1.12 1999/12/30 07:26:36 xiphmont Exp $
last mod: $Id: envelope.c,v 1.13 2000/01/05 03:10:56 xiphmont Exp $
Preecho calculation.
......@@ -22,9 +22,9 @@
#include <string.h>
#include <stdio.h>
#include <math.h>
#include "vorbis/codec.h"
#include "os.h"
#include "codec.h"
#include "mdct.h"
#include "envelope.h"
#include "bitwise.h"
......
......@@ -13,7 +13,7 @@
function: code raw [Vorbis] packets into framed OggSquish stream and
decode Ogg streams back into raw packets
last mod: $Id: framing.c,v 1.12 1999/12/30 07:26:38 xiphmont Exp $
last mod: $Id: framing.c,v 1.13 2000/01/05 03:10:57 xiphmont Exp $
note: The CRC code is directly derived from public domain code by
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
......@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include "codec.h"
#include "vorbis/codec.h"
/* A complete description of Ogg framing exists in docs/framing.html */
......
......@@ -12,7 +12,7 @@
********************************************************************
function: maintain the info structure, info <-> header packets
last mod: $Id: info.c,v 1.13 2000/01/04 09:05:00 xiphmont Exp $
last mod: $Id: info.c,v 1.14 2000/01/05 03:10:58 xiphmont Exp $
********************************************************************/
......@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include "modes.h"
#include "vorbis/modes.h"
#include "bitwise.h"
static int ilog2(unsigned int v){
......
......@@ -12,14 +12,14 @@
********************************************************************
function: LPC low level routines
last mod: $Id: lpc.h,v 1.6 1999/12/31 12:35:15 xiphmont Exp $
last mod: $Id: lpc.h,v 1.7 2000/01/05 03:10:59 xiphmont Exp $
********************************************************************/
#ifndef _V_LPC_H_
#define _V_LPC_H_
#include "codec.h"
#include "vorbis/codec.h"
extern void lpc_init(lpc_lookup *l,int n, long mapped, long rate, int m);
extern void lpc_clear(lpc_lookup *l);
......
......@@ -12,14 +12,14 @@
********************************************************************
function: modified discrete cosine transform prototypes
last mod: $Id: mdct.h,v 1.8 1999/12/30 07:26:45 xiphmont Exp $
last mod: $Id: mdct.h,v 1.9 2000/01/05 03:11:00 xiphmont Exp $
********************************************************************/
#ifndef _OGG_mdct_H_
#define _OGG_mdct_H_
#include "codec.h"
#include "vorbis/codec.h"
extern void mdct_init(mdct_lookup *lookup,int n);
extern void mdct_clear(mdct_lookup *l);
......
......@@ -12,7 +12,7 @@
********************************************************************
function: random psychoacoustics (not including preecho)
last mod: $Id: psy.c,v 1.9 2000/01/04 09:05:02 xiphmont Exp $
last mod: $Id: psy.c,v 1.10 2000/01/05 03:11:01 xiphmont Exp $
********************************************************************/
......@@ -20,7 +20,8 @@
#include <math.h>
#include <string.h>
#include <stdio.h>
#include "codec.h"
#include "vorbis/codec.h"
#include "psy.h"
#include "lpc.h"
#include "smallft.h"
......
......@@ -12,14 +12,14 @@
********************************************************************
function: fft transform
last mod: $Id: smallft.h,v 1.4 1999/12/30 07:26:50 xiphmont Exp $
last mod: $Id: smallft.h,v 1.5 2000/01/05 03:11:02 xiphmont Exp $
********************************************************************/
#ifndef _V_SMFT_H_
#define _V_SMFT_H_
#include "codec.h"
#include "vorbis/codec.h"
extern void drft_forward(drft_lookup *l,double *data);
extern void drft_backward(drft_lookup *l,double *data);
......
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