This question is regarding the following video by google developers (after 11:20 mins) . He explains how a markov probability updated table can be used to do compression. Since it's a dynamic probability table, we get an output stream whose literal to binary sequence mapping changes with more information of the stream. As he then points out, it's not possible to decode this stream because we do not have the probability table itself that was used to encode this. So he says that using a escape code we can signal to the decoder that we now have to read off the next literal in full. I'm completely lost after that. For the first example without escape codes, this is my understanding: for an input stream of $ABB$, the output binary sequence goes like this:
- We read $A$, which is the first in the stream. So we give full 100% probability to it. Which then leads to a Huffman tree with $A$ being assigned to binary $0$.
Output stream: $0$
- Next we read $B$, which is also the first of its kind. Leads to the probability table being 50% each now. The binary codes remain the same and Huffman tree has a $B$ to $1$ mapping.
Output stream: $01$
- The next B tilts the probability table and $B$ = $0$, $A$ = $1$.
Output stream: $010$
Obviously this output stream: $010$ cannot be decoded without the probability table initially. So then how does the escape code help in this scenario?