CUERipper: More precise measurement of track quality. Quality will now be less

than 100% if retries were made, even if retries were successful.
This commit is contained in:
Grigory Chudov
2013-05-07 00:13:50 -04:00
parent d54c133024
commit 110f6b19f4
7 changed files with 60 additions and 39 deletions

View File

@@ -2239,7 +2239,7 @@ namespace CUETools.Processor
uint sec_end = Math.Min(sec_start + 74, tr_start + len - 1);
bool fError = false;
for (uint iSector = sec_start; iSector <= sec_end; iSector++)
if (_ripper.Errors[(int)iSector - (int)_toc[_toc.FirstAudio][0].Start])
if (_ripper.FailedSectors[(int)iSector - (int)_toc[_toc.FirstAudio][0].Start])
fError = true;
if (fError)
{
@@ -2250,7 +2250,7 @@ namespace CUETools.Processor
uint jsec_end = Math.Min(jsec_start + 74, tr_start + len - 1);
bool jfError = false;
for (uint jSector = jsec_start; jSector <= jsec_end; jSector++)
if (_ripper.Errors[(int)jSector - (int)_toc[_toc.FirstAudio][0].Start])
if (_ripper.FailedSectors[(int)jSector - (int)_toc[_toc.FirstAudio][0].Start])
jfError = true;
if (!jfError)
{
@@ -2429,10 +2429,10 @@ namespace CUETools.Processor
if (prefix != "") prefix += ", ";
prefix += "CTDB: " + CTDB.Status;
}
if (_isCD && _ripper.ErrorsCount > 0)
if (_isCD && _ripper.FailedSectors.PopulationCount() > 0)
{
if (prefix != "") prefix += ", ";
prefix += "ripper found " + _ripper.ErrorsCount + " suspicious sectors";
prefix += "ripper found " + _ripper.FailedSectors.PopulationCount() + " suspicious sectors";
}
if (prefix == "")
prefix += "done";

View File

@@ -2,6 +2,7 @@
using System.IO;
using CUETools.AccurateRip;
using CUETools.CDImage;
using CUETools.Ripper;
using System.Globalization;
namespace CUETools.Processor
@@ -85,11 +86,9 @@ namespace CUETools.Processor
private static double GetRangeQuality(CUESheet sheet, uint start, uint length)
{
int errCount = 0;
for (uint iSector = start; iSector < start + length; iSector++)
if (sheet.CDRipper.Errors[(int)iSector - (int)sheet.TOC[sheet.TOC.FirstAudio][0].Start])
errCount++;
return 100 * (1.0 - Math.Log(errCount / 5.0 + 1) / Math.Log(length / 5.0 + 1));
int failedSectorsCount = sheet.CDRipper.FailedSectors.PopulationCount((int)start - (int)sheet.TOC[sheet.TOC.FirstAudio][0].Start, (int)length);
int retrySectorsCount = sheet.CDRipper.RetrySectors.PopulationCount((int)start - (int)sheet.TOC[sheet.TOC.FirstAudio][0].Start, (int)length);
return 100 * (1.0 - Math.Log(failedSectorsCount / 5.0 + retrySectorsCount / 100.0 + 1) / Math.Log(length / 5.0 + length / 100.0 + 1));
}
public static string GetExactAudioCopyLog(CUESheet sheet)