AccurateRip: Difference between revisions
m (→Checksum calculation: typo fix: added missing words "in a" before "65,536-sample cycle". Moved that phrase for clarity.) |
No edit summary |
||
Line 33: | Line 33: | ||
==External links== | ==External links== | ||
* [http://www.accuraterip.com/ AccurateRip web site] | * [http://www.accuraterip.com/ AccurateRip web site] | ||
[[Category:CD ripping]] |
Revision as of 19:22, 29 July 2010
AccurateRip is a database that accepts and supplies two things: 1. estimates of the accuracy of the digital audio extraction (DAE) capabilities of CD-ROM/CD-RW drives (specifically, their read offsets), and 2. checksums for audio tracks extracted with those drives.
Drive read offsets
Very few CD drives actually start reading data from audio CDs exactly at the sector requested by DAE software. There are drives that are off by over 1 sector (1/75th of a second), but most are off by much less (1/250 to 1/350 second). Most modern CD drives have "Accurate Stream" technology, so there's no "jitter", meaning in this case that the variance is consistent from read to read, and will tend to be the same for all drives of a certain make & model.
The AccurateRip database allows one to find out the read offset, which is a number, for a given make & model of CD drive. This number can then be used by DAE software to ensure that each track is ripped from its exact start to its exact finish.
The offset is given in samples. One "sample" on an audio CD is 4 bytes, consisting of a 2-byte left-channel value and a 2-byte right-channel value. There are 2352 bytes, or 588 samples, in each sector of an audio CD, corresponding to 1/75th of a second of sound. Therefore, an AccurateRip offset of +134 means the drive consistently delivers data from 536 bytes behind (earlier than) where it was asked to read from, so the DAE software needs to look that far ahead (hence the positive offset) in order to get the right data.
When offsets are taken into account, the DAE software might have to ask the drive to "overread" into the lead-in or lead-out portions of the disc, where there's no audio data. Some drives can't be asked to do it, some drives will try to do it and fail, and some will just return null samples (a stream of "0" bytes, a.k.a. digital silence). If the drive can't overread, then there will be samples missing from the extracted track. The DAE software can correct for this by padding the track with digital silence so it's the correct length.
Ripped track checksums
Once all the samples for a track have been extracted and put into a file such as a WAV, a checksum can be generated to summarize the sample data. Identical data will produce identical checksums. If the data is the slightest bit different, the checksums will usually be very different. The checksums derived from the same tracks from the same pressings of the same CDs, so long as drive offsets have been accounted for, can be compared in order to determine whether the extraction was error-free. That is, if you rip a track and find that your checksum matches what everyone else got, then you can be confident there are no missing or incorrect samples (or that you've all got exactly the same damage, which is nearly impossible). See the secure ripping article for more on this subject.
The AccurateRip database contains checksum data for the tracks on thousands of CDs. DAE software can use this info to decide whether to try re-reading a track that produced a different checksum than was expected.
Checksum calculation
Each AccurateRip checksum is based on a complete track rip, from the beginning of the track to the end, as determined by the track's entry in the disc's table of contents. This means that any silence or "gap" at the beginning or end of the track must be included in the rip. If your DAE software is configured to trim silence or to do anything with gaps other than put them at the end of the preceding track (as normally happens when gaps aren't taken into account), then it's unlikely the checksums of your rips will be submitted to or compared against those in the AccurateRip database.
The checksum algorithm ignores the first 2940 samples (5 frames, a little over 0.013s of audio) at the beginning of the first track, and ignores an equal amount at the end of the last track. The largest drive offset in the database, as of October 2009, is only 1776 samples, so when an offset-corrected drive "overreads" beyond the boundaries of the audio data, it normally won't affect the checksum. If the overread were to exceed 2940 samples, though, the algorithm assumes the data is padded with digital silence (nothing but zeroes). If your drive isn't capable of overreading and your DAE software doesn't zero-pad the rip to simulate an overread, then it's unlikely the checksums of your rips will be submitted to or compared against those in the AccurateRip database.
An optimization oversight in the AccurateRip checksum algorithm results in an unintended loss of accuracy: about 3% of the audio data is not counted in the checksum at all. The left channel's samples are fully included, but in a 65,536-sample cycle, half of the right-channel samples are treated as if they're missing anywhere from 1 bit to all 16 bits. Proposals for improving the algorithm, the database, and the database's API are under consideration, but for now, all implementations must continue to use this incorrect algorithm in order to maintain compatibility with existing data in the AccurateRip database.
Submitting offsets and checksums
The database is designed to be anonymously accessed by DAE software, via HTTP. Submitting data should only be done through such software.