Lossy compression. CSCI 470: Web Science Keith Vertanen

Similar documents
Lossy compression CSCI 470: Web Science Keith Vertanen Copyright 2013

Digital Image Representation Image Compression

Image, video and audio coding concepts. Roadmap. Rationale. Stefan Alfredsson. (based on material by Johan Garcia)

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

Lecture 8 JPEG Compression (Part 3)

CS 074 The Digital World. Digital Audio

Features. Sequential encoding. Progressive encoding. Hierarchical encoding. Lossless encoding using a different strategy

Perceptual Coding. Lossless vs. lossy compression Perceptual models Selecting info to eliminate Quantization and entropy encoding

Introduction ti to JPEG

CISC 7610 Lecture 3 Multimedia data and data formats

Multimedia Systems Image III (Image Compression, JPEG) Mahdi Amiri April 2011 Sharif University of Technology

Audio Compression. Audio Compression. Absolute Threshold. CD quality audio:

INF5063: Programming heterogeneous multi-core processors. September 17, 2010

What is multimedia? Multimedia. Continuous media. Most common media types. Continuous media processing. Interactivity. What is multimedia?

Lecture 16 Perceptual Audio Coding

15 Data Compression 2014/9/21. Objectives After studying this chapter, the student should be able to: 15-1 LOSSLESS COMPRESSION

Multimedia. What is multimedia? Media types. Interchange formats. + Text +Graphics +Audio +Image +Video. Petri Vuorimaa 1

Compression II: Images (JPEG)

Audio-coding standards

Mpeg 1 layer 3 (mp3) general overview

Lecture 8 JPEG Compression (Part 3)

ECE 417 Guest Lecture Video Compression in MPEG-1/2/4. Min-Hsuan Tsai Apr 02, 2013

5: Music Compression. Music Coding. Mark Handley

Audio-coding standards

Compression; Error detection & correction

Principles of Audio Coding

Networking Applications

MPEG-1. Overview of MPEG-1 1 Standard. Introduction to perceptual and entropy codings

ELL 788 Computational Perception & Cognition July November 2015

Robert Matthew Buckley. Nova Southeastern University. Dr. Laszlo. MCIS625 On Line. Module 2 Graphics File Format Essay

Perceptual coding. A psychoacoustic model is used to identify those signals that are influenced by both these effects.

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

Chapter 14 MPEG Audio Compression

IMAGE COMPRESSION. Image Compression. Why? Reducing transportation times Reducing file size. A two way event - compression and decompression

Audio Fundamentals, Compression Techniques & Standards. Hamid R. Rabiee Mostafa Salehi, Fatemeh Dabiran, Hoda Ayatollahi Spring 2011

Both LPC and CELP are used primarily for telephony applications and hence the compression of a speech signal.

Index. 1. Motivation 2. Background 3. JPEG Compression The Discrete Cosine Transformation Quantization Coding 4. MPEG 5.

Compressed Audio Demystified by Hendrik Gideonse and Connor Smith. All Rights Reserved.

CSCD 443/533 Advanced Networks Fall 2017

Data Representation. Reminders. Sound What is sound? Interpreting bits to give them meaning. Part 4: Media - Sound, Video, Compression

ITEC310 Computer Networks II

2.4 Audio Compression

AUDIOVISUAL COMMUNICATION

JPEG. Wikipedia: Felis_silvestris_silvestris.jpg, Michael Gäbler CC BY 3.0

Compression; Error detection & correction

Optical Storage Technology. MPEG Data Compression

CHAPTER 10: SOUND AND VIDEO EDITING

CMPT 365 Multimedia Systems. Media Compression - Image

Digital Video Processing

FILE CONVERSION AFTERMATH: ANALYSIS OF AUDIO FILE STRUCTURE FORMAT

The Gullibility of Human Senses

AUDIOVISUAL COMMUNICATION

Data Compression. Audio compression

Fundamentals of Perceptual Audio Encoding. Craig Lewiston HST.723 Lab II 3/23/06

Data encoding. Lauri Võsandi

Audio Coding and MP3

Lecture 5: Compression I. This Week s Schedule

ITNP80: Multimedia! Sound-II!

Computer and Machine Vision

Professor Laurence S. Dooley. School of Computing and Communications Milton Keynes, UK

IMAGE COMPRESSION USING HYBRID QUANTIZATION METHOD IN JPEG

Digital Media. Daniel Fuller ITEC 2110

Figure 1. Generic Encoder. Window. Spectral Analysis. Psychoacoustic Model. Quantize. Pack Data into Frames. Additional Coding.

Audio and video compression

UNDERSTANDING MUSIC & VIDEO FORMATS

Lecture 3 Image and Video (MPEG) Coding

VC 12/13 T16 Video Compression

Wolf-Tilo Balke Silviu Homoceanu Institut für Informationssysteme Technische Universität Braunschweig

Compression of Stereo Images using a Huffman-Zip Scheme

Principles of MPEG audio compression

MULTIMEDIA COMMUNICATION

EE482: Digital Signal Processing Applications

Transporting audio-video. over the Internet

EEC-484/584 Computer Networks

Wireless Communication

Ch. 5: Audio Compression Multimedia Systems

CHAPTER 6 Audio compression in practice

7: Image Compression

Multimedia Communications. Audio coding

Standard File Formats

Video Compression MPEG-4. Market s requirements for Video compression standard

CS 335 Graphics and Multimedia. Image Compression

Lecture 6: Compression II. This Week s Schedule

Appendix 4. Audio coding algorithms

3 Sound / Audio. CS 5513 Multimedia Systems Spring 2009 LECTURE. Imran Ihsan Principal Design Consultant

COMP 249 Advanced Distributed Systems Multimedia Networking. The Video Data Type Coding & Compression Basics

Audio for Everybody. OCPUG/PATACS 21 January Tom Gutnick. Copyright by Tom Gutnick. All rights reserved.

JPEG Compression. What is JPEG?

Fundamentals of Video Compression. Video Compression

ESE532: System-on-a-Chip Architecture. Today. Message. Project. Expect. Why MPEG Encode? MPEG Encoding Project Motion Estimation DCT Entropy Encoding

Introducing Audio Signal Processing & Audio Coding. Dr Michael Mason Senior Manager, CE Technology Dolby Australia Pty Ltd

Ch 4: Multimedia. Fig.4.1 Internet Audio/Video

Mul$media Streaming. Digital Audio and Video Data. Digital Audio Sampling the analog signal. Challenges for Media Streaming.

DSP. Presented to the IEEE Central Texas Consultants Network by Sergio Liberman

Parametric Coding of High-Quality Audio

Fundamental of Digital Media Design. Introduction to Audio

The Effect of Bit-Errors on Compressed Speech, Music and Images

Lossy Coding 2 JPEG. Perceptual Image Coding. Discrete Cosine Transform JPEG. CS559 Lecture 9 JPEG, Raster Algorithms

AN ANALYTICAL STUDY OF LOSSY COMPRESSION TECHINIQUES ON CONTINUOUS TONE GRAPHICAL IMAGES

Does everyone have an override code?

Transcription:

Lossy compression CSCI 470: Web Science Keith Vertanen

Digital audio Overview Sampling rate Quan5za5on MPEG audio layer 3 (MP3) JPEG s5ll images Color space conversion, downsampling Discrete Cosine Transform (DCT) Quan5za5on Encoding 2

hhp://www.vectronicsappleworld.com/collec5on/appleiie.html 3

4

Studio quality audio 96kHz sampling 24 bits / sample 2 channels Stats 10s = 3,411 KB 2729 kbps FLAC loseless, maximum C 5

Digital audio Analog- to- Digital Converter (ADC) Sampling rate of analog waveform 96 khz (studio) 44.1 khz (CD) 8 khz (telephone) Bits per sample 24 bits (studio) 16 bits (CD) 8 bits (telephone) Number of channels 1 = mono, 2 = stereo Nyquist- Shannon sampling theorem If a func5on x(t) contains no frequencies higher than B hertz, it is completely determined by a series of samples spaced 1/(2B) seconds apart. 2 24 = 16,777,216 2 16 = 65,536 2 8 = 256 Dynamic range of ear: ~1 million 6

CD quality audio 44.1 khz sampling 16 bits / sample 2 channels Stats 10s = 831 KB 665 kbps FLAC loseless A 7

8- bit sampling rate 44.1 khz sampling 8 bits / sample 2 channels Stats 10s = 883 KB 169 kbps WAV uncompressed 8

FM radio quality 22.05 khz sampling 16 bits / sample 2 channels Stats 10s = 501 KB 400 kbps FLAC lossless 9

AM radio quality 16 khz sampling 16 bits / sample 2 channels Stats 10s = 378 KB 303 kbps FLAC lossless 10

Bad radio quality 11 khz sampling 16 bits / sample 2 channels Stats 10s = 279 KB 224 kbps FLAC lossless 11

Telephone quality 8 khz sampling 16 bits / sample 2 channels Stats 10s = 214 KB 171 kbps FLAC lossless 12

8 khz sampling rate 8 khz sampling 8 bits / sample mono, µ- Law Stats 10s = 80 KB 64 kbps Works on our 56K modem! WAV 13

MPEG Mo5on Picture Experts Group (MPEG) Formed to set audio/video compression standards MPEG 1 First phase started in 1988 Compress VHS quality video/audio to 1.5 Mbps "Layer" 1, 2, 3 of increasing complexity Audio layer 3 = MP3 MPEG 2 Addi5onal extensions Advanced Audio Coding (AAC) Greater sound quality at the same bit rate 14

Perceptual coding MP3 Exploit flaws in the human auditory system Psychoacous5cs, encode signal so it sounds the same even though informa5on dropped Frequency masking, loud sound masks nearby weak one Temporal masking, sudden loud sound, other sounds inaudible before (20 ms) and aier (100 ms) Threshold of audibility 15

MP3 Perceptual audio coding Process audio in small batches Pass through digital filters to get frequency bands Psychoacous5c model determines masked freqs Available bit budget divided among bands More bits to bands with more spectral power Huffman encode bits 16

MP3 48 khz sampling 320 kbps 2 channels Stats 10s = 402 KB 322 Kbps MPEG- 1 audio layer 3 D 17

MP3 48 khz sampling 128 kbps 2 channels Stats 10s = 161 KB 129 Kbps MPEG- 1 audio layer 3 B 18

MP3 48 khz sampling 64 kbps 2 channels Stats 10s = 81 KB 65 Kbps MPEG- 1 audio layer 3 19

MP3 format Mandatory header with every frame You can drop into a live stream at any point 20

Audio file sizes 04/29/2012 04:41 PM 5,766,528 gomez_24_96.wav 04/29/2012 03:48 PM 3,411,865 gomez_24_96.flac 04/29/2012 06:43 PM 402,499 gomez_48_320.mp3 04/29/2012 06:49 PM 241,603 gomez_48_192.mp3 04/29/2012 07:12 PM 161,539 gomez_24_128.mp3 04/29/2012 07:11 PM 161,173 gomez_44_128.mp3 04/29/2012 06:50 PM 161,155 gomez_48_128.mp3 04/29/2012 06:51 PM 120,931 gomez_48_96.mp3 04/29/2012 06:53 PM 80,707 gomez_48_64.mp3 04/29/2012 06:53 PM 40,483 gomez_48_32.mp3 04/29/2012 06:54 PM 10,483 gomez_8_8.mp3 21

JPEG Joint Photographic Experts Group (JPEG) Compressing con5nuous- tone s5ll pictures e.g. photos, pain5ngs Not good for sharp changes in color e.g. line drawings, text Not good for repeated edits Inherently a lossy process Quality level 0 (low) to 100 (high) 22

Lossless image, 1920x1280 = 13.4MB

JPEG file sizes 04/29/2012 08:09 PM 13,454,982 bike.tif 04/29/2012 08:11 PM 2,617,520 bike_q100.jpg 04/29/2012 08:12 PM 736,695 bike_q90.jpg 04/29/2012 08:12 PM 431,162 bike_q80.jpg 04/29/2012 08:13 PM 321,685 bike_q70.jpg 04/29/2012 08:14 PM 260,027 bike_q60.jpg 04/29/2012 08:14 PM 222,118 bike_q50.jpg 04/29/2012 08:25 PM 196,832 bike_q40.jpg 04/29/2012 08:25 PM 177,614 bike_q30.jpg 04/29/2012 08:26 PM 162,819 bike_q20.jpg 04/29/2012 08:26 PM 151,471 bike_q10.jpg 04/29/2012 08:26 PM 141,793 bike_q0.jpg 24

4- step process 25

Step 1: JPEG compression Convert to YCbCr from RGB Y = 16 + 0.26R + 0.50G + 0.09B Cb = 128 + 0.15R - 0.29G - 0.44B Cr = 128 + 0.44R - 0.37G + 0.07B More info in luminance channel (Y) Separate channels into matrices Assuming image is 640 x 480: Reduce Cb and Cr to 320 x 240 by averaging square blocks of 4 pixels Split matrices into 8 x 8 blocks Subtract 128 from every element Lossy, but hard to no5ce Orig Y Cb Cr 26

Step 2: JPEG compression Discrete Cosine Transforma5on (DCT) Applied to each 8 x 8 block separately Output is an 8 x 8 matrix of real numbers DCT (0, 0) is average value of the block Values typically decay rapidly away from (0, 0) DCT not itself lossy (given sufficient precision) 27

28

29

Quan5za5on Step 3: JPEG compression Divide the DCT coefficients by a table of weights Different tables for different JPEG quality levels Round the result 30

Step 4: JPEG compression Encoding the elements Zig- zag pahern to try and get lots of 0's in a row Run- length encoding (RLE) Huffman encode the result 31

MP3 Summary Most prevalent lossy audio format Psychoacous5c model JPEG Throw away things from audio you can't hear anyway Most prevalent lossy s5ll image format Change colorspace and downsample Lossy: Ignore less important changes in 8 x 8 blocks Controlled quality via quan5za5on tables Lossless compress using RLE and Huffman 32