Multimedia Systems (Part 1) CS-502 Fall 20061 Multimedia Systems (Part 1) CS-502 Operating Systems Fall 2006 (Slides include materials from Operating System.

Slides:



Advertisements
Similar presentations
Streaming Video over the Internet
Advertisements

T.Sharon-A.Frank 1 Multimedia Compression Basics.
MPEG: A Video Compression Standard for Multimedia Applications Václav Hlaváč CTU Prague, Initial material were slides of Didier.
Multimedia SystemsCS-502 Fall Multimedia Systems CS-502 Operating Systems Fall 2007 (Slides include materials from Operating System Concepts, 7 th.
T.Sharon-A.Frank 1 Multimedia Quality of Service (QoS)
Multimedia Systems As Presented by: Craig Tomastik.
Chapter 20: Multimedia Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 20: Multimedia Systems What is Multimedia.
29.1 Chapter 29 Multimedia Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 20: Multimedia Systems.
Distributed Multimedia Systems
Motivation Application driven -- VoD, Information on Demand (WWW), education, telemedicine, videoconference, videophone Storage capacity Large capacity.
Comp 1001: IT & Architecture - Joe Carthy 1 Review Floating point numbers are represented in scientific notation In binary: ± m x 2 exp There are different.
1 Multimedia Chapter Introduction to multimedia 7.2 Multimedia files 7.3 Video compression 7.4 Multimedia process scheduling 7.5 Multimedia file.
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems.
EE442—Multimedia Networking Jane Dong California State University, Los Angeles.
Multimedia Systems 1 CS502 Spring 2006 Multimedia Systems CS-502 Operating Systems.
MPEG: A Video Compression Standard for Multimedia Applications Didier Le Gall Communications of the ACM Volume 34, Number 4 Pages 46-58, 1991.
SWE 423: Multimedia Systems Chapter 7: Data Compression (1)
MPEG: A Video Compression Standard for Multimedia Applications Didier Le Gall Communications of the ACM Volume 34, Number 4 Pages 46-58, 1991.
CS-3013 & CS-502, Summer 2006 Multimedia topics1 Multimedia CS-3013 & CS-502 Operating Systems.
Multimedia Applications r Multimedia requirements r Streaming r Phone over IP r Recovering from Jitter and Loss r RTP r Diff-serv, Int-serv, RSVP.
Chapter 7 Multimedia Operating Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Multimedia Systems (Part 2)
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Media File Formats Jon Ivins, DMU. Text Files n Two types n 1. Plain text (unformatted) u ASCII Character set is most common u 7 bits are used u This.
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.
CS 1308 Computer Literacy and the Internet. Creating Digital Pictures  A traditional photograph is an analog representation of an image.  Digitizing.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
MPEG: A Video Compression Standard for Multimedia Applications Didier Le Gall Communications of the ACM Volume 34, Number 4 Pages 46-58, 1991.
Multimedia Data Video Compression The MPEG-1 Standard
Video Basics. Agenda Digital Video Compressing Video Audio Video Encoding in tools.
MPEG: (Moving Pictures Expert Group) A Video Compression Standard for Multimedia Applications Seo Yeong Geon Dept. of Computer Science in GNU.
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 19/20: Real-time and Multimedia Systems Inclusions from Tanenbaum,
Audio Compression Usha Sree CMSC 691M 10/12/04. Motivation Efficient Storage Streaming Interactive Multimedia Applications.
Announcements Chapter 11 for today No quiz this week Instructor got behind…. We'll be back in MGH389 on Friday.
Klara Nahrstedt Spring 2011
 Refers to sampling the gray/color level in the picture at MXN (M number of rows and N number of columns )array of points.  Once points are sampled,
XE33OSA Chapter 20: Multimedia Systems. 20.2XE33OSA Silberschatz, Galvin and Gagne ©2005 Chapter 20: Multimedia Systems What is Multimedia Compression.
Dr. M. Munlin Real-Time and Multimedia Systems 1 NETE0516 Operating Systems Instructor: ผ. ศ. ดร. หมัดอามีน หมัน หลิน Faculty of Information Science and.
1 Lecture 17 – March 21, 2002 Content-delivery services. Multimedia services Reminder  next week individual meetings and project status report are due.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Multimedia Systems.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
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.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - VIDEO. In this chapter How digital video differs from conventional analog video How digital video differs from.
8. 1 MPEG MPEG is Moving Picture Experts Group On 1992 MPEG-1 was the standard, but was replaced only a year after by MPEG-2. Nowadays, MPEG-2 is gradually.
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
Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 19 – Multimedia Transport Subsystem (Part 2) + Midterm Review Klara Nahrstedt Spring 2014.
1 Part A Multimedia Production Chapter 2 Multimedia Basics Digitization, Coding-decoding and Compression Information and Communication Technology.
Chapter 20: Multimedia Systems
Multimedia Systems Operating System Presentation On
Chapter 20: Multimedia Systems
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Data Compression.
Video Compression - MPEG
Chapter 20: Multimedia Systems
Judith Molka-Danielsen, Oct. 02, 2000
Chapter 20: Multimedia Systems
Chapter 20: Multimedia Systems
Chapter 20: Multimedia Systems
Presentation transcript:

Multimedia Systems (Part 1) CS-502 Fall Multimedia Systems (Part 1) CS-502 Operating Systems Fall 2006 (Slides include materials from Operating System Concepts, 7 th ed., by Silbershatz, Galvin, & Gagne and from Modern Operating Systems, 2 nd ed., by Tanenbaum)

Multimedia Systems (Part 1) CS-502 Fall Outline What is multi-media? Requirements and challenges for audio and video in computer systems –CD devices and formats Systems for multimedia Compression and bandwidth Next week:– –Processor and disk scheduling –Network streaming and management Silbershatz, Chapter 20 Tanenbaum, Chapter 7

Multimedia Systems (Part 1) CS-502 Fall What do we mean by “multimedia” Audio and video within a computer system –CD’s & DVD’s –Computer hard drive –Interactive Live broadcast & web casts –Radio stations, Network TV, Webcams, Skype, … Video on demand –Pause, fast forward, reverse, etc. Interactive activities involving audio, video, images –Meetings and presentations with 2-way audio –Teleconferencing Handheld devices –iPod, MP-3 players; personal video; mobile phones, … …

Multimedia Systems (Part 1) CS-502 Fall Multimedia Data and Delivery Stored in file system like ordinary data. Must be accessed with specific timing requirements. E.g., video must be displayed at frames per second. System must guarantee timely delivery Continuous-media data –Data with specific rate requirements

Multimedia Systems (Part 1) CS-502 Fall Multimedia Characteristics Multimedia files can be very large. Continuous media data may require very high data rates. Multimedia applications are usually sensitive to timing delays during playback. Note: human ear is more sensitive to jitter in audio than eye is to jitter in video!

Multimedia Systems (Part 1) CS-502 Fall Requirements “Smooth” audio and video –Deterioration in quality  jerky playback Multiple concurrent streams –Video & multimedia servers –TiVo, etc. Wide range of network bandwidths Audio/video while PC is doing something else

Multimedia Systems (Part 1) CS-502 Fall System and OS Challenges Bandwidths and Compression Jitter Processor Scheduling Disk Scheduling Network Streaming

Multimedia Systems (Part 1) CS-502 Fall Some System Architectures Simple: –Data paths for audio/video that are separate from computational data paths Modern –Fast system bus, CPU, devices Video server –Disk farm and multiple streams

Multimedia Systems (Part 1) CS-502 Fall audio stream CD-ROM drive System Organization (a decade ago) Separate data path for audio stream Or headphone jack and volume control on CD drive itself Main system bus and CPU were too busy/slow to handle real-time audio CPU Memory memory bus DeviceSound card

Multimedia Systems (Part 1) CS-502 Fall video stream via ISA & bridge to graphics card audio stream via ISA bridge to sound card System Organization (typical Pentium PC today) ISA bridge IDE disk Main Memory CPU Level 2 cache Bridge Moni- tor Graphics card USB Key- board Mouse Ether- net SCSI Modem Sound card Printer PCI bus ISA bus AGP Port

Multimedia Systems (Part 1) CS-502 Fall Digression CD and DVD devices and files

Multimedia Systems (Part 1) CS-502 Fall Compact Discs (CDs) Not in Silbershatz –See Tanenbaum, pp Audio CD –Molded polycarbonate; easy to manufacture –120 mm diameter with 15 mm hole –One single spiral track Starts in center, spirals outward 22,188 revolutions, approx 5.6 kilometers long Random access –Constant linear velocity under read head Audio playback:– 120 cm/sec Variable speed motor:– 200 – 530 rpm ISO standard IS 10149, aka the Red Book –Audio CD’s

Multimedia Systems (Part 1) CS-502 Fall CDs for data storage Problem for adapting to data usage –No bad block recovery capability! ISO standard for data: Yellow Book –Three levels of error-correcting schemes: – Symbol, Frame, Sector ~7200 bytes to record 2048 byte payload per sector –Mode 2: less error correction in exchange for more data rate Audio and video data –Sectors linearly numbered from center to edge Read speed –1x ~ 153,000 bytes/sec –40x ~ 5.9 megabytes/sec ISO standard for multi-media: Green Book –Interleaved audio, video, data in same sector

Multimedia Systems (Part 1) CS-502 Fall CD-ROM File System ISO 9660 — High Sierra Write once  contiguous file allocation Variable length directories Variable length directory entries Points to first sector of file File size and metadata stored in directory entry Variable length names Linux, Windows support iso9660 file system Several extensions to standard for additional features E.g., adding files, replacing directories See Tanenbaum, pp

Multimedia Systems (Part 1) CS-502 Fall DVD devices Similar in concept, different in details More data, higher bandwidth –Track spacing: 0.834μvs.1.6μ –Bit spacing:0.4μvs.0.74μ –Capacity:4.7 Gbytesvs.650 Mbytes Details not provided here –Tanenbaum, pp

Multimedia Systems (Part 1) CS-502 Fall Compression An essential part of audio and video representation as files

Multimedia Systems (Part 1) CS-502 Fall Why Compression? – CD-quality audio 22,050 Hz  44,100 samples/sec 16 bits per sample Two channels  176,400 bytes/sec  1.4 mbits/sec –Okay for a modern PC –Not okay for 56 kb/sec modem (speed) or iPod (space)! MP-3  0.14 mbits/sec (10:1) –Same audio quality! –Compression ratio varies with type of music

Multimedia Systems (Part 1) CS-502 Fall Why Compression? – Video “Standard” TV frame = 640  frames/sec (fps)   9,216,000 pixels/sec = 27,648,000 bytes/sec Hollywood “standard” movie  133 minutes  approx. 210 gigabytes (standard resolution)! HDTV = 1280  fps  82,944,000 bytes/sec (and rising!) DVD holds ~ 4.7 gigabytes  average of ~ 620 kilobytes/sec! “Standard” movie of 133 minutes requires serious compression just to fit onto DVD

Multimedia Systems (Part 1) CS-502 Fall Video Compression Requirements Compression ratio > 50:1 i.e., 210 gigabytes:4.7 gigabytes Visually indistinguishable from original Even when paused Fast, cheap decoder Slow encoder is okay VCR controls Pause, fast forward, reverse

Multimedia Systems (Part 1) CS-502 Fall Video Compression Standards MPEG (Motion Picture Experts Group) –Based on JPEG (Joint Photographic Experts Group) –Multi-layer Layer 1 = system and timing information Layer 2 = video stream Layer 3 = audio and text streams Three standards –MPEG-1 – 352  240 frames; < 1.5 mb/sec ( < VHS quality) Layer 3 = MP3 Audio standard Typical uses:– video clips on internet; video for handhelds –MPEG-2 – standard TV & HDTV; mb/sec DVD encoding –MPEG-4 – combined audio, video, interactive graphics 2D & 3D animations

Multimedia Systems (Part 1) CS-502 Fall JPEG compression (single frame) 1.Convert RGB into YIQ Y = luminance (i.e., brightness) ~ black-white TV I, Q = chrominance (similar to saturation and hue) Reason: Human eye is more sensitive to luminance than to color (rods vs. cones) 2.Down-sample I, Q channels i.e., average over 2  2 pixels to reduce resolution lossy compression, but barely noticeable to eye 3.Partition each channel into 8  8 blocks 4800 Y blocks, 1200 each I & Q blocks (for 640  480)

Multimedia Systems (Part 1) CS-502 Fall JPEG (continued)

Multimedia Systems (Part 1) CS-502 Fall JPEG (continued)

Multimedia Systems (Part 1) CS-502 Fall JPEG (continued) 4.Calculate Discrete Cosine Transform (DCT) of each 8  8 block What is a Discrete Cosine Transform? 5.Divide 8  8 block of DCT values by 8  8 quantization table Effectively throwing away higher frequencies 6.Linearize 8  8 block, run-length encode, and apply a Huffman code to reduce to a small fraction of original size (in bytes)

Multimedia Systems (Part 1) CS-502 Fall JPEG (concluded) 7.Store or transmit 8  8 quantization table followed by list of compressed blocks Achieves 20:1 compression with good visual characteristics Higher compression ratios possible with visible degradation JPEG algorithm executed backwards to recover image Visually indistinguishable from 20:1 JPEG algorithm is symmetric Same speed forwards and backwards

Multimedia Systems (Part 1) CS-502 Fall MPEG JPEG-like encoding of each frame Takes advantage of temporal locality I.e., each frame usually shares similarities with previous frame  encode and transmit only differences Sometimes an object moves relative to background  find object in previous frame, calculate difference, apply motion vector

Multimedia Systems (Part 1) CS-502 Fall Temporal Locality (example) Consecutive Video Frames

Multimedia Systems (Part 1) CS-502 Fall MPEG organization Three types of frames –I-frame: Intracoded or Independent. Full JPEG-encoded frame Occurs at intervals of a second or so Also at start of every scene –P-frame: Predictive frame Difference from previous frame –B-frame: Bidirectional frame Like p-frame but difference from both previous and next frame IBBBP BBBPBBBPBBBIBBBPBBBP

Multimedia Systems (Part 1) CS-502 Fall MPEG Characteristics Non-uniform data rate! Compression ratios of 50:1 – 80:1 are readily obtainable Asymmetric algorithm –Fast decode (like JPEG) –Encode requires image search and analysis to get high quality differences Cheap decoding chips available for –graphics cards –DVD players, etc.

Multimedia Systems (Part 1) CS-502 Fall MPEG Problem – Fast Forward/Reverse Cannot simply skip frames –Next desired frame might be B or P derived from a skipped frame Options: –Separate fast forward and fast reverse files MPEG encoding of every nth frame Often used in video-on-demand server –Display only I and P frames If B frame is needed, derive from nearest I or P

Multimedia Systems (Part 1) CS-502 Fall “Movie” File Organization One MPEG-2 video stream Possible fast forward, fast reverse sub-streams Multiple audio streams Multiple languages Multiple text streams Subtitles in multiple languages All interleaved Possibly in multiple files!

Multimedia Systems (Part 1) CS-502 Fall

Multimedia Systems (Part 1) CS-502 Fall Questions? (skip to reading assignment)

Multimedia Systems (Part 1) CS-502 Fall Operating System Challenge How to get the contents of a movie file from disk or DVD drive to video screen and speakers. –Fixed frame rate (25 or 30 fps) –Steady audio rate –Bounded jitter Such requirements are known as Quality-of- Service (QoS) guarantees. Classical problem in real-time scheduling –Obscure niche become mainstream! –See Silbershatz, §19.1–19.5

Multimedia Systems (Part 1) CS-502 Fall QoS Guarantees Building a system to guarantee QoS effects the following:– –CPU processing –Scheduling and interrupt handling –File systems –Network protocols

Multimedia Systems (Part 1) CS-502 Fall Requirement of Multimedia Operating Systems There are three levels of QoS –Best-effort service: the system makes a best effort with no attempt to guarantee –Soft QoS: allows different traffic streams to be prioritized, but no QoS guarantees are made –Hard QoS: system ensures QoS requirements are always met Prioritization Admission control Bounded latency on interrupt handling, processing, etc.

Multimedia Systems (Part 1) CS-502 Fall Parameters Defining QoS Throughput: the total amount of work completed during a specific time interval Delay: the elapsed time from when request is first submitted to desired result Jitter: delays that occur during playback of a stream. Reliability: how errors are handled during transmission and processing of continuous media

Multimedia Systems (Part 1) CS-502 Fall Further QoS Issues QoS may be negotiated between the client and server. Operating systems may use an admission control algorithm –Admits a request for service only if the server has sufficient resources to satisfy the request

Multimedia Systems (Part 1) CS-502 Fall Two common methods Rate Monotonic Scheduling Earliest Deadline First Many variations Many analytic methods for proving QoS (Quality of Service)

Multimedia Systems (Part 1) CS-502 Fall Processor Scheduling for Real-Time Rate Monotonic Scheduling (RMS) Assume m periodic processes –Process i requires t i msec of processing time every p i msec. –Equal processing every interval — like clockwork!

Multimedia Systems (Part 1) CS-502 Fall Example Periodic process i requires the CPU at specified intervals (periods) p i is the duration of the period t i is the processing time d i is the deadline by when the process must be serviced –Often same as end of period

Multimedia Systems (Part 1) CS-502 Fall Processor Scheduling for Real-Time Rate Monotonic Scheduling (RMS) Assume m periodic processes –Process i requires t i msec of processing time every p i msec. –Equal processing every interval — like clockwork! Assume Assign priority of process i to be –Statically assigned Let priority of non-real-time processes be 0

Multimedia Systems (Part 1) CS-502 Fall Rate Monotonic Scheduling (continued) Scheduler simply runs highest priority process that is ready –May pre-empt other real-time processes –Real-time processes become ready in time for each frame or sound interval –Non-real-time processes run only when no real- time process needs CPU

Multimedia Systems (Part 1) CS-502 Fall Example p 1 = 50 msec; t 1 = 20 msec p 2 = 100 msec; t 2 = 35 msec Priority(p 1 ) > Priority(p 2 ) Total compute load is 75 msec per every 100 msec. Both tasks complete within every period 25 msec per 100 msec to spare

Multimedia Systems (Part 1) CS-502 Fall Example 2 p 1 = 50 msec; t 1 = 25 msec p 2 = 80 msec; t 2 = 35 msec Priority(p 1 ) > Priority(p 2 ) Total compute load is ~ 94% of CPU. Cannot complete both tasks within some periods Even though there is still CPU capacity to spare!

Multimedia Systems (Part 1) CS-502 Fall Rate Monotonic Theorems (without proof) Theorem 1: using these priorities, scheduler can guarantee the needed Quality of Service (QoS), provided that –Asymptotically approaches ln 2 as m   ln 2 = … Theorem 2: If a set of processes can be scheduled by any method of static priorities, then it can be scheduled by Rate Monotonic method.

Multimedia Systems (Part 1) CS-502 Fall Example 2 again Note that p 1 pre-empts p 2 in second interval, even though p 2 has the earlier deadline!

Multimedia Systems (Part 1) CS-502 Fall More on Rate Monotonic Scheduling Rate Monotonic assumes periodic processes MPEG-2 playback is not a periodic process!

Multimedia Systems (Part 1) CS-502 Fall Processor Scheduling for Real-Time Earliest Deadline First (EDF) When each process i become ready, it announces deadline D i for its next task. Scheduler always assigns processor to process with earliest deadline. May pre-empt other real-time processes

Multimedia Systems (Part 1) CS-502 Fall Earliest Deadline First Scheduling (continued) No assumption of periodicity No assumption of uniform processing times Theorem: If any scheduling policy can satisfy QoS requirement for a sequence of real time tasks, then EDF can also satisfy it. –Proof: If i scheduled before i+1, but D i+1 < D i, then i and i+1 can be interchanged without affecting QoS guarantee to either one.

Multimedia Systems (Part 1) CS-502 Fall Earliest Deadline First Scheduling (continued) EDF is more complex scheduling algorithm Priorities are dynamically calculated Processes must know deadlines for tasks EDF can make higher use of processor than RMS Up to 100% There is a large body of knowledge and theorems about EDF analysis

Multimedia Systems (Part 1) CS-502 Fall Example 2 (again) Priorities are assigned according to deadlines: –the earlier the deadline, the higher the priority; –the later the deadline, the lower the priority.

Multimedia Systems (Part 1) CS-502 Fall Questions?

Multimedia Systems (Part 1) CS-502 Fall Reading Assignments Silbershatz, §19.1–19.5 –Real-time systems & Real-time scheduling Silbershat, Chapter 20 –Multimedia systems

Multimedia Systems (Part 1) CS-502 Fall

Multimedia Systems (Part 1) CS-502 Fall Digression on Transforms Fourier’s Theorem Every continuous, periodic function can be reduced to the sum of a series of sine waves The Fourier transform is a representation of that function in terms of the frequencies of those sine waves Original function can be recovered from its Fourier transform Fourier transforms occur frequently in nature!

Multimedia Systems (Part 1) CS-502 Fall Nyquist’s Theorem (1924) If a continuous function is sampled at a frequency 2f, then the function can be recovered from those samples provided that its maximum Fourier frequency is  f.

Multimedia Systems (Part 1) CS-502 Fall Discrete Cosine Transform A form of the Fourier Transform When applied to an 8  8 block of samples (i.e. pixel values) yields an 8  8 block of spatial frequencies Original 8  8 block of samples can be recovered from its DCT. –Assuming infinite arithmetic precision

Multimedia Systems (Part 1) CS-502 Fall More on Nyquist If arithmetic precision is not infinite, we get quantization error during sampling Recovered signal has quantization noise i.e., a lossy transform