3.6 Representing Video

Video information is one of the most complex types of information to capture, compress, and still get a result that makes sense to the human eye. Video clips contain the equivalent of many still images, each of which must be compressed. The Web is full of video clips with widely varying levels of quality. Some of the quality issues depend on the sophistication of video compression techniques, which are referred to as video codecs.

Video Codecs

Codec stands for COmpressor/DECompressor. A video codec refers to the methods used to shrink the size of a movie so that it can be played on a computer or over a network. Almost all video codecs use lossy compression to minimize the huge amounts of data associated with video. The goal, therefore, is not to lose information that affects the viewer’s senses.

Most codecs are block oriented, meaning that each frame of a video is divided into rectangular blocks. The various codecs differ in how the blocks are encoded. Some video codecs are accomplished completely in software, whereas others require special hardware.

Video codecs employ two types of compression: temporal and spatial. Temporal compression looks for differences between consecutive frames. If most of an image in two frames hasn’t changed, why should we waste space by duplicating all of the similar information? A keyframe is chosen as the basis on which to compare the differences, and its entire image is stored. For consecutive images, only the changes (called delta frames) are stored. Temporal compression is effective in video that changes little from frame to frame, such as a scene that contains little movement.

Spatial compression removes redundant information within a frame. This problem is essentially the same as the one we face when compressing still images. Spatial video compression often groups pixels into blocks (rectangular areas) that have the same color, such as a portion of a clear blue sky. Instead of storing each pixel, the color and the coordinates of the area are stored instead. This idea is similar to run-length encoding.

Various video codecs are popular today, including Sorenson, Cinepak, MPEG, and Real Video. The details of how these codecs represent and compress video are beyond the scope of this book.

SUMMARY

Computers are multimedia devices that manipulate data varying in form from numbers to graphics to video. Because a computer can manipulate only binary values, all forms of data must be represented in binary form. Data is classified as being either continuous (analog) or discrete (digital).

Integer values are represented by their binary equivalent using one of several techniques for representing negative numbers, such as a signed-magnitude or two’s complement. Real numbers are represented by a triple made up of the sign, the digits in the number, and an exponent that specifies the radix point.

A character set is a list of alphanumeric characters and the codes that represent each character. The most commonly used character set today is Unicode (16 bits for each character), which has ASCII as a subset. The 8-bit ASCII set is sufficient for English but not for other (or multiple) languages. There are various ways for compressing text so that it takes less space to store it or less time to transmit it from one machine to another.

Audio information is represented as digitized sound waves. Color is represented by three values that represent the contributions of red, blue, and green, respectively. Two basic techniques are used for representing pictures, bitmaps, and vector graphics. Video is broken up into a series of still images, each of which is represented as a picture.

KEY TERMS

EXERCISES

For Exercises 1–20, mark the answers true or false as follows:

  1. True

  2. False

  1.   1. Lossless compression means the data can be retrieved without losing any of the original information.

  2.   2. A computer represents information in an analog form.

  3.   3. A computer must use the binary number system to represent information.

  4.   4. A digital signal represents one of two values at any point in time.

  5.   5. Four bits can be used to represent 32 unique things.

  6.   6. The signed-magnitude representation of numbers has two representations for zero.

  7.   7. Overflow occurs when the value that we compute cannot fit into the number of bits we have allocated for the result.

  8.   8. In the ASCII character set, no distinction is made between uppercase and lowercase letters.

  9.   9. The Unicode character set includes all of the characters in the ASCII character set.

  10. 10. Keyword encoding replaces frequently used words with a single character.

  11. 11. Run-length encoding is very good at compressing English text.

  12. 12. Huffman encoding uses variable-length binary strings to represent characters.

  13. 13. An audio signal is digitized by sampling it at regular intervals.

  14. 14. A CD stores audio information in a binary format.

  15. 15. The MP3 audio format discards information that cannot be heard by humans.

  16. 16. An RGB value represents a color using three numeric values.

  17. 17. Indexed color increases the number of colors that can be used in an image, and thus increases the file size.

  18. 18. Bitmap, GIF, and JPEG are all examples of raster-graphics formats.

  19. 19. Vector graphics represent images in terms of lines and geometric shapes.

  20. 20. A keyframe is used in temporal compression to represent the changes from one frame to another.

For Exercises 21–26, choose the correct term from the following list.

  1. Signed-magnitude representation

  2. Radix point

  3. Frequency of use

  4. Sampling

  5. Analog

  6. Digital

  1. 21. ______ data is a continuous representation of information.

  2. 22. The representation for numbers you’ve used since grade school is called ______.

  3. 23. If the number base is other than base 10, we call the decimal point the ______.

  4. 24. ______ data is a discrete representation of information.

  5. 25. Huffman codes are created based on the ______ of the character.

  6. 26. An audio signal is digitized by ______ its value at regular intervals.

Exercises 27–79 are problems or short-answer questions.

  1. 27. Why is data compression an important topic today?

  2. 28. What is the difference between lossless and lossy data compression?

  3. 29. Why do computers have difficulty with analog information?

  4. 30. Is a clock with a sweeping second hand an analog device or a digital device? Explain.

  5. 31. What does it mean to digitize something?

  6. 32. What is pulse-code modulation?

  7. 33. How many things can be represented with

  1. Four bits?

  2. Five bits?

  3. Six bits?

  4. Seven bits?

  1. 34. Although you have been computing simple arithmetic operations since the second grade, take the following quick test to confirm that you thoroughly understand operations on signed integers. Evaluate the following expressions where W is 17, X is 28, Y is –29, and Z is –13.

  1. X + Y

  2. X + W

  3. Z + W

  4. Y + Z

  5. W – Z

  6. X – W

  7. Y – W

  8. Z – Y

  1.   35. Use the base-10 number line to prove the solutions to the following operations, where A is 5 and B is –7.

  1. A + B

  2. A – B

  3. B + A

  4. B – A

  1. 36. Given a fixed-sized number scheme where k in the formula for the ten’s complement is 6 (see page 63), answer the following questions.

  1. How many positive integers can be represented?

  2. How many negative integers can be represented?

  3. Draw the number line showing the three smallest and largest positive numbers, the three smallest and largest negative numbers, and zero.

  1. 37. Use the number line in Exercise 36(c) to calculate the following expressions, where A is –499999 and B is 3.

  1. A + B

  2. A - B

  3. B + A

  4. B - A

  1. 38. Use the formula for the ten’s complement to calculate the following numbers in the scheme described on page 63.

  1. 35768

  2. –35768

  3. –444455

  4. –123456

  1. 39. In calculating the ten’s complement in Exercise 38, did you have trouble borrowing from so many zeros? Such calculations are error prone. There is a trick you can use that makes the calculation easier and thus less prone to errors: Subtract from all 9s and then add 1. A number subtracted from all 9s is called the nine’s complement of the number.

  1. Prove that the nine’s complement of a number plus one is equal to the ten’s complement of the same number.

  2. Use the nine’s complement plus one to calculate the values in Exercise 38(b), (c), and (d).

  3. Which did you find easier to use, the direct calculation of the ten’s complement or the nine’s complement plus one? Justify your answer.

  1. 40. Evaluate the following expressions, where A is 11111110 and B is 00000010, using the two’s complement.

  1. A + B

  2. A − B

  3. B − A

  4. −B

  5. − (−A)

  1. 41. Is the two’s complement of a number always a negative number? Explain.

  2. 42. Devise a number system based on base 11.

  1. Draw the number line.

  2. Show examples of addition and subtraction.

  3. Develop a representation of negative numbers based on the eleven’s complement.

  1. 43. Convert the rules for subtraction in a signed-magnitude system to the algorithm format.

  2. 44. Convert the following real numbers to binary (five binary places).

  1. 0.50

  2. 0.26

  3. 0.10

  1. 45. Convert the following real numbers to octal (five octal places).

  1. 0.50

  2. 0.26

  3. 0.10

  1. 46. Can fractional values be visually converted between octal and binary and back? Explain.

  2. 47. How many bits would be needed to represent a character set containing 45 characters? Why?

  3. 48. How can the decimal number 175.23 be represented as a sign, mantissa, and exponent?

  4. 49. What is the main difference between the ASCII and Unicode character sets?

  5. 50. Create a keyword encoding table that contains a few simple words. Rewrite a paragraph of your choosing using this encoding scheme. Compute the compression ratio you achieve.

  6. 51. How would the following string of characters be represented using run-length encoding? What is the compression ratio? AAAABBBCCCCCCCCDDDD hi there EEEEEEEEEFF

  7. 52. What does the code *X5*A9 represent using run-length encoding?

  8. 53. Given the following Huffman encoding table, decipher the bit strings that follow.

HUFFMAN CODE CHARACTER
00 A
11 E
010 T
0110 C
0111 L
1000 S
1011 R
10010 O
10011 I
101000 N
101001 F
101010 H
101011 D
  1. 1101110001011

  2. 0110101010100101011111000

  3. 101001001010000100010000101 00110110

  4. 101000100101010001000111010 00100011

  1. 54. How do humans perceive sound?

  2. 55. Is a stereo speaker an analog device or a digital device? Explain.

  3. 56. What is an RGB value?

  4. 57. What does color depth indicate?

  5. 58. How does pixel resolution affect the visual impact of an image?

  6. 59. Explain temporal video compression.

  7. 60. Describe a situation in which spatial video compression would be effective.

  8. 61. Define sampling as it relates to digitizing sound waves.

  9. 62. Which produces better sound quality, higher sampling rates or lower sampling rates?

  10. 63. What is the sampling rate per second that is enough to create reasonable sound reproduction?

  11. 64. Do vinyl record albums and compact disks record sound in the same way?

  12. 65. What does an RGB value of (130, 0, 255) mean?

  13. 66. What color does an RGB value of (255, 255, 255) represent?

  14. 67. What is resolution?

  15. 68. The GIF format uses which technique?

  16. 69. What are GIF files best for?

  17. 70. How are the various video codecs alike?

  18. 71. How are the various video codecs different?

  19. 72. Name two types of video compression.

  20. 73. What do we call the perception of the various frequencies of light that reach the retinas of our eyes?

  21. 74. What is the best format for photographic color images?

  22. 75. What are the techniques called that shrink the sizes of movies?

  23. 76. What is the technique in which an application supports only a certain number of specific colors, creating a palette from which to choose?

  24. 77. What is the format that describes an image in terms of lines and geometric shapes?

  25. 78. Which format stores information on a pixel-by-pixel basis?

  26. 79. What is the difference between high color and true color?

THOUGHT QUESTIONS

  1. What are some advantages of using a common (standardized) character set? What are some disadvantages?

  2. When converting whole numbers from one base to another, we divide by the new base. When converting fractional parts from one base to another, we multiply by the new base. Can positional notation be used to explain these algorithms?

  3. Technology is changing rapidly. What changes have occurred in data compression since this book was written?

  4. Where is Edward Snowden now? How do you think his actions will be characterized in the future?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.183.89