# US 2019/0320193 A1 · Video transcoding method, computer device, and storage medium

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

- Number: US 2019/0320193 A1
- Document ID: US20190320193A1
- Status: Published application
- Kind: A1
- Application number: 16/436,570
- Filed: 2019-06-10
- Published: 2019-10-17
- Earliest claimed: 2017-10-10
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Xunan MAO; Haixu HAN; Xinwei GAO; Chenchen GU; Jian HE; Jingchang CHEN
- Web page: https://patentgrep.com/patent/US20190320193A1

## CPC

- H04N 19/40: using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
- H04N 19/124: Quantisation
- H04N 19/136: Incoming video signal characteristics or properties
- H04N 19/14: Coding unit complexity, e.g. amount of activity or edge presence estimation (H04N19/146 takes precedence)
- H04N 19/172: the region being a picture, frame or field
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/196: being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters (processing of motion vectors H04N19/513)
- H04N 19/146: Data rate or code amount at the encoder output
- H04N 21/2343: involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements {(video transcoding H04N19/40; media packet handling at the source H04L65/762)}
- H04N 21/4402: involving reformatting operations of video signals for household redistribution, storage or real-time display {(details of conversion of video standards at pixel level H04N7/01; video transcoding H04N19/40; adapting incoming signals to the display format of the display terminal G09G5/005; media handling at the source in data packet switching networks H04L65/764)}
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A video transcoding method is described. A computer device obtains at least one initial quantization parameter used to encode at least one initial coding unit for generating an initial compressed video, and determines, according to the at least one initial quantization parameter, a current reference quantization parameter corresponding to a current coding unit in a current video frame that is generated by decoding the initial compressed video. The computer device determines an estimated quantization parameter for encoding the current coding unit, determines a first difference between the current reference quantization parameter and the estimated quantization parameter, and sets a target quantization parameter to be equal to or greater than the estimated quantization parameter according to the first difference. The computer device encodes the current coding unit according to the target quantization parameter.

## Claims

### Claim 1

A video transcoding method, comprising:
obtaining, by a computer device, at least one initial quantization parameter used to encode at least one initial coding unit for generating an initial compressed video;
determining, by the computer device according to the at least one initial quantization parameter, a current reference quantization parameter corresponding to a current coding unit in a current video frame that is generated by decoding the initial compressed video;
determining, by the computer device, an estimated quantization parameter for encoding the current coding unit;
determining, by the computer device, a first difference between the current reference quantization parameter and the estimated quantization parameter;
setting a target quantization parameter to be equal to or greater than the estimated quantization parameter according to the first difference; and
encoding, by the computer device, the current coding unit according to the target quantization parameter.

### Claim 2 (depends on 1)

The method according to claim 1, wherein
the obtaining the at least one initial quantization parameter comprises:
obtaining, by the computer device, a target initial decoded frame matching the current video frame;
obtaining, by the computer device, a target initial coding unit matching the current coding unit in the target initial decoded frame; and
obtaining an initial quantization parameter used to encode the target initial coding unit, and
the determining the current reference quantization parameter comprises:
determining, by the computer device according to the initial quantization parameter used to encode the target initial coding unit, the current reference quantization parameter corresponding to the current coding unit.

### Claim 3 (depends on 1)

The method according to claim 1, wherein
the obtaining the at least one initial quantization parameter comprises:
obtaining, by the computer device, a target initial decoded frame matching the current video frame; and
obtaining, by the computer device, initial quantization parameters used to encode initial coding units in the target initial decoded frame, and
the determining the current reference quantization parameter comprises:
sorting, by the computer device, the initial quantization parameters according to an ascending or descending order to obtain a sorted result; and
determining, according to the sorted result, the current reference quantization parameter.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the determining, according to the sorted result, the current reference quantization parameter comprises:
determining, by the computer device, a smallest one of the initial quantization parameters as the current reference quantization parameter.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the determining the current reference quantization parameter comprises:
identifying an initial video coding standard corresponding to the initial compressed video;
identifying a current video coding standard corresponding to encoding the current video frame;
determining, by the computer device, a mapping relationship of a first quantization parameter according to the initial video coding standard and a second quantization parameter according to the current video coding standard; and
obtaining, by the computer device, the current reference quantization parameter according to the initial quantization parameter and the mapping relationship.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the setting the target quantization parameter comprises:
when the first difference is greater than a preset threshold,
obtaining, by the computer device, an adjustment coefficient,
calculating a quantization parameter increment according to the adjustment coefficient and the first difference, and
calculating, by the computer device, the target coding quantization parameter according to the quantization parameter increment and the estimated quantization parameter.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
determining, by the computer device, an average reference quantization parameter of initial quantization parameters used to encode an initial video frame that corresponds to the current video frame,
wherein the obtaining the adjustment coefficient comprises:
calculating, by the computer device, a second difference between the average reference quantization parameter and the current reference quantization parameter; and
calculating, by the computer device, the adjustment coefficient according to the second difference, the adjustment coefficient and the second difference being positively correlated.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the determining the average reference quantization parameter comprises:
obtaining, by the computer device, the initial quantization parameters used to encode coding units in the initial video frame;
calculating an average value of the initial quantization parameters used to encode the coding units in the initial video frame; and
determining, by the computer device, the average value as the average reference quantization parameter.

### Claim 9 (depends on 6)

The method according to claim 6, further comprising:
determining, by the computer device, a frame average reference quantization parameter of quantization parameters used to encode coding units in the current video frame for generating the initial compressed video;
determining, by the computer device, a video average reference quantization parameter of quantization parameters used to encode coding units in plural video frames for generating the initial compressed video;
when a third difference between the video average quantization parameter and the frame average quantization parameter is greater than a preset parameter, classifying, by the computer device, the current video frame as a first type of video frame; and
when the third difference between the video average quantization parameter and the frame average quantization parameter is less than or equal to the preset parameter, classifying, by the computer device, the current video frame as a second type of video frame,
wherein the obtaining the adjustment coefficient and the calculating the quantization parameter increment comprises:
when the current video frame is classified as the first type of video frame, obtaining, by the computer device, a first adjustment coefficient, and calculating the quantization parameter increment according to the first adjustment coefficient and the second difference; and
when the current video frame is classified as the second type of video frame, obtaining, by the computer device, a second adjustment coefficient, and calculating the quantization parameter increment according to the second adjustment coefficient and the second difference.

### Claim 10

A computer device, comprising:
processing circuitry configured to:
obtain at least one initial quantization parameter used to encode at least one initial coding unit for generating an initial compressed video;
determine, according to the at least one initial quantization parameter, a current reference quantization parameter corresponding to a current coding unit in a current video frame that is generated by decoding the initial compressed video;
determine an estimated quantization parameter for encoding the current coding unit;
determine a first difference between the current reference quantization parameter and the estimated quantization parameter;
set a target quantization parameter to be equal to or greater than the estimated quantization parameter according to the first difference; and
encode the current coding unit according to the target quantization parameter.

### Claim 11 (depends on 10)

The computer device according to claim 10, wherein the processing circuitry configured to:
obtain a target initial decoded frame matching the current video frame;
obtain a target initial coding unit matching the current coding unit in the target initial decoded frame;
obtain an initial quantization parameter used to encode the target initial coding unit; and
determine, according to the initial quantization parameter used to encode the target initial coding unit, the current reference quantization parameter corresponding to the current coding unit.

### Claim 12 (depends on 10)

The computer device according to claim 10, wherein the processing circuitry configured to:
obtain a target initial decoded frame matching the current video frame; and
obtain initial quantization parameters used to encode initial coding units in the target initial decoded frame; and
sort the initial quantization parameters according to an ascending or descending order to obtain a sorted result; and
determine, according to the sorted result, the current reference quantization parameter.

### Claim 13 (depends on 12)

The computer device according to claim 12, wherein the processing circuitry configured to:
determine a smallest one of the initial quantization parameters as the current reference quantization parameter.

### Claim 14 (depends on 10)

The computer device according to claim 10, wherein the processing circuitry configured to:
identify an initial video coding standard corresponding to the initial compressed video;
identify a current video coding standard corresponding to encoding the current video frame;
determine a mapping relationship of a first quantization parameter according to the initial video coding standard and a second quantization parameter according to the current video coding standard; and
obtain the current reference quantization parameter according to the initial quantization parameter and the mapping relationship.

### Claim 15 (depends on 10)

The computer device according to claim 10, wherein the processing circuitry configured to:
when the first difference is greater than a preset threshold,
obtain an adjustment coefficient,
calculate a quantization parameter increment according to the adjustment coefficient and the first difference, and
calculate the target coding quantization parameter according to the quantization parameter increment and the estimated quantization parameter.

### Claim 16 (depends on 15)

The computer device according to claim 15, wherein the processing circuitry configured to:
determine an average reference quantization parameter of initial quantization parameters used to encode an initial video frame that corresponds to the current video frame,
calculate a second difference between the average reference quantization parameter and the current reference quantization parameter; and
calculate the adjustment coefficient according to the second difference, the adjustment coefficient and the second difference being positively correlated.

### Claim 17 (depends on 16)

The computer device according to claim 16, wherein the processing circuitry configured to:
obtain initial quantization parameters used to encode coding units in the initial video frame;
calculate an average value of the initial quantization parameters used to encode the coding units in the initial video frame; and
determine the average value as the average reference quantization parameter.

### Claim 18 (depends on 15)

The computer device according to claim 15, wherein the processing circuitry configured to:
determine a frame average reference quantization parameter of quantization parameters used to encode coding units in the current video frame for generating the initial compressed video;
determine a video average reference quantization parameter of quantization parameters used to encode to coding units in plural video frames for generating the initial compressed video;
when a third difference between the video average quantization parameter and the frame average quantization parameter is greater than a preset parameter, classify the current video frame as a first type of video frame; and
when the third difference between the video average quantization parameter and the frame average quantization parameter is less than or equal to the preset parameter, classify the current video frame as a second type of video frame,
when the current video frame is classified as the first type of video frame, obtain a first adjustment coefficient, and calculate the quantization parameter increment according to the first adjustment coefficient and the second difference; and
when the current video frame is classified as the second type of video frame, obtain a second adjustment coefficient, and calculate the quantization parameter increment according to the second adjustment coefficient and the second difference.

### Claim 19

A non-transitory computer-readable storage medium storing computer-readable instructions, which when executed by one or more processors, cause the one or more processors to perform:
obtaining at least one initial quantization parameter used to encode at least one initial coding unit for generating an initial compressed video;
determining, according to the at least one initial quantization parameter, a current reference quantization parameter corresponding to a current coding unit in a current video frame that is generated by decoding the initial compressed video;
determining an estimated quantization parameter for encoding the current coding unit;
determining a first difference between the current reference quantization parameter and the estimated quantization parameter
setting a target quantization parameter to be equal to or greater than the estimated quantization parameter according to the first difference; and
encoding the current coding unit according to the target quantization parameter.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium according to claim 19, wherein
the obtaining the at least one initial quantization parameter comprises:
obtaining a target initial decoded frame matching the current video frame;
obtaining a target initial coding unit matching the current coding unit in the target initial decoded frame; and
obtaining an initial quantization parameter used to encode the target initial coding unit, and
the determining the current reference quantization parameter comprises:
determining, according to the initial quantization parameter used to encode the target initial coding unit, the current reference quantization parameter corresponding to the current coding unit.
