Embedding a watermark includes receiving a datastream of repeated values,
determining if an end of run mode permits embedding a first or second
binary value, transmitting a shortened version of the datastream when the
next bit is a first binary value, appending to the datastream a redundant
codeword indicating when the next bit is a first binary value and
transmitting an unshortened version of the repeated data values to
indicate the next bit is a second binary value and appending a
conventional codeword from the codespace indicating the end of run mode
and second binary value. Extracting a watermark bit-sequence includes
determining if an end of run mode could have embedded either binary
value, indicating a first binary value when the end of run mode uses a
redundant codeword from the codespace and indicating a second binary
value when the end of run mode uses a conventional codeword.