public SubMode( int lbrPitch, int forcedPitchGain, int haveSubframeGain, int doubleCodebook, LspQuant lspQuant, Ltp ltp, CodebookSearch innovation, float lpcEnhK1, float lpcEnhK2, float combGain, int bitsPerFrame) { this.lbrPitch = lbrPitch; this.forcedPitchGain = forcedPitchGain; this.haveSubframeGain = haveSubframeGain; this.doubleCodebook = doubleCodebook; this.lsqQuant = lspQuant; this.ltp = ltp; this.innovation = innovation; this.lpcEnhK1 = lpcEnhK1; this.lpcEnhK2 = lpcEnhK2; this.combGain = combGain; this.bitsPerFrame = bitsPerFrame; }
/// <summary> /// Returns true if RunnerChange instances are equal /// </summary> /// <param name="other">Instance of RunnerChange to be compared</param> /// <returns>Boolean</returns> public bool Equals(RunnerChange other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return((Tv == other.Tv || Tv != null && Tv.Equals(other.Tv)) && (Batb == other.Batb || Batb != null && Batb.SequenceEqual(other.Batb)) && (Spb == other.Spb || Spb != null && Spb.SequenceEqual(other.Spb)) && (Bdatl == other.Bdatl || Bdatl != null && Bdatl.SequenceEqual(other.Bdatl)) && (Trd == other.Trd || Trd != null && Trd.SequenceEqual(other.Trd)) && (Spf == other.Spf || Spf != null && Spf.Equals(other.Spf)) && (Ltp == other.Ltp || Ltp != null && Ltp.Equals(other.Ltp)) && (Atb == other.Atb || Atb != null && Atb.SequenceEqual(other.Atb)) && (Spl == other.Spl || Spl != null && Spl.SequenceEqual(other.Spl)) && (Spn == other.Spn || Spn != null && Spn.Equals(other.Spn)) && (Atl == other.Atl || Atl != null && Atl.SequenceEqual(other.Atl)) && (Batl == other.Batl || Batl != null && Batl.SequenceEqual(other.Batl)) && (Id == other.Id || Id != null && Id.Equals(other.Id)) && (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) && (Bdatb == other.Bdatb || Bdatb != null && Bdatb.SequenceEqual(other.Bdatb))); }
/// <summary> /// Constructor /// </summary> /// <param name="lbr_pitch"></param> /// <param name="forced_pitch_gain"></param> /// <param name="have_subframe_gain"></param> /// <param name="double_codebook"></param> /// <param name="lspQuant"></param> /// <param name="ltp"></param> /// <param name="innovation"></param> /// <param name="lpc_enh_k1"></param> /// <param name="lpc_enh_k2"></param> /// <param name="comb_gain"></param> /// <param name="bits_per_frame"></param> public SubMode(int lbr_pitch, int forced_pitch_gain, int have_subframe_gain, int double_codebook, LspQuant lspQuant, Ltp ltp, CbSearch innovation, float lpc_enh_k1, float lpc_enh_k2, float comb_gain, int bits_per_frame) { this.lbr_pitch = lbr_pitch; this.forced_pitch_gain = forced_pitch_gain; this.have_subframe_gain = have_subframe_gain; this.double_codebook = double_codebook; this.lsqQuant = lspQuant; this.ltp = ltp; this.innovation = innovation; this.lpc_enh_k1 = lpc_enh_k1; this.lpc_enh_k2 = lpc_enh_k2; this.comb_gain = comb_gain; this.bits_per_frame = bits_per_frame; }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { var hash = 41; // Suitable nullity checks etc, of course :) if (Tv != null) { hash = hash * 59 + Tv.GetHashCode(); } if (Batb != null) { hash = hash * 59 + Batb.GetHashCode(); } if (Spb != null) { hash = hash * 59 + Spb.GetHashCode(); } if (Bdatl != null) { hash = hash * 59 + Bdatl.GetHashCode(); } if (Trd != null) { hash = hash * 59 + Trd.GetHashCode(); } if (Spf != null) { hash = hash * 59 + Spf.GetHashCode(); } if (Ltp != null) { hash = hash * 59 + Ltp.GetHashCode(); } if (Atb != null) { hash = hash * 59 + Atb.GetHashCode(); } if (Spl != null) { hash = hash * 59 + Spl.GetHashCode(); } if (Spn != null) { hash = hash * 59 + Spn.GetHashCode(); } if (Atl != null) { hash = hash * 59 + Atl.GetHashCode(); } if (Batl != null) { hash = hash * 59 + Batl.GetHashCode(); } if (Id != null) { hash = hash * 59 + Id.GetHashCode(); } if (Hc != null) { hash = hash * 59 + Hc.GetHashCode(); } if (Bdatb != null) { hash = hash * 59 + Bdatb.GetHashCode(); } return(hash); } }