# US 12,120,352 B2 · Method and apparatus for decoding a video signal

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

- Number: US 12,120,352 B2
- Document ID: US12120352B2
- Status: Granted
- Kind: B2
- Application number: 17/208,100
- Filed: 2021-03-22
- Published: 2021-07-08
- Granted: 2024-10-15
- Earliest claimed: 2009-06-07
- Assignees: LG Electronics Inc.
- Applicants: LG Electronics Inc.
- Inventors: Jung Sun Kim; Seung Wook Park; Young Hee Choi; Jaewon Sung; Byeong Moon Jeon; Joon Young Park
- Web page: https://patentgrep.com/patent/US12120352B2

## CPC

- H04N 19/61: in combination with predictive coding
- H04N 19/119: Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
- H04N 19/122: Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
- H04N 19/129: Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
- H04N 19/149: by estimating the code amount by means of a model, e.g. mathematical model or statistical model
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/18: the unit being a set of transform coefficients
- H04N 19/625: using discrete cosine transform [DCT]
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present invention relates to a method for decoding a video signal, comprising the steps of: acquiring a transform size flag of the current macroblock from a video signal; checking the number of non-zero transform coefficients at each pixel position in a first transform block which corresponds to the transform size flag; changing a scan order of the first transform block by prioritizing the position of the pixel having the greatest number of the non-zero transform coefficients in the first transform block; determining the number of the non-zero transform coefficients at each pixel position in a second transform block, and setting the changed scan order of the first transform block as an initialized scan order of the second transform block; adding the number of the non-zero transform coefficients at each pixel position in the first transform block and the number of the non-zero transform coefficients at each pixel position in the second transform block, and changing the scan order of the second transform block by prioritizing the position of the pixel having the greatest number of the non-zero transform coefficients; and decoding the transform coefficients arranged in the scan order changed in the previous step, wherein the first transform block and the second transform block have sizes corresponding to the transform size flag, and are contained in the current macroblock.

## Claims

### Claim 1

A method for encoding a video signal by an encoding apparatus, the method comprising:
obtaining a prediction value of a current block by using inter prediction or intra prediction;
obtaining residual information of the current block based on the prediction value; and
encoding the current block by performing a first transform or a second transform based on the residual information,
wherein the encoding the current block comprises:
obtaining flag information indicating whether the current block includes a transform coefficient level not equal to 0;
obtaining transform type information indicating a transform type, the transform type specifying one among a first transform kernel for the first transform and a second transform kernel for the second transform, the first transform kernel being different from the second transform kernel; and
encoding the current block by using the first transform or the second transform based on the flag information and the transform type information,
wherein the current block is encoded by using the first transform based on that the transform type information has a value of 0 or the current block is not an intra block,
wherein the current block is encoded by using the second transform based on that the transform type information has a value of 1 and the current block is an intra block,
wherein a transform size equal to a size of a block for intra prediction is used based on intra prediction being used for the current block, and
wherein whether to use the first transform or the second transform is determined differently based on whether the intra prediction is used for the current block.

### Claim 2

A method for decoding a video signal by a decoding apparatus, the method comprising:
obtaining a prediction value of a current block by using inter prediction or intra prediction;
obtaining encoded residual information of the current block from a video signal; and
decoding the current block by performing a first transform or a second transform based on the encoded residual information,
wherein the decoding the current block comprises:
obtaining flag information indicating whether the current block includes a transform coefficient level not equal to 0;
obtaining transform type information indicating a transform type, the transform type specifying one among a first transform kernel for the first transform and a second transform kernel for the second transform, the first transform kernel being different from the second transform kernel; and
decoding the current block by using the first transform or the second transform based on the flag information and the transform type information,
wherein the current block is decoded by using the first transform based on that the transform type information has a value of 0 or the current block is not an intra block,
wherein the current block is decoded by using the second transform based on that the transform type information has a value of 1 and the current block is an intra block,
wherein a transform size equal to a size of a block for intra prediction is used based on intra prediction being used for the current block, and
wherein whether to use the first transform or the second transform is determined differently based on whether the intra prediction is used for the current block.

### Claim 3 (depends on 1)

A non-transitory computer-readable recording medium storing the bitstream generated by the method of claim 1.
