Patent ID: 7787537

Claim:
An apparatus for discrete cosine transform coefficient prediction, wherein a first memory block and a second memory block are used and a discrete cosine transformed block is input into the apparatus for encoding the block into an encoded bit string; the apparatus comprising: an AC prediction mode variable length encoder for receiving the block, performing an AC prediction and a first variable length coding on the block, and saving a first encoded bit string in the first memory block; a non-AC prediction mode variable length encoder for receiving the block, performing a second variable length coding on the block, and saving a second encoded bit string in the second memory block; and a coding arbitrator, comprising: a mode selector for comparing the first bit string and the second bit string, wherein the mode selector provides a first signal when the first bit string has fewer number of bits or a bit number of the second bit string reaches a second capacity limit of the second memory block, provides a second signal when the second bit string has fewer number of bits, a bit number of the first bit string reaches a first capacity limit of the first memory block or both of the first and the second memory blocks respectively reach the first and second capacity limits; and an output selector, wherein the output selector provides the first bit string as the encoded bit string when receiving the first signal, and provides the second bit string as the encoded bit string when receiving the second signal.