• Cognizant 20-20 Insights

Using Compression Techniques to Streamline Image and Storage and Retrieval To overcome large-scale content challenges, organizations need a compression strategy that balances storage and transmission costs with and business requirements.

Executive Summary Digital Content Challenges Digital devices such as smartphones and tablets To meet customers’ increasingly digital content have changed the way in which we live and demands, organizations need more cost-effec- interact. This channel has paved the way to digitize tive and secure ways to store, retrieve and share virtually all work and play operations and activi- assets. The cost of warehousing digital content ties. Companies across industries now digitize increases exponentially with the size/scale of the operational and process-oriented content, image organization. As such, bigger companies incur and video form, in applications ranging from sur- greater costs to warehouse digital content. veillance systems to identity management. The Bottom Line The impact is already being felt in industries as The storage and transmission of digital images diverse as media and entertainment, online retail and video has proven to be very expensive. Figure and social networking. With the rapid develop- 1 shows the size of a definition (720 X ment in mobile technology, users now want quality 480 X 24bit) video of one hour’s length. digital content to be delivered to these new digital channels. Accommodating these demands means For example, a standard definition video of delivering images and on a large scale in a 100GB+ costs roughly $252 per year to store and timely way. transmit via a cloud service such as Windows Azure.1 The cost could run into hundreds of This white paper illustrates the challenges that thousands of dollars when hours of videos or all industry players face in handling large-scale thousands of uncompressed images in terabytes digital media content. Importantly, it proposes a are stored. The transmission cost and time of generic solution architecture to help organiza- such uncompressed data is additional overhead, tions industry-wide to achieve efficient digital since it requires gigabytes of bandwidth. In the media storage and transmission. case of high definition (1920 X 1080) video, the

cognizant 20-20 insights | may 2014 Digital Content’s Scale and Scope

30 720 X 480 3 3,600 1.120E11 Bytes Frames/Second Frame Resolution Bytes/Pixel Seconds (OR) 112GB

Figure 1 uncompressed file size can be multiplied nearly pression comes down to precision image com- five times and becomes too large to cost-effec- pression. However, video compression follows an tively store and transmit. Here is where compres- additional routine that includes inter-frame com- sion is required. For example, 112GB of video can pression, and motion compen- be reduced to 50GB or less based on the exact sation. Organizations, therefore, must choose the components of an effective compression strategy. most appropriate approach for video and image to achieve a desired compression rate. The Need for Effective Storage Digital content handled across industry sectors Cost-effective media content storage can be such as for surveillance systems is solely for accomplished by using efficient image compres- reference. Therefore, it does not demand high- sion techniques. As mentioned earlier, divergent definition output for storage or retrieval. This usages may require different image compres- means organizations can compromise content sion techniques. The level of compression (size quality for storage. reduction) also depends on the specific business need. However, this is not the case in other sectors, such as healthcare. These organizations deal with A counterpart operation of the coding (com- radiographic images and surgery videos. Content pression) executed at the transmitter side is quality in these applications cannot be compro- decoding (decompression), which is performed at mised as it concerns critical data. Such sectors the retrieval/receiver end as a part of the image demand cost-effective but high-quality procedure. Depending on the media storage and retrieval. device, user need, transmission bandwidth and its application, the decoder may vary the quality of Storage solutions in the media and entertain- the digital media content. ment industry require the best of both worlds. It may not be appropriate to broadcast the same Two Approaches quality content over a wide range of devices, As mentioned above, a video stream can be because certain digital media content is created viewed as a sequential image stream. Therefore, with specific devices in mind ranging from smart- video coding can be accomplished through image phones to high-definition televisions. To under- coding with additional processes like inter-frame stand this balance, the quality of the content compression, motion estimation and motion delivered should be based on the following: compensation. In image terminology, an image is known as a frame. The approach to com- • Bandwidth available at the target device. pressing a frame or a sequence of frames can be • Maximum quality that the device supports. viewed through two windows: Therefore, applications that deliver targeted • Intra-frame compression: This technique digital content require variable quality retrieval considers each frame as a non-correlated seg- procedures from the same stored media content. ment of an image sequence and reduces only the spatial (pixel) redundancies present in an The Approach image. Strictly defined, video is comprised of a sequence Inter-frame compression: This technique of images flowing at a fast transmission rate • considers each frame as part of an image se- (as measured in number of frames/images per quence and employs temporal predictions, second). Therefore, both image and video com-

cognizant 20-20 insights 2 thus aiming to reduce temporal and spatial are typically archived using (pixel) redundancies. This also increases the techniques. The acceptable loss in quality is efficiency of data compression. determined by the use case. A common example Video compression algorithms generally aim for of lossy compression relates to images and an inter-frame compression technique, because videos captured by digital cameras or mobile a video stream may have high-ratio temporal phones, in which data from the image sensor is redundancies, while an image compression processed to a compressed format of either GIF routine will apply an intra-frame compression or JPEG of desired quality. Lossy compression technique. In addition to inter-frame compres- can reduce the size of the digital content from sion, video coding also follows motion estimation 5% to almost 95%, depending on the business and compensation procedures that are explained requirement. Though called “lossy,” they are in the following sections. often termed as visually .

Types of Compression Implementation Details Regardless of whether it is image or video, the As depicted in Figure 2, each block in the imple- compression type is broadly classified into two mentation phase applies a discrete algorithm that classes: lossy or lossless. The appropriate type is contingent upon the application, approach and of compression that is followed is based on the the type and level of desired compression. Any nature of the application. digital image is viewed merely as a two-dimen- sional matrix in a spatial domain. The compres- • Lossless compression: Applications that sion algorithm transforms the image, or frame, to mandate zero loss in the quality of images a different dimension and domain, in which indi- and videos upon archiving require the lossless vidual components of the image can be analyzed. compression technique. Examples are found Post analysis, redundant image components are in healthcare industries which deal with radio- quantized and the image matrix is encoded by graphic images and manufacturing industries using lossless or lossy compression techniques. which use machine drawings images and whose The encoded image stream is converted into com- intricate details are significant. Similarly, pressed (encoded) digital bit streams, which are images of circuit diagrams, etc. are another used for transmission or storage. example that demands zero loss in quality and hence use the lossless compression technique. In the event that the system handles a sequence of images or video streams, motion estimation Lossy compression: Applications that do not • and compensation algorithms come into play. require high fidelity in image and These components analyze the current frame

Image and Video Compression Workflow

Compression Quantiser Input Algorithm Removes Encoding Frame (Such as DCT/ Wavelet) Redundant Bits

Motion Variable Length Compensation Coding Represents the Bit Stream with Fewer Bits (Such as Huffman)

Motion Estimation Output Compressed Frame Memory Frame

Figure 2

cognizant 20-20 insights 3 with that of the previous frame from the memory Compression Au Courant and calculate the redundant elements that are New modes of image compression techniques inappropriate for further processing. are emerging that could reduce costs for many For instance, consider a video stream of about industries such as online retailing and market one hour from a surveillance system, which pre- researchers whose businesses pivot around huge dominantly records an empty aisle with sparse image volumes. Other industries such as media passers-by. Such an uncompressed video stream and entertainment could also embrace new constitutes more than 100 GB of disk space, which compression techniques to achieve greater effi- can be expensive to store, transmit and handle. ciency. Consider the example of the surveillance Efficient image compression routines help in system. The hours of surveillance video recording reducing cost and minimizing the required disk and thousands of photographic images for space, which speeds transmission due to lower identity management (which are stored for mere bandwidth requirements. In our example of a reference) occupy large volumes (in terabytes) of surveillance video of a mostly empty aisle, most server space. Similar scenarios prevail in online of the video stream is comprised of the same commodities businesses, where millions of com- content (i.e., empty aisle). Therefore, frames pany-supplied, user-shared product images of indicating the empty aisle may be considered products are stored on its e-commerce servers. redundant and can be encoded into a single Market Insight frame present at multiple instances. The motion estimation and compensation algorithm reads • A popular graphically-rich iOS Twitter client app, that the frames are repetitive and responds only Tweetbot, which weighs over 33MB, uses over 2 to the changes that may be present between the 26MB to stock more than 900 images that are frames, ignoring the redundant components. compressed using a native iOS IDE compres- sion technique. Such a large image size slows Tangible Benefits of Compression image display time. Beyond this elementary Techniques level compression, the app is integrated with additional compression techniques to achieve Among the prime advantages of image/video • a compression rate of more than 80% and a compression is size reduction. Based on the display time that is reduced by a factor of three application, an image/video stream can be (see Figure 3). compressed to the required size, which can eventually save storage space. Therefore, it is cost-effective. For situations that involve large amounts of data, this generates significant Compression Analytics impact, optimizing archiving and producing appreciable cost savings. Another advantage is the variable quality • Uncompressed 49.63 MB retrieval procedure. This is also referred to as progressive resolution encoding. Some image/video playback devices do not support Native Compression 26.46 MB high-resolution data streams or may restrict — iOS IDE the bandwidth through which the content is delivered. This prevents streaming of uncom- Lossless pressed high-quality data over such devices. Compression 16.81 MB Technique In such cases, image decoder (decompres-

sion) can be tuned to deliver appropriate data Lossy quality from the compressed stream. Compression 9.37 MB Technique • Transmission of compressed digital media content between electronic devices or Web hosts and the device’s retrieval rate is faster, thereby improving the workflow of the process. Figure 3

cognizant 20-20 insights 4 • A popular camera-capturing app on iOS, Looking Forward IncrediBooth, was 70MB in size and had PNG When a state-of-the-art image compression strat- images of screen texture with a resolution of egy is embraced, companies can save on storage 2048 X 1536, each weighing more than 10MB and transmission costs. Similarly, retrieval rates in its app bundle. The bundle size was shrunk can also be increased, thereby providing fast and from 70MB to 31MB3 (a reduction of more than effective solutions to users inside and outside 50%) by incorporating effective lossless image the company. The ratio of the storage savings is compression techniques. directly proportional to the level of compression • Experimental results in healthcare show that and the quality required upon retrieval. medical imaging (such as Dicom, CT, MRI, etc.) can be optimized using compression schemes When it comes to digital content management, that retain image quality only in the region every block in the implementation workflow of interest (i.e., in diagnostically important plays a vital role in warehousing it effectively. An regions) and reduce image size by more than effective algorithm is required for each block for 95%.4 efficient repositioning. • A Netherlands-based medical imaging systems To achieve cost-effective warehousing and trans- firm, Accusoft, has implemented lossless JPEG mission of digital media content, organizations compression and decompression schemes must analyze the level of quality/compression to achieve image quality comparable to required by the business. The resulting solution the original image. A typical 2048 x 2048 should then be capable of handling multiple resolution 16-bit grey scale image of size images and video formats as required by the 9,948 KB was reduced to 5,517 KB5 (more than business. 40% compressed) using lossless compression techniques. The compression techniques selected should be framed and optimized to achieve the required compression rate at the desired data quality, without incurring any additional overhead. Finally, if the business targets multiple devices for content delivery, then the decoder (at the device end) must be modelled to deliver progressive quality based on the device specification.

Footnotes 1 www.windowsazure.com/en-us/pricing/details/storage/. 2 http://imageoptim.com/tweetbot.html. 3 http://sam.roon.io/image-optimization-on-ios. 4 P. Bharti, S. Gupta, and R. Bhatia, “Comparative Analysis of Image Compression Techniques: A Case Study on Medical Images in Advances in Recent Technologies in Communication and Computing,” ARTCom ‘09. International Conference, 2009. 5 www.accusoft.com.

cognizant 20-20 insights 5 About the Author Srinivasan Krishnan is an Associate with Cognizant’s Audio Video Imaging Center of Excellence within the company’s Global Technology Office. He has over four years of architecture design, algorithm development and application-building experience and has extensive experience developing solutions in niche domains such as digital image processing, computer vision and machine learning. He holds a bachelor’s degree in electronics engineering from Anna University and a master’s in microelectronics systems design from University of Southampton in the UK. He can be reached at [email protected].

About Cognizant Cognizant (NASDAQ: CTSH) is a leading provider of information technology, consulting, and business process outsourc- ing services, dedicated to helping the world’s leading companies build stronger businesses. Headquartered in Teaneck, New Jersey (U.S.), Cognizant combines a passion for client satisfaction, technology innovation, deep industry and busi- ness process expertise, and a global, collaborative workforce that embodies the future of work. With over 75 develop- ment and delivery centers worldwide and approximately 178,600 employees as of March 31, 2014, Cognizant is a member of the NASDAQ-100, the S&P 500, the Forbes Global 2000, and the Fortune 500 and is ranked among the top performing and fastest growing companies in the world. Visit us online at www.cognizant.com or follow us on Twitter: Cognizant.

World Headquarters European Headquarters India Operations Headquarters 500 Frank W. Burr Blvd. 1 Kingdom Street #5/535, Old Mahabalipuram Road Teaneck, NJ 07666 USA Paddington Central Okkiyam Pettai, Thoraipakkam Phone: +1 201 801 0233 London W2 6BD Chennai, 600 096 India Fax: +1 201 801 0243 Phone: +44 (0) 20 7297 7600 Phone: +91 (0) 44 4209 6000 Toll Free: +1 888 937 3277 Fax: +44 (0) 20 7121 0102 Fax: +91 (0) 44 4209 6060 Email: [email protected] Email: [email protected] Email: [email protected]

­­© Copyright 2014, Cognizant. All rights reserved. No part of this document may be reproduced, stored in a retrieval system, transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the express written permission from Cognizant. The information contained herein is subject to change without notice. All other trademarks mentioned herein are the property of their respective owners.