Implementation of Motion-Compensated Prediction Algorithm
Our image encoder supports a variable block-match size, variable maximum block-match delta, and a variable long-term memory buffer size. The user must also specify a quantization parameter that determines the degree of compression. For comparison, the encoder also supports frame-difference encoding and simple intra-frame encoding. The motion-compensation vectors (dx, dy, dt) were jointly encoded using a Huffman table, with the dt value differentially encoded based on the previous frame's dt. The block matching algorithm utilizes a lagrangian cost function based on the MSE of the block and the bit cost of encoding the vector (dx, dy, dt).
To verify the functionality of our encoder, we compressed a contrived
periodic cardiac sequence (period 10 frames) with a buffer size of 1 and
16 frames respectively. As each frame was compressed, we examined the PSNR of the
predicted vs. the original image. As expected, the PSNR of the predicted
vs. the original image took a sharp jump upward from the 11th coded frame
onward, as shown in Figure 1. Note that we used a very low quantization
parameter (meaning we're not compressing the sequence much) in order to make
the jump in PSNR more pronounced.
We repeated the experiment for seven different quantization
levels, and generated the PSNR curves shown in Figure 2. The graph also shows the PSNR
curves for simple frame-difference encoding and intra-frame encoding
for comparison. Notice that MCP with a buffer size of 1 and
frame-difference encoding yield almost identical results due to the
strong temporal correllation of the data. Our test sequence was not
sub-sampled to reduce this correllation. Also note that simple
frame-difference encoding is actually the best at low bit rates. The
strong temporal correllation due to the shared fourier-space data of
temporally adjacent images makes the previous frame an excellent
predictor, as previously discussed.
In an attempt to determine the optimal MCP parameters for compression of our cardiac sequences, we ran the compression algorithm in batch mode for the following parameter combinations:
After further verification that our motion compensation algorithm was indeed working on periodic sequences, we examined the PSNR of the predicted vs. the original image as each frame was encoded in an attempt to understand why the gain from increasing the buffer size was so small on the cardiac images. While increasing the buffer size did improve the PSNR (as expected), the improvement was generally limited to a fraction of a decibel. At low bit rates, the additional bit overhead for sending the diplacement vectors overshadowed the small gain in bit rate from reducing the error.
Despite the relatively small improvement we were able to obtain using MCP, we were still able to obtain impressive compression ratios on the cardiac sequences while retaining their diagnostic utility, as discussed in Results.