Commit a7cc4c71 authored by Monty's avatar Monty
Browse files

Add some unneccessary but potentially useful bulletproofing to allow use of versized floors in

floor1 on encode side (already worked properly decode-side).


svn path=/trunk/vorbis/; revision=16956
parent b57f18e9
...@@ -381,7 +381,7 @@ static void render_line(int n, int x0,int x1,int y0,int y1,float *d){ ...@@ -381,7 +381,7 @@ static void render_line(int n, int x0,int x1,int y0,int y1,float *d){
} }
} }
static void render_line0(int x0,int x1,int y0,int y1,int *d){ static void render_line0(int n, int x0,int x1,int y0,int y1,int *d){
int dy=y1-y0; int dy=y1-y0;
int adx=x1-x0; int adx=x1-x0;
int ady=abs(dy); int ady=abs(dy);
...@@ -393,8 +393,12 @@ static void render_line0(int x0,int x1,int y0,int y1,int *d){ ...@@ -393,8 +393,12 @@ static void render_line0(int x0,int x1,int y0,int y1,int *d){
ady-=abs(base*adx); ady-=abs(base*adx);
d[x]=y; if(n>x1)n=x1;
while(++x<x1){
if(x<n)
d[x]=y;
while(++x<n){
err=err+ady; err=err+ady;
if(err>=adx){ if(err>=adx){
err-=adx; err-=adx;
...@@ -945,6 +949,8 @@ int floor1_encode(oggpack_buffer *opb,vorbis_block *vb, ...@@ -945,6 +949,8 @@ int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
int hx=0; int hx=0;
int lx=0; int lx=0;
int ly=post[0]*info->mult; int ly=post[0]*info->mult;
int n=ci->blocksizes[vb->W]/2;
for(j=1;j<look->posts;j++){ for(j=1;j<look->posts;j++){
int current=look->forward_index[j]; int current=look->forward_index[j];
int hy=post[current]&0x7fff; int hy=post[current]&0x7fff;
...@@ -953,7 +959,7 @@ int floor1_encode(oggpack_buffer *opb,vorbis_block *vb, ...@@ -953,7 +959,7 @@ int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
hy*=info->mult; hy*=info->mult;
hx=info->postlist[current]; hx=info->postlist[current];
render_line0(lx,hx,ly,hy,ilogmask); render_line0(n,lx,hx,ly,hy,ilogmask);
lx=hx; lx=hx;
ly=hy; ly=hy;
......
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