Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

Contents 1 Introduction (0:00–5:00)

2

2 Multimedia (5:00–101:00) 2.1 Graphics (20:00–73:00) . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Audio (73:00–80:00) . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Video (80:00–101:00) . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 5 6

1

Computer Science E-1 Spring 2010 Scribe Notes

1

Lecture 5: March 22, 2010 Andrew Sellergren

Introduction (0:00–5:00) • David and Dan have a mutually beneficial (or destructive) habit of matching each other’s hardware purchases. This past week, they both purchased solid-state hard drives (SSDs) for their Mac Pros. Recall that SSDs offer higher speeds (but lower capacities) than regular hard drives because they don’t contain any mechanical, moving parts. MacSales did a side-by-side comparison of boot times for a Mac using a SSD versus a normal HDD. As expected, the SSD greatly outperformed the HDD, booting in 30 seconds compared to several minutes. By moving their operating system and application files to a SSD, but leaving all their multimedia files on a HDD, Dan and David were able to speed up their computers without reducing their storage capacities.

2

Multimedia (5:00–101:00) • Multimedia files, including picture, video, and music files, come in a variety of different formats, among them MP3, JPEG, and AVI. Most picture and video file formats are raster-based, which is to say that they are composed of pixels, or small squares of color, which have a definite size. As you zoom in, the quality of the picture will degrade. If you zoom in enough, you’ll be able to see each of the individual pixels. SWF files, on the other hand, are vector-based, which means that as you zoom in, the shapes that make up the picture will be redrawn at a different size and the quality will not appear to degrade. Take a look at these singing horses for a good example. Most devices that you are familiar with, like digital cameras, aren’t able to take pictures and store them in a vector-based format like SWF. Generally, what you see is what you get with a digital camera. • What exactly is a file format? A file format is simply the way in which bits are arranged in a file so that a given program can interpret them. Below are some file formats that you might be familiar with: – graphics ∗ ∗ ∗ ∗ ∗

PSD JPEG TIFF GIF BMP

– videos ∗ ∗ ∗ ∗

MOV/QuickTime AVI WMV MPEG-4

2

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

∗ Flash – audio ∗ ∗ ∗ ∗ ∗ ∗ 2.1

MP3 AAC WMA WAV AUP MIDI

Graphics (20:00–73:00) • As we begin to discuss the differences between graphics file formats, perhaps the most important differences will pertain to quality. We’ve already discussed how the most popular graphics file formats are raster-based, which affects their quality as they are enlarged. Another factor which influences quality is the type of compression the file format uses. Some file formats, like BMP, don’t use compression at all. This of course means that BMP files take up a large amount of disk space. Most file formats, like GIF and JPEG, use compression to reduce the amount of disk space that an image takes up. GIF and JPEG use lossless and lossy compression, respectively. Lossless compression is a type of compression which can be reversed such that any information stored in the original graphics file can be restored by decompression. Lossy compression, on the other hand, can’t be reversed because it discards some information (i.e. some bits) during the compression process. • How does compression work, generally speaking? Consider Germany’s flag. If we wanted to represent this as a BMP, we’d simply store each pixel in one or more bits. Given that there are only three colors total in the flag, though, why not eliminate some of the redundancy? As humans, we can describe the flag as three stripes of of black, red, and yellow. Computers can describe the flag similarly by storing a color as a bit and then storing the number of times that color appears consecutively left to right, top to bottom. • Now consider France’s flag. We can compress this image using the same logic, but it will still be larger in size than the file storing Germany’s flag. Whereas Germany’s flag can be represented as black repeated left to right top to bottom followed by red followed by yellow, France’s flag must be represented as red followed by white followed by blue followed by red followed by white followed by blue, etc. Germany’s flag can be summarized more succinctly and, as expected, its GIF file size is approximately 8 kilobytes while France’s flag’s GIF file size is approximately 12 kilobytes. • By its very nature, lossy compression can achieve much smaller file sizes than lossless compression because it can discard some of the information 3

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

(i.e. some of the bits) which lossless compression must preserve. The tradeoff, of course, is that lossy compression actually reduces the quality of the image whereas lossless compression does not. With this in mind, Dan recommends that if you open a JPEG file in a photo editor, make some changes, and then save it again as a JPEG file, you should choose a different filename than the original. If you don’t, you will actually be degrading the quality of the image simply by saving it in a format that uses lossy compression. Keep the originals! • Another way of compressing graphics files is actually scaling down the image itself. Is this compression lossy or lossless? To answer this question, consider a simple image consisting of four pixels in a two-by-two grid. After scaling down this image, we’ll be left with only a single pixel in order to preserve the squareness of the original image. But if the four pixels in the original image are four different colors, then we must choose only one color for the scaled-down image. Thus, you can see that scaling down an image in this manner is most certainly an implementation of lossy compression. Is there anyway to mitigate this if you want to, say, print a photo in high quality? Unfortunately, no. You’ll need to print the original rather than the scaled-down version! • When you’re scaling a photo, you need to keep in mind the original aspect ratio, or the ratio of the width to the height. If you don’t preserve this while you’re scaling the image in photo-editing software, your resulting edited photo will appear distorted. • There of course exists a plateau for lossy image compression. That is, it would be impossible to take an image and compress it repeatedly until it was a single bit. As you approach this plateau, the lossy-compressed photo becomes increasingly noisy and random until it is basically unrecognizable. • A pixel that stores a particular color actually stores it as a combination of three separate colors, namely red, green, and blue, because every possible color can be created by mixing these three together in specific proportions. The number of possible combinations of these three colors is determined by the color depth or bit depth, which is the number of bits used to store each color. A typical color depth is 24-bit, which means that 8 bits or 1 byte is used to represent each of the three colors. Since a byte can take 28 or 256 possible values, the whole pixel can take 2563 possible values. That’s over 16 million possible combinations! • While JPEG supports 24-bit color depth, GIF only supports 8-bit color depth. Thus, the total number of possible colors in a GIF image is only 256. • One final factor to consider when deciding between graphics file formats is support for alpha. Alpha allows for transparent backgrounds in images so that if an image is stacked on top of another image, the bottom image will 4

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

be visible wherever the top image is transparent. This is incredibly useful in web design, as we’ll see, since images can thereby take on interesting shapes and be elegantly layered on top of each other. PNG is compelling as a file format because it has 24-bit color depth, uses lossless compression, and supports alpha. As an example, take a look at Google Maps with a marker on it. The marker, the shadow, and the underlying map are all separate image files that are layered on top of each other. • To round out our discussion of graphics file formats, PSD is a proprietary Photoshop format and TIFF is a format typically used for graphic design. • Memory cards for cameras come in a variety of different formats, including CF, SD, and Memory Stick. The differences between them are beyond the scope of this course, but suffice it to say that we recommend you stay away from proprietary formats like Memory Stick (made by Sony) whenever possible. If you take a lot of pictures and you don’t always have the opportunity to sync them with your laptop, you might look into buying an external hard drive that has card slot built in. These devices will simply copy all the data from the memory card you insert so that you can clear the memory card and fill it up again with new pictures. This might be a more cost-effective solution than buying multiple memory cards. • Whether you’re buying memory cards or hard drives or any kind of hardware, it’s worth doing some research on customer reviews. SanDisk and Kensington are well-reputed memory card vendors while Seagate and Western Digital are well-reputed hard drive vendors. Rob Galbraith’s website will help you compare the speeds of various memory cards while more generally, Newegg will help you compare all kinds of different hardware. • Graphics in the gaming world are a slightly different story than photos. In order to create the illusion of 3D objects in 2D space, polygons are stacked together to create a wireframe representation of the object. Various textures are then added to simulate shading. If you consider yourself a gamer, then you may be concerned with the speed of graphics cards which is usually advertised as a certain number of polygons that can be processed per second. 2.2

Audio (73:00–80:00) • A typical CD can store approximately 700 megabytes of data and considering that artists generally release CDs with about 10 songs on them and assuming that these artists actually fill the whole CD, we might estimate that each song takes up about 70 megabytes of space. How might we go about compressing this? Generally speaking, we’ll follow the same logic as that of photo compression whereby reducing the quality also reduces the overall size. Audio quality is harder to define than photo quality, but it pertains to the range of possible sounds. Fortunately, humans are

5

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

generally poor at recognizing audio quality, so audio files can be greatly compressed. This is what makes MP3s so compelling. A typical MP3 is only 2 to 3 megabytes in size and yet it has nearly the same quality as the audio files on a music CD which are approximately 70 megabytes in size. • AAC is the file format used by iTunes and is slightly higher quality than MP3. WAV is the format used for the beeps and dings on your computer, MIDI is the format used for musical instruments, and WMA is a format specific to Microsoft. 2.3

Video (80:00–101:00) • You can think of the various different video file formats as containers or boxes for the actual data. Within those boxes, the video file and the audio file may be encoded using any one of many different codecs. For example, h.264 is a popular codec for high-quality video and MPEG is the codec for videos on DVD. You may find that a particular video player may support the file format of a video, but it may still be unable to play that video if it can’t read the codec with which it is encoded. • The Flash file format is compelling because it offers support for streaming. When you watch a YouTube video, for example, you typically have to wait only a short period of time for the video to start playing because the bytes which represent the start of the video can be sent first. The Quicktime file format doesn’t support streaming, but it doesn’t require internet connectivity, so it’s a good option for persistently storing the video and watching it on the go. • If you go to Apple’s website and click on the link that allows you to watch a movie trailer, you’re presented with several options for the file, namely 1080p, 720p, and 480p. The “p” actually stands for progressive, but the 1080, 720, and 480 refer to the number of scanlines (the vertical number of pixels). By convention, the horizontal number of pixels is left off, but the numbers are 1920, 1280, and 854. Thus, the typical resolutions of TVs are 1920x1080, 1280x720, and 854x480. What really determines which option you choose when downloading a trailer from Apple is probably the amount of time you’re willing to spend on the download, given its size. Frankly, it’s easy enough just to select the Automatic option and let Apple decide for you. Another problem with choosing the highest resolution file is that it may be higher resolution than your monitor itself, so playing it in full size will cut off a large portion of it. Not to mention that older computers and slower processors will not be able to keep up with the higher resolution and playback will be extremely choppy as many of the frames get dropped. • On a sidenote, one cool device that deserves a shoutout is Slingbox, which you hook up to your cable box so that it broadcasts your TV signal over the internet. Thus, wherever you have internet access, you can watch your

6

Computer Science E-1 Spring 2010 Scribe Notes

Lecture 5: March 22, 2010 Andrew Sellergren

TV at home. TV tuners such as EyeTV allow you to save TV shows to your computer so that you can watch them whenever you want. Devices like Slingbox and EyeTV are a good indication that television guides, scheduled shows, and DVR will soon be a thing of the past. And we welcome that day!

7

Lectures / Lecture 5

Mar 22, 2010 - application files to a SSD, but leaving all their multimedia files on a HDD,. Dan and David were able to ... logic, but it will still be larger in size than the file storing Germany's flag. Whereas Germany's flag can ... in web design, as we'll see, since images can thereby take on interesting shapes and be elegantly ...

56KB Sizes 2 Downloads 274 Views

Recommend Documents

Lectures / Lecture 4
Mar 1, 2010 - Exam 1 is next week during normal lecture hours. You'll find resources to help you prepare for the exam, which will be comprehensive, on the.

Lectures / Lecture 4
Mar 1, 2010 - course website. After lecture today, there will also be a review section. • Assignments are graded on a /–, /, /+ basis whereas exams are graded.

Lectures / Lecture 7
Apr 5, 2010 - Contents. 1 Introduction (0:00–5:00). 2. 2 Security (5:00–112:00). 2 .... use it to distribute pornography, you don't have to pay for disk space or bandwidth, but you might make money off ... requests—the more of a threat you pose

Lectures / Lecture 7
Apr 5, 2010 - Next we might try passing a phrase like “DELETE FROM ... your hard drive. This is why you should never open attachments from sources you don't trust! • Worms are more insidious because they don't require user interaction in order to

Lectures / Lecture 9 - Building Dynamic Websites
Andrew Sellergren. Contents. 1 Announcements (0:00–2:00). 2. 2 Ajax (2:00–105:00). 2. 2.1 Introduction . ... 2.4.2 ajax2.html . ... 2.4.10 ajax10.html .

Max Muller - Lectures Science of Language - v 1 - Lecture III.pdf ...
Max Muller - Lectures Science of Language - v 1 - Lecture III.pdf. Max Muller - Lectures Science of Language - v 1 - Lecture III.pdf. Open. Extract. Open with.

Max Muller - Lectures Science of Language - v 1 - Lecture I.pdf ...
Max Muller - Lectures Science of Language - v 1 - Lecture I.pdf. Max Muller - Lectures Science of Language - v 1 - Lecture I.pdf. Open. Extract. Open with. Sign In.

lecture 5: matrix diagonalization, singular value ... - GitHub
We can decorrelate the variables using spectral principal axis rotation (diagonalization) α=XT. L. DX. L. • One way to do so is to use eigenvectors, columns of X. L corresponding to the non-zero eigenvalues λ i of precision matrix, to define new

Lecture 5-Circuit-Packet Switching.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

lecture 5-1 wp.pdf
The AR bandwidth is the frequency bandwidth in which the AR of an antenna changes less than. 3-dB from its minimum value. The AR beamwidth is the angle span over which the AR of an antenna. changes less than 3-dB from its minimum value. Fig. 26: AR b

EE 396: Lecture 5
Feb 22, 2011 - In an inner product space, we automatically get for free the Cauchy-Schwartz .... smoothing with and closeness to the original image I. 3The is a ...

4 Review of selected material, Lectures 1-5
i=1 is a partition of [0, 1], and the h(ti)'s are square-integrable, F(ti)-adapted random variables. H is thus an F(r)-adapted process, with left-continuous sample paths. H is termed a simple process; let S denote the collection of all such processes

5 Llibres Eso (lectures) 2017-18.pdf
Oscar Wilde. G.A. Bécquer. Antonio Machado. Gabriel García Márquez. Robinson Crusoe Editorial Anaya. Clásicos a medida ISBN: 978-84-678-2871-9.

Max Muller - Lectures Science of Language - v 1 - Lecture II .pdf ...
Max Muller - Lectures Science of Language - v 1 - Lecture II .pdf. Max Muller - Lectures Science of Language - v 1 - Lecture II .pdf. Open. Extract. Open with.

Lecture 5: Random variables and expectation
Dec 13, 2017 - Ma 3/103. KC Border. Introduction to Probability and Statistics. Winter 2018. Lecture 5: Random variables and expectation. Relevant textbook passages: Pitman [5]: Sections 3.1– .... (This is beginning to sound ... For a discrete rand

Lecture 5 Number System Ben Hammond Goals
Decimal Number System. • Base 10 system (Ten digits: 0, 1, 2, …, 9). • Counting process. • Every digit goes through a cycle 0 → 9. • After a complete cycle of a lower significant digit (0 through 9) immediately higher digit is incremented

Lecture 5. Metal complex Colloid chemistry Surface properties.pdf ...
Retrying... Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Lecture 5. Metal complex Colloid chemistry Surface properties.pdf. Lecture 5. Metal comp

Lecture 7
Nov 22, 2016 - Faculty of Computer and Information Sciences. Ain Shams University ... A into two subsequences A0 and A1 such that all the elements in A0 are ... In this example, once the list has been partitioned around the pivot, each sublist .....

LECTURE - CHECKLIST
Consider hardware available for visual aids - Computer/ Laptop, LCD ... Decide timing- 65 minutes for lecture and 10 minutes for questions and answers.

Lecture 3
Oct 11, 2016 - request to the time the data is available at the ... If you want to fight big fires, you want high ... On the above architecture, consider the problem.

Goljan audio lectures
Page 1 of 4. Don t beso hard.Isabels02 e05.68968823868 - Download Goljan audio lectures.Office 2013 x64 activ.Thejuniorsarefunded bymainly the. club itself but the Ourclub is split who let the dogs out three parts thejuniors, theadultsand theacademy

lectures voltaire micromegas.pdf
Esto se acabó; nunca mas he de. querer. Abrazóla el filósofo, lloró con ella, puesto que filósofo; y la dama, despues de. haberse desmayado, se fué á consolar ...

FOUR LECTURES ON QUASIGROUP ... - CiteSeerX
The product in the group is obtained from concatenation of words followed by cancellation of adjacent pairs of identical letters. For example, q1q2q3 · q3q2 = q1.