VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

How Compression Works | Streaming — What Changes When the Future Has Not Arrived Yet?

What if the compressor has to speak before it knows how the story ends?

Give an offline compressor a complete file and it can inspect the ending before deciding how to encode the beginning. It can count frequencies, build a global dictionary, choose block boundaries and compare alternative models.

A live stream is different.

The next packet has not arrived. Tomorrow’s sensor reading does not exist yet. The speaker is still talking. The game is still running.

Compression now operates under causality: decide with the past and present, not the unavailable future.

Quick Read

  • Streaming compression processes data incrementally rather than requiring the entire object first.
  • The encoder cannot use future observations unless it buffers and waits.
  • More buffering can improve modelling but increases latency and memory.
  • Adaptive models learn source statistics as the stream arrives.
  • Encoder and decoder must update state in the same order.
  • Framing and restart points matter because streams can be interrupted or joined mid-way.
  • The optimal offline representation may be impossible or undesirable in a real-time system.

The One-Sentence Answer

Streaming compression must make coding decisions using only information available so far, trading potential global compression gains for bounded memory, low latency and the ability to produce output before the source is complete.

Offline Compression Gets to Read the Last Page First

Suppose a file contains one million symbols. An offline compressor can count every symbol before emitting anything. It knows the exact empirical distribution of the complete block.

It may discover that a phrase appearing rarely at the beginning becomes extremely common later. It can optimise with hindsight.

A streaming compressor at symbol 100 does not know this future.

It has to learn while acting.

Causality Is an Information Constraint

We often think of constraints as storage or CPU limits. Streaming introduces another: unavailable information.

The future cannot be used because it has not happened yet.

This sounds trivial until we notice how many offline optimisations depend on global knowledge: optimal partitions, global frequency tables, full-file transforms, corpus-wide ordering and expensive search across the complete object.

Streaming changes the feasible algorithm, not merely its speed.

Buffering Buys a Small Piece of the Future

A streaming system can wait.

Buffer one second of audio and the encoder sees one second ahead before committing output. Buffer a full video segment and it can optimise across that segment.

But waiting creates latency.

more lookahead → potentially better decisions → more delay

For archival compression, minutes of delay may be irrelevant. For a live conversation, even hundreds of milliseconds matter.

One Pass Changes the Search

An offline encoder may make several passes: first analyse, then model, then encode. A one-pass stream cannot rewind an infinite source.

This favours algorithms that update incrementally. Counts evolve. Dictionaries grow. Predictions adapt. Decisions become irreversible once transmitted unless the protocol supports correction.

Streaming is therefore compression under commitment.

Adaptive Models Are Natural Stream Companions

At the beginning of a stream, the model may know little. As data arrives, it learns symbol frequencies, repeated phrases or predictive contexts.

The decoder observes the same reconstructed history and can update the same model.

This lets model knowledge emerge without sending a giant table first.

The cost is cold start: early parts of the stream may compress worse while the model learns.

A Stream Can Change Personality

Live data is often non-stationary.

A network stream moves from text to images. A sensor enters a different operating regime. A conversation switches language. A game changes scene.

The compressor must adapt without knowing exactly when the regime changes.

Remember too much and stale statistics linger. Forget too quickly and stable patterns never accumulate.

Streaming makes memory policy visible.

Latency Can Matter More Than Ratio

Suppose Codec A reduces a live stream by 45% but adds two seconds of delay. Codec B reduces it by 35% and adds 20 milliseconds.

For a backup transfer, A may win. For interactive speech, B may be vastly better.

Compression is receiver-relative and deadline-relative. A byte saved after the useful moment may be worthless.

Streaming Needs Boundaries

A receiver joining an endless stream cannot necessarily begin at the beginning.

It needs framing, headers, synchronisation markers, periodic model resets or checkpoints so decoding can begin from a reachable state.

Those additions cost bits. They buy joinability and recovery.

This is useful redundancy returning because the operating environment demands it.

Packet Loss Changes the Design

If one compressed packet is lost and every later packet depends on its decoded state, the stream may remain broken indefinitely.

Practical systems bound dependency, insert recovery points or use transport and error-control mechanisms so the receiver can resynchronise.

A slightly worse ratio can create a dramatically more robust stream.

Streaming Video Is a Negotiation With Time

Video encoders exploit spatial and temporal structure while meeting frame deadlines. They may look ahead a limited number of frames, choose reference frames and allocate computation according to scene complexity.

But live video cannot perform arbitrarily expensive whole-movie optimisation because the movie has not finished.

Archival encoding can spend far more time because the complete sequence exists.

Same content class. Different temporal contract.

Sensors Cannot Wait for Tomorrow

A remote sensor may generate data continuously for years. There is no natural “complete file” to analyse first.

Compression must operate online with bounded memory and power. It may exploit recent trends, periodicity and learned baselines while emitting data continuously.

Streaming is not a compromised version of offline compression. For endless sources, it is the only meaningful form.

Human Conversation Is Streaming Communication

When you speak, you usually do not know your exact final sentence before beginning it.

You produce language incrementally. The listener updates context incrementally. Pronouns, ellipsis and shorthand exploit what has already been established.

If misunderstanding appears, conversation adds repair: “No, I meant the other one.”

Human dialogue is a live codec with feedback.

Writing Is More Offline

A writer can draft the ending, return to the opening and revise earlier sentences so the whole piece becomes tighter.

That is an offline advantage. The complete object can influence every part.

Editing is partly global compression: after seeing the whole, the writer discovers which earlier words were unnecessary.

Education: Exams Are Streaming Decisions

During an examination, a student cannot know every later question before allocating time to the first one—unless they deliberately scan the paper first.

Scanning is lookahead. It costs initial time but improves global planning.

The analogy is useful: more future information can improve present decisions, but acquiring it may itself consume time.

Primary School: Tell the Story One Card at a Time

Reveal picture cards one at a time and ask pupils to describe the developing story without knowing the next card.

Then reveal all cards at once and let them rewrite the description.

The second version can use global structure the first could not know.

Secondary School: Online Versus Offline Coding

Give one group a complete symbol sequence before designing a code. Give another group the sequence one symbol at a time and require immediate coding decisions.

Compare the strategies. Students experience the value of future knowledge directly.

JC and Beyond: Competitive and Online Thinking

Computer science studies online algorithms that make decisions without full future input and compares their performance with an offline optimum that sees the entire sequence.

Streaming compression belongs to this broader family of problems. The interesting question is not only how small the final output becomes, but how close an online method can get while respecting memory, delay and causality constraints.

A Streaming Checklist

  1. How much future lookahead is available?
  2. How much latency can the application tolerate?
  3. How much data can be buffered?
  4. Can the source distribution change?
  5. How quickly should the model adapt?
  6. Can receivers join mid-stream?
  7. How does the system recover after loss or corruption?
  8. Is one-pass operation required?

The Deeper Point

Offline compression asks what the best description is after the object exists.

Streaming compression asks something harder:

What is the best description I can commit to now, before I know what comes next?

That is compression under time’s arrow.

Discover more from eduKate Singapore

Subscribe now to keep reading and get access to the full archive.

Continue reading