Data Representation. Data is more than just numbers! Representations of Text ASCII. Interpreting bits to give them meaning.

Similar documents
Data Representation. Reminders. Data is more than just numbers! Interpreting bits to give them meaning. Part 3: Media - Text and Pictures

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

Elementary Computing CSC 100. M. Cheng, Computer Science

Digital Media. Daniel Fuller ITEC 2110

Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3

Introduction to Computer Science (I1100) Data Storage

Compression; Error detection & correction

Bits, bytes, binary numbers, and the representation of information

Standard File Formats

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

Compression; Error detection & correction

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Computing in the Modern World

计算原理导论. Introduction to Computing Principles 智能与计算学部刘志磊

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

MULTIMEDIA AND CODING

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

GCSE Computing. Revision Pack TWO. Data Representation Questions. Name: /113. Attempt One % Attempt Two % Attempt Three %

NUMBERS AND DATA REPRESENTATION. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

Lecture 19 Media Formats

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

Bits and Bit Patterns

Part III: Survey of Internet technologies

Fundamental of Digital Media Design. Introduction to Audio

General Computing Concepts. Coding and Representation. General Computing Concepts. Computing Concepts: Review

Multimedia on the Web

Common Technology Words and Definitions

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

The Gullibility of Human Senses

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Digital Media. Daniel Fuller ITEC 2110

Lecture #3: Digital Music and Sound

AET 1380 Digital Audio Formats

Final Study Guide Arts & Communications

Data Representation 1

Networking Applications

CSC 170 Introduction to Computers and Their Applications. Lecture #1 Digital Basics. Data Representation

Unit 2 Digital Information. Chapter 1 Study Guide

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

COS 116 The Computational Universe Laboratory 4: Digital Sound and Music

Lesson 5: Multimedia on the Web

Different File Types and their Use

CHAPTER 10: SOUND AND VIDEO EDITING

Digital Media. Lecture 2: SemesterOverview. Georgia Gwinnett College School of Science and Technology Dr. Mark Iken

CSCD 443/533 Advanced Networks Fall 2017

Data Representation From 0s and 1s to images CPSC 101

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

MEDIA RELATED FILE TYPES

COS 116 The Computational Universe Laboratory 4: Digital Sound and Music

Data Representation and Networking

FA269 - DIGITAL MEDIA AND CULTURE

UNDERSTANDING MUSIC & VIDEO FORMATS

Multimedia applications

6.1 Font Types. Font Types

Digital Audio. Amplitude Analogue signal

Lecture 16 Perceptual Audio Coding

CISC 7610 Lecture 3 Multimedia data and data formats

Introduction to LAN/WAN. Application Layer 4

Sustainable File Formats for Electronic Records A Guide for Government Agencies

2nd Paragraph should make a point (could be an advantage or disadvantage) and explain the point fully giving an example where necessary.

Lesson 5: Multimedia on the Web

Binary representation and data

Digitization of Multimedia Elements

CHAPTER 6 Audio compression in practice

Discussion. Why do we use Base 10?

Introducing Audio Signal Processing & Audio Coding. Dr Michael Mason Snr Staff Eng., Team Lead (Applied Research) Dolby Australia Pty Ltd

Unicode. Standard Alphanumeric Formats. Unicode Version 2.1 BCD ASCII EBCDIC

So, what is data compression, and why do we need it?

Digital Data. 10/11/2011 Prepared by: Khuzaima Jallad

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

Gerald's Column by Gerald Fitton

Lossy compression. CSCI 470: Web Science Keith Vertanen

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

Robin Dittwald Institut für Linguistik Universität zu Köln June Subtitles with ELAN An Easy Guide

Welcome. Web Authoring: HTML - Advanced Topics & Photo Optimisation (Level 3) Richard Hey & Barny Baggs

Audio and video compression

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

Contents. Media Files and Formats. The prehistory. Pre-Digital Formats

Source coding and compression

3.01C Multimedia Elements and Guidelines Explore multimedia systems, elements and presentations.

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

VC 12/13 T16 Video Compression

Image and video processing

CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015

CS101 Lecture 12: Image Compression. What You ll Learn Today

Data Representation. Types of data: Numbers Text Audio Images & Graphics Video

Administrative Notes February 9, 2017

ITNP80: Multimedia! Sound-II!

M4-R4: INTRODUCTION TO MULTIMEDIA (JAN 2019) DURATION: 03 Hrs

Multimedia Content. Web Architecture and Information Management [./] Spring 2009 INFO (CCN 42509) Contents. Erik Wilde, UC Berkeley School of

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

enjoy pure digital perfection USB host HDMI out 1080P Up-scaling Full HD (1080) up-scaling

Tablet 300x x x x1024

Chapter 5 Images. Presented by Thomas Powell. Slides adopted from HTML & XHTML: The Complete Reference, 4th Edition 2003 Thomas A.

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

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

Bluray (

A Digital Audio Primer

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

Worksheet - Storing Data

Transcription:

Data Representation Interpreting bits to give them meaning Part 2: Media Text, Web Pages,, /Music, Video Notes for CSC 100 - The Beauty and Joy of Computing The University of North Carolina at Greensboro Data is more than just numbers! Data is stored using bits but represents many things: Documents /music Video... How does this work? File formats: Structure bits in such a way that mapping between bits and what they represent is unambiguous Standardized or open file formats Specified so that anyone can write programs for them (JPEG, MPEG (and MP3), OpenDocument, HTML,...) "Open" and "standardized" doesn't mean "free" (MP3, GIF,...) A data capture or creation program builds the file in the appropriate format A rendering program converts the file format to a recognizable form (image viewer, web browser, video player,...) Representations of Text ASCII When everything is 0's and 1's, how do you store or transmit something like "Hello World"? Some Special Characters 07 Bell 08 Backspace 0A New line Punctuation Samples Answer: Encode characters as binary strings 20 Space 21! 22 " In early days there were several "encodings" American Standard Code for Information Interchange Uses 7 bits per character Typically embedded in 8-bit bytes Hexadecimal bytes -> ASCII examples to the right Less U.S.-centric encoding: Unicode 24 $ 2B + 2C, 2E. 3A : 3F? Digits 30 0 Most common for basic US/English use is ASCII 0C Form Feed 0D Carriage Ret 27 ESC... 39 9 Letters 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D A B C D E F G H I J K L M 4E 4F 50 51 52 53 54 55 56 57 58 59 5A N O P Q R S T U V W X Y Z 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D a b c d e f g h i j k l m 6e 6f 70 71 72 73 74 75 76 77 78 79 7A n o p q r s t u v w x y z

Representations of Text ASCII - What does the highlighted part say? 0000000: 0000010: 0000020: 0000030: 0000040: 0000050: 0000060: 0000070: 0000080: 0000090: 00000a0: 00000b0: 00000c0: 00000d0: 00000e0: 00000f0: 0000100: 0000110: 0000120: 0000130: 0000140: 0000150: 0000160: 0000170: 4c65 7720 6f66 6576 6163 7469 696c 2e20 6465 7265 6c6c 6976 206d 6372 6265 696e 6672 656e 6c20 4974 6570 6865 6d2e 616d 2072 6565 2073 6372 7573 2079 6965 206f 6d6f 2069 6c79 2041 0a0a 6973 6973 6f75 6e69 643a 656c 206e 6865 7061 6f75 6e64 686f 6620 7272 7665 2072 6d65 4920 206e 6e67 2022 7472 662d 7465 6f74 2076 6972 7567 6469 6f77 6120 6f6f 7269 6174 7570 206f 5765 7574 6576 6c20 2077 2e20 6f64 2d2d 6820 6666 6461 2c20 6472 7465 6361 7665 6f6e 696f 6620 2068 6873 6964 6d65 6571 6c65 4920 6179 2073 7765 6963 4920 7265 6e20 6e20 6e64 7472 6974 6f6c 656e 6e20 7561 6c6f 7361 206d 6f20 2066 756c 616e 7374 616d 6d20 696e 6472 6461 7769 206c 7565 6f20 742c 6172 6c2e Some Special Characters 07 Bell 08 Backspace 0A New line 0C Form Feed 0D Carriage Ret 27 ESC Punctuation Samples 20 Space 21! 22 " 24 $ 2B + 2C, 2E. 3A : 3F? Digits 30 0... 39 9 Letters 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D A B C D E F G H I J K L M 4E 4F 50 51 52 53 54 55 56 57 58 59 5A N O P Q R S T U V W X Y Z 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D a b c d e f g h i j k l m 6e 6f 70 71 72 73 74 75 76 77 78 79 7A Representations of Text ASCII - The full hex dump! 0000000: 0000010: 0000020: 0000030: 0000040: 0000050: 0000060: 0000070: 0000080: 0000090: 00000a0: 00000b0: 00000c0: 00000d0: 00000e0: 00000f0: 0000100: 0000110: 0000120: 0000130: 0000140: 0000150: 0000160: 0000170: 4c65 7720 6f66 6576 6163 7469 696c 2e20 6465 7265 6c6c 6976 206d 6372 6265 696e 6672 656e 6c20 4974 6570 6865 6d2e 616d 2072 6565 2073 6372 7573 2079 6965 206f 6d6f 2069 6c79 2041 0a0a 6973 6973 6f75 6e69 643a 656c 206e 6865 7061 6f75 6e64 686f 6620 7272 7665 2072 6d65 4920 206e 6e67 2022 7472 662d 7465 6f74 2076 6972 7567 6469 6f77 6120 6f6f 7269 6174 7570 206f 5765 7574 6576 6c20 2077 2e20 6f64 2d2d 6820 6666 6461 2c20 6472 7465 6361 7665 6f6e 696f 6620 2068 6873 6964 6d65 6571 6c6f 6c65 4920 7361 6179 206d 2073 6f20 7765 2066 6963 756c 616e 4920 7374 7265 616d 6d20 696e 6e20 6472 6461 6e20 7769 6e64 206c 7472 7565 6974 6f6c 6f20 656e 742c 6e20 6172 7561 6c2e Let us not wallo w in the valley of despair. I sa y to you today m y friends -- so even though we f ace the difficul ties of today an d tomorrow, I st ill have a dream. It is a dream deeply rooted in the American dr eam...i have a d ream that one da y this nation wi ll rise up and l ive out the true meaning of its creed: "We hold these truths to be self-evident, that all men ar e created equal. Formatted Text HTML ASCII provides letters - what about fonts, sizes, etc? One option: HTML - HyperText Markup Language The "language of web pages" "Markup" indicates formatting/style All characters are just regular character set (like ASCII) - including markup Must be rendered to convert character-based markup to formatted text A lot of formatting is now in CSS - Cascading Style Sheets Much more involved than these examples! HTML Source This is formatted text, which can be <b>bold</b> or <i>italic</i> or <u>underlined</u> or <span style=" font-size: 150%">big</span> or <span style="font-size: 50%" >small</span> or... Rendered Text This is formatted text, which can be bold or italic or underlined or big or small or... n o p q r s t u v w x y z

Grayscale Grayscale images have levels of intensity, but no color More information than bi-tonal black and white (like fax machines or most printers) Less information than color Grayscale - Pixels Pixels are "picture elements" Resolution is pixel density Can be in dots/pixels per inch (dpi/ppi) Typical monitor: 100ppi Typical printer: 600dpi (bi-tonal) Quality depends on viewing distance (52" high def TV is only 43 ppi - but you don't sit right next to it!) Apple "retina display" - 326 ppi on iphone Grayscale - Pixels as numbers Number of levels typically one byte

Color - Three "color planes" (red, green, blue) Each color plane is just like a grayscale image, with same issues: Resolution (ppi) Depth (bpp) "24 bit color" means 8 bits per pixel in each of the 3 colors Why does this work? "Rods" and "cones" signal our brain about light we receive in our eye Rods: monochrome only Cones: Color - in three kinds, red, green, and blue Why does this work? Bottom line: If humans can only perceive three colors (red, green, and blue) then reconstructing just those three colors allow us to perceive everything just as in an original. Interesting question: What if someone were born with a mutation that gave them purple and yellow receptors?

What is sound? is just rapid fluctuations in air pressure, detected by the (somewhat delicate!) organs in our ears waveforms We can plot changes in pressure over time: Main components: Intensity (how much pressure changes): We perceive this as "loudness" and in graph would be reflected in larger fluctuations Frequency: How rapid are the fluctuations? waveforms - Zooming in! "Pure" tone is a sine wave (real world sounds are generally not pure!) One cycle here is approximately 0.150 seconds to 0.157 seconds: Period is 0.007 seconds Frequency is 1/0.007 = 142.857... Hz (for "Hertz") For reference, "middle C" is around 261.626 Hz An octave doubles/halves frequency, so this note is a probably something like a "D below middle C" (which is 146.8 Hz) Question: How do we make this digital?

waveforms - Zooming in even more! Answer: We sample the waveform many times per second. This is zoomed in enough where you can see actual samples: Quality of sound reproduction depends on sample rate (samples per second): In this example, 22 samples between 0.1890 and 0.1900 So 22/(0.190-0.189) = 22,000 samples per second CD sound: 44,100 samples/second Typical DVD sound: 48,000 samples/second Nyquist Theorem: Perfect reconstruction of signals with frequency <= F if you sample at (2/F) samples/second waveforms - Zooming in even more! Answer: We sample the waveform many times per second. This is zoomed in enough where you can see actual samples: Question: What is maximum frequency that can be reconstructed from a CD? From a DVD? For comparison: Human hearing range is typically 20 Hz to around 20,000 Hz Quality of sound reproduction depends on sample rate (samples per second): In this example, 22 samples between 0.1890 and 0.1900 So 22/(0.190-0.189) = 22,000 samples per second CD sound: 44,100 samples/second Typical DVD sound: 48,000 samples/second Nyquist Theorem: Perfect reconstruction of signals with frequency <= F if you sample at (2/F) samples/second Video Basics Can be viewed as a series of still images 24 frames per second (fps) in movies 30 fps in US television Motion-JPEG (M-JPEG) is exactly this: JPEG image for each frame Benefit: Very simple format to work with and edit Drawback: Doesn't take advantage of temporal similarities between frames MPEG (DVD format) includes motion estimation:

Video A few more details... Frames are no longer independent! MPEG has three frame types: I-frames (intra-coded independent) P-frames (predicted) B-frames (bi-predictive) Must buffer B-frames until the next P-frame Can only "enter" a video stream at an I-frame (or you see very blocky artifacts). Video editors need to be very careful about this (splicing at non-i frames can be tricky!) Video and A movie typically has multiple "streams" multiplexed together: Video stream Audio stream (maybe multiple for multi-language) Subtitles Rendering software must synchronize streams - otherwise sound and video may be off (probably everyone has seen this happen!) Compression Taking advantage of redundancies and other structure to give smaller file sizes. Two main types: Lossless: Allows perfect reconstruction of original data Zip, RAR, FLAC,... (JPEG has a lossless mode too!) Lossy: Reconstruction is an approximation of original Most media formats: JPEG, MPEG, MP3,... Can usually trade off quality for compression Note that digital sampling/capture is already a lossy process (Remember taking advantage of human color vision?)

Compression Examples, and what you can expect Text: "Pride and Prejudice" Audio: "London Calling" (3:19 long) Original (uncompressed) 685 kb Zip 250 kb GZip 250 kb RAR CD audio (uncompressed) 35.2 MB Zip (lossless, general) 33.9 MB FLAC (lossless, audio) 25.4 MB MP3 (lossy, 128 kbps) 3.2 MB Ogg (lossy, quality 3) 3.1 MB 217 kb 7Zip 204 kb BZip 176 kb Notes: Zip is not designed for audio Both MP3 and Ogg sound good at this rate MP3 plays on almost all players MP3 encoding (using LAME) took 11.2 sec Ogg encoding took 6.1 sec Compression Examples, and what you can expect - cont'd Picture: 3648 x 2736 (9.98 MPixel) Raw 29.9 MB Zip (lossless) 17.0 MB BZip (lossless) 10.9 MB Raw 190 GB PNG (lossless) 9.8 MB HQ DVD 3.6 GB JPEG (lossy - Q=95) 2.1 MB JPEG (lossy - Q=85) 1.1 MB Video: "Wizard of Oz" (1:41:42) 480x720 @30fps Notes: DVD compression is over 50:1 DiVX / MP4 can give 200:1 or more Summary There's a lot more we could talk about Logarithmic scale of human perception (intensities, frequencies, etc.) Image formats: bitmapped vs vector formats Compression techniques Other imagery formats (multispectral images)... Explore this if it interests you! Following your curiosity is a great way to learn...