• 沒有找到結果。

Dynamic Memory Organization

3. Binary Arithmetic Coding: Once the highest priority bit is identified, we follow the CABIC scheme in Section 4.2 for coding

4.6 Dynamic Memory Organization

The reshuffling and update process causes intensive computation. With straightforward imple-mentation, the estimated rate-distortion data of all coefficient bits must be updated after the coding of a non-zero significant bit; then, the reshuffling is conducted using all coefficient bits as input. From the profiling of foreman CIF sequence on P4 2.0GHz machine, it takes about 30 minutes for the bit-plane encoding5 of an enhancement-layer frame, which is unacceptable and unrealistic. Thus, in this section, we propose a dynamic memory organization to reduce the complexity of SBR.

5The bit-plane coding at the enhancement layer has balanced complexity in encoder and decoder.

Chapter 4. Context-Adaptive Bit-Plane Coding

Highest priority bit of the list

Ctx3 group

The associated register of a significant bit , recording the estimated rate -distortion data and bit location .

The register to be updated.

The destination for an updated register.

CtxN

The context group pointer to be reshuffled.

Figure 4.10: Example of dynamic memory organization for the list of significant bit.

4.6.1 Memory Management for The List of Significant Bit

For reducing the complexity of update and reshuffling, we observe that not all the registers are required for modification after the coding of each significant bit. Thus, we can minimize the computation by updating those outdated registers while keeping the others untouched.

To update the outdated registers, we first search them in the list. To quickly identify the registers of Category 1, we group the registers, recording the same context index, by a linked list.

The right hand side of Figure 4.10 shows an example, where each circle denotes the associated register of a significant bit and each rectangle represents a context group. In addition, to identify the registers of Categories 2 and 3, we avoid exhaustive searching by confining our search within certain context groups. To determine which context groups for search, we follow the definitions of Categories 2 and 3 to derive the bit locations for those outdated significant bits.

From the bit locations, we further calculate their context indices before the coding by reversing the significance status of the currently coded bit. These context indices then determine the context groups for search. Within a group, we perform the search by comparing the bit location.

Then, we update the outdated rate-distortion data using the latest context probability model.

After the update, we perform the reshuffling in a hierarchical way. Specifically, we first identify the highest priority bit in each group. Then, we assign each group a context group pointer that points to the highest priority bit in a group. Lastly, we reshuffle the context group pointers to find out the highest priority bit in the list. Note that we do not directly reshuffle the highest priority bit of each group since we want to maintain the same context group structure.

Particularly, the reshuffling in each group and the reordering of all the context group pointers are performed in the initialization step. During the actual coding, we only modify certain context groups and context group pointers so that the computation for reshuffling is minimized. Figure 4.10 shows an example of our priority structure. For each group, the priority from left to right is in descending order. Similarly, for different groups, the priority of the highest priority bit from top to bottom is in descending order, i.e., we have A3 > A1 > A5 > . . . . > AN. In this example, A3 is not only the highest priority bit of Ctx3 group but also has the highest priority in the list.

During the reshuffling and update, we must quickly access a context group for a given con-text index. To avoid exhaustive search in the linked list of concon-text group pointers, we construct a look-up table that takes the context index as input and produces the associated context group pointer. The left hand side of Figure 4.10 depicts an example of the look-up table.

To show our dynamic memory organization, we use Figure 4.10 as an example, where we assume that the registers in each group and the context group pointers have been reshuffled since the initialization. According to our priority structure, we start the coding from A3. More-over, we assume the context indices of relevant registers B5 and A2 must be changed as A3 is recognized significant. To perform the reshuffling, after A3 is coded, we first update the rate-distortion data for the registers in the same group, i.e., B3, C3 and D3. Next we update the

Chapter 4. Context-Adaptive Bit-Plane Coding

Table 4.6: Average execution time for the bit-plane encoding of an enhancement-layer frame on P4 2.0GHz machine

Sequences Straightforward Dynamic Memory Improvement Implementation Organization Ratio

Foreman CIF 1817 seconds 38 seconds 48 Mobile CIF 2324 seconds 37 seconds 63

News CIF 1662 seconds 34 seconds 49

rate-distortion data of B5 and A2. Then we move B5 and A2 to the other context groups since their context indices have been changed. Specifically, the destination groups are determined by their context indices after A3 becomes significant. For example, in Figure 4.10, the register B5 is updated and moved from the Ctx5 group to the B4 position of the Ctx4 group. Similarly, the register A2 is updated and moved from the Ctx2 group to the Ctx6 group. Particularly, we put B5 at the location of B4 because the priority in the Ctx4 group is A4 > B5 (B4) > C4.

After the update and movement for the relevant context groups (i.e., Ctx groups 3, 5, 2, 4, and 6), the highest priority bits of Ctx3, Ctx2, and Ctx6 groups have been changed. Thus, we must determine their new positions in the linked list of the context group pointers. To do so, we first remove the context group pointers (i.e., Context group pointers 3, 2, and 6) from the linked list. Then, we sequentially insert them back at proper positions by comparing the registers of the highest priority after the update. Particularly, the linked list of context group pointers is bidirectional. We can easily remove any context group pointer from the list. In this example, we only modify the contents of the context groups 3, 5, 2, 4, and 6 while keeping the others untouched. The computation for update and reshuffling is minimized.

4.6.2 Memory Management for The List of Refinement Bit

For the refinement bit, we only reshuffle the registers for identifying the highest priority one.

There is no need for update and relocation. Thus, we simply use a linked list to maintain the list of the refinement bit.

As compared to straightforward implementation, Table 4.6 shows that a relative improve-ment ratio of more than 48X is achieved by using a structural memory organization. Although the performance is still far way from real-time, more improvements are expected by further optimizing in both algorithmic and coding aspects.

Table 4.7: Testing conditions for comparing bit-plane coding schemes

Sequence Foreman Mobile News

Base-Layer Qp 38 (QCIF) 38 45

/46 (CIF)

Enh.-Layer Prediction 128kbits/s 160kbits/s 64kbits/s Bit Rate, QCIF

Enh.-Layer Prediction 320kbits/s 384kbits/s 256kbits/s Bit Rate, CIF

Frame Size CIF (352x288) / QCIF (176x144)

Frame Rate 10 frames/s

GOP Structure IPPPP....P

Prediction Leaky Factor 0.9375 Reference Frame Number 1 Motion Estimation Range 32

Block Modes All the block modes are enabled Base-Layer Entropy CABAC

Coding Mode

Freq. Weighting Matrix (3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,,0) in Zigzag Order