/* Class243_Sub3_Sub3 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import jagtheora.ogg.OggPacket;
import jagtheora.ogg.OggStreamState;
import jagtheora.vorbis.DSPState;
import jagtheora.vorbis.VorbisBlock;
import jagtheora.vorbis.VorbisComment;
import jagtheora.vorbis.VorbisInfo;

public class Class243_Sub3_Sub3 extends Class243_Sub3
{
    VorbisBlock aVorbisBlock10732;
    VorbisComment aVorbisComment10733;
    DSPState aDSPState10734;
    double aDouble10735;
    VorbisInfo aVorbisInfo10736 = new VorbisInfo();
    Class243_Sub44_Sub1 aClass243_Sub44_Sub1_10737;
    Class587 aClass587_10738;
    int anInt10739;
    
    void method14510() {
	if (null != ((Class243_Sub3_Sub3) this).aVorbisBlock10732)
	    ((Class243_Sub3_Sub3) this).aVorbisBlock10732.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aDSPState10734)
	    ((Class243_Sub3_Sub3) this).aDSPState10734.method7301();
	((Class243_Sub3_Sub3) this).aVorbisComment10733.method7301();
	((Class243_Sub3_Sub3) this).aVorbisInfo10736.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737)
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17368(-1542193619);
    }
    
    Class243_Sub3_Sub3(OggStreamState oggstreamstate) {
	super(oggstreamstate);
	((Class243_Sub3_Sub3) this).aVorbisComment10733 = new VorbisComment();
    }
    
    public Class243_Sub44_Sub1 method17171(byte i) {
	return ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737;
    }
    
    void method14508(int i) {
	if (null != ((Class243_Sub3_Sub3) this).aVorbisBlock10732)
	    ((Class243_Sub3_Sub3) this).aVorbisBlock10732.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aDSPState10734)
	    ((Class243_Sub3_Sub3) this).aDSPState10734.method7301();
	((Class243_Sub3_Sub3) this).aVorbisComment10733.method7301();
	((Class243_Sub3_Sub3) this).aVorbisInfo10736.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737)
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17368(-1542193619);
    }
    
    double method17172(int i) {
	double d = ((Class243_Sub3_Sub3) this).aDouble10735;
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737) {
	    d = ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		    .method17375(-648767292);
	    if (d < 0.0)
		d = ((Class243_Sub3_Sub3) this).aDouble10735;
	}
	return d - (double) (256.0F / (float) Class594.anInt7714);
    }
    
    int method17173(int i) {
	return (((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737 == null
		? 0
		: ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		      .method17365((byte) 21));
    }
    
    void method14509(OggPacket oggpacket) {
	if (347901265 * ((Class243_Sub3_Sub3) this).anInt8594 < 3) {
	    int i = (((Class243_Sub3_Sub3) this).aVorbisInfo10736.headerIn
		     (((Class243_Sub3_Sub3) this).aVorbisComment10733,
		      oggpacket));
	    if (i < 0)
		throw new IllegalStateException(new StringBuilder().append
						    ("").append
						    (i).toString());
	    if (347901265 * ((Class243_Sub3_Sub3) this).anInt8594 == 2) {
		if (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels > 2
		    || (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels
			< 1))
		    throw new RuntimeException(new StringBuilder().append
						   ("").append
						   (((Class243_Sub3_Sub3) this)
						    .aVorbisInfo10736.channels)
						   .toString());
		((Class243_Sub3_Sub3) this).aDSPState10734
		    = new DSPState(((Class243_Sub3_Sub3) this)
				   .aVorbisInfo10736);
		((Class243_Sub3_Sub3) this).aVorbisBlock10732
		    = new VorbisBlock(((Class243_Sub3_Sub3) this)
				      .aDSPState10734);
		((Class243_Sub3_Sub3) this).aClass587_10738
		    = new Class587((((Class243_Sub3_Sub3) this)
				    .aVorbisInfo10736.rate),
				   Class594.anInt7714);
		((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		    = new Class243_Sub44_Sub1(((Class243_Sub3_Sub3) this)
					      .aVorbisInfo10736.channels);
	    }
	} else {
	    if (((Class243_Sub3_Sub3) this).aVorbisBlock10732
		    .synthesis(oggpacket)
		== 0)
		((Class243_Sub3_Sub3) this).aDSPState10734
		    .blockIn(((Class243_Sub3_Sub3) this).aVorbisBlock10732);
	    float[][] fs
		= (((Class243_Sub3_Sub3) this).aDSPState10734.pcmOut
		   (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels));
	    ((Class243_Sub3_Sub3) this).aDouble10735
		= ((Class243_Sub3_Sub3) this).aDSPState10734.granuleTime();
	    if (-1.0 == ((Class243_Sub3_Sub3) this).aDouble10735)
		((Class243_Sub3_Sub3) this).aDouble10735
		    = (double) ((float) (328722479
					 * (((Class243_Sub3_Sub3) this)
					    .anInt10739))
				/ (float) (((Class243_Sub3_Sub3) this)
					   .aVorbisInfo10736.rate));
	    ((Class243_Sub3_Sub3) this).aDSPState10734.read(fs[0].length);
	    ((Class243_Sub3_Sub3) this).anInt10739
		+= 1228299983 * fs[0].length;
	    Class243_Sub4 class243_sub4
		= (((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		       .method17377
		   (fs[0].length, ((Class243_Sub3_Sub3) this).aDouble10735));
	    Class520.method11701(fs, (((Class243_Sub4) class243_sub4)
				      .aShortArrayArray8597), 116950054);
	    for (int i = 0;
		 i < ((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels;
		 i++)
		((Class243_Sub4) class243_sub4).aShortArrayArray8597[i]
		    = (((Class243_Sub3_Sub3) this).aClass587_10738.method12848
		       ((((Class243_Sub4) class243_sub4).aShortArrayArray8597
			 [i]),
			1308259807));
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17366(class243_sub4, -1532363169);
	}
    }
    
    void method14505(OggPacket oggpacket, byte i) {
	if (347901265 * ((Class243_Sub3_Sub3) this).anInt8594 < 3) {
	    int i_0_ = (((Class243_Sub3_Sub3) this).aVorbisInfo10736.headerIn
			(((Class243_Sub3_Sub3) this).aVorbisComment10733,
			 oggpacket));
	    if (i_0_ < 0)
		throw new IllegalStateException(new StringBuilder().append
						    ("").append
						    (i_0_).toString());
	    if (347901265 * ((Class243_Sub3_Sub3) this).anInt8594 == 2) {
		if (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels > 2
		    || (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels
			< 1))
		    throw new RuntimeException(new StringBuilder().append
						   ("").append
						   (((Class243_Sub3_Sub3) this)
						    .aVorbisInfo10736.channels)
						   .toString());
		((Class243_Sub3_Sub3) this).aDSPState10734
		    = new DSPState(((Class243_Sub3_Sub3) this)
				   .aVorbisInfo10736);
		((Class243_Sub3_Sub3) this).aVorbisBlock10732
		    = new VorbisBlock(((Class243_Sub3_Sub3) this)
				      .aDSPState10734);
		((Class243_Sub3_Sub3) this).aClass587_10738
		    = new Class587((((Class243_Sub3_Sub3) this)
				    .aVorbisInfo10736.rate),
				   Class594.anInt7714);
		((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		    = new Class243_Sub44_Sub1(((Class243_Sub3_Sub3) this)
					      .aVorbisInfo10736.channels);
	    }
	} else {
	    if (((Class243_Sub3_Sub3) this).aVorbisBlock10732
		    .synthesis(oggpacket)
		== 0)
		((Class243_Sub3_Sub3) this).aDSPState10734
		    .blockIn(((Class243_Sub3_Sub3) this).aVorbisBlock10732);
	    float[][] fs
		= (((Class243_Sub3_Sub3) this).aDSPState10734.pcmOut
		   (((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels));
	    ((Class243_Sub3_Sub3) this).aDouble10735
		= ((Class243_Sub3_Sub3) this).aDSPState10734.granuleTime();
	    if (-1.0 == ((Class243_Sub3_Sub3) this).aDouble10735)
		((Class243_Sub3_Sub3) this).aDouble10735
		    = (double) ((float) (328722479
					 * (((Class243_Sub3_Sub3) this)
					    .anInt10739))
				/ (float) (((Class243_Sub3_Sub3) this)
					   .aVorbisInfo10736.rate));
	    ((Class243_Sub3_Sub3) this).aDSPState10734.read(fs[0].length);
	    ((Class243_Sub3_Sub3) this).anInt10739
		+= 1228299983 * fs[0].length;
	    Class243_Sub4 class243_sub4
		= (((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		       .method17377
		   (fs[0].length, ((Class243_Sub3_Sub3) this).aDouble10735));
	    Class520.method11701(fs, (((Class243_Sub4) class243_sub4)
				      .aShortArrayArray8597), 1037183453);
	    for (int i_1_ = 0;
		 i_1_ < ((Class243_Sub3_Sub3) this).aVorbisInfo10736.channels;
		 i_1_++)
		((Class243_Sub4) class243_sub4).aShortArrayArray8597[i_1_]
		    = (((Class243_Sub3_Sub3) this).aClass587_10738.method12848
		       ((((Class243_Sub4) class243_sub4).aShortArrayArray8597
			 [i_1_]),
			80631378));
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17366(class243_sub4, 1927086769);
	}
    }
    
    int method17174() {
	return (((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737 == null
		? 0
		: ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		      .method17365((byte) 17));
    }
    
    void method14512() {
	if (null != ((Class243_Sub3_Sub3) this).aVorbisBlock10732)
	    ((Class243_Sub3_Sub3) this).aVorbisBlock10732.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aDSPState10734)
	    ((Class243_Sub3_Sub3) this).aDSPState10734.method7301();
	((Class243_Sub3_Sub3) this).aVorbisComment10733.method7301();
	((Class243_Sub3_Sub3) this).aVorbisInfo10736.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737)
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17368(-1542193619);
    }
    
    void method14507() {
	if (null != ((Class243_Sub3_Sub3) this).aVorbisBlock10732)
	    ((Class243_Sub3_Sub3) this).aVorbisBlock10732.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aDSPState10734)
	    ((Class243_Sub3_Sub3) this).aDSPState10734.method7301();
	((Class243_Sub3_Sub3) this).aVorbisComment10733.method7301();
	((Class243_Sub3_Sub3) this).aVorbisInfo10736.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737)
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17368(-1542193619);
    }
    
    static short[][] method17175(float[][] fs, short[][] is) {
	for (int i = 0; i < fs.length; i++) {
	    for (int i_2_ = 0; i_2_ < is[i].length; i_2_++)
		is[i][i_2_] = (short) (int) (16383.0F * fs[i][i_2_]);
	}
	return is;
    }
    
    static short[][] method17176(float[][] fs, short[][] is) {
	for (int i = 0; i < fs.length; i++) {
	    for (int i_3_ = 0; i_3_ < is[i].length; i_3_++)
		is[i][i_3_] = (short) (int) (16383.0F * fs[i][i_3_]);
	}
	return is;
    }
    
    public Class243_Sub44_Sub1 method17177() {
	return ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737;
    }
    
    double method17178() {
	double d = ((Class243_Sub3_Sub3) this).aDouble10735;
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737) {
	    d = ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		    .method17375(-1794353499);
	    if (d < 0.0)
		d = ((Class243_Sub3_Sub3) this).aDouble10735;
	}
	return d - (double) (256.0F / (float) Class594.anInt7714);
    }
    
    int method17179() {
	return (((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737 == null
		? 0
		: ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		      .method17365((byte) 56));
    }
    
    void method14511() {
	if (null != ((Class243_Sub3_Sub3) this).aVorbisBlock10732)
	    ((Class243_Sub3_Sub3) this).aVorbisBlock10732.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aDSPState10734)
	    ((Class243_Sub3_Sub3) this).aDSPState10734.method7301();
	((Class243_Sub3_Sub3) this).aVorbisComment10733.method7301();
	((Class243_Sub3_Sub3) this).aVorbisInfo10736.method7301();
	if (null != ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737)
	    ((Class243_Sub3_Sub3) this).aClass243_Sub44_Sub1_10737
		.method17368(-1542193619);
    }
}
