# US 12,184,309 B2 · Dynamic content encoding

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,184,309 B2
- Document ID: US12184309B2
- Status: Granted
- Kind: B2
- Application number: 18/077,196
- Filed: 2022-12-07
- Published: 2023-10-26
- Granted: 2024-12-31
- Earliest claimed: 2022-04-26
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Christian T. Martelock; Ali Sazegari; Eric Bainville
- Web page: https://patentgrep.com/patent/US12184309B2

## CPC

- H03M 7/30: Compression (speech analysis-synthesis for redundancy reduction G10L19/00; for image communication H04N); Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- G06F 40/211: Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
- H03M 7/3071: {Prediction}
- H03M 7/3079: {Context modeling}
- H03M 7/42: using table look-up for the coding or decoding process, e.g. using read-only memory {(H03M7/4006 takes precedence)}
- H03M: CODING; DECODING; CODE CONVERSION IN GENERAL (using fluidic means F15C4/00; optical analogue/digital converters G02F7/00; coding, decoding or code conversion, specially adapted for particular applications, see the relevant subclasses, e.g. G01D, G01R, G06F, G06T, G09G, G10L, G11B, G11C, H04B, H04L, H04M, H04N; ciphering or deciphering for cryptography or other purposes involving the need for secrecy G09C)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for encoding text includes grouping text as a sequence of bytes, the text comprising a string of characters, each byte corresponding to a character in the text. For each byte of the sequence of bytes: (a) each bit is processed from most significant bit to least significant bit to generate a context; and (b) a subsequent bit is predicted, using a prediction model, based on the context generated based on previously processed bits, prediction of the prediction model being a combination of predictions of a plurality of sub-models. An encoded bitstream is output based on the predicted bits. The encoded bitstream includes encoded data corresponding to the text.

## Claims

### Claim 1

A method, comprising:
grouping text as a sequence of bytes, the text comprising a string of characters, each byte corresponding to a character in the text;
for each byte of the sequence of bytes:
processing each bit from most significant bit to least significant bit to generate a context; and
predicting a subsequent bit, using a prediction model, based on the context generated based on previously processed bits, prediction of the prediction model being a combination of predictions of a plurality of sub-models; and
outputting an encoded bitstream based on the predicted bits, the encoded bitstream comprising encoded data corresponding to the text.

### Claim 2 (depends on 1)

The method of claim 1, wherein predicting the subsequent bit comprises generating a probability, using each of the plurality of sub-models, that the subsequent bit is 1 using a corresponding pre-determined number of previously processed bits as context, the probability being determined by a hash table lookup for the corresponding sub-model.

### Claim 3 (depends on 1)

The method of claim 1, wherein at least one of the plurality of sub-models predicts a subsequent character based on a previously processed string of characters in the text.

### Claim 4 (depends on 1)

The method of claim 1, wherein each of the plurality of sub-models is static model and is pre-trained using a known data set.

### Claim 5 (depends on 1)

The method of claim 1, wherein the combination of predictions of the plurality of sub-models comprises combining different order predictions using a 3D function, each of the different order predictions obtained by combining a corresponding subset of sub-models among the plurality of sub-models.

### Claim 6 (depends on 5)

The method of claim 5, wherein a low order prediction is based on a sub-model that uses one previously processed bit as a context for predicting the subsequent bit.

### Claim 7 (depends on 5)

The method of claim 5, wherein combining the predictions of a first subset is performed using a medium order 3D function, and combining the predictions of a second subset is performed using a high order 3D function.

### Claim 8 (depends on 1)

The method of claim 1, wherein the outputted encoded bitstream comprises a first encoded portion indicating a size of the data being encoded, a single bit indicating whether the data is compressed, and a third encoded portion encoding the data corresponding to the text.

### Claim 9

A non-transitory computer-readable medium including instructions, which when executed by at least one computing device, cause the at least one computing device to perform operations including:
grouping text as a sequence of bytes, the text comprising a string of characters, each byte corresponding to a character in the text;
for each byte of the sequence of bytes:
processing each bit from most significant bit to least significant bit to generate a context; and
predicting a subsequent bit, using a prediction model, based on the context generated based on previously processed bits, prediction of the prediction model being a combination of predictions of a plurality of sub-models; and
outputting an encoded bitstream based on the predicted bits, the encoded bitstream comprising encoded data corresponding to the text.

### Claim 10 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein predicting the subsequent bit comprises generating a probability, using each of the plurality of sub-models, that the subsequent bit is 1 using a corresponding pre-determined number of previously processed bits as context, the probability being determined by a hash table lookup for the corresponding sub-model.

### Claim 11 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein at least one of the plurality of sub-models predicts a subsequent character based on a previously processed string of characters in the text.

### Claim 12 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein each of the plurality of sub-models is static model and is pre-trained using a known data set.

### Claim 13 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the combination of predictions of the plurality of sub-models comprises combining different order predictions using a 3D function, each of the different order predictions obtained by combining a corresponding subset of sub-models among the plurality of sub-models.

### Claim 14 (depends on 13)

The non-transitory computer-readable medium of claim 13, wherein a low order prediction is based on a sub-model that uses one previously processed bit as a context for predicting the subsequent bit.

### Claim 15 (depends on 13)

The non-transitory computer-readable medium of claim 13, wherein combining the predictions of a first subset is performed using a medium order 3D function, and combining the predictions of a second subset is performed using a high order 3D function.

### Claim 16 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the outputted encoded bitstream comprises a first encoded portion indicating a size of the data being encoded, a single bit indicating whether the data is compressed, and a third encoded portion encoding the data corresponding to the text.

### Claim 17

A device including an input, an output, a memory and at least one processor communicatively coupled to the memory, the at least one processor configured to:
group text as a sequence of bytes, the text comprising a string of characters, each byte corresponding to a character in the text;
for each byte of the sequence of bytes:
process each bit from most significant bit to least significant bit to generate a context; and
predict a subsequent bit, using a prediction model, based on the context generated based on previously processed bits, prediction of the prediction model being a combination of predictions of a plurality of sub-models; and
output an encoded bitstream based on the predicted bits, the encoded bitstream comprising encoded data corresponding to the text.

### Claim 18 (depends on 17)

The device of claim 17, wherein predicting the subsequent bit comprises generating a probability, using each of the plurality of sub-models, that the subsequent bit is 1 using a corresponding pre-determined number of previously processed bits as context, the probability being determined by a hash table lookup for the corresponding sub-model.

### Claim 19 (depends on 17)

The device of claim 17, wherein the combination of predictions of the plurality of sub-models comprises combining different order predictions using a 3D function, each of the different order predictions obtained by combining a corresponding subset of sub-models among the plurality of sub-models.

### Claim 20 (depends on 17)

The device of claim 17, wherein the outputted encoded bitstream comprises a first encoded portion indicating a size of the data being encoded, a single bit indicating whether the data is compressed, and a third encoded portion encoding the data corresponding to the text.
