Compressing Bi-Level Images by Block Matching on a Tree Architecture Sergio De Agostino Computer Science Department Sapienza University of Rome ITALY.

Slides:



Advertisements
Similar presentations
Chapter 11. Hash Tables.
Advertisements

Introduction to Algorithms Quicksort
Lecture 19: Parallel Algorithms
Lecture 3: Parallel Algorithm Design
MPEG4 Natural Video Coding Functionalities: –Coding of arbitrary shaped objects –Efficient compression of video and images over wide range of bit rates.
CPSC 335 Dr. Marina Gavrilova Computer Science University of Calgary Canada.
The Binary Numbering Systems
§7 Quicksort -- the fastest known sorting algorithm in practice 1. The Algorithm void Quicksort ( ElementType A[ ], int N ) { if ( N < 2 ) return; pivot.
Tic Tac Toe Game playing strategies
Searching Kruse and Ryba Ch and 9.6. Problem: Search We are given a list of records. Each record has an associated key. Give efficient algorithm.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 24 Sorting.
Genome-scale disk-based suffix tree indexing Benjarath Phoophakdee Mohammed J. Zaki Compiled by: Amit Mahajan Chaitra Venus.
Digital Images in Java The structure of code and concept
SPRING 2004CENG 3521 Query Evaluation Chapters 12, 14.
Advanced Topics in Algorithms and Data Structures Lecture 6.1 – pg 1 An overview of lecture 6 A parallel search algorithm A parallel merging algorithm.
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
Binary Image Compression Using Efficient Partitioning into Rectangular Regions IEEE Transactions on Communications Sherif A.Mohamed and Moustafa M. Fahmy.
1 A simple construction of two- dimensional suffix trees in linear time * Division of Electronics and Computer Engineering Hanyang University, Korea Dong.
ISPDC 2007, Hagenberg, Austria, 5-8 July On Grid-based Matrix Partitioning for Networks of Heterogeneous Processors Alexey Lastovetsky School of.
Parallel Prefix Sum (Scan) GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from articles taken from GPU Gems III.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Tree Contraction Label leaf nodes 1...n –Rake odd indexed leaf nodes –Left Compress –Right Compress –Left Compress –Right Compress Key: avoid memory conflicts.
CSC 2300 Data Structures & Algorithms March 20, 2007 Chapter 7. Sorting.
General Trees and Variants CPSC 335. General Trees and transformation to binary trees B-tree variants: B*, B+, prefix B+ 2-4, Horizontal-vertical, Red-black.
DAST 2005 Week 4 – Some Helpful Material Randomized Quick Sort & Lower bound & General remarks…
CSE 373, Copyright S. Tanimoto, 2002 Up-trees - 1 Up-Trees Review of the UNION-FIND ADT Straight implementation with Up-Trees Path compression Worst-case.
Advanced Topics in Algorithms and Data Structures 1 Two parallel list ranking algorithms An O (log n ) time and O ( n log n ) work list ranking algorithm.
Evaluation of Relational Operations. Relational Operations v We will consider how to implement: – Selection ( ) Selects a subset of rows from relation.
Basic PRAM algorithms Problem 1. Min of n numbers Problem 2. Computing a position of the first one in the sequence of 0’s and 1’s.
1 Exact Set Matching Charles Yan Exact Set Matching Goal: To find all occurrences in text T of any pattern in a set of patterns P={p 1,p 2,…,p.
Ch. 8 & 9 – Linear Sorting and Order Statistics What do you trade for speed?
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
IP Address Lookup Masoud Sabaei Assistant professor
Binary Image Compression via Monochromatic Pattern Substitution: A Sequential Speed-Up Luigi Cinque and Sergio De Agostino Computer Science Department.
Introduction n – length of text, m – length of search pattern string Generally suffix tree construction takes O(n) time, O(n) space and searching takes.
 Pearson Education, Inc. All rights reserved Searching and Sorting.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
Parallel Algorithms Patrick Cozzi University of Pennsylvania CIS Spring 2012.
Parallel Algorithms Patrick Cozzi University of Pennsylvania CIS Fall 2013.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
CSC 211 Data Structures Lecture 13
Data Structure Introduction.
Communication and Computation on Arrays with Reconfigurable Optical Buses Yi Pan, Ph.D. IEEE Computer Society Distinguished Visitors Program Speaker Department.
Cache-efficient string sorting for Burrows-Wheeler Transform Advait D. Karande Sriram Saroop.
Chapter 18: Searching and Sorting Algorithms. Objectives In this chapter, you will: Learn the various search algorithms Implement sequential and binary.
Module #9: Matrices Rosen 5 th ed., §2.7 Now we are moving on to matrices, section 7.
Sorting and Searching by Dr P.Padmanabham Professor (CSE)&Director
Speeding up Lossless Image Compression: Experimental Results on a Parallel Machine Luigi Cinque and Sergio De Agostino Computer Science Department Sapienza.
Chapter 15 A External Methods. © 2004 Pearson Addison-Wesley. All rights reserved 15 A-2 A Look At External Storage External storage –Exists beyond the.
Winter 2014Parallel Processing, Fundamental ConceptsSlide 1 2 A Taste of Parallel Algorithms Learn about the nature of parallel algorithms and complexity:
Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar
Fall 2008Simple Parallel Algorithms1. Fall 2008Simple Parallel Algorithms2 Scalar Product of Two Vectors Let a = (a 1, a 2, …, a n ); b = (b 1, b 2, …,
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
1. Searching The basic characteristics of any searching algorithm is that searching should be efficient, it should have less number of computations involved.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
Implementation of Database Systems, Jarek Gryz1 Evaluation of Relational Operations Chapter 12, Part A.
Unit-8 Sorting Algorithms Prepared By:-H.M.PATEL.
 2006 Pearson Education, Inc. All rights reserved. 1 Searching and Sorting.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Evaluation of Relational Operations Chapter 14, Part A (Joins)
© 2006 Pearson Addison-Wesley. All rights reserved15 A-1 Chapter 15 External Methods.
Navigation Piles with Applications to Sorting, Priority Queues, and Priority Deques Jyrki Katajainen and Fabio Vitale Department of Computing, University.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 23 Sorting.
Lecture 3: Parallel Algorithm Design
Succinct Data Structures
Spatial Indexing I Point Access Methods.
Evaluation of Relational Operations
MPEG4 Natural Video Coding
Disjoint Sets DS.S.1 Chapter 8 Overview Dynamic Equivalence Classes
An Algorithm for Compression of Bilevel Images
CS203 Lecture 15.
Presentation transcript:

Compressing Bi-Level Images by Block Matching on a Tree Architecture Sergio De Agostino Computer Science Department Sapienza University of Rome ITALY

Lossless image compression by block matching is an extension of the LZ1 method to bi-level images. A square greedy matching heuristic using a simple hashing scheme provides a linear time implementation. Storer [1996], Proc. IEEE Data Compression Conf. A slower rectangle greedy matching technique requires O(Mlog M) time to compute a match (M is the size of a match) and the worst-case sequential time is Ω(nlog M) for an image of size n. Storer and Helfgott [1997], The Computer Journal The image is scanned in some linear order and the window is unrestricted.

The Compression Scheme The image is read by a raster scan and the matching algorithm works with a perfect hashing table with one position for each possible 4x4 subarray. All-zero and all-one rectangles are handled differently. The encoding scheme starts each pointer with a flag field indicating whether there is a monochromatic rectangle (0 for white, 10 for black), a match (110) or raw data (111).

If the 4 x 4 subarray in position (i,j) is monochromatic, then we compute the largest monochromatic rectangle in that position and encode the width and the length. Otherwise we compute the largest rectangular match in the position provided by the hash table, encode its position, width and length, and update the table with the current position. If the subarray is not hashed, then it is left uncompressed and added to the hash table with its current position. The positions covered by matches are skipped in the linear scan of the image.

Worst Case Running time ≈ M(1+1/2+1/3+…+1/M)= θ(Mlog M)

Parallel Block Matching A work-optimal parallel block matching algorithm requiring O(log M log n) time can be implemented on a shared memory machine. An m x m' image is partitioned into w x l rectangular areas A i,j for 1≤ i ≤ ┌ m/w ┐ and 1≤ j ≤ ┌ m’/l ┐, where w and l are θ(log 1/2 m x m'), and the sequential block matching algorithm is applied to each area. If w, l are θ(α 1/2 ) and α is Ω(log n), the algorithm can be implemented in O(α logM) time with O(n/α) processors.

Merging phases Larger monochromatic rectangles are computed by merging adjacent monochromatic areas.

The Tree Architecture We extend an m x m’ bi-level image with dummy rows and dummy columns so that the image can be partitioned in l x w rectangular areas B i,j for 1 ≤ i, j ≤ 2 h, where h = min { d : 2 d ≥ max(m/l, m’/w) }. The tree is full and binary. The leaves of the full binary tree are 2 2h and labeled from 1 to 2 2h from left to right. 2h is the height of the tree.

Storing the Image STORE(image I, integers μ, i, j) if μ >1 STORE(I, μ/2, i, j) STORE(I, μ/2, i+ μ/2, j) STORE(I, μ /2, i, j+ μ/2) STORE(I, μ/2, i+ μ/2, j+\mu/2) else store B i,j into leaf k; k=k+1 k is a global integer variabile initially set to 1. STORE(I, 2 h, 1, 1) stores the rectangular areas into the leaves of the tree.

Example

Merging phases For each area of a larger monochromatic rectangle, the indices of the areas at the upper left and lower right corners are stored in the corresponding leaf.

Vertical merging phases The k-th vertical merging phase is computed by broadcasting the information through processors up to level 2h - 2k + 1.

Horizontal merging phases The k-th horizontal merging phase is computed by broadcasting the information through processors up to level 2h - 2k.

Two assumptions needed to obtain an O(α log M) time encoder/decoder with O(n/α) processors on a full binary tree architecture are: the number of monochromatic matches with length or width ≥ 2 k ┌ log 1/2 n ┐ is O(n/(2 2k log n) for 1 ≤ k ≤ h – 1. each pixel is covered by a small constant number of monochromatic matches. It follows that the amount of information each processor at level k must broacast is constant for 1 ≤ k ≤ h – 1.

Encoding on the Tree The leaf processors produce the pointers. If the leaf processor stores a non-monochromatic area, the sequence of pointers is produced by a raster scan. The end of the sequence of pointers is indicated with the flag field 1111 (the flag field 111 is changed to 1110). A pointer encoding a monochromatic rectangle obtained by merging is produced by the leaf processor storing the upper left corner.

The order of the pointers is the one of the leaves. A pointer encoding a monochromatic rectangle obtained by merging is followed by the flag field 1111 and the index of the next leaf storing some pointer. Such index is computed by parallel suffix computation if for each leaf a variable is set to 1 if the leaf stores at least a pointer, 0 otherwise. Such encoding is realized in O(α) time with O(n/α) processors on a full binary tree architecture.

The Parallel Decoder For each area A i,j, the input phase of the parallel decoder identifies the corresponding sequence of pointers, if any, and stores it into the corresponding leaf by reading the encoding binary string from left to right and detecting the flag fields equal to Once the input phase is completed, the parallel decoding is divided in two phases and requires O(α log M) time with O(n/α) processors. The parallel decoder is not work-optimal since the sequential decoder requires linear time.

Phase 1 For each area A i,j one processor decodes the corresponding sequence of pointers, if any. For each monochromatic rectangle, the left upper portion corresponding to a given area A i,j is decoded. i or j are odd values. A i,j

Phase 2 Step 1: Left upper monochromatic area A 2i-1,j is copied on A 2i,j if it is monochromatic and has the same color (information provided by the pointer); the same is done horizontally. → ↓ → A 2i-1,j A 2i,,j

Step k: Areas A (i-1)2^(k-1)+1,j … A i2^(k-1),j, with i odd, are copied respectively on A i2^(k-1)+1,j … A (i+1)2^(k-1),j if monochromatic with the same color (similarly on the vertical boundaries). ↓ →

Parallel Complexity Phase 1 requires O(α) time with O(n/α) processors. Phase 2 requires O(α log M) time with O(n/α) processors under the same assumptions made for the parallel block matching algorithm. After phase 2, the image is stored into the leaves as with the STORE procedure. In conclusion, the computation of the block matching encoder/decoder takes O(α log M) time on a full binary tree architecture with O(n/α) processors, where α is an integer parameter in Ω(log n).

Future Work ●To make block matching suitable for large scale array architectures by improving its compression locally. ●To study how scalability and compression effectiveness relate to each other. ●To detect experimentally an upper bound to the integer parameter α for which the tree architecture is effective. ●To detect if there are values of the integer parameter α which it is better to discriminate.