BRIEF DESCRIPTION OF THE DRAWINGS
The invention can be more fully understood by reading the following detailed description of the preferred embodiment, with reference made to the accompanying drawings as follows:
FIG. 1 is a schematic view showing a four-stage pipelined arithmetic encoder in the prior art;
FIG. 2 is a schematic view showing a constant output-rate context formation module according to one preferred embodiment of this invention; and
FIG. 3 is a schematic view showing a four-stage pipelined input-interleaved arithmetic encoder according to one preferred embodiment of this invention.
DESCRIPTION OF THE PREFERRED EMBODIMENTS
Detailed illustrative embodiments of the present invention are disclosed herein. However, specific details disclosed herein are merely representative for purposes of describing exemplary embodiments of the present invention. This invention may, however, be embodied in many alternate forms and should not be construed as limited to the embodiments set forth herein.
The present invention provides a data processing method for the context formation (CF) module and the arithmetic encoder (AE) in EBCOT, so as to increase the performance and cut down the cost. In one preferred embodiment, the CF module is controlled by a finite state machine (FSM) controller to constantly output a valid context and decision pair in each clock cycle, and the arithmetic encoder processes the data by interleaving the inputs. Therefore, the additional first-in first-out (FIFO) buffer is not necessary anymore for the CF module, and each clock cycle can be used efficiently. Besides, the look-ahead approach is not necessary anymore for the arithmetic encoder.
First of all, for the CF module, each code-block is divided into bit-planes and coded starting from the most significant bit-plane (MSB) down towards the least significant bit-plane (LSB). Within a bit-plane, every four rows form a stripe, and the scanning order is stripe by stripe from top to bottom. In every stripe, data are scanned column by column from left to right. But the number of context and decision pairs generated in every stripe is not constant. If the CF module is made to have a constant output rate, the condition of outputting only one context and decision pair has to be considered. Outputting only one context and decision pair may cause the CF module to not have a constant output rate. A non-constant output rate is also known to happen in Run-Length Coding (RLC) of the coding pass, and the decisions in Run-Length Coding are in accordance with the four bits of one column in every stripe. Therefore, the inputs have to be column-based in order to determine the Run-Length Coding conditions in the CF module. After the inputs are decided, a finite state machine (FSM) controller is provided to control the CF module, so that the CF module with a finite state can have a constant valid output in each clock cycle.
FIG. 2 is a schematic view showing a constant output-rate context formation module according to one preferred embodiment of this invention. Referring to FIG. 2, the CF module includes a variable abstract device, a parallel pass classification device, a parallel contribution calculation device, a context and decision pair mapping device, a line buffer, and a FSM controller. The variable abstract device 200 is used to obtain the signs, μk, σk, and γk of four coefficients of one column within a code-block, wherein k is the k-th bit-plane, μ is the magnitude, σ is the significant state, and γ is the first time magnitude refinement coding. Besides, the scripts of those are the same as the hardware description language VHDL as follows:
- sign=Coffi [7];
- μk=Coffi_s[0]; //Coffi_s[6:0] == Coffi[6:0]<<k
- σk=|Coffi_s[6:1];
- γk=|Coffi_s[6:1]& ˜(|Coffi_s[6:2]);
Moreover, the parallel pass classification device 202 and the parallel contribution calculation device 204 are designed to adopt the pass parallel architectures. The context and decision pair mapping device 206 is used to generate the context and decision pairs corresponding to the coded bit, in accordance with a controlling signal, and is practiced according to Boolean logic. In addition, the line buffer 208 is used to store the signs, μk, σk, and coding pass of the fourth bit within a stripe, wherein the length of the line buffer 208 is 64 units and the width of every unit is 5 bits. Then, the FSM controller 210 is provided to control the CF module, so that the CF module with a finite state can have a constant valid output in each clock cycle.
On the other hand, for the arithmetic encoder, if the context and decision pairs have to be processed continuously in one pass, the calculation and the normalization operation have to be done during different pipeline stages when the pass parallel architecture is used in the CF module. Therefore, each context and decision pair has to be processed in each clock cycle. As a result, the present invention provides the arithmetic encoder designed to have interleaving inputs, so that two sequential input data have no relations to each other, and the complicated look-ahead approach is not necessary anymore. Besides, each clock cycle can be used more efficiently.
Referring to FIG. 2 again, after the CF module processes the data and then the context and decision pairs are generated from the CF module, the arithmetic encoder is used to encode each bit according to its contexts and output the bit-streams.
FIG. 3 is a schematic view showing a four-stage pipelined input-interleaved arithmetic encoder according to one preferred embodiment of this invention. Referring to FIG. 3, the calculation and the normalization of the 16-bit A-register are divided into the calculation of the 16-bit A-register 300 and the normalization of the 16-bit A-register 302. The calculation and the normalization of the 16-bit C-register are divided into the calculation of the 16-bit C-register 304 and the normalization of the 16-bit C-register 306. Furthermore, the calculation and the normalization of the 12-bit C-register are divided into the calculation of the 12-bit C-register 308 and the normalization of the 12-bit C-register 310. After that, a four-stage pipelined arithmetic encoder is formed with interleaving inputs.
Referring to FIG. 3 again, the calculation of the 16-bit A-register 300 and the calculation of the 16-bit C-register 304 in the second stage are connected to the probability estimation 312, to send the feedback and update the context and decision pairs by means of index and MPS updating (IMU) 314. Moreover, the normalization of the 16-bit A-register 302 and the normalization of the 16-bit C-register 306 in the third stage are connected to the calculation of the 16-bit A-register 300 and the calculation of the 16-bit C-register 304 in the second stage, to send the feedback and update the context and decision pairs by means of the 16-bit A-register and the 16-bit C-register updating 316. Then, the normalization of the 12-bit C-register 310 in the fourth stage is connected to the calculation of the 12-bit C-register 308 in the third stage, to send the feedback and update the context and decision pairs by means of the 12-bit C-register updating 318. Thus, the look-ahead approach can be replaced and each clock cycle can be used more efficiently. Besides, the path length in this arithmetic encoder is the same as that in the prior art. This arithmetic encoder can also be practiced more easily and increase the performance of EBCOT.
While the exemplary embodiments of the present invention and their advantages have been described in detail, it should be understood that various changes, substitutions and alterations may be made herein without departing from the scope of the invention.