Manipulating Lossless Video in the Compressed Domain William Thies 1, Steven Hall 2, Saman Amarasinghe 2 1 Microsoft Research India 2 Massachusetts Institute.

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
Advertisements

15 Data Compression Foundations of Computer Science ã Cengage Learning.
Data Compression CS 147 Minh Nguyen.
Bottleneck Elimination from Stream Graphs S. M. Farhad The University of Sydney Joint work with Yousun Ko Bernd Burgstaller Bernhard Scholz.
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
SCA Introduction to Multimedia
Phased Scheduling of Stream Programs Michal Karczmarek, William Thies and Saman Amarasinghe MIT LCS.
T.Sharon-A.Frank 1 Multimedia Size of Data Frame.
Computer Science 335 Data Compression.
Static Translation of Stream Programming to a Parallel System S. M. Farhad PhD Student Supervisor: Dr. Bernhard Scholz Programming Language Group School.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Lossless Compression in Multimedia Data Representation Hao Jiang Computer Science Department Sept. 20, 2007.
Data dan Teknologi Multimedia Sesi 08 Nofriyadi Nurdam.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
1 Exploiting Coarse-Grained Task, Data, and Pipeline Parallelism in Stream Programs Michael Gordon, William Thies, and Saman Amarasinghe Massachusetts.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
1 Digital Video. 2  Until the arrival of the Pentium processor, in 1993, even the most powerful PCs were limited to capturing images no more than 160.
Compression Algorithms Robert Buckley MCIS681 Online Dr. Smith Nova Southeastern University.
JPEG C OMPRESSION A LGORITHM I N CUDA Group Members: Pranit Patel Manisha Tatikonda Jeff Wong Jarek Marczewski Date: April 14, 2009.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 7 End-to-End Data Copyright © 2010, Elsevier Inc. All rights Reserved.
Lab #5-6 Follow-Up: More Python; Images Images ● A signal (e.g. sound, temperature infrared sensor reading) is a single (one- dimensional) quantity that.
296.3Page 1 CPS 296.3:Algorithms in the Real World Data Compression: Lecture 2.5.
Computing in the Modern World BCS-CMW-7: Data Representation Wayne Summers Marion County October 25, 2011.
Orchestration by Approximation Mapping Stream Programs onto Multicore Architectures S. M. Farhad (University of Sydney) Joint work with Yousun Ko Bernd.
Chapter 11 Fluency with Information Technology 4 th edition by Lawrence Snyder (slides by Deborah Woodall : 1.
Communication Overhead Estimation on Multicores S. M. Farhad The University of Sydney Joint work with Yousun Ko Bernd Burgstaller Bernhard Scholz.
1 i206: Lecture 2: Computer Architecture, Binary Encodings, and Data Representation Marti Hearst Spring 2012.
Static Translation of Stream Programs S. M. Farhad School of Information Technology The University of Sydney.
Survey on Improving Dynamic Web Performance Guide:- Dr. G. ShanmungaSundaram (M.Tech, Ph.D), Assistant Professor, Dept of IT, SMVEC. Aswini. S M.Tech CSE.
Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Still-image compression Moving-image compression and File types.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
Chapter 3 Pelekanou Olga INF221 INTRODUCTION TO MULTIMEDIA.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
1 Optimizing Stream Programs Using Linear State Space Analysis Sitij Agrawal 1,2, William Thies 1, and Saman Amarasinghe 1 1 Massachusetts Institute of.
Profile Guided Deployment of Stream Programs on Multicores S. M. Farhad The University of Sydney Joint work with Yousun Ko Bernd Burgstaller Bernhard Scholz.
I Power Multimedia Technology Graphics Higher Computing.
Data compression. lossless – looking for unicolor areas or repeating patterns –Run length encoding –Dictionary compressions Lossy – reduction of colors.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Orchestration by Approximation Mapping Stream Programs onto Multicore Architectures S. M. Farhad (University of Sydney) Joint work with Yousun Ko Bernd.
Michael I. Gordon, William Thies, and Saman Amarasinghe
Real Time Transcoding Soam Acharya July 30, 1997 Cornell University.
A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and Applications software. Systems.
CS1354 GRAPHICS AND MULTIMEDIA Handle By, S.JENILA AP/IT.
Linear Analysis and Optimization of Stream Programs Masterworks Presentation Andrew A. Lamb 4/30/2003 Professor Saman Amarasinghe MIT Laboratory for Computer.
Static Translation of Stream Program to a Parallel System S. M. Farhad The University of Sydney.
1 Part A Multimedia Production Chapter 2 Multimedia Basics Digitization, Coding-decoding and Compression Information and Communication Technology.
Multimedia Systems Dr. Wissam Alkhadour.
3.3 Fundamentals of data representation
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Algorithms in the Real World
Algorithms in the Real World
Linear Filters in StreamIt
Digital 2D Image Basic Masaki Hayashi
JPG vs GIF vs PNG What is the difference?
Introduction to Computer Science - Lecture 4
Data Compression.
Inserting Graphics, Media, and Objects
Chapter III, Desktop Imaging Systems and Issues: Lesson IV Working With Images
Data Compression CS 147 Minh Nguyen.
Vector Processing => Multimedia
3.01F Publishing Animated Videos
StreamIt: High-Level Stream Programming on Raw
15 Data Compression Foundations of Computer Science ã Cengage Learning.
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

Manipulating Lossless Video in the Compressed Domain William Thies 1, Steven Hall 2, Saman Amarasinghe 2 1 Microsoft Research India 2 Massachusetts Institute of Technology ACM Multimedia October 20, 2009

Processing in the Compressed Domain Multimedia archives are growing rapidly –Monsters vs. Aliens production 100 TB –Facebook photos 400 TB –YouTube 600 TB How to analyze or modify the data? Uncompress Process Recompress Compressed Input Compressed Output Process Compressed Input Compressed Output Compressed-domain transformation Typical practice lossless prior to distribution

Prior Work: Focus on Lossy Formats DCT-based spatial compression (JPEG, MPEG stills) –Resizing [Dugad & Ahuja 2001] [Mukherjee & Mitra 2002] –Edge detection [Shen & Sethi 1996] –Image segmentation [Feng & Jiang 2003] –Shearing and rotating inner blocks [Shen & Sethi 1998] –Linear combinations of pixels [Smith & Rowe 1996] DCT-based temporal compression (MPEG video) –Captioning [Nang, Kwon, & Hong 2000] –Reversal [Vasudev 1998] –Distortion detection [Dorai, Ratha, & Bolle 2000] –Transcoding [Acharya & Smith 1998] Almost no work on lossless formats –Transpose and rotation of black/white images [Shoji 1995; Misra et al. 1999] –Pattern matching in compressed text [Farach & Thorup 1998; Navarro 2003] –Modifying pitch and playback of audio [Levine 1998]

Prior Work: Focus on Lossy Formats DCT-based spatial compression (JPEG, MPEG stills) –Resizing [Dugad & Ahuja 2001] [Mukherjee & Mitra 2002] –Edge detection [Shen & Sethi 1996] –Image segmentation [Feng & Jiang 2003] –Shearing and rotating inner blocks [Shen & Sethi 1998] –Linear combinations of pixels [Smith & Rowe 1996] DCT-based temporal compression (MPEG video) –Captioning [Nang, Kwon, & Hong 2000] –Reversal [Vasudev 1998] –Distortion detection [Dorai, Ratha, & Bolle 2000] –Transcoding [Acharya & Smith 1998] Almost no work on lossless formats –Transpose and rotation of black/white images [Shoji 1995; Misra et al. 1999] –Pattern matching in compressed text [Farach & Thorup 1998; Navarro 2003] –Modifying pitch and playback of audio [Levine 1998] Our Focus: Regular Processing of LZ77-Compressed Data Streams Our Focus: Regular Processing of LZ77-Compressed Data Streams

Example oooolalala OOOOLALALA Output: Input: to lowercase

AALALL Example OOOOALALLA OOOOLALALA Input: Compressed Input: oooolalala Output:

A Example OOOOLALLA OOOOLALALA 42 Input: oooolalala Output: Compressed Input:

Example OOOOLA OOOOLALALA 42 oooolalala Output: Input: Compressed Input: “Repeat Token” CountDistance

Example OOOOLA OOOOLALALA 4213 oooolalala Output: Input: Compressed Input: CountDistance “Repeat Token”

Example OLA OOOOLALALA 4213 oooolalala Output: Input: Compressed Input: CountDistance “Repeat Token”

Example OLA ola OOOOLALALA Compressed Output: Compressed Input: oooolalala Output:

Example OLA ola Compressed Output: Compressed Input: Compressed Domain Transformation OOOOLALALAoooolalala Output: Input:

Example

Our Contributions Handle the general case –Produce and consume more than one data item –Split and join data streams Implement in a compiler –Programmer thinks in terms of uncompressed data –Compiler translates to work on compressed data –Relies on StreamIt programming language Evaluate on video processing tasks –12 videos in Apple Animation format –Adjust colors or overlay two videos –Speedups proportional to compression ratio (median 15x)

In This Talk StreamIt Language Compressed Domain Transformation Experimental Evaluation

void->void pipeline FMRadio(freq1 low, float freq2, int N) { add AtoD(); add FMDemod(); add splitjoin { split duplicate; for (int i=0; i<N; i++) { add pipeline { add LowPassFilter(freq1 + i*(freq2-freq1)/N); add HighPassFilter(freq2 + i*(freq2-freq1)/N); } join roundrobin(); } add Adder(); add Speaker(); } Adder Speaker AtoD FMDemod LPF 1 Duplicate RoundRobin LPF 2 LPF 3 HPF 1 HPF 2 HPF 3 The StreamIt Language

Adder Speaker AtoD FMDemod LPF 1 Duplicate RoundRobin LPF 2 LPF 3 HPF 1 HPF 2 HPF 3 Applications –DES and Serpent [PLDI 05] –MPEG-2 [IPDPS 06] –SAR, DSP benchmarks, JPEG, … Programmability –StreamIt Language (CC 02) –Teleport Messaging (PPOPP 05) –Programming Environment in Eclipse (P-PHEC 05) Domain Specific Optimizations –Linear Analysis and Optimization (PLDI 03) –Optimizations for bit streaming (PLDI 05) –Linear State Space Analysis (CASES 05) Architecture Specific Optimizations –Compiling for Communication-Exposed Architectures (ASPLOS 02 & 06, dasCMP 07) –Phased Scheduling (LCTES 03) –Cache Aware Optimization (LCTES 05) –Load-Balanced Rendering (Graphics Hardware 05) Migrating Legacy Code to a Stream Representation –Using a Dynamic Analysis (MICRO 07) The StreamIt Language

Language Primitives FilterSplitterJoiner Filter pop 2 push 1 roundrobin(1,1) roundrobin(2,2) pop N push M roundrobin(N,M) Model of computation also known as cyclo-static dataflow

Example: Video Compositing roundrobin(1,1) Source 1 Source 2 Output MultiplyPixels 2 1

In This Talk StreamIt Language Compressed Domain Transformation Experimental Evaluation

Transforming Windows of Data OO–OOLA–L––LA– A LALAAOOOOL OO–OOLA–L––LA– A LALAAOOOOL Hyphenate Pairs Input: Output:

Transforming Windows of Data OO–OOLA–L––LA– A LALAAOOOOL OO–OOLA–L––LA– A LALAAOOOOL Hyphenate Pairs Input: Output:

Transforming Windows of Data OO–OOLA–L––LA– A LALAAOOOOL AOL 2431 L–A 36 Output: Compressed Input: Compressed Output:

Transforming Windows of Data OO–OOLA–L––LA– A LALAAOOOOL AOL 2431 L–A 36 Output: Compressed Input: Compressed Output:

Transforming Windows of Data OO–OOLA–L––LA– A LALAAOOOOL AOL 2431 OOL––A 36 AOOL Output: Coarsened, Expanded Compressed Input: Compressed Output:

General Case: Filters DN … … Filter I O D’O/ I N’’O/ I … … D’N’ …..… Filter I O I O … N’ % I items CoarsenTranslate D’ = LCM (D, I ) N’ = N – (D’ – D) N’’ = N’ – N % I

Compressed Input: Compressed Output: Splitting Streams LALAALALAL 1 1 ALALALALAL Input: Output:

Compressed Input: Splitting Streams LALAALALAL 2 2 AL 2 2 Input: Output:

Coarsened, Expanded Input: Compressed Output: Splitting Streams LAALALALAL

1 1 O X X O OOO Splitting and Joining: Transpose OOO OOO 4 4 OOO

O X 1 1 OOO OOO 4 4 O XOOO OO O

O X X O OOO OOO OOO OOO

XO O XO 31 O OO OOO

O O O 2 4 X O XO 12 O XO O 31

General Case: Joiners D1N1 … … W1 W2 D2N2 … … If D1 % W1 = 0 and D2 % W2 = 0 and D1/W1 = D2/W2 D1(W1+W2) N’ … … W1

In This Talk StreamIt Language Compressed Domain Transformation Experimental Evaluation

Implementation Implemented subset of transformations in StreamIt –User can change graph connectivity + filter functions Supported file format: Apple Animation (part of.MOV) –Standard format for interchange of lossless video –Compression: Run-length encoding within a line + difference encoding between frames Emit executable plugins for MEncoder and Blender –Allows integration with standard video editing workflow to-1 filter 1-to-1 joiner with 2-to-1 filter 1 1

Experimental Methodology Evaluated on 12 videos drawn from Internet video, computer animation, and stock digital television content Two classes of transformations: 1. Color adjustment: inverse, brightness, contrast 2. Composite transformations: alpha-under, multiply + = x= alpha under

Results: Execution Time Color Adjustment: - 2.5x to 471x (median 17x) Compositing: - 1.1x to 32x (median 6.6x) Compression Factor Following Re-compression Compression factor was low (≤1.1x) for one of source videos

Masked out areas not re-compressed Saturated colors not re-compressed Compression Factor Following Re-compression Results: File Bloat

Opportunity: Ignoring “Dead” Data Some pixels in composite frames do not depend on both input frames –Example: digital television mask (a low-performance case) If two data streams are multiplied, and one of them is repeatedly zero, then the repeat can be copied to the output (regardless of the values in the other stream) –We expect this would fix performance of our outlier cases –Requires pattern matching on stream graph x=

Extension to Other File Formats High-efficiency mappings –Flic Video –Microsoft RLE –Targa (with run-length encoding) Medium-efficiency mappings –Open EXR –Planar RGB  Re-arranges data by color or by byte Low-efficiency mappings –ZIP –GZIP –PNG  Performs Huffman coding prior to LZ77

Conclusions New method for direct processing of lossless-encoded data streams –Relies on LZ77 compression and stream programming model –Supports operations on windows of data –Supports splitting, joining, and reordering data Preliminary implementation in an automatic compiler –Write program on uncompressed data, run on compressed data Good speedups in the context of video processing –15x speedup (median) on color adjustment and compositing –Across 12 videos in Apple Animation format –May prove useful as more content authored in lossless formats Scope for extending technique, finding new applications

Extra Slides

General Case: Splitters DN … … Split U D’V U+V N’’V U+V … … D’N’ …..… Split … N’ % (U+V) items CoarsenTranslate D’ = LCM (D, U+V) N’ = N – (D’ – D) N’’ = N’ – N % (U+V) V U V U V