# US 2006/0050975 A1 · Image encoding apparatus and method, computer program, and computer-readable storage medium

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

- Number: US 2006/0050975 A1
- Document ID: US20060050975A1
- Status: Published application
- Kind: A1
- Application number: 11/220,541
- Filed: 2005-09-08
- Published: 2006-03-09
- Earliest claimed: 2004-09-08
- Assignees: Canon Kabushiki Kaisha
- Inventors: Naoki Ito; Hirokazu Tamura
- Web page: https://patentgrep.com/patent/US20060050975A1

## CPC

- H04N 19/124: Quantisation
- H04N 19/15: by monitoring actual compressed data size at the memory before deciding storage at the transmission buffer
- H04N 19/192: the adaptation method, adaptation tool or adaptation type being iterative or recursive
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

According to this invention, encoded data of a target data amount is generated by one image input operation while both lossless encoding and lossy encoding are adopted. For this purpose, an encoding sequence control unit controls a first encoding unit for lossy (JPEG) encoding, a second encoding unit for lossless (JPEG-LS) encoding, first and second memories, and a re-encoding unit, and stores, in a first memory, encoded data of a target data amount or less that contains both losslessly and lossily encoded data. A correction unit corrects, of encoded data stored in the first memory, encoded data of an isolated type to the type of neighboring encoded data, and outputs the corrected data.

## Claims

### Claim 1

An image encoding apparatus which receives image data and encodes the image data, comprising:
first encoding means for lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data;
second encoding means for losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data;
first storage means for storing, of the encoded data generated by said first encoding means and said second encoding means, encoded data of a shorter encode length in a predetermined first memory;
second storage means for storing the losslessly encoded data generated by said second encoding means in a predetermined second memory;
re-encoding means for decoding the losslessly encoded data in the second memory, re-encoding the decoded data in accordance with a second parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the first memory;
monitoring means for monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount;
parameter update means for, when said monitoring means determines that the encoded data amount has exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, (b) updating the first parameter set for said first encoding means to a parameter having a high compression ratio, and causing said first encoding means to continue encoding of the image data, and (c) setting, as the second parameter, the same parameter as the updated first parameter for said re-encoding means, and causing said re-encoding means to ret-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount; and
correction means for, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 2 (depends on 1)

The apparatus according to claim 1, wherein JPEG is used for encoding by said first encoding means, and JPEG-LS is used for encoding by said second encoding means.

### Claim 3 (depends on 1)

The apparatus according to claim 1, wherein, if the isolated encoded data is losslessly encoded data, said correction means corrects the losslessly encoded data to lossily encoded data.

### Claim 4 (depends on 3)

The apparatus according to claim 3, wherein, if the isolated encoded data is losslessly encoded data and an encoded data amount of the isolated encoded data is not less than a predetermined threshold, said correction means corrects the losslessly encoded data to lossily encoded data.

### Claim 5 (depends on 3)

The apparatus according to claim 3, wherein, if the isolated encoded data is lossily encoded data, said correction means outputs, as a correction result, losslessly encoded data of a pixel block at a corresponding position in the second memory.

### Claim 6

An image encoding method of receiving image data, and compression-encoding and outputting the image data, comprising:
a first encoding step of lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data;
a second encoding step of losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data;
a first storage step of storing, of the encoded data generated in the first encoding step and the second encoding step, encoded data of a shorter encode length in a predetermined first memory;
a second storage step of storing the losslessly encoded data generated in the second encoding step in a predetermined second memory;
a re-encoding step of decoding the losslessly encoded data in the second memory, re-encoding the decoded data in accordance with a second parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the first memory;
a monitoring step of monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount;
a parameter update step of, when the encoded data amount is determined in the monitoring step to have exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, (b) updating the first parameter set for the first encoding step to a parameter having a high compression ratio to continue encoding of the image data, and (c) setting, as the second parameter, the same parameter as the updated first parameter for the re-encoding step to re-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount; and
a correction step of, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 7

A computer program which is loaded and executed by a computer and functions as an image encoding apparatus for receiving image data, and compression-encoding and outputting the image data, functioning as
first encoding means for lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data,
second encoding means for losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data,
first storage means for storing, of the encoded data generated by said first encoding means and said second encoding means, encoded data of a shorter encode length in a predetermined first memory,
second storage means for storing the losslessly encoded data generated by said second encoding means in a predetermined second memory,
re-encoding means for decoding the losslessly encoded data in the second memory, re-encoding the decoded data in accordance with a second parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the first memory,
monitoring means for monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount,
parameter update means for, when said monitoring means determines that the encoded data amount has exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, (b) updating the first parameter set for said first encoding means to a parameter having a high compression ratio, and causing said first encoding means to continue encoding of the image data, and (c) setting, as the second parameter, the same parameter as the updated first parameter for said re-encoding means, and causing said re-encoding means to re-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount, and
correction means for, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 8 (depends on 7)

A computer-readable storage medium storing a computer program defined in claim 7.

### Claim 9

An image encoding apparatus which receives image data and encodes the image data, comprising:
first encoding means for lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data;
second encoding means for lossily encoding input image data for the predetermined pixel block in accordance with a second parameter higher in compression ratio than the first parameter to generate lossily encoded data;
third encoding means for losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data;
first storage means for storing, of the encoded data generated by said first encoding means and said third encoding means, encoded data of a shorter encode length in a predetermined first memory;
second storage means for storing, of the encoded data generated by said second encoding means and said third encoding means, encoded data of a shorter encode length in a predetermined second memory;
third storage means for storing the losslessly encoded data generated by said third encoding means in a predetermined third memory;
re-encoding means for decoding the losslessly encoded data in the third memory, re-encoding the decoded data in accordance with a third parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the second memory;
monitoring means for monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount;
parameter update means for, when said monitoring means determines that the encoded data amount has exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, and transferring the encoded data in the second memory to the first memory, (b) updating the first parameter set for said first encoding means to the second parameter set for said second encoding means, and causing said first encoding means to continue encoding of the image data, (c) discarding the encoded data in the second memory, updating the second parameter set for said second encoding means to a parameter having a high compression ratio, and causing said second encoding means to continue encoding, and (d) setting, as the third parameter, the same parameter as the updated second parameter for said re-encoding means, and causing said re-encoding means to re-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount; and
correction means for, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein JPEG is used for encoding by said first encoding means and said second encoding means, and JPEG-LS is used for encoding by said third encoding means.

### Claim 11 (depends on 9)

The apparatus according to claim 9, wherein, if the isolated encoded data is losslessly encoded data, said correction means corrects the losslessly encoded data to lossily encoded data.

### Claim 12 (depends on 11)

The apparatus according to claim 11, wherein, if the isolated encoded data is losslessly encoded data and an encoded data amount of the isolated encoded data is not less than a predetermined threshold, said correction means corrects the losslessly encoded data to lossily encoded data.

### Claim 13 (depends on 11)

The apparatus according to claim 11, wherein if the isolated encoded data is lossily encoded data, said correction means outputs, as a correction result, losslessly encoded data of a pixel block at a corresponding position in the second memory.

### Claim 14

An image encoding method of receiving image data, and compression-encoding and outputting the image data, comprising:
a first encoding step of lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data;
a second encoding step of lossily encoding input image data for the predetermined pixel block in accordance with a second parameter higher in compression ratio than the first parameter to generate lossily encoded data;
a third encoding step of losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data;
a first storage step of storing, of the encoded data generated in the first encoding step and the third encoding step, encoded data of a shorter encode length in a predetermined first memory;
a second storage step of storing, of the encoded data generated in the second encoding step and the third encoding step, encoded data of a shorter encode length in a predetermined second memory;
a third storage step of storing the losslessly encoded data generated in the third encoding step in a predetermined third memory;
a re-encoding step of decoding the losslessly encoded data in the third memory, re-encoding the decoded data in accordance with a third parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the second memory;
a monitoring step of monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount;
a parameter update step of, when the encoded data amount is determined in the monitoring step to have exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, and transferring the encoded data in the second memory to the first memory, (b) updating the first parameter set for the first encoding step to the second parameter set for the second encoding step to continue encoding of the image data, (c) discarding the encoded data in the second memory, and updating the second parameter set for the second encoding step to a parameter having a high compression ratio to continue encoding, and (d) setting, as the third parameter, the same parameter as the updated second parameter for the re-encoding step to re-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount; and
a correction step of, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 15

A computer program which is loaded and executed by a computer and functions as an image encoding apparatus for receiving image data, and compression-encoding and outputting the image data, functioning as
first encoding means for lossily encoding input image data for each predetermined pixel block in accordance with a first parameter to generate lossily encoded data,
second encoding means for lossily encoding input image data for the predetermined pixel block in accordance with a second parameter higher in compression ratio than the first parameter to generate lossily encoded data,
third encoding means for losslessly encoding input image data for the predetermined pixel block to generate losslessly encoded data,
first storage means for storing, of the encoded data generated by said first encoding means and said third encoding means, encoded data of a shorter encode length in a predetermined first memory,
second storage means for storing, of the encoded data generated by said second encoding means and said third encoding means, encoded data of a shorter encode length in a predetermined second memory,
third storage means for storing the losslessly encoded data generated by said third encoding means in a predetermined third memory,
re-encoding means for decoding the losslessly encoded data in the third memory, re-encoding the decoded data in accordance with a third parameter to generate lossily encoded data, and storing, of the lossily encoded data obtained after re-encoding and the losslessly encoded data before re-encoding, encoded data of a shorter encode length in the second memory,
monitoring means for monitoring an encoded data amount in the first memory and determining whether the encoded data amount has exceeded a predetermined data amount,
parameter update means for, when said monitoring means determines that the encoded data amount has exceeded the predetermined data amount, (a) discarding the encoded data in the first memory, and transferring the encoded data in the second memory to the first memory, (b) updating the first parameter set for said first encoding means to the second parameter set for said second encoding means, and causing said first encoding means to continue encoding of the image data, (c) discarding the encoded data in the second memory, updating the second parameter set for said second encoding means to a parameter having a high compression ratio, and causing said second encoding means to continue encoding, and (d) setting, as the third parameter, the same parameter as the updated second parameter for said re-encoding means, and causing said re-encoding means to re-encode losslessly encoded data obtained before the encoded data amount exceeds the predetermined data amount, and
correction means for, when an encoding process for one page is completed, correcting, of encoded data of pixel blocks that are stored in the first memory, isolated encoded data of a type different from a type of neighboring encoded data to the type of the neighboring encoded data.

### Claim 16 (depends on 15)

A computer-readable storage medium storing a computer program defined in claim 15.

### Claim 17 (depends on 1)

An image forming apparatus which receives a document image and forms a visible image on a predetermined printing medium, comprising:
an image encoding apparatus defined in claim 1 which encodes input document image data;
storage means for storing encoded data generated by said image encoding apparatus;
decoding means for decoding the encoded data stored in said storage means; and
image forming means for forming an image on the basis of image data obtained by said decoding means.
