Skip to content

Commit

Permalink
fix: BD ECCR avg calculation was off (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
speed47 committed Dec 29, 2024
1 parent f8c8d92 commit 3a98b04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions gui/src/resultsio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ void ResultsReader::run() {
ErrcADD(&dev->testData.errcTOT, d_errc);
ErrcMAX(&dev->testData.errcMAX, d_errc);
if (dev->media.type.startsWith("CD")) {
// /75: This converts the number of errors into a more standard "number of errors per second" metric, as 75 is the number of frames (sectors) that are read in 1 second in 1x speed
CDErrcAVG(&dev->testData.errcAVG, &dev->testData.errcTOT, d_errc.cd.lba/75);
} else if (dev->media.type.startsWith("DVD")) {
// >>4: DVD ECC blocks are 32 KiB aka 16 (2^4) sectors
DVDErrcAVG(&dev->testData.errcAVG, &dev->testData.errcTOT, d_errc.dvd.lba >> 4);
} else if (dev->media.type.startsWith("BD")) {
// >>5: BD ECC blocks are 64 KiB aka 32 (2^5) sectors
BDErrcAVG(&dev->testData.errcAVG, &dev->testData.errcTOT, d_errc.bd.lba >> 5);
}
#endif
Expand Down
7 changes: 5 additions & 2 deletions lib/qpxscan/qpx_scan_algo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ int qscanner::run_dvd_errc()
err_max.pie,pi8_max,err_max.pif,
err_max.poe,po8_max,err_max.pof,
err_max.uncr);
// >>4: DVD ECC blocks are 32 KiB aka 16 (2^4) sectors
// >>7: PI8/PO8 are the mean number of PIE/POE errors over 8 (2^3) ECC blocks, and 4+3==7
printf("avg : %5.2f %5.2f %5.2f | %5.2f %5.2f %5.2f | %5.2f\n",
err_tot.pie/(float)(lba>>4),err_tot.pie/(float)(lba>>7),err_tot.pif/(float)(lba>>4),
err_tot.poe/(float)(lba>>4),err_tot.poe/(float)(lba>>7),err_tot.pof/(float)(lba>>4),
Expand Down Expand Up @@ -890,9 +892,10 @@ int qscanner::run_bd_errc()
printf("max : %5ld %5ld | %5ld\n",
err_max.ldc,err_max.bis,
err_max.uncr);
// >>5: BD ECC blocks are 64 KiB aka 32 (2^5) sectors
printf("avg : %5.2f %5.2f | %5.2f\n",
err_tot.ldc/(float)(lba>>4),err_tot.bis/(float)(lba>>4),
err_tot.uncr/(float)(lba>>4));
err_tot.ldc/(float)(lba>>5),err_tot.bis/(float)(lba>>5),
err_tot.uncr/(float)(lba>>5));
#ifdef USE_FFLUSH
fflush(stdout);
#endif
Expand Down

0 comments on commit 3a98b04

Please sign in to comment.