Patent ID: 7429937

Claim:
In a media device operable to encode and decode codewords of data, a method for encoding codewords of data to be written to a medium, the method comprising: receiving a word comprising N bits of data; pre-pending an additional bit to the word to form a codeword, wherein each bit has a corresponding bit address; locating a violating sequence in the codeword, wherein locating the violating sequence comprises: pointing an address table pointer to a bit address adjacent to the pre-pended additional bit; scanning the codeword for the violating sequence, wherein the violating sequence comprises a contiguous sequence of bits that violate a run-length limited coding constraint k, wherein N≦2 k−2 +k−1; and locating a starting bit address of the violating sequence; inserting, responsive to locating a violating sequence, an indicator into the codeword, wherein inserting the indicator comprises: replacing k bits of the violating sequence with k bits of the codeword starting from the bit address of address table pointer; constructing the indicator to include the starting bit address of the violating sequence; and inserting the indicator starting at the bit address of the address table pointer; and advancing the address table pointer, by k, to point to a new bit address of the code word.