
com.github.trilarion.jcraft.jorbis.Residue0 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vorbis-support Show documentation
Show all versions of vorbis-support Show documentation
Vorbis SPI support. Combination of JOrbis, JavaSPI and Tritonus-Share.
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/* JOrbis
* Copyright (C) 2000 ymnk, JCraft,Inc.
*
* Written by: 2000 ymnk
*
* Many thanks to
* Monty and
* The XIPHOPHORUS Company http://www.xiph.org/ .
* JOrbis has been based on their awesome works, Vorbis codec.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.github.trilarion.jcraft.jorbis;
import com.github.trilarion.jcraft.jogg.Buffer;
class Residue0 extends FuncResidue{
void pack(Object vr, Buffer opb){
InfoResidue0 info=(InfoResidue0)vr;
int acc=0;
opb.write(info.begin, 24);
opb.write(info.end, 24);
opb.write(info.grouping-1, 24); /* residue vectors to group and
code with a partitioned book */
opb.write(info.partitions-1, 6); /* possible partition choices */
opb.write(info.groupbook, 8); /* group huffman book */
/* secondstages is a bitmask; as encoding progresses pass by pass, a
bitmask of one indicates this partition class has bits to write
this pass */
for(int j=0; j3){
/* yes, this is a minor hack due to not thinking ahead */
opb.write(i, 3);
opb.write(1, 1);
opb.write(i>>>3, 5);
}
else{
opb.write(i, 4); /* trailing zero */
}
acc+=Util.icount(i);
}
for(int j=0; j=vi.books){
free_info(info);
return (null);
}
for(int j=0; j=vi.books){
free_info(info);
return (null);
}
}
return (info);
}
Object look(DspState vd, InfoMode vm, Object vr){
InfoResidue0 info=(InfoResidue0)vr;
LookResidue0 look=new LookResidue0();
int acc=0;
int dim;
int maxstage=0;
look.info=info;
look.map=vm.mapping;
look.parts=info.partitions;
look.fullbooks=vd.fullbooks;
look.phrasebook=vd.fullbooks[info.groupbook];
dim=look.phrasebook.dim;
look.partbooks=new int[look.parts][];
for(int j=0; jmaxstage)
maxstage=stages;
look.partbooks[j]=new int[stages];
for(int k=0; k
© 2015 - 2025 Weber Informatics LLC | Privacy Policy