sarami wrote:I can't understand how to use the FixLevel/[FixLevel] bits.
FixLevel = 1
if (Q-CRC of QCurrentSector is bad) {
create QGenSector1 from QNextSector - 1
compare 96bits of QCurrentSector and QGenSector1
if (the difference is 1-bit) {
QCurrentSector = QGenSector1
}
else {
create QGenSector2 from QPrevSector + 1
compare 96bits of QCurrentSector and QGenSector2
if (the difference is 1-bit) {
QCurrentSector = QGenSector2
}
else {
try to change each bit to opposite (Max 96 times) // for the case when QCurrentSector and QGenSector are different
if not success {
reread sector (*1)
}
}
}
FixLevel = 2
if (Q-CRC of QCurrentSector is bad) {
create QGenSector1 from QNextSector - 1
compare 96bits of QCurrentSector and QGenSector1
if (the difference is 2-bit or less) {
QCurrentSector = QGenSector1
}
else {
create QGenSector2 from QPrevSector + 1
compare 96bits of QCurrentSector and QGenSector2
if (the difference is 2-bit or less) {
QCurrentSector = QGenSector2
}
else {
try to change each bit to opposite (Max 96*96? times) // for the case when QCurrentSector and QGenSector are different
if not success {
reread sector (*1)
}
}
}
FixLevel = 3
if (Q-CRC of QCurrentSector is bad) {
create QGenSector1 from QNextSector - 1
compare 96bits of QCurrentSector and QGenSector1
if (the difference is 3-bit or less) {
QCurrentSector = QGenSector1
}
else {
create QGenSector2 from QPrevSector + 1
compare 96bits of QCurrentSector and QGenSector2
if (the difference is 3-bit or less) {
QCurrentSector = QGenSector2
}
else {
try to change each bit to opposite (Max 96*96*96? times) // for the case when QCurrentSector and QGenSector are different
if not success {
reread sector (*1)
}
}
}
sarami wrote:Who fixes the 1-bit error of QCurrentSector? Isn't it fixed by changing each bit to opposite?
Comparing QCurrentSector and QGenSector1 and QCurrentSector and QGenSector2 are 2 operations, changing the bits is 96^FixLevel operations, much longer. So it's faster to compare with the generated sector first. Maybe also worth to add a flag not to use the bit changing, if the difference between QCurrentSector and QGenSector1 or QCurrentSector and QGenSector2 is FixLevel+1 ... FixLevel+9 bits then not to use the bits changing for this sector.
For example:
FixLevel = 1
compare 96bits of QCurrentSector and QGenSector1
QCurrentSector = 0101010101
QGenSector1 = 0111010111
Difference: 2 bits. 2 bits is between "FixLevel+1 ... FixLevel+9", so you don't change the bits, you reread the sector.
Or:
FixLevel = 1
compare 96bits of QCurrentSector and QGenSector1
QCurrentSector = 010101010101
QGenSector1 = 101010101010
Difference: 12 bits. 12 bits is more than FixLevel+9, so we assume the sector is probably of a different type than generated sector and we're trying to change the bits before rereading.