ITPEC IP April 2024 Question 25

Source exam: ITPEC IP April 2024Topic: Multimedia

ITPEC IP April 2024 — Question 25 of 100

The compressed representation has 13 characters, so the compression ratio is 52.0%. The calculation is 13 ÷ 25 × 100 = 52.0%. Scan all 25 pixels continuously from left to right and top to bottom. Runs can cross a row boundary, as demonstrated in Fig. 1.

The color runs in Fig. 2 have lengths B6, W4, B4, W1, B1, W4, B1, W4. A run of two or more uses two characters: its color and its count. A single pixel uses one character. The encoded length is therefore 2 + 2 + 2 + 1 + 1 + 2 + 1 + 2 = 13. Dividing by the original 25 characters gives 52.0%.

Answer (b)

Why not others: (a), (c), and (d) do not equal the encoded-to-original length ratio 13/25. They result from miscounting runs or reversing the ratio.

Key rule: In run-length encoding, first determine maximal consecutive runs across the entire scan sequence, then count the characters required for each run.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.