🎓 BookMCQ
← Back to 28. Multimedia

📝 Text representation in multimedia (10 MCQs)

Character Data Within Multimedia Documents and Interfaces

Text is a compact but essential multimedia component used for titles, captions, subtitles, menus, labels, descriptions and interactive content. Computers store text as coded character values rather than as pictures of letters. A consistent character encoding allows different systems to interpret those values correctly, while multimedia applications associate text with images, sound and timed video. Correct encoding is essential when content moves between platforms and languages.

Character Sets, Unicode and Text Encodings

A character repertoire defines the characters that can be represented, while an encoding maps each character value to bytes. Unicode assigns code points for characters from many writing systems; UTF-8 represents those code points using one to four bytes. Markup languages can add structure, formatting and links without changing the underlying idea of character encoding.

From Character Codes to Transmitted Text Bytes

A text application converts characters into bytes using a selected encoding, then includes those bytes in a file or protocol message. The receiver identifies or is informed of the encoding, decodes the bytes into characters, and applies any markup or timing instructions. If sender and receiver use incompatible encodings, text may appear as replacement symbols or incorrect characters.

UTF-8 Representation of a Short Caption

The English word Cat is encoded in UTF-8 as three bytes: 43 61 74 in hexadecimal. A subtitle cue can carry the text together with a start time and end time, allowing a player to display it during the matching video interval. Non-ASCII characters may require multiple bytes, depending on their Unicode code point.

Text Tracks, Subtitles and Accessibility Services

Text often accompanies video as subtitles, captions, transcripts and descriptions. Captions can include speech and relevant sounds, improving accessibility, while timed text can be synchronized with a media timeline. Text is also used in menus and metadata that control playback. Its relatively small size makes it practical to deliver separately from high-rate audio-video streams.

Unicode Is Not a Compression Algorithm

'Unicode is a font' confuses character coding with visual rendering; fonts provide glyph shapes. 'UTF-8 assigns character meanings' is inaccurate because Unicode assigns code points and UTF-8 encodes them as bytes. 'Every character uses one byte' is false because UTF-8 uses one to four bytes per code point. This distinction matters when evaluating codec behavior and media delivery.

Interpreting Character Encoding and Text Size

Be able to distinguish a character, code point, byte sequence, encoding and rendered glyph. Calculate simple UTF-8 byte counts only when the character values are specified. For subtitles, interpret timing cues and explain how text can remain synchronized with video while being transported independently from the video frames. Explain how encoding errors affect displayed text.

Character Encoding and Timed-Text Terms

  • Unicode - Assigns code points to characters across scripts.
  • Code point - Identifies a character in Unicode.
  • UTF-8 - Encodes Unicode values with one to four bytes.
  • Glyph - Visual shape used to display a character.
  • Subtitle cue - Text item linked to a presentation time.
  • Timed text - Text synchronized to a media timeline.
3
Easy
5
Medium
2
Hard

📝 All Text representation in multimedia MCQs

Q1. In the LZW decoding pseudocode, what does the variable SS represent?

A.The next input codeword
B.The current string retrieved from the dictionary ✅
C.The previous codeword
D.A temporary counter
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The variable SS holds the string that is looked up in the dictionary for the current codeword. When a codeword is read, the algorithm accesses Dictionary[CC] and assigns that value to SS, which is then used for output and for building new entries.

Q2. If the current codeword CC is not found in the dictionary, which clause is executed and what immediate effect does it have on the dictionary?

A.If-clause; no new entry is added
B.If-clause; the existing entry is overwritten
C.Else-clause; the codeword is ignored
D.Else-clause; a new entry is created using PreS+charPreS + char ✅
💡 Difficulty: easy | ✅ Correct: D

📖 Explanation: When CC is absent, the algorithm follows the else‑clause. This clause constructs a new dictionary entry by concatenating the previous string PreSPreS with the first character of the current string, thereby expanding the dictionary for future lookups.

Q3. Assume the dictionary initially contains entries for characters A and B. After reading codeword 2 (which corresponds to string 'BA') and then codeword 1 (string 'A'), what string is output by the algorithm for the second codeword?

A.BA
B.A ✅
C.BAA
D.AB
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The first codeword outputs 'BA' as expected. When the second codeword (1) is processed, the algorithm retrieves Dictionary[1], which is the single character 'A', and outputs that string. Thus the output associated with the second codeword is exactly 'A', independent of the previous output.

Q4. Compare the effect of the else‑clause versus the if‑clause on the size of the dictionary during decoding. Which statement is accurate?

A.Both increase size equally
B.If clause increases size, else does not
C.Else clause increases size, if clause does not ✅
D.Neither changes size
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The else‑clause is the only branch that adds a new entry to the dictionary, formed from PreS+charPreS + char. The if‑clause simply uses an existing entry without modification. Consequently, each execution of the else‑clause grows the dictionary, while the if‑clause leaves its size unchanged.

Q5. Considering the number of codewords processed, what is the overall time‑complexity of the LZW decoding algorithm?

A.O(n)O(n) where nn is the number of codewords ✅
B.O(nlog⁡n)O(n \log n)
C.O(n2)O(n^{2})
D.O(log⁡n)O(\log n)
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Each iteration handles a single codeword with constant‑time dictionary lookups and possible entry creation. Because the work per codeword does not depend on previously processed data, the total runtime grows linearly with the number of codewords, giving a complexity of O(n)O(n).

Q6. If PreS = 'A' and the next character char = 'B', what new dictionary entry is created by the else‑clause?

A.'AB' ✅
B.'BA'
C.'AA'
D.'BB'
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The else‑clause forms a new entry by concatenating the previous string PreSPreS with the newly read character. With PreS = 'A' and char = 'B', the resulting string is 'AB', which is then stored in the dictionary under the next available code.

Q7. During decoding, if the algorithm encounters a codeword that is not yet present in the dictionary, what does it output?

A.PreSPreS concatenated with its first character ✅
B.The previous output string
C.An empty string
D.The codeword itself
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When a missing codeword is read, LZW decoding uses the rule that the output is the previous string PreSPreS followed by the first character of PreSPreS. This constructs a valid string and also supplies the information needed to add a new dictionary entry.

Q8. What is the relationship between PreSPreS and SS in the LZW decoding process?

A.PreSPreS is always a prefix of SS ✅
B.PreSPreS equals SS
C.PreSPreS is the suffix of SS
D.No relationship
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: In each loop, PreSPreS holds the string from the previous iteration, and SS is the current string retrieved from the dictionary. Because SS is built from PreSPreS (often as PreS+charPreS + char), the previous string naturally appears as a prefix of the new string.

Q9. During the decoding process, after the else‑clause creates a new entry at code 5, the subsequent if‑clause checks code 6 which is present in the dictionary. What will be the output for code 6?

A.The string stored at Dictionary[6] ✅
B.The previous string concatenated with the first character of Dictionary[6]
C.An error occurs
D.The algorithm terminates
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the if‑clause is taken, the algorithm simply retrieves the existing entry at Dictionary[6] and outputs that string. No new entry is added, and the decoding continues normally, producing the exact string associated with code 6.

Q10. How does LZW encoding differ from LZW decoding as illustrated in the example?

A.Encoding adds entries only when a new pattern appears, decoding adds entries on every iteration
B.Encoding never uses the else clause, decoding always does
C.Encoding builds dictionary from input, decoding reconstructs using codewords ✅
D.Both processes are identical
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Encoding constructs the dictionary by scanning the input and adding new patterns as they appear, while decoding uses the transmitted codewords to rebuild the original data, inserting new entries only when the else‑clause condition is met. This fundamental directionality distinguishes the two procedures.

🔗 Related Topics (MCQs)