Skip to content

Commit

Permalink
Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidXH committed Mar 9, 2024
1 parent 733d903 commit 38754ee
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
27 changes: 27 additions & 0 deletions Cavern.Format/Transcoders/EnhancedAC3Body/AllocationConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@
namespace Cavern.Format.Transcoders {
partial class EnhancedAC3Body {
partial class Allocation {
/// <summary>
/// Reference exponent for decoding others with offsets (absexp).
/// </summary>
public int absoluteExponent;

/// <summary>
/// Grouped exponents read from the bitstream (gexp/exps). A 7-bit encoded exponent data contains 3 consecutive exponents.
/// </summary>
/// <remarks>Handling of this array differs from the reference code,
/// the first element is extracted to <see cref="absoluteExponent"/>.</remarks>
public readonly int[] groupedExponents;

/// <summary>
/// Fully decoded, final exponents, used for shifting mantissas to place (exp).
/// </summary>
public readonly int[] exponents;

/// <summary>
/// Exponents mapped for power spectral density.
/// </summary>
public readonly int[] psd;

/// <summary>
/// PSD summed for each masked band (bndpsd).
/// </summary>
public readonly int[] integratedPSD;

public readonly int[] excite;
public readonly int[] mask;
public readonly byte[] bap;
Expand Down
27 changes: 0 additions & 27 deletions Cavern.Format/Transcoders/EnhancedAC3Body/AllocationParsing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,6 @@ namespace Cavern.Format.Transcoders {
partial class EnhancedAC3Body {
// Convert bitstream data to allocation data
partial class Allocation {
/// <summary>
/// Reference exponent for decoding others with offsets (absexp).
/// </summary>
public int absoluteExponent;

/// <summary>
/// Grouped exponents read from the bitstream (gexp/exps). A 7-bit encoded exponent data contains 3 consecutive exponents.
/// </summary>
/// <remarks>Handling of this array differs from the reference code,
/// the first element is extracted to <see cref="absoluteExponent"/>.</remarks>
public readonly int[] groupedExponents;

/// <summary>
/// Fully decoded, final exponents, used for shifting mantissas to place (exp).
/// </summary>
public readonly int[] exponents;

/// <summary>
/// Exponents mapped for power spectral density.
/// </summary>
public readonly int[] psd;

/// <summary>
/// PSD summed for each masked band (bndpsd).
/// </summary>
public readonly int[] integratedPSD;

/// <summary>
/// Read grouped full-range channel exponent data from the bitstream and decode it.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Cavern.QuickEQ/Equalization/EQGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static Equalizer FromCalibration(float[] source) {
public static Equalizer FromCalibration(string[] lines) {
List<Band> bands = new List<Band>();
for (int line = 0; line < lines.Length; ++line) {
string[] nums = lines[line].Trim().Split(' ', '\t');
string[] nums = lines[line].Trim().Split(new char[] { ' ', '\t' });
if (nums.Length > 1 && double.TryParse(nums[0].Replace(',', '.'), NumberStyles.Any,
CultureInfo.InvariantCulture, out double freq) && double.TryParse(nums[1].Replace(',', '.'), NumberStyles.Any,
CultureInfo.InvariantCulture, out double gain)) {
Expand Down
2 changes: 1 addition & 1 deletion Cavern/Filters/PhaseSwappableBiquadFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public bool PhaseSwapped {
/// <summary>
/// State of phase swapping to be used when the filter is reset.
/// </summary>
protected bool phaseSwapped = false;
protected bool phaseSwapped;

/// <inheritdoc/>
protected PhaseSwappableBiquadFilter(int sampleRate, double centerFreq) : base(sampleRate, centerFreq) { }
Expand Down
1 change: 0 additions & 1 deletion CavernSamples/CavernizeGUI/MainWindow.Exporting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ RenderStats WriteRender(Track target, AudioWriter writer, RenderTarget renderTar
if (writer != null) {
writeCache = new float[blockSize];
}
// TODO: override multichannel process for the fast convolution filter to prevent reallocation

bool wasError = false;
while (progressor.Rendered < target.Length) {
Expand Down

0 comments on commit 38754ee

Please sign in to comment.