summaryrefslogtreecommitdiffstats
path: root/tremor/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'tremor/block.c')
-rw-r--r--tremor/block.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/tremor/block.c b/tremor/block.c
index 81406e2a1f..e09fea553c 100644
--- a/tremor/block.c
+++ b/tremor/block.c
@@ -46,28 +46,28 @@ static int ilog(unsigned int v){
:.....''' |_____--- '''......| | \_______|
:.................|__________________|_______|__|______|
|<------ Sl ------>| > Sr < |endW
- |beginSl |endSl | |endSr
+ |beginSl |endSl | |endSr
|beginW |endlW |beginSr
- |< lW >|
+ |< lW >|
<--------------- W ---------------->
| | .. ______________ |
| | ' `/ | ---_ |
- |___.'___/`. | ---_____|
+ |___.'___/`. | ---_____|
|_______|__|_______|_________________|
| >|Sl|< |<------ Sr ----->|endW
| | |endSl |beginSr |endSr
- |beginW | |endlW
+ |beginW | |endlW
mult[0] |beginSl mult[n]
<-------------- lW ----------------->
- |<--W-->|
-: .............. ___ | |
-: .''' |`/ \ | |
-:.....''' |/`....\|...|
-:.........................|___|___|___|
- |Sl |Sr |endW
+ |<--W-->|
+: .............. ___ | |
+: .''' |`/ \ | |
+:.....''' |/`....\|...|
+:.........................|___|___|___|
+ |Sl |Sr |endW
| | |endSr
| |beginSr
| |endSl
@@ -86,7 +86,7 @@ int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
vb->vd=v;
vb->localalloc=0;
vb->localstore=NULL;
-
+
return(0);
}
@@ -226,10 +226,10 @@ void vorbis_dsp_clear(vorbis_dsp_state *v){
}
if(b){
- if(b->mode)_ogg_free(b->mode);
+ if(b->mode)_ogg_free(b->mode);
_ogg_free(b);
}
-
+
memset(v,0,sizeof(*v));
}
}
@@ -253,15 +253,15 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
lose count */
v->sequence=vb->sequence;
-
+
{
int n=ci->blocksizes[v->W]/2;
int n0=ci->blocksizes[0]/2;
int n1=ci->blocksizes[1]/2;
-
+
int thisCenter;
int prevCenter;
-
+
if(v->centerW){
thisCenter=n1;
prevCenter=0;
@@ -269,13 +269,13 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
thisCenter=0;
prevCenter=n1;
}
-
+
/* v->pcm is now used like a two-stage double buffer. We don't want
to have to constantly shift *or* adjust memory usage. Don't
accept a new block until the old is shifted out */
-
+
/* overlap/add PCM */
-
+
for(j=0;j<vi->channels;j++){
/* the overlap/add section */
if(v->lW){
@@ -309,7 +309,7 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
pcm[i]+=p[i];
}
}
-
+
/* the copy section */
{
ogg_int32_t *pcm=v->pcm[j]+thisCenter;
@@ -318,12 +318,12 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
pcm[i]=p[i];
}
}
-
+
if(v->centerW)
v->centerW=0;
else
v->centerW=n1;
-
+
/* deal with initial packet state; we do this using the explicit
pcm_returned==-1 flag otherwise we're sensitive to first block
being short or long */
@@ -342,7 +342,7 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
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->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,
we don't have a starting point to judge where the last frame
@@ -373,20 +373,20 @@ int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
v->pcm_returned+=extra;
if(v->pcm_returned>v->pcm_current)
v->pcm_returned=v->pcm_current;
-
+
}
-
+
}/* else{ Shouldn't happen *unless* the bitstream is out of
spec. Either way, believe the bitstream } */
v->granulepos=vb->granulepos;
}
}
-
+
/* Update, cleanup */
-
+
if(vb->eofflag)v->eofflag=1;
}
-
+
return(0);
}