PadhaikoAll subjects

Video and Animation

Multimedia System (ENCT 466)

Open in the Padhaiko app

4.1 Digital Video

Definition

Digital Video

Digital video represents moving visual scenes as a discrete time-ordered sequence of digital raster images (frames) captured and displayed at a constant frame rate (). Because of human persistence of vision, displaying at least creates the illusion of smooth, continuous motion.

Key Digital Video Parameters

  1. Spatial Resolution & Aspect Ratio: Width Height in pixels (e.g., ), with display aspect ratio ( standard TV, widescreen HD/UHD).
  2. Frame Rate (): Standard rates are (cinema), (PAL), (NTSC), and (high-motion gaming/sports).
  3. Progressive (p) vs. Interlaced (i) Scanning:
    • Progressive (1080p): Draws all horizontal scan lines sequentially () in every frame; sharp motion without combing artifacts.
    • Interlaced (1080i): Splits each frame into two half-resolution fields—odd lines first, then even lines—halving transmission bandwidth at the cost of motion combing.
  4. Chroma Subsampling: Exploits human vision's lower spatial sensitivity to color () than brightness () by sampling chrominance at reduced horizontal/vertical resolution over every pixel macro-block:
    • : Full , , at every pixel ( samples/pixel average).
    • : Full , half horizontal ( samples/pixel average; data reduction).
    • : Full , half horizontal and half vertical ( samples/pixel average; data reduction; used in JPEG, H.264, Blu-ray).

4.2 Video signal representation

Analog and broadcast video signals are transmitted using three primary electrical signal representations:

Video Signal Representations: Component vs. S-Video vs. Composite
RepresentationPhysical Channels / WiresSignal StructureVisual Quality
Component Video separate cables or / kept completely isolatedHighest: zero color crosstalk or dot crawl
S-Video (Separate) separate channelsLuminance () on one wire, modulated chrominance () on the secondMedium-high: eliminates luma-chroma interference
Composite Video single wireLuminance (), modulated chrominance (), and sync pulses combinedLowest: susceptible to dot crawl and color bleeding

Analog Broadcast Television Standards

NTSC, PAL, and SECAM Comparison
StandardRegionTotal Scan LinesFrame RateColor Encoding
NTSCNorth America, Japan ( visible) ()YIQ (Quadrature Amplitude Modulation)
PALEurope, Nepal, India, Australia ( visible) ()YUV (Phase Alternating Line to cancel hue errors)
SECAMFrance, Russia, Eastern Europe ( visible) ()YDbDr (FM-modulated color difference signals)

4.3 Computer Video Format

Computer video standards evolved from low-resolution display adapters to high-definition digital interfaces and modern compressed video containers:

Display Resolution Standards

Evolution of Computer Display & Video Formats
FormatResolution ()Aspect RatioTypical Color / Era
CGA / (non-square) colors / colors (1981)
EGA colors from -color palette
VGA colors () or colors ()
SVGA / /
XGA True Color
HD ()Progressive YCbCr
Full HD ()Progressive YCbCr
4K UHD () / HDR

Container Formats vs. Video Codecs

A container format (wrapper) multiplexes compressed video, audio, subtitles, and metadata, whereas a codec (coder-decoder) compresses and decompresses the raw pixel stream:


4.4 Computer- Based animation

Definition

Computer-Based Animation

Computer-based animation is the creation of moving images using computers by updating visual attributes—position, orientation, shape, color, transparency, or camera viewpoint—across successive frames over time.

Categories of Computer Animation

  1. 2D Animation: Operates in the plane using raster sprites, layered cels, or vector shapes (e.g., cartoons, UI micro-interactions, 2D games).
  2. 3D Animation: Models objects as 3D meshes, rigs them with hierarchical skeletons, applies lighting/materials, and renders scenes from a virtual camera:
    • Forward Kinematics (FK): Animator sets each joint angle from root to end-effector (e.g., shoulder elbow wrist).
    • Inverse Kinematics (IK): Animator places the end-effector (e.g., hand or foot), and the solver computes intermediate joint angles automatically.
  3. Motion Capture (Mocap): Records real human performers' joint trajectories using optical markers or inertial sensors and maps them onto 3D character rigs.

4.5 Animation Language

An animation language provides formal syntax or scripting constructs to specify how objects move, deform, and synchronize over time. They fall into three main classes:

  1. Linear-List Notations: Tabular frame-by-frame specifications listing frame number, target object, action, and parameters (e.g., 42, 53, ROTATE, "wheel", 1, 360).
  2. Declarative / Web Animation Languages: High-level markup or stylesheets describing keyframes and timelines directly:
    • SMIL (Synchronized Multimedia Integration Language), SVG <animate>, and CSS @keyframes.
  3. General-Purpose & Scene-Graph Scripting Languages: Full programming languages or 3D tool APIs controlling complex physics, conditionals, and loops (e.g., C/OpenGL, JavaScript requestAnimationFrame, Python in Blender, Maya MEL).
Declarative Keyframe Animation in CSSCSS
@keyframes slideBounce {
  0%   { transform: translateX(0px);   opacity: 0.2; }
  50%  { transform: translateX(180px); opacity: 1.0; }
  100% { transform: translateX(240px); opacity: 1.0; }
}
.ball { animation: slideBounce 1.5s ease-in-out infinite; }

4.6 Timeline and frame based animation

In timeline and frame-based (cel) animation, the timeline is divided into discrete frame slots (e.g., or slots per second), and the artist or system explicitly supplies the complete visual state for every single frame.


4.7 Timeline and Tween-Based animation

In tween-based (keyframe) animation, the animator defines only the major keyframes (start, turning points, and end states) on the timeline, and the computer automatically generates the intermediate frames (in-betweens or tweens) via mathematical interpolation.

Types of Tweening

  1. Motion Tweening: Interpolates rigid geometric properties—position , rotation , and scale .
  2. Shape Tweening (Morphing): Interpolates vertex coordinates/contours to smoothly transform one shape into another.
  3. Color / Attribute Tweening: Interpolates fill color, opacity (), or lighting intensity.

Mathematical Interpolation (Linear & Easing)

Given keyframe values at time and at , normalized parameter computes intermediate value :

AspectFrame-Based AnimationTween-Based (Keyframe) Animation
Authoring EffortEvery frame must be drawn or edited manuallyAnimator defines only sparse keyframes; computer interpolates
File SizeLarge (stores full artwork per frame)Very compact (stores keyframes + interpolation curve)
Smoothness ScalingDoubling frame rate requires redrawing twice as many framesDoubling frame rate simply evaluates at finer steps
Best Suited ForHand-drawn character expressions, stop-motion, frame spritesUI motion, mechanical parts, camera flythroughs, skeletal rigs

4.8 Methods of controlling Animation

Animation systems control object motion through five primary mechanisms:

  1. Full Explicit Control: The animator manually defines every keyframe, motion path, or scripting parameter directly (keyframing, spline paths).
  2. Procedural Control: Motion is computed dynamically from algorithms and physical laws—particle systems (smoke, fire, rain), rigid-body dynamics, gravity, springs, and flocking simulations.
  3. Constraint-Based Control: Objects obey geometric or physical rules (e.g., Inverse Kinematics joints, feet staying planted on the floor, non-penetration collisions).
  4. Live-Action Tracking (Motion Capture / Rotoscoping): Real-world actor or camera motion is tracked electronically and transferred directly to digital characters.
  5. Interactive / Behavioral Control: User inputs (game controllers, touch gestures, VR headsets) or AI finite-state machines dynamically branch and blend animations in real time.

4.9 Display of Animation

Smooth on-screen display of animation requires synchronizing frame generation with the display hardware's refresh cycle:

  1. Double Buffering & V-Sync: Rendering directly into the visible screen memory causes flickering and screen tearing (top half showing frame , bottom half showing frame ). Double buffering renders the next frame completely inside an off-screen back buffer while the monitor scans out the front buffer, then swaps pointers instantaneously during the Vertical Blank Interval (V-Sync).
  2. Sprite & Blitting Engines: Moving 2D animated characters quickly over static backgrounds by copying rectangular pixel regions (BitBLT) with transparency masks or alpha channels.
  3. Color-Lookup-Table (CLUT) Animation: Cycling palette entries in an indexed-color framebuffer to animate waterfalls, blinking lights, or radar sweeps without touching pixel memory.
  4. GPU Hardware Acceleration: Offloading vertex transforms, skeletal skinning, and fragment shading to parallel GPU pipelines to sustain .

4.10 Transmission of Animation

Delivering animations over networks balances bandwidth against client rendering capability:

  1. Pre-Rendered Video Stream Transmission: The animation is rendered on a server/workstation into raster frames and compressed with a video codec (H.264/HEVC/AV1). Requires moderate-to-high bandwidth, but even a thin client with a basic hardware decoder can play complex photorealistic CGI.
  2. Symbolic / Vector & Keyframe Transmission: Instead of pixels, the server transmits compact geometry, textures, and keyframe/procedural instructions (e.g., SVG/Lottie JSON, glTF 3D scenes, game-engine state updates). Uses orders-of-magnitude less bandwidth and scales cleanly to any resolution, provided the client device has CPU/GPU power to render frames locally.
  3. Frame-Difference (Delta) Transmission: Sends only the dirty bounding rectangles or changed pixel runs between consecutive frames (used in animated GIFs, remote desktop VNC, and simple 2D screen sharing).

Worked Examples

Example 1

1 (6 marks)

An uncompressed () digital video runs at with per color sample. Compute the raw video bit rate in () under three chroma subsampling schemes:

  1. (no subsampling)

Compute average samples per pixel for each subsampling format:

Calculate bit rates ():

Answer:
  • :
  • : ( reduction)
  • : ( reduction)
Example 2

2 (5 marks)

In a tween-based animation, a sprite starts at keyframe at position and reaches keyframe ( later) at position .

  1. Compute the sprite's interpolated position at frame () using linear tweening.
  2. Recompute the position at frame using smoothstep ease-in/ease-out , and explain the visual difference.

Linear interpolation at :

Smoothstep ease-in/ease-out at : First evaluate the easing parameter:

Now interpolate:

Because , smoothstep moves slower near the start keyframe (gradual acceleration) before speeding up in the middle, giving natural physical momentum instead of abrupt robotic motion.

Answer:
  1. Linear tween at frame : .
  2. Smoothstep ease-in/ease-out at frame : (starts slower for natural acceleration).
Example 3

3 (5 marks)

A animation runs at ( RGB). Compare the data volume required to transmit it over a network using:

  1. Uncompressed raster video frames (in , ).
  2. A symbolic vector/keyframe stream averaging (in , ).

Explain when each transmission approach is preferred.

Uncompressed raster video volume:

Symbolic keyframe stream volume and trade-off:

  • Pre-rendered video (compressed with H.264/AV1) is preferred for photorealistic CGI or thin clients lacking 3D rendering GPUs.
  • Symbolic/keyframe transmission is preferred for UI animations, vector graphics, and interactive games where ultra-low bandwidth and crisp resolution independence matter.
Answer:
  1. Uncompressed raster video ().
  2. Symbolic keyframe stream (). Symbolic streams save massive bandwidth when the client can render locally; pre-rendered compressed video suits complex CGI and thin decoders.

Exercises

Practice Exercises — Video and Animation

Question 1

Compare Component Video, S-Video, and Composite Video signal representations, and contrast the NTSC, PAL, and SECAM analog broadcast standards. Also explain the difference between progressive and interlaced scanning.

Video Signal Representations:

  • Component Video sends three completely separate channels ( or ), eliminating crosstalk for the highest analog quality.
  • S-Video separates luminance () from modulated chrominance () over two lines, preventing dot crawl.
  • Composite Video multiplexes luma, chroma, and sync on one cable, trading lowest cost for color bleeding.

NTSC vs. PAL vs. SECAM and Scanning Modes:

  • NTSC: lines ( visible), , YIQ color. PAL: lines ( visible), , YUV with phase alternation. SECAM: lines, , FM-encoded YDbDr.
  • Progressive scanning (p) draws all scan lines sequentially per frame; interlaced scanning (i) alternates odd and even half-resolution fields to halve bandwidth at the expense of motion combing.
Answer:

Component isolates all three channels (best quality), S-Video separates and , and Composite combines all signals on one wire. NTSC uses lines at , while PAL and SECAM use lines at . Progressive renders complete frames every refresh, whereas interlaced alternates odd and even fields.

Question 2

Distinguish between frame-based animation and tween-based (keyframe) animation. Explain motion tweening versus shape tweening, and list the five major methods of controlling animation.

Frame-Based vs. Tween-Based Animation:

  • Frame-based animation defines every frame manually on the timeline—offering complete pixel/cel artistic control at high authoring cost and large file size.
  • Tween-based animation specifies sparse keyframes while the computer interpolates intermediate frames—yielding small files and easy frame-rate scaling. Motion tweening interpolates position, rotation, and scale; shape tweening (morphing) interpolates outline geometry between shapes.

Five Methods of Controlling Animation:

  1. Full Explicit Control (manual keyframing/scripting).
  2. Procedural Control (physics equations, particle systems).
  3. Constraint-Based Control (Inverse Kinematics, joint/collision limits).
  4. Live-Action Tracking (optical/inertial motion capture).
  5. Interactive Control (real-time user input and state machines).
Answer:

Frame-based authors every frame individually; tween-based interpolates automatically between keyframes (via motion or shape tweening). Animation is controlled through explicit, procedural, constraint-based (IK), motion-capture, or interactive methods.

Question 3

Explain how double buffering with V-Sync prevents flicker and tearing during the display of animation, and compare pre-rendered video streaming against symbolic/keyframe transmission for delivering animation over networks.

Display of Animation (Double Buffering + V-Sync): If a program draws directly into the active display buffer while the monitor scans out pixels, the viewer sees partial frames (tearing) and erasure flicker. Double buffering renders the upcoming frame into an off-screen back buffer while the display reads the front buffer, swapping buffers atomically during the vertical blanking interval (V-Sync).

Transmission of Animation:

  • Pre-rendered video streaming sends compressed raster pixels (e.g., H.264), requiring higher bandwidth but minimal client rendering hardware.
  • Symbolic/keyframe transmission sends compact geometric objects, rigs, and interpolation curves (e.g., SVG/Lottie/glTF), using minimal bandwidth and scaling cleanly, provided the client renders frames locally.
Answer:

Double buffering + V-Sync prevents tearing and flicker by rendering into an off-screen back buffer and swapping pointers only between display refreshes. Pre-rendered video transmission sends compressed pixels (higher bandwidth, thin client), whereas symbolic/keyframe transmission sends geometry and motion parameters (minimal bandwidth, local client rendering).

Question 4

A PAL-rate Full-HD video ( pixels, , ) uses chroma subsampling.

  1. Calculate the uncompressed bit rate in ().
  2. Calculate the uncompressed storage needed for of this video in ().
  3. If compressed at a ratio, what is the compressed bit rate in ?

Uncompressed bit rate with ():

Uncompressed storage and compressed bit rate:

Answer:
  1. Uncompressed bit rate .
  2. uncompressed storage .
  3. Compressed bit rate at .
Question 5

An animated object moves and rotates linearly between Keyframe at frame () and Keyframe at frame ().

  1. Compute at frame using linear tweening.
  2. Compute the -coordinate at frame if smoothstep easing is used instead.

Linear tweening at frame ():

Smoothstep -coordinate at :

Answer:
  1. Linear tween at frame : .
  2. Smoothstep -coordinate at frame : .
← Images and GraphicsData Compression →