public int blocksize(Packet op){ //codec_setup_info Buffer opb=new Buffer(); int mode; opb.readinit(op.packet_base, op.packet, op.bytes); /* Check the packet type */ if(opb.read(1)!=0){ /* Oops. This is not an audio data packet */ return (OV_ENOTAUDIO); } { int modebits=0; int v=modes; while(v>1){ modebits++; v>>>=1; } /* read our mode and pre/post windowsize */ mode=opb.read(modebits); } if(mode==-1) return (OV_EBADPACKET); return (blocksizes[mode_param[mode].blockflag]); }
int decode(Buffer b){ int ptr=0; DecodeAux t=decode_tree; int lok=b.look(t.tabn); if(lok>=0){ ptr=t.tab[lok]; b.adv(t.tabl[lok]); if(ptr<=0){ return -ptr; } } do{ switch(b.read1()){ case 0: ptr=t.ptr0[ptr]; break; case 1: ptr=t.ptr1[ptr]; break; case -1: default: return (-1); } } while(ptr>0); return (-ptr); }
public void write(byte[] s){ for(int i=0; i<s.length; i++){ if(s[i]==0) break; write(s[i], 8); } }
public void read(byte[] s, int bytes){ int i=0; while(bytes--!=0){ s[i++]=(byte)(read(8)); } }
public int clear(){ if(vd!=null){ if(vd.analysisp!=0){ opb.writeclear(); } } return (0); }
public void readinit(byte[] buf, int bytes){ readinit(buf, 0, bytes); }
public void read(byte[] s, int bytes) { int i = 0; while (bytes-- != 0) { s[i++] = (byte) (read(8)); } }
public int clear(){ if(vd!=null){ if(vd.analysisp!=0){ opb.writeclear(); } } return (0); }
public void readinit(byte[] buf, int bytes) { readinit(buf, 0, bytes); }
public int blocksize(Packet op){ //codec_setup_info Buffer opb=new Buffer(); int mode; opb.readinit(op.packet_base, op.packet, op.bytes); /* Check the packet type */ if(opb.read(1)!=0){ /* Oops. This is not an audio data packet */ return (OV_ENOTAUDIO); } { int modebits=0; int v=modes; while(v>1){ modebits++; v>>>=1; } /* read our mode and pre/post windowsize */ mode=opb.read(modebits); } if(mode==-1) return (OV_EBADPACKET); return (blocksizes[mode_param[mode].blockflag]); }
int decode(Buffer b){ int ptr=0; DecodeAux t=decode_tree; int lok=b.look(t.tabn); if(lok>=0){ ptr=t.tab[lok]; b.adv(t.tabl[lok]); if(ptr<=0){ return -ptr; } } do{ switch(b.read1()){ case 0: ptr=t.ptr0[ptr]; break; case 1: ptr=t.ptr1[ptr]; break; case -1: default: return (-1); } } while(ptr>0); return (-ptr); }
public void read(byte[] s, int bytes){ int i=0; while(bytes--!=0){ s[i++]=(byte)(read(8)); } }
public int clear(){ if(vd!=null){ if(vd.analysisp!=0){ opb.writeclear(); } } return (0); }