# US 2019/0356914 A1 · Encoding method, decoding method and device thereof

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

- Number: US 2019/0356914 A1
- Document ID: US20190356914A1
- Status: Published application
- Kind: A1
- Application number: 16/531,513
- Filed: 2019-08-05
- Published: 2019-11-21
- Earliest claimed: 2017-12-01
- Assignees: Tsinghua University
- Applicants: Tsinghua University
- Inventors: Pin Tao; Lixin Feng; Zheng Wang
- Web page: https://patentgrep.com/patent/US20190356914A1

## CPC

- H04N 19/11: among a plurality of spatial predictive coding modes
- H04N 19/124: Quantisation
- H04N 19/13: Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
- H04N 19/14: Coding unit complexity, e.g. amount of activity or edge presence estimation (H04N19/146 takes precedence)
- H04N 19/182: the unit being a pixel
- H04N 19/61: in combination with predictive coding
- H04N 19/86: involving reduction of coding artifacts, e.g. of blockiness
- H04N 19/91: Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

An image encoding method, decoding method and corresponding device, and intraframe pixel prediction method. The image encoding method comprises: a step of pixel segmentation, segmenting pixels in an image frame; a step of pixel value prediction, respectively performing a pixel value prediction process to obtain a first prediction value for each of pixels in a current block to be encoded; a step of residual calculation, calculating a residual for each of the pixels in the current block to be encoded; a step of discrete cosine transform, quantization and entropy encoding, performing discrete cosine transform, quantization and entropy encoding with respect to a residual block corresponding to the current block to be encoded obtained in the residual calculation step, wherein the quantized residual block is used in a pixel value reconstruction step at an encoding end, and the entropy encoded residual block is sent to a decoding end; and a pixel value reconstruction step, reconstructing a pixel value of the previously-encoded pixel, wherein the re-constructed pixel value is used in the pixel value prediction step. The residual calculation step comprises: calculating a first residual with respect to a pixel on the basis of the first prediction value of the pixel predicted in the pixel value prediction step and an actual value of the pixel; determining whether the first residual of the pixel is a normal residual or an abnormal residual; correcting the abnormal residual if the first residual of the pixel is an abnormal residual, the correction including recording a position of which the abnormal residual of the pixel has occurred; re-predicting the pixel to obtain a second prediction value and a corresponding second residual, and recording the re-prediction information, such that the pixel value reconstruction step of the encoding end and the decoding end can both reconstruct and decode the pixel value of the pixel on the basis of the position of which the abnormal residual of the pixel has occurred and the re-prediction information, wherein the normal residual block of the current block is formed by the residual of the pixel of the current block to be encoded after undergoing the abnormal residual correction, and is provided for further processing in the discrete cosine transform, quantization and entropy encoding step; separately encoding the position of which the abnormal residual of the pixel has occurred and the re-prediction information, wherein the encoding process is lossless, and the encoded pixel position and the re-prediction information are used in the pixel value reconstruction step and sent to the decoding end. Pixels can be re-arranged before segmentation, thereby avoiding error diffusion. In the pixel value prediction process, a prediction algorithm can be predicted first, and the pixel value is then predicted according to the determined prediction algorithm. By classifying the pixel residual into the normal residual and the abnormal residual, as well as by performing a re-prediction of the pixel of the abnormal residual, the accuracy of image encoding/decoding can be improved.

## Claims

### Claim 24

An intraframe pixel prediction method for performing prediction on a pixel within an image, comprising:
a pixel rearranging step of rearranging pixels within an image frame; and
a step of pixel value prediction of performing prediction on pixel values of respective pixels rearranged by taking a pixel as a unit.

### Claim 25 (depends on 24)

The intraframe pixel prediction method according to claim 24, wherein, the step of pixel value prediction includes:
when predicting each pixel,
determining a prediction algorithm used for the pixel and/or a parameter of the prediction algorithm; and
predicting the value of the pixel by using the prediction algorithm.

### Claim 26 (depends on 25)

The intraframe pixel prediction method according to claim 25, wherein, the determining a prediction algorithm used for the pixel includes:
determining the prediction algorithm used therefor based on prediction algorithm used for pixels in the image before rearrangement around the pixel.

### Claim 27 (depends on 25)

The intraframe pixel prediction method according to claim 25, wherein, the prediction algorithm used therefor is determined according to a position of the pixel in the rearranged image.

### Claim 28 (depends on 27)

The intraframe pixel prediction method according to claim 27, wherein, the determining a prediction algorithm used for the pixel includes:
the first prediction algorithm used therefor being JPEG-LS, if the pixel is located on the upper side or the left side in the rearranged image, otherwise, the first prediction algorithm used therefor being the template matching algorithm.

### Claim 29 (depends on 25)

The intraframe pixel prediction method according to claim 25, wherein, the prediction algorithm is selected from one of:
a template matching algorithm, a weighted template matching algorithm, a JPEG-LS prediction method, and a gradient adaptive prediction method.

### Claim 30 (depends on 24)

The intraframe pixel prediction method according to claim 24, further comprising:
a step of pixel segmentation of segmenting the rearranged pixels into blocks; and
the step of pixel value prediction of respectively performing pixel value prediction process on each pixel in a block, by using a template matching method, to obtain a first prediction value, including:
a target template obtaining step of obtaining the target template of a current pixel to be predicted;
a matching template determining step of comparing the target template with a candidate template of a search region of the frame, and determining at least one matching template in the candidate templates that matches the target template; and
determining, based on the at least one matching template, the prediction value of the pixel.

### Claim 31 (depends on 30)

The intraframe pixel prediction method according to claim 30, further comprising:
a matching index table constructing step of extracting a template feature with respect to a target template of a pixel value of which has been predicted, and constructing a Hash Table,
wherein, the matching template determining step includes extracting the feature of the target template, and locating the template matching the target template in the Hash Table based on the extracted feature.

### Claim 32 (depends on 31)

The intraframe pixel prediction method according to claim 31, wherein, the extracting the template feature includes segmenting the template into subgroups, obtaining pixel representation values of respective subgroups, and taking the pixel representation values of the respective subgroups as the feature of the template.

### Claim 33 (depends on 32)

The intraframe pixel prediction method according to claim 32, wherein, with respect to a target template of one pixel, the number of pixels within a subgroup closer to the pixel is smaller than the number of pixels within a subgroup farther away from the pixel.

### Claim 34 (depends on 33)

The intraframe pixel prediction method according to claim 33, wherein, the pixel representation values of the respective subgroups are average values of pixels of the subgroups.

### Claim 35 (depends on 31)

The intraframe pixel prediction method according to claim 31, wherein, a target template of a pixel X includes 21 pixels, which are respectively, three pixels on the left side of the pixel X, and three rows of pixels immediately on the upper side of the pixel, each of the three rows of pixels having 6 pixels, which are respectively three pixels on the left side of the pixel X, one pixel on the upper side of the pixel and two pixels on the right side of the pixel X, wherein, each of the three pixels immediately adjacent to the pixel X is a subgroup, two pixels on the leftmost side of a same row of the pixel X and two immediately adjacent pixels respectively on the upper side of the two pixels constitute one subgroup, two pixels on the rightmost side of a row prior to the row where the pixel X is located constitute one subgroup, and four pixels of each two rows above the row where the pixel X is located, among two non-adjacent rows in an order from left to right constitute one subgroup, so as to constitute eight subgroups, and the pixel representation values of the eight subgroups are taken as the template feature.

### Claim 36 (depends on 31)

The intraframe pixel prediction method according to claim 31, further comprising:
constructing a new node based on the target template and adding it to the Hash Table, if no template that matches the target template is located in the Hash Table.

### Claim 37

A computer program product comprising a non-transitory computer readable medium having instructions recorded thereon, the instructions when executed by a computer implementing an intraframe pixel prediction method, comprising:
a pixel rearranging step of rearranging pixels within an image frame; and
a step of pixel value prediction of performing prediction on pixel values of respective pixels rearranged by taking a pixel as a unit.

### Claim 38 (depends on 37)

The computer program according to claim 37, wherein, the step of pixel value prediction includes:
when predicting each pixel,
determining a prediction algorithm used for the pixel and/or a parameter of the prediction algorithm; and
predicting the value of the pixel by using the prediction algorithm.

### Claim 39 (depends on 38)

The computer program according to claim 38, wherein, the determining a prediction algorithm used for the pixel includes:
determining the prediction algorithm used therefor based on prediction algorithm used for pixels in the image before rearrangement around the pixel.

### Claim 40 (depends on 38)

The computer program according to claim 38, wherein, the prediction algorithm used therefor is determined according to a position of the pixel in the rearranged image.

### Claim 41 (depends on 40)

The computer program according to claim 40, wherein, the determining a prediction algorithm used for the pixel includes:
the first prediction algorithm used therefor being JPEG-LS, if the pixel is located on the upper side or the left side in the rearranged image, otherwise, the first prediction algorithm used therefor being the template matching algorithm.

### Claim 42 (depends on 38)

The intraframe pixel prediction method according to claim 38, wherein, the prediction algorithm is selected from one of:
a template matching algorithm, a weighted template matching algorithm, a JPEG-LS prediction method, and a gradient adaptive prediction method.

### Claim 43 (depends on 37)

The intraframe pixel prediction method according to claim 37, further comprising:
a step of pixel segmentation of segmenting the rearranged pixels into blocks; and
the step of pixel value prediction of respectively performing pixel value prediction process on each pixel in a block, by using a template matching method, to obtain a first prediction value, including:
a target template obtaining step of obtaining the target template of a current pixel to be predicted;
a matching template determining step of comparing the target template with a candidate template of a search region of the frame, and determining at least one matching template in the candidate templates that matches the target template; and
determining, based on the at least one matching template, the prediction value of the pixel.
