Patent ID: 8233545

Claim:
A computer implemented method of video data encoding, the computer operable to perform a left most bit detect instruction, the left most bit detect instruction storing in a destination register a number of consecutive bits of a first digital state in high order bits of data stored in a source register, the method comprising the steps of: quantizing spatial frequency coefficients for each block of a frame; generating a mask having one bit for each spatial frequency coefficient of the block, each mask bit having a first digital state if a corresponding quantized spatial frequency coefficient is non-zero and a second digital state opposite to said first digital state if the corresponding quantized spatial frequency coefficient is zero; and run length encoding said quantized spatial frequency coefficients by storing said mask in a first data register and repeatedly performing a left most bit detect instruction to determine a number of bit positions in said first data register storing said mask more significant than a most significant bit having said first digital state and storing a result in a second data register, run length encoding zero coefficients with a run length equal to said determined number of bit positions stored in said second data register, left shifting said first data register storing said mask a number of bit positions one more than said determined number of bit positions stored in said second data register, until all bits having the first digital state within said first data register storing said mask are considered.