BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 shows a flowchart of a CAVLD decoding process.
FIG. 2 shows the CAVLD decoding bit-stream (0001 0011 100).
FIG. 3A shows the statistics of using CAVLC to compress a 4×4 block when compressing 4 CIF images.
FIG. 3B shows the statistics of using CAVLC to compress a 4×4 block when compressing 5 QCIF images.
FIG. 4 shows the decompression and compression processes according to the present invention.
FIG. 5 shows the tally percentage of bit length of 4000 bit-stream patterns.
FIG. 6A shows an example of the frequent bit-stream patterns.
FIG. 6B shows the zig-zag ordered coefficients obtained by CAVLD decoding the bit-stream patterns of FIG. 6A.
FIG. 7 shows a look-up table according to the present invention.
FIG. 8 shows a flowchart of the pattern-search process according to the present invention.
FIG. 9 shows a hash table constructed from FIG. 6B.
FIG. 10 shows the zig-zag ordered coefficients matching process according to the present invention.
FIG. 11 shows the performance comparison between the present invention and CAVLD on 7 test sequences.
FIG. 12 shows a pattern-search table of the extension of FIG. 6B to encompass the coefficients of the blocks after IT and IQ.
FIG. 13A shows a block diagram of a decompression module for the decompression process of FIG. 4.
FIG. 13B shows a block diagram of a compression module for the compression process of FIG. 4.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
As described earlier, the conventional technology collects the statistic data of the frequency of 4×4 blocks without differentiating the blocks having the nC value. However, the same 4×4 blocks may have different nC values, and will be coded into different bit-stream. For example, when nC is 0, the 4×4 block (2, 0, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) is coded as bit-stream (0001 0011 100). However, when nC is 2, the 4×4 block (2, 0, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) is coded as bit-stream (0011 1111 1000).
In other words, there exists a correlation between the bit pattern and the block. Therefore, if the specific bit-stream (0001 0011 1100) can be quickly matched in the bit-stream during the decoding, the 16 zig-zag ordered coefficients (2, 0, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) can be obtained directly without the CAVLD process. Similarly, if the 16 zig-zag ordered coefficients (2, 0, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) can be matched quickly during the coding, the coded bit-stream (0001 0011 1100) can be obtained directly without the CAVLC process.
Based on this characteristic, the pattern-search based method for variable length coding/decoding of the present invention includes a decompression process and a compress process, as described in FIG. 4 respectively.
In the decompression process 400 of FIG. 4, a pattern-search mechanism is added before the entropy decoding to match a corresponding bit-stream pattern, as shown in step 401. If matched, the zig-zag ordered coefficients can be obtained directly from the pattern-search mechanism without the entropy decoding process, as shown in step 403. Otherwise, an entropy decoding process is conducted, as shown in step 405.
A compression process 410 of FIG. 4 includes a table look-up mechanism before the entropy coding to match the zig-zag ordered coefficients, as shown in step 411. If matched, the coded bit-stream is obtained directly without the entropy coding process, as shown in step 413. Otherwise, an entropy coding process is conducted, as shown in step 415.
The present invention further analyzes the correlation between the bit pattern and the block. First, the number of each type of 4×4 block is calculated and a frequency bit-stream pattern is produced. The bit lengths of the bit-stream pattern are different. Some are 2-bit long, and some are 3-bit long. FIG. 5 shows the percentage of the bit length of 4000 bit-stream pattern samples. The x-axis indicates the bit length, and the y-axis indicates the tally percentage. As shown in FIG. 5, 81.07% of the bit-stream patterns has the bit length less than 8, and 96.93% of the bit-stream patterns has the bit length less than 12.
FIG. 6A shows an example of bit-stream pattern. The first field is the ID number of the bit-stream pattern, and the second field is the corresponding bit-stream pattern. For example, #9 is a 2-bit bit-stream pattern 01, 31 is a 3-bit bit-stream pattern 111, and #5 is a 3-bit bit-stream pattern 101. The statistics show that there are many types of bit-stream patterns. FIG. 6A shows 26 bit-stream patterns.
Without the loss of generality, the present invention uses an 8-bit pattern as an embodiment for constructing a look-up table of FIG. 6A, which will be described in FIG. 7. Also, a byte (8 bits) is read from the bit-stream to use as an index.
Then, the present invention uses CAVLD to decode the bit-stream patterns to obatain the zig-zag ordered coefficients, as shown in the table FIG. 6B. The entry of the zig-zag ordered coefficient table includes three fields. The first field is the ID number of the bit-stream pattern, the second field is the bit-stream pattern, and the third field is the corresponding 16 zig-zag ordered coefficients.
With the zig-zag ordered coefficient table, if the bit-stream pattern can be matched quickly before decoding, the entropy decoding process is skipped, and the corresponding 16 zig-zag ordered coefficients are obtained directly. Similarly, if the corresponding 16 zig-zag ordered coefficients are matched quickly before coding, the coded bit-stream can be obtained directly.
To speed up the matching process of the bit-stream pattern, the present invention uses bit-stream as the index. Without the loss of generality, the present invention uses 8-bit stream as an embodiment to construct the look-up table of FIG. 7. The look-up table includes 256 entries, called, entry 0, 1, . . . , 255. Each entry includes four fields, and they are index, bit length of the matched, bit-stream pattern of the matched and the ID number of the bit-stream pattern in FIG. 6A. With the look-up table of FIG. 7, FIG. 8 further describes the flow of the bit-stream pattern search process.
Referring to FIG. 8, a block, such as a 4×4 block, is extracted and a byte is read from its bit-stream, as shown in step 801. Step 802 is to use the byte as index to the look-up table to locate the indexed entry. Step 803 is to determine whether a match is found based on the fourth field X4, the ID number of the bit-stream pattern in FIG. 6A. If X4 is greater than 0, a match is found, and proceed to step 804 to obtain the third field X3, the matched bit-stream pattern. Step 805 is to obtain the corresponding zig-zag ordered coefficients from the table in FIG. 6B based on X3.
When X4=0 in step 803, it means no match is found. Therefore, an entropy decoding process must be conducted, such as CAVLD, as shown in step 806. Then, step 807 is to extract the next block and repeat the above steps.
In summary, according to the present invention, a bit-stream pattern search step is added before the entropy decoding. If a match is found, the entropy decoding is skipped and the corresponding 16 zig-zag ordered coefficients can be obtained directly.
It is worth mentioning that when nC≧8, the present invention does not construct a look-up table as in FIG. 7. This is because the look-up table is sufficient to cover most of the 4×4 or 2×2 blocks. The few blocks without the matching bit-stream patterns can be decoded using entropy decoding more efficiently.
Similarly, if the specific zig-zag ordered coefficients, such as (2, 0, −1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), can be matched quickly before coding, the coded bit-stream, such as (0001 0011 1100) can be obtained directly without CAVLC.
As the modulus coefficients are 16-bit signed numbers, a hash table is constructed using the FIG. 6B to speed up the matching of zig-zag ordered coefficients (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16), as shown in FIG. 9. The hash table incldues 256 entries. Each entry includes four fields. They are index, zig-zag ordered coefficients, ID number of matched bit-stream pattern in FIG. 6A and bit-stream pattern. The following is an embodiment of the hash function h:
h (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)=(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16)·(2,7,13,23,0,0,0,0,0,0,0,0,0,0,0,0)+64.
Using this hash table, FIG. 10 further describes the flowchart of the matching zig-zag ordered coefficients process. Referring to FIG. 10, step 1001 is to compute the hash value of the zig-zag ordered coefficients (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) to be matched. Step 1002 is to use the hash value as index to locate the entry in the hash table. Step 1003 is to determine whether a match is found for the zig-zag ordered coefficients according to the third field y3, the ID number of the bit-stream pattern in FIG. 6A. When y3 is greater than 0, a match is found, and proceed to step 1004 to obtain the corresponding bit-stream from the table FIG. 6B according to y3.
When y3=0, no match is found. Therefore, an entropy coding process, such as CAVLC, as shown in step 1005. The next zig-zag ordered coefficients are then selected to repeat the above steps.
To verify the effectiveness of the present invention, an ARM based embedded system is used to implement the pattern-search based method for variable length coding/decoding of the present invention, including seven test sequences, called mobile, foreman, carphone, silent, news, highway, and Claire. FIG. 11 shows the comparison of the performance of the standard CAVLD and the present invention on the seven test sequences. The comparison is on the memory count cycles. As shown in IFG. 11, the present invention improves 14.86% on highway sequence, 12.38% on foreman sequence, and 6.12% on mobile sequence in comparison with CAVLD.
In addition, because the behavior of the inverse transformation (IT) and inverse quantization (IQ) are regular, and is limited to the coefficients of the 4×4 blocks. The present invention extends FIG. 6B to encompass the coefficients of the blocks after IQ&IT to construct a new pattern-search table, as shown in FIG. 12. Without the entropy decoding and IQ & IT processes, a 4×4 block after IT can be reconstructed directly.
According to the method of the present invention, FIGS. 13A and 13B show the block diagram of an apparatus for the decompression and compression process of FIG. 4, respectively.
FIG. 13A shows a decompression module 1300, including a pattern-search unit 1301 and an entropy decoder 1305 Using the look-up table in FIG. 7, pattern-search unit 1301 uses an input bit-stream to match a corresponding bit-stream pattern. If matched, pattern-search unit 1301 obtains zig-zag ordered coefficients 1303 from the look-up table. If no match is found, pattern-search unit 1301 informs entropy decoder 1305 to perform entropy decoding process.
According to the present invention, pattern-search unit 1301 reads a byte from the bit-stream, which is used as index to the look-up table for matching the bit-stream pattern to obtain the zig-zag ordered coefficients.
FIG. 13B shows a compression module 1310, including a table look-up unit 1311 and an entropy coder 1315 Using the hash table in FIG. 9, table look-up unit 1311 tries to match the input zig-zag ordered coefficients. If matched, table look-up unit 1311 obtains bit-stream 1313 from the hash table. If no match is found, table look-up unit 1311 informs entropy coder 1315 to perform entropy coding process.
According to the present invention, table look-up unit 1311 computes a hash value 1313 from the input zig-zag ordered coefficients, which is used as index to the hash table for matching the zig-zag ordered coefficients.
In summary, the present invention analyzes the correlation between the bit pattern and the block, and provides a pattern-search based method an apparatus for variable length coding/decoding. The present invention is applicable to the reconstruction of 4×4 or 8×8 blocks and 4×4 blocks after IT, without the standard CAVLD, IT and IQ processes. In comparison with the standard CAVLD, the present invention improves the entropy coding/decoding performance by 10%.
Although the present invention has been described with reference to the preferred embodiments, it will be understood that the invention is not limited to the details described thereof. Various substitutions and modifications have been suggested in the foregoing description, and others will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.