# US 10,123,015 B2 · Macroblock-level adaptive quantization in quality-aware video optimization

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

- Number: US 10,123,015 B2
- Document ID: US10123015B2
- Status: Granted
- Kind: B2
- Application number: 15/482,931
- Filed: 2017-04-10
- Published: 2017-07-27
- Granted: 2018-11-06
- Earliest claimed: 2011-06-10
- Assignees: Citrix Systems, Inc.
- Applicants: Citrix Systems, Inc.
- Inventors: Jeremy Tidemann; Andrew Penner
- Web page: https://patentgrep.com/patent/US10123015B2

## CPC

- H04N 19/124: Quantisation
- H04N 19/115: Selection of the code volume for a coding unit prior to coding
- H04N 19/136: Incoming video signal characteristics or properties
- H04N 19/146: Data rate or code amount at the encoder output
- H04N 19/154: Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion (use of rate-distortion criteria H04N19/147)
- H04N 19/176: the region being a block, e.g. a macroblock
- 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/172: the region being a picture, frame or field
- H04N 19/182: the unit being a pixel
- H04N 19/184: the unit being bits, e.g. of the compressed video stream
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

A method of optimizing an encoded video stream comprising one or more video frames, each video frame comprising a plurality of macroblocks, each macroblock comprising a plurality of pixels. The method includes receiving an encoded macroblock, decoding the encoded macroblock, and extracting a first quantization parameter. The first quantization parameter corresponds to quantization settings originally used for compressing the encoded macroblock. The method also includes computing a second quantization parameter based at least in part on the first quantization parameter, re-encoding the decoded macroblock based on the second quantization parameter, and providing the re-encoded macroblock.

## Claims

### Claim 1

A method for video optimization of an encoded video stream comprising one or more video frames, each video frame comprising a plurality of macroblocks, the method being performed by at least one processor, the method comprising:
receiving information for a macroblock of a video frame of the encoded video stream;
extracting a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
determining, using the received information, motion vector information for at least one motion vector associated with the macroblock that indicates a location of at least one prediction block within the video frame or another video frame which was subtracted from the macroblock prior to encoding;
computing a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information;
re-encoding the macroblock based on the second quantization parameter; and
transmitting the re-encoded macroblock to a user device.

### Claim 2 (depends on 1)

The method of claim 1, wherein computing the second quantization parameter comprises setting the second quantization parameter to be equal or lower than the first quantization parameter when the first quantization parameter is higher than the first threshold, and setting the second quantization parameter to be higher than the first quantization parameter when the first quantization parameter is lower than the second threshold.

### Claim 3

A method for video optimization of an encoded video stream comprising one or more video frames, each video frame comprising a plurality of macroblocks, the method being performed by at least one processor, the method comprising:
receiving information for a macroblock of a video frame of the encoded video stream;
extracting a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
determining, using the received information, motion vector information for at least one motion vector associated with the macroblock;
computing a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information; and
re-encoding the macroblock based on the second quantization parameter; and
transmitting the re-encoded macroblock to a user device;
wherein the macroblock was encoded using inter-prediction, and the motion vector information is indicative of relative positions of one or more prediction blocks.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
performing a statistical analysis and obtain an average motion vector length, across macroblocks belonging to the video frame of the encoded video stream.

### Claim 5 (depends on 1)

The method of claim 1, further comprising
decreasing the second quantization parameter responsive to a determination that a length of the at least one motion vector is below a predetermined low threshold, and
increasing the second quantization parameter responsive to a determination that the length of the at least one motion vector is above a predetermined high threshold.

### Claim 6 (depends on 1)

The method of claim 1, wherein computing the second quantization parameter is based in part on visual characteristics extracted from the macroblock.

### Claim 7 (depends on 6)

The method of claim 6, wherein the visual characteristics of the encoded macroblock or the macroblock include a variance of a plurality of pixels of either the encoded macroblock or the macroblock.

### Claim 8 (depends on 6)

The method of claim 6, wherein the visual characteristics of the encoded macroblock or the macroblock include an average brightness of the plurality of pixels of either the encoded macroblock or the macroblock.

### Claim 9

A non-transitory computer readable medium that stores a set of instructions that is executable by a at least one processor of a video optimization system to cause the video optimization system to perform a method for video optimization of an encoded video stream comprising one or more video frames, each frame comprising a plurality of macroblocks, the method comprising:
receiving information for a macroblock of a video frame of the encoded video stream;
extracting a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
determining, using the received information, motion vector information for at least one motion vector associated with the macroblock that indicates a location of at least one prediction block within the video frame or another video frame which was subtracted from the macroblock prior to encoding;
computing a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information;
re-encoding the macroblock based on the second quantization parameter; and
transmitting the re-encoded macroblock to a user device.

### Claim 10 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein computing the second quantization parameter comprises setting the second quantization parameter to be equal or lower than the first quantization parameter when the first quantization parameter is higher than the first threshold, and setting the second quantization parameter to be higher than the first quantization parameter when the first quantization parameter is lower than the second threshold.

### Claim 11

A non-transitory computer readable medium that stores a set of instructions that is executable by a at least one processor of a video optimization system to cause the video optimization system to perform a method for video optimization of an encoded video stream comprising one or more video frames, each frame comprising a plurality of macroblocks, the method comprising:
receiving information for a macroblock of a video frame of the encoded video stream;
extracting a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
determining, using the received information, motion vector information for at least one motion vector associated with the macroblock;
computing a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information;
re-encoding the macroblock based on the second quantization parameter; and
transmitting the re-encoded macroblock to a user device;
wherein the macroblock was encoded using inter-prediction, and the motion vector information is indicative of relative positions of one or more prediction blocks.

### Claim 12 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the at least one processor is configured to perform a statistical analysis and obtain an average motion vector length, across macroblocks belonging to the video frame of the encoded video stream.

### Claim 13 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the set of instructions that is executable by the at least one processor of the video optimization system cause the video optimization system to further perform:
decreasing the second quantization parameter responsive to a determination that a length of the at least one motion vector is below a predetermined low threshold, and
increasing the second quantization parameter responsive to a determination that the length of the at least one motion vector is above a predetermined high threshold.

### Claim 14 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein computing the second quantization parameter is based in part on visual characteristics extracted from the macroblock.

### Claim 15 (depends on 14)

The non-transitory computer readable medium of claim 14, wherein the visual characteristics of the encoded macroblock or the macroblock include a variance of a plurality of pixels of either the encoded macroblock or the macroblock.

### Claim 16 (depends on 14)

The non-transitory computer readable medium of claim 14, wherein the visual characteristics of the encoded macroblock or the macroblock include an average brightness of the plurality of pixels of either the encoded macroblock or the macroblock.

### Claim 17

A video optimizer for video optimization of an encoded video stream comprising one or more video frames, each frame comprising a plurality of macroblocks, the video optimizer comprising:
a decoder configured to:
receive information for a macroblock of a video frame of the encoded video stream and
extract a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
a quantization parameter adjustment module configured to:
determine, using the received information, motion vector information for at least one motion vector associated with the macroblock that indicates a location of at least one prediction block within the video frame or another video frame which was subtracted from the macroblock prior to encoding;
compute a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information; and
an encoder configured to:
re-encode the macroblock based on the second quantization parameter; and
provide the re-encoded macroblock for transmission to a user device.

### Claim 18

A video optimizer for video optimization of an encoded video stream comprising one or more video frames, each frame comprising a plurality of macroblocks, the video optimizer comprising:
a decoder configured to receive information for a macroblock of a video frame of the encoded video stream, and to extract a first quantization parameter corresponding to quantization settings originally used for compressing the macroblock;
a quantization parameter adjustment module configured to:
determine, using the received information, motion vector information for at least one motion vector associated with the macroblock;
compute a second quantization parameter for re-encoding the macroblock, the second quantization parameter based at least in part on the first quantization parameter and the motion vector information; and
an encoder configured to re-encode the macroblock based on the second quantization parameter and to provide the re-encoded macroblock for transmission to a user device;
wherein the macroblock was encoded using inter-prediction, and the motion vector information is indicative of relative positions of one or more prediction blocks.

### Claim 19 (depends on 17)

The video optimizer of claim 17, wherein the quantization parameter adjustment module is configured to perform a statistical analysis and obtain an average motion vector length, across macroblocks belonging to the video frame of the encoded video stream.

### Claim 20 (depends on 17)

The video optimizer of claim 17, wherein
the quantization parameter adjustment module is configured to decrease the second quantization parameter responsive to a determination that a length of the at least one motion vector is below a predetermined low threshold, and
the quantization parameter adjustment module is configured to increase the second quantization parameter responsive to a determination that the length of the at least one motion vector is above a predetermined high threshold.

### Claim 21 (depends on 3)

The method of claim 3, wherein computing the second quantization parameter is based in part on visual characteristics extracted from the macroblock.

### Claim 22 (depends on 21)

The method of claim 21, wherein the visual characteristics of the encoded macroblock or the macroblock include a variance of a plurality of pixels of either the encoded macroblock or the macroblock.

### Claim 23 (depends on 21)

The method of claim 21, wherein the visual characteristics of the encoded macroblock or the macroblock include an average brightness of the plurality of pixels of either the encoded macroblock or the macroblock.
