[xiph-cvs] cvs commit: vorbis/lib Makefile.am analysis.c block.c envelope.c floor0.c info.c psytune.c synthesis.c vorbisfile.c
Jack Moffitt
jack at xiph.org
Tue Sep 26 11:45:36 PDT 2000
jack 00/09/26 11:45:36
Modified: . Tag: branch_jackoggsvorbis configure.in
include/vorbis Tag: branch_jackoggsvorbis codec.h
lib Tag: branch_jackoggsvorbis Makefile.am analysis.c
block.c envelope.c floor0.c info.c psytune.c
synthesis.c vorbisfile.c
Log:
frameno -> granulepos
library version fixes
Revision Changes Path
No revision
No revision
1.20.2.3.2.5 +10 -1 vorbis/configure.in
Index: configure.in
===================================================================
RCS file: /usr/local/cvsroot/vorbis/configure.in,v
retrieving revision 1.20.2.3.2.4
retrieving revision 1.20.2.3.2.5
diff -u -r1.20.2.3.2.4 -r1.20.2.3.2.5
--- configure.in 2000/09/12 22:48:56 1.20.2.3.2.4
+++ configure.in 2000/09/26 18:45:32 1.20.2.3.2.5
@@ -1,11 +1,20 @@
dnl Process this file with autoconf to produce a configure script
dnl ------------------------------------------------
-dnl Initialization
+dnl Initialization and Versioning
dnl ------------------------------------------------
AC_INIT(lib/mdct.c)
AM_INIT_AUTOMAKE(libvorbis,1.0.0)
+
+dnl Library versioning
+
+LIB_CURRENT=0
+LIB_REVISION=0
+LIB_AGE=0
+AC_SUBST(LIB_CURRENT)
+AC_SUBST(LIB_REVISION)
+AC_SUBST(LIB_AGE)
dnl --------------------------------------------------
dnl Check for programs
No revision
No revision
1.27.2.2.2.3 +3 -3 vorbis/include/vorbis/codec.h
Index: codec.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/include/vorbis/codec.h,v
retrieving revision 1.27.2.2.2.2
retrieving revision 1.27.2.2.2.3
diff -u -r1.27.2.2.2.2 -r1.27.2.2.2.3
--- codec.h 2000/09/03 08:34:51 1.27.2.2.2.2
+++ codec.h 2000/09/26 18:45:32 1.27.2.2.2.3
@@ -12,7 +12,7 @@
********************************************************************
function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.27.2.2.2.2 2000/09/03 08:34:51 jack Exp $
+ last mod: $Id: codec.h,v 1.27.2.2.2.3 2000/09/26 18:45:32 jack Exp $
********************************************************************/
@@ -171,7 +171,7 @@
long nW;
long centerW;
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
ogg_int64_t sequence;
ogg_int64_t glue_bits;
@@ -219,7 +219,7 @@
int mode;
int eofflag;
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
ogg_int64_t sequence;
vorbis_dsp_state *vd; /* For read-only access of configuration */
No revision
No revision
1.1.2.2 +1 -1 vorbis/lib/Attic/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/Attic/Makefile.am,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- Makefile.am 2000/09/07 06:32:39 1.1.2.1
+++ Makefile.am 2000/09/26 18:45:33 1.1.2.2
@@ -12,7 +12,7 @@
iir.c vorbisfile.c\
envelope.h lpc.h lsp.h bookinternal.h misc.h psy.h\
masking.h sharedbook.h iir.h os.h
-libvorbis_la_LDFLAGS = -version-info 1:0:0
+libvorbis_la_LDFLAGS = -version-info @LIB_CURRENT@:@LIB_REVISION@:@LIB_AGE@
debug:
$(MAKE) all CFLAGS="@DEBUG@"
1.33.2.2.2.2 +2 -2 vorbis/lib/analysis.c
Index: analysis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/analysis.c,v
retrieving revision 1.33.2.2.2.1
retrieving revision 1.33.2.2.2.2
diff -u -r1.33.2.2.2.1 -r1.33.2.2.2.2
--- analysis.c 2000/09/03 08:34:51 1.33.2.2.2.1
+++ analysis.c 2000/09/26 18:45:33 1.33.2.2.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: single-block PCM analysis mode dispatch
- last mod: $Id: analysis.c,v 1.33.2.2.2.1 2000/09/03 08:34:51 jack Exp $
+ last mod: $Id: analysis.c,v 1.33.2.2.2.2 2000/09/26 18:45:33 jack Exp $
********************************************************************/
@@ -67,7 +67,7 @@
op->bytes=oggpack_bytes(&vb->opb);
op->b_o_s=0;
op->e_o_s=vb->eofflag;
- op->frameno=vb->frameno;
+ op->granulepos=vb->granulepos;
op->packetno=vb->sequence; /* for sake of completeness */
return(0);
1.38.2.2.2.2 +15 -15 vorbis/lib/block.c
Index: block.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/block.c,v
retrieving revision 1.38.2.2.2.1
retrieving revision 1.38.2.2.2.2
diff -u -r1.38.2.2.2.1 -r1.38.2.2.2.2
--- block.c 2000/09/03 08:34:51 1.38.2.2.2.1
+++ block.c 2000/09/26 18:45:33 1.38.2.2.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.38.2.2.2.1 2000/09/03 08:34:51 jack Exp $
+ last mod: $Id: block.c,v 1.38.2.2.2.2 2000/09/26 18:45:33 jack Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
@@ -512,7 +512,7 @@
}
vb->vd=v;
vb->sequence=v->sequence;
- vb->frameno=v->frameno;
+ vb->granulepos=v->granulepos;
vb->pcmend=vi->blocksizes[v->W];
/* copy the vectors; this uses the local storage in vb */
@@ -559,12 +559,12 @@
v->eofflag-=movementW;
/* do not add padding to end of stream! */
if(v->centerW>=v->eofflag){
- v->frameno+=movementW-(v->centerW-v->eofflag);
+ v->granulepos+=movementW-(v->centerW-v->eofflag);
}else{
- v->frameno+=movementW;
+ v->granulepos+=movementW;
}
}else{
- v->frameno+=movementW;
+ v->granulepos+=movementW;
}
}
@@ -578,7 +578,7 @@
/* Adjust centerW to allow an easier mechanism for determining output */
v->pcm_returned=v->centerW;
v->centerW-= vi->blocksizes[v->W]/4+vi->blocksizes[v->lW]/4;
- v->frameno=-1;
+ v->granulepos=-1;
v->sequence=-1;
return(0);
@@ -622,7 +622,7 @@
v->floor_bits+=vb->floor_bits;
v->res_bits+=vb->res_bits;
- if(v->sequence+1 != vb->sequence)v->frameno=-1; /* out of sequence;
+ if(v->sequence+1 != vb->sequence)v->granulepos=-1; /* out of sequence;
lose count */
v->sequence=vb->sequence;
@@ -673,7 +673,7 @@
/* track the frame number... This is for convenience, but also
making sure our last packet doesn't end with added padding. If
the last packet is partial, the number of samples we'll have to
- return will be past the vb->frameno.
+ return will be past the vb->granulepos.
This is not foolproof! It will be confused if we begin
decoding at the last page after a seek or hole. In that case,
@@ -681,17 +681,17 @@
is. For this reason, vorbisfile will always try to make sure
it reads the last two marked pages in proper sequence */
- if(v->frameno==-1)
- v->frameno=vb->frameno;
+ if(v->granulepos==-1)
+ v->granulepos=vb->granulepos;
else{
- v->frameno+=(centerW-v->centerW);
- if(vb->frameno!=-1 && v->frameno!=vb->frameno){
- if(v->frameno>vb->frameno && vb->eofflag){
+ v->granulepos+=(centerW-v->centerW);
+ if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
+ if(v->granulepos>vb->granulepos && vb->eofflag){
/* partial last frame. Strip the padding off */
- centerW-=(v->frameno-vb->frameno);
+ centerW-=(v->granulepos-vb->granulepos);
}/* else{ Shouldn't happen *unless* the bitstream is out of
spec. Either way, believe the bitstream } */
- v->frameno=vb->frameno;
+ v->granulepos=vb->granulepos;
}
}
1.21.2.2.2.2 +9 -9 vorbis/lib/envelope.c
Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.21.2.2.2.1
retrieving revision 1.21.2.2.2.2
diff -u -r1.21.2.2.2.1 -r1.21.2.2.2.2
--- envelope.c 2000/09/03 08:34:52 1.21.2.2.2.1
+++ envelope.c 2000/09/26 18:45:33 1.21.2.2.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: PCM data envelope analysis and manipulation
- last mod: $Id: envelope.c,v 1.21.2.2.2.1 2000/09/03 08:34:52 jack Exp $
+ last mod: $Id: envelope.c,v 1.21.2.2.2.2 2000/09/26 18:45:33 jack Exp $
Preecho calculation.
@@ -115,16 +115,16 @@
float *workB=alloca(sizeof(float)*n2),B=0.;
long i;
- /*_analysis_output("A",frameno,pre,n,0,0);
- _analysis_output("B",frameno,post,n,0,0);*/
+ /*_analysis_output("A",granulepos,pre,n,0,0);
+ _analysis_output("B",granulepos,post,n,0,0);*/
for(i=0;i<n;i++){
workA[i]=pre[i]*ve->window[i];
workB[i]=post[i]*ve->window[i];
}
- /*_analysis_output("Awin",frameno,workA,n,0,0);
- _analysis_output("Bwin",frameno,workB,n,0,0);*/
+ /*_analysis_output("Awin",granulepos,workA,n,0,0);
+ _analysis_output("Bwin",granulepos,workB,n,0,0);*/
drft_forward(&ve->drft,workA);
drft_forward(&ve->drft,workB);
@@ -140,8 +140,8 @@
}
}
- /*_analysis_output("Afft",frameno,workA,n,0,0);
- _analysis_output("Bfft",frameno,workB,n,0,0);*/
+ /*_analysis_output("Afft",granulepos,workA,n,0,0);
+ _analysis_output("Bfft",granulepos,workB,n,0,0);*/
for(i=0;i<n;i++){
A+=workA[i]*workA[i];
@@ -191,10 +191,10 @@
float m=_ve_deltai(ve,iir,filtered-ve->winlength,filtered);
if(m>vi->preecho_thresh){
- /*frameno++;*/
+ /*granulepos++;*/
return(0);
}
- /*frameno++;*/
+ /*granulepos++;*/
}
j+=vi->blocksizes[0]/2;
1.23.2.3.2.2 +5 -5 vorbis/lib/floor0.c
Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor0.c,v
retrieving revision 1.23.2.3.2.1
retrieving revision 1.23.2.3.2.2
diff -u -r1.23.2.3.2.1 -r1.23.2.3.2.2
--- floor0.c 2000/09/03 08:34:52 1.23.2.3.2.1
+++ floor0.c 2000/09/26 18:45:33 1.23.2.3.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.23.2.3.2.1 2000/09/03 08:34:52 jack Exp $
+ last mod: $Id: floor0.c,v 1.23.2.3.2.2 2000/09/26 18:45:33 jack Exp $
********************************************************************/
@@ -179,7 +179,7 @@
not bottlenecked here anyway */
float _curve_to_lpc(float *curve,float *lpc,
- vorbis_look_floor0 *l,long frameno){
+ vorbis_look_floor0 *l,long granulepos){
/* map the input curve to a bark-scale curve for encoding */
int mapped=l->ln;
@@ -228,7 +228,7 @@
char buffer[80];
int i;
- sprintf(buffer,"Fmask_%d.m",frameno);
+ sprintf(buffer,"Fmask_%d.m",granulepos);
of=fopen(buffer,"w");
for(i=0;i<mapped;i++)
fprintf(of,"%g\n",work[i]);
@@ -242,7 +242,7 @@
/* generate the whole freq response curve of an LSP IIR filter */
void _lsp_to_curve(float *curve,float *lsp,float amp,
- vorbis_look_floor0 *l,char *name,long frameno){
+ vorbis_look_floor0 *l,char *name,long granulepos){
/* l->m+1 must be less than l->ln, but guard in case we get a bad stream */
float *lcurve=alloca(sizeof(float)*l->ln);
int i;
@@ -258,7 +258,7 @@
}
void s_lsp_to_curve(float *curve,float *lsp,float amp,
- vorbis_look_floor0 *l,char *name,long frameno,
+ vorbis_look_floor0 *l,char *name,long granulepos,
float ampdB){
/* l->m+1 must be less than l->ln, but guard in case we get a bad stream */
float *lcurve=alloca(sizeof(double)*l->ln);
1.30.4.2 +4 -4 vorbis/lib/info.c
Index: info.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/info.c,v
retrieving revision 1.30.4.1
retrieving revision 1.30.4.2
diff -u -r1.30.4.1 -r1.30.4.2
--- info.c 2000/09/03 08:34:52 1.30.4.1
+++ info.c 2000/09/26 18:45:33 1.30.4.2
@@ -12,7 +12,7 @@
********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.30.4.1 2000/09/03 08:34:52 jack Exp $
+ last mod: $Id: info.c,v 1.30.4.2 2000/09/26 18:45:33 jack Exp $
********************************************************************/
@@ -509,7 +509,7 @@
op->bytes=oggpack_bytes(&opb);
op->b_o_s=1;
op->e_o_s=0;
- op->frameno=0;
+ op->granulepos=0;
/* second header packet (comments) **********************************/
@@ -523,7 +523,7 @@
op_comm->bytes=oggpack_bytes(&opb);
op_comm->b_o_s=0;
op_comm->e_o_s=0;
- op_comm->frameno=0;
+ op_comm->granulepos=0;
/* third header packet (modes/codebooks) ****************************/
@@ -537,7 +537,7 @@
op_code->bytes=oggpack_bytes(&opb);
op_code->b_o_s=0;
op_code->e_o_s=0;
- op_code->frameno=0;
+ op_code->granulepos=0;
oggpack_writeclear(&opb);
return(0);
1.6.2.1.2.1 +14 -14 vorbis/lib/psytune.c
Index: psytune.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psytune.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.1.2.1
diff -u -r1.6.2.1 -r1.6.2.1.2.1
--- psytune.c 2000/08/31 09:00:01 1.6.2.1
+++ psytune.c 2000/09/26 18:45:34 1.6.2.1.2.1
@@ -13,7 +13,7 @@
function: simple utility that runs audio through the psychoacoustics
without encoding
- last mod: $Id: psytune.c,v 1.6.2.1 2000/08/31 09:00:01 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.6.2.1.2.1 2000/09/26 18:45:34 jack Exp $
********************************************************************/
@@ -151,11 +151,11 @@
} vorbis_look_floor0;
extern float _curve_to_lpc(float *curve,float *lpc,vorbis_look_floor0 *l,
- long frameno);
+ long granulepos);
extern void _lsp_to_curve(float *curve,float *lpc,float amp,
- vorbis_look_floor0 *l,char *name,long frameno);
+ vorbis_look_floor0 *l,char *name,long granulepos);
-long frameno=0;
+long granulepos=0;
/* hacked from floor0.c */
static void floorinit(vorbis_look_floor0 *look,int n,int m,int ln){
@@ -283,7 +283,7 @@
for(i=0;i<2;i++){
float amp;
- analysis("pre",frameno,pcm[i],framesize,0,0);
+ analysis("pre",granulepos,pcm[i],framesize,0,0);
/* do the psychacoustics */
for(j=0;j<framesize;j++)
@@ -291,25 +291,25 @@
mdct_forward(&m_look,pcm[i],pcm[i]);
- analysis("mdct",frameno,pcm[i],framesize/2,1,1);
+ analysis("mdct",granulepos,pcm[i],framesize/2,1,1);
_vp_compute_mask(&p_look,pcm[i],floor,decay[i]);
- analysis("prefloor",frameno,floor,framesize/2,1,1);
- analysis("decay",frameno,decay[i],framesize/2,1,1);
+ analysis("prefloor",granulepos,floor,framesize/2,1,1);
+ analysis("decay",granulepos,decay[i],framesize/2,1,1);
for(j=0;j<framesize/2;j++)floor[j]=todB(floor[j])+150;
- amp=_curve_to_lpc(floor,lpc,&floorlook,frameno);
+ amp=_curve_to_lpc(floor,lpc,&floorlook,granulepos);
vorbis_lpc_to_lsp(lpc,lpc,order);
- _lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",frameno);
+ _lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",granulepos);
for(j=0;j<framesize/2;j++)floor[j]=fromdB(floor[j]-150);
- analysis("floor",frameno,floor,framesize/2,1,1);
+ analysis("floor",granulepos,floor,framesize/2,1,1);
_vp_apply_floor(&p_look,pcm[i],floor);
/*r(j=0;j<framesize/2;j++)
if(fabs(pcm[i][j])<1.)pcm[i][j]=0;*/
- analysis("quant",frameno,pcm[i],framesize/2,1,1);
+ analysis("quant",granulepos,pcm[i],framesize/2,1,1);
/* re-add floor */
for(j=0;j<framesize/2;j++){
@@ -324,14 +324,14 @@
}
}
- analysis("final",frameno,pcm[i],framesize/2,1,1);
+ analysis("final",granulepos,pcm[i],framesize/2,1,1);
/* take it back to time */
mdct_backward(&m_look,pcm[i],pcm[i]);
for(j=0;j<framesize/2;j++)
out[i][j]+=pcm[i][j]*window[j];
- frameno++;
+ granulepos++;
}
/* write data. Use the part of buffer we're about to shift out */
1.17.4.1.2.2 +2 -2 vorbis/lib/synthesis.c
Index: synthesis.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/synthesis.c,v
retrieving revision 1.17.4.1.2.1
retrieving revision 1.17.4.1.2.2
diff -u -r1.17.4.1.2.1 -r1.17.4.1.2.2
--- synthesis.c 2000/09/03 08:34:52 1.17.4.1.2.1
+++ synthesis.c 2000/09/26 18:45:34 1.17.4.1.2.2
@@ -12,7 +12,7 @@
********************************************************************
function: single-block PCM synthesis
- last mod: $Id: synthesis.c,v 1.17.4.1.2.1 2000/09/03 08:34:52 jack Exp $
+ last mod: $Id: synthesis.c,v 1.17.4.1.2.2 2000/09/26 18:45:34 jack Exp $
********************************************************************/
@@ -55,7 +55,7 @@
}
/* more setup */
- vb->frameno=op->frameno;
+ vb->granulepos=op->granulepos;
vb->sequence=op->packetno-3; /* first block is third packet */
vb->eofflag=op->e_o_s;
1.27.2.2.2.1 +15 -15 vorbis/lib/vorbisfile.c
Index: vorbisfile.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisfile.c,v
retrieving revision 1.27.2.2
retrieving revision 1.27.2.2.2.1
diff -u -r1.27.2.2 -r1.27.2.2.2.1
--- vorbisfile.c 2000/08/31 09:00:02 1.27.2.2
+++ vorbisfile.c 2000/09/26 18:45:34 1.27.2.2.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.27.2.2 2000/08/31 09:00:02 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.27.2.2.2.1 2000/09/26 18:45:34 jack Exp $
********************************************************************/
@@ -306,9 +306,9 @@
vorbis_comment_clear(vf->vc+i);
break;
}
- if(ogg_page_frameno(&og)!=-1){
+ if(ogg_page_granulepos(&og)!=-1){
vf->serialnos[i]=ogg_page_serialno(&og);
- vf->pcmlengths[i]=ogg_page_frameno(&og);
+ vf->pcmlengths[i]=ogg_page_granulepos(&og);
break;
}
}
@@ -413,14 +413,14 @@
if(vf->decode_ready){
ogg_packet op;
int result=ogg_stream_packetout(&vf->os,&op);
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
/* if(result==-1)return(-1); hole in the data. For now, swallow
and go. We'll need to add a real
error code in a bit. */
if(result>0){
/* got a packet. process it */
- frameno=op.frameno;
+ granulepos=op.granulepos;
if(!vorbis_synthesis(&vf->vb,&op)){ /* lazy check for lazy
header handling. The
header packets aren't
@@ -438,7 +438,7 @@
}
/* update the pcm offset. */
- if(frameno!=-1 && !op.e_o_s){
+ if(granulepos!=-1 && !op.e_o_s){
int link=(vf->seekable?vf->current_link:0);
int i,samples;
@@ -449,18 +449,18 @@
As an aside, this trick is inaccurate if we begin
reading anew right at the last page; the end-of-stream
- frameno declares the last frame in the stream, and the
+ granulepos declares the last frame in the stream, and the
last packet of the last page may be a partial frame.
- So, we need a previous frameno from an in-sequence page
+ So, we need a previous granulepos from an in-sequence page
to have a reference point. Thus the !op.e_o_s clause
above */
samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
- frameno-=samples;
+ granulepos-=samples;
for(i=0;i<link;i++)
- frameno+=vf->pcmlengths[i];
- vf->pcm_offset=frameno;
+ granulepos+=vf->pcmlengths[i];
+ vf->pcm_offset=granulepos;
}
return(1);
}
@@ -766,7 +766,7 @@
/* we need to make sure the pcm_offset is set. We use the
_fetch_packet helper to process one packet with readp set, then
call it until it returns '0' with readp not set (the last packet
- from a page has the 'frameno' field set, and that's how the
+ from a page has the 'granulepos' field set, and that's how the
helper updates the offset */
switch(_process_packet(vf,1)){
@@ -851,9 +851,9 @@
if(ret==-1){
end=bisect;
}else{
- ogg_int64_t frameno=ogg_page_frameno(&og);
- if(frameno<target){
- best=ret; /* raw offset of packet with frameno */
+ ogg_int64_t granulepos=ogg_page_granulepos(&og);
+ if(granulepos<target){
+ best=ret; /* raw offset of packet with granulepos */
begin=vf->offset; /* raw offset of next packet */
}else{
end=bisect;
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list