Center for Image Processing Research

5 downloads 38600 Views 5MB Size Report
all its pixels are hosted in the list LSP, since the sign bits of all. Both EZW and .... With BFS, the functions Branchl and Branch4 do not call each other, rather the ...
SPIHT Algorithms Using Depth First Search Algorithm with Minimum Memory Usage CIPR Technical Report TR-2006-10

Mustafa Sakalli and William A. Pearlman March 2006

Center for Image Processing Research Rensselaer Polytechnic Institute Troy, New York 12180-3590 http://www.cipr.rpi.edu

SPIHT algorithms using Depth First Search Algorithm with minimum memory usage Mustafa Sakalli, William A. Pearlman, and Masoud Farshchian

Abstract This paper presents SPIHT and block-wise SPIHT algorithms where full Depth First Search algorithm is used to agglomerate significant bits at each bitplane. Search strategies

used for SPIHT to date are more or less based on a Breadth First Search algorithm. The aim of this work is to minimize the final

memory usage without paying additional overhead cost. DFS also brings benefits such as resolution scalability and a random access decodable bitstream.

Index Terms-Image Coding with Set Partitioning in Hierarchical Trees (SPIHT), Block-wise Set Partitioning in Hierarchical Trees, Breadth First Search Algorithm (BFS), Depth First Search Algorithm (DFS), Tree Search, Memory Usage.

examination of all the sibling roots across a frequency band before proceeding to the descendants of the roots at the higher frequency bands as presented in the left figure of Fig. 1. If a

significant

child exists, the immediate branches available at

the next level higher frequency bands are appended to the list LS Initially the LISenting the types of the roots are set as type-A representing the possible existence of a progenitive branch. A progenitive branch is the one whose offspring are likely to be a significant one. If a type-A root has any significant offspring, the significant pixel is moved to the list LSP and the insignificant ones at the same (2x2 pixels) block are moved to the LIP. The root pointing to this block is queued to the end of the list LIS while its type is raised to type B, for further significant bit check at the same bitplane. At every frequency band, BFS first performs a search through all the roots listed

I. INTRODUCTION A mong wavelet based tree algorithms, SPIHT has achieved I._.__.I.ItXhigh performance with its combined properties of high 1 speed, low complexity and easy applicability in a coarse-to. fine encoding scheme with easy scalability, as well as with full embeddedness, in bit rates and in fidelity. SPIHT achieves............................. . ._.., the optimum results while providing a progressive n 2 2n+2 . transmission capability in communication and multimedia .....................\ ,.......... system s. The aim of the SPIHT algorithm is to locate significant bits wavelet coefficients With1 thle minimum in each biotplane of thle t is impt to i efficients Fig. 1. [Left] Breadth First Search Algorithm versus [Right] Depth First tr eech cot.lTheref tree cost. Therefore,it is important to implementanefficient Search algorithm. The breadth first completes the search of entire siblings at a given depth in the search tree before going on to the next depth. The search algorithm. The search starts from the highest energy depth first examines all the descendant branches of a current node before bitplane level and continues down to the lowest energy proceeding to any other sibling nodes in the search tree. bitplane. The search path at every traversal of a bitplane is registered in three lists in terms of types of the branches and in LIS, and then type B search is performed for the newly the importance of the pixels: lists of insignificant sets (LIS), appended ones. If a significant bit is detected at the list of insignificant (LIP) and significant (LSP) pixels. As the descending blocks of a type-B root, it is replaced with four algorithm traverses a bitplane, LIS relates the roots of the new progenitive branches of the higher frequency bands. Such same spatial orientation to each other with the type a block that is excluded from the list LIS, is a semiinformation, while 2x2 pixels of each block with a significant progenitive block (non-type-B). A block is non-progenitive if all its pixels are hosted in the list LSP, since the sign bits of all element are addressed in the lists of LIP and LIS. Both EZW and SPIHT employ the breadth first search the four pixels must have been already encoded. Appending (BFS) algorithm, [1]. Search starts from a number of roots progenitive roots to the list LIS does not just build up memory from the lower frequency bands and proceeds towards the expansion but it also causes the spatial shuffling of the links higher frequencies. Formally, BFS aims to complete the towards the higher frequency bands. Depth First Search algorithm explores a tree by expanding child root of a search tree and thus traversing deeper and Prof. William A. Pearlman, pearlw(ecse.rpi.edu, Center for Image deeper until it hits a branch that has no child (see Fig. 1Processing Research, Electrical, Computer and Systems Engineering,

Rensselaer Polytechnic Institute, 110 Eighth Street, Troy, NY 12180-3590

Telephone: 518-276-6082, Fax: 518-276-8715 Mustafa Sakalli, msakalli(cipr.rpi.edu, Center for Image Processing

Research, ECSE, Rensselaer Polytechnic Institute.

1-4244-03 50-2/06/$20.OO ©C2006 IEEE

[ih].Te,tesacalotmbckrksocniueo

[1h] hn h erhagrtmakrcst otnet explore next adjacent branches. DFS algorithm lends itself

much better to heuristic methods of choosing a likely solution

1158

2

exhibiting branches with no delay, particularly in the case of trees with shallow branches. When original SPIHT (SPIHT o) is applied with DFS [2], the memory demand of LIS can not be totally avoided. This is due to conveying the final search list LIS (it is also referred as contour) from one bitplane to the next lower bitplane. The expansion of the search contour in DFS, is implicit, does not require appending of type-B branches in LIS between frequency bands, but it will require appending between bitplanes. One disadvantage of the DFS algorithm is that if the search terminates before completing the encoding of the entire bitplane, then BFS algorithm is likely to perform better. This is due to the fact that the low sparsity of the significant coefficients residing closer to the roots at the higher biplanes requires fewer bits to reach than those residing at the higher frequency bands. Otherwise the tree cost for the entire bitplane will always be the same, since it is independent of the type of the search. A method without employing any list (No List SPIHT, NLS) was proposed by Wheeler and Pearlman [2], where state information of the elements is kept in a fixed array size (with about four bits/coef) with spatial markers placed on certain lower nodes of the insignificant branches. In addition to this, Instead of employing two indices for the array of coefficients NLS implements linear indexing through interleaving of the bits representing the two co-ordinates by using one dimensional array with a lookup table. Similar to NLS, we use one dimensional array but without interleaving the bits of indices to reach the address of descendants. NLS achieves a memory reduction of almost sixty percent of the memory required for SPIHT_o. In the following sections, we present implementation of the full level DFS algorithm with and without block-wise implementations in three different memory configurations. II. THREE DIFFERENT MEMORY CONFIGURATIONS USING BREADTH OR DEPTH FIRST SEARCH ALGORTIMS

A. Original SPIHT with BFT and DFT

SPIHT using BFS is non-recursive in nature. That is, the tree search is performed just one level deep, therefore there is no need to continue to search immediately along the branches with consecutive calls of type-B, type-A related functions. he Thu,

Thus es which procedures

requiesm handing addlgoithm ddition omplexity oyandslwuon and

function Brchl(blckaddr) if (func Check_Desendents(blckaddr)) _ _ Output(ind) 1; Clover(blckaddr) Brch4(blckaddr); Mask(blckaddr) = 1; else

Output(ind)

0;

function Brch4(blckaddr) if (func_Check_Desendents(n4blckaddr)) Output(ind) = 1;

Mask(blckaddr) = 2; else

Brckaddr)i2; r

n

Output(ind) = 0;

function Clover(blckaddr

Newfoundch= Find(bplane(l-mask(blckassr))). mask(Newfoundch) = 1; Output(next) = [sign(bitplne(Newfoundch)), //Sign bits

bitplane(mask(blckaddr))];

Fig. 2. Pseudo code of functions Branch], Branch4 presented for DFS and

function Clover. descendant search for a type-B branch through four branches. Fig.2 gives pseudo-code of these functions for the DFS search algorithm. If the search of significant bit with Branch 1 is successful, then the succeeding function is always Clover for transferring the four children into the lists of LSP and LIP. With BFS, the functions Branchl and Branch4 do not call each other, rather the search proceeds in the order listed in U.Roswt infcn hlrnaeapne otels for Rther significant cndeninesation. fS algorithm procedsnt th getivbbranches c algorithm proceeds through the wit with the successive calls of functions between Branchl

progefnihve

(and

Branch4, until thefunctions of a Clover),areandregistered. d branch Calling entire significant recursivelybits requires the process with the delehton of seml-progenitive ueuming additional stack memory. But this is maintained with the of the progenitive roots, and shifting all progenitive remaining aruetpsedbadessorefens.Aarsl, arguments passed by addresses or references. As a result, PITwih F ones up tooth the ls list iin LS However, ^ SPIHT with DFS UIS. Hwee, demand due to the recursive calls of the functions ~~~~~memoryz iease te the recursive natue fu the traverses towards the higher frequency bands by the recursive desot not increase as expected with the recursive nature of the calls ofthe funtions tobe give FSalgrihmreqirs BFS

mmoy

hndin

ons p

below.does algorithm.

h functionsbe givenfbelow, with a subsequent subsequent function Clover (which function Clover (wIch isis associated assocIated with (quadrifoliate)), and Branch4. Function Branch] investigates the significance of the bits at type-A branches. Type-A and type-B branches are those that include and exclude the immediate four children of the current block from the pointed search field, respectively. Function Branch4 performs Tw

The only information kept in the stack is the address of the immediate adjacent branch at every band visited, so that once the algorithm backtracks, the significance chc'otne hog h daetbac.Teadesso thbrnesatefilcoouaecridinheitUSo telwrbtlnst ntaietesac.A euto hs temmr anwt tagtowr plcto fDSi

1159

3

not very high, since the final contour of the branches with no child gradually grows from one bitplane to the next. The memory demand for LIP and LSP remains unchanged. In the following subsection, initialization of bitplanes is performed from a fixed set of the roots in order to achieve a large memory gain, and a mask of coefficients encoded is utilized with one bit per pixel. Later on in subsection C, with a slight modification, the type information is transferred across the bitplanes to obtain better R/D profiles. B. SPIHT with a mask ofLIP-LSP with afixed number of initial roots In this subsection, we apply SPIHT by merging LSP and LIP lists into a mask. A wavelet coefficient encoded is marked to avoid re-encoding of the sign bits, and also to provide a correct refinement of the coefficients. To save memory, a higher bitplane of the wavelet coefficients above the MSB bitplane can be allocated for the mask. LL level

dyadicBsbbtpand dc completed wirthe bior. fyaditersubove i esompoLatone and Gompleedh Athe wiort intil navle fiiens ar rouned the nearesthintegers The st

hogna

is

coefficients are rounded to their nearest bitplane

with whic

istegersmin with

to startatthesearchisdeterminedwith

the decomposition depth L, by assuming all the image pixels havigte lages enegy evelas k_ werek isth The havolution bbits). its. The resolutiontheto lrgestenergyageloevelcias represent image coefficients (8 orhre 16k6 magntud of he

aximm tresold

ive

by

. the maximu maglrounitudewio not notbe gthrgesthok+Ld1giveneby mah( roend(wen)rescan tan.

h,,x

=

ar

the coefficients residing in the DC band...' Figures 3 and 4 represent the flow diagrams of SPIHT performed with BFS and DFS, respectively. With both search methods, the initial entries of the LIS are kept constant for bitlanandtheprogess

ever

f te serchcontour with the

ever binfoatplne andot ofthsrhe down down to the bitplanesbu type transferred informaton S notprogsferress bitplanestbut the ue tansferredhwithin a tpe t owards uprfe s

f

(Its)

LI

HF(2cp12cp+ -2ac D

l>>

LX

(s)

Fig. 4. Flow diagram of the SPIHT-DFS with LIP and LSP masked and with fixed size of LIS.

being

examined before the algorithm proceeds to the next band. A smlrwr

to the

sn

F

a

rvosypooe n[]

u

expanding size of the search contour, the expansion of

ULIS can not be avoided with BFS, but it can be avoided with DFS since the number of initial roots is fixed, and the size of the additional stack memory required for this is L-1. BFS or DFS, at every traversal o With a b either asearch technique s of a bitplane algorithm searches the significant bits without zero bits that are already encoded during consideringofheuprbpansTeeoe, the trvsa rvisl traversal of the upper bitplanes. Therefore, previously transmitted coefficients yet, needsotothat be those distinguished from that are not transmitted bitsthose can having zero refining. This requires an early scanning of the entire mask from the beginning. Thus, all the bits that are marked are initially refined with 2Th-1 before starting the search of the ones at the current Thth bitplane level. Then, all the onesis of bitplane At sought side, whilethese the given bit Th,thearedecoder nottheexceeded. ones are budget such that those that are marked as received are treated earlier,

not be missed from

Intheormrcse,thetypinormtiooftheadded bands. amplitude of 2Th for the refining, and those that are from lower to the higher frequency bands is carried by just notanmarked as received are added an amplitude of 2Th+1 to utilizing a list of LIS. In the DFS case (in Figure.2), this is their absolute value. For the earlier received coefficients, this implicit by invoking the functions with the type of a root, in results with a final refinin of 2Th-1 negative if zero bit is g the order of horizontal, vertical and diagonal branches. There received or positive in the ' all. the . received or positive in the ~opposite case. If the bitplane can is no need to accommodate a list, since subsequent not be completely scanned, then the final PSNR results will branches of an initial root in entire frequency bands will be slightly skew towards zeros. Every bitplane is traversed three times during encoding: first for the refining (only at the decoder side), second for checking entire bits at the current ~hik (US) Type(LTS(/is)) bitplane, and third for checking if the coefficient is previously

gpi

T