# US 2018/0027239 A1 · Systems and methods for enhanced video encoding

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

- Number: US 2018/0027239 A1
- Document ID: US20180027239A1
- Status: Published application
- Kind: A1
- Application number: 15/711,895
- Filed: 2017-09-21
- Published: 2018-01-25
- Earliest claimed: 2014-02-12
- Assignees: Facebook, Inc.
- Applicants: Facebook, Inc.
- Inventors: John Torres Fremlin
- Web page: https://patentgrep.com/patent/US20180027239A1

## CPC

- 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/115: Selection of the code volume for a coding unit prior to coding
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/192: the adaptation method, adaptation tool or adaptation type being iterative or recursive
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

Systems, methods, and non-transitory computer-readable media receive a source video having a source file size. A bit rate at which to encode the source video is determined. The source video is encoded at the determined bit rate to produce an encoded video having a file size less than the source file size. A video quality metric for the encoded video is determined. Whether or not the video quality metric for the encoded video is within an allowable deviation from a target quality metric is determined. The source video is encoded at another determined bit rate when the video quality metric for the encoded video is outside the allowable deviation from the target quality metric. Determining the bit rate and encoding the source video at the determined bit rate can repeat iteratively until the video quality metric for the encoded video is within the allowable deviation from the target quality metric.

## Claims

### Claim 1

A computer-implemented method comprising:
performing, by a computing system, a first-pass encoding of a source video having a source file size to generate a first-pass encoded video;
performing, by the computing system, iterative encoding of the first-pass encoded video to generate an encoded video, wherein the iterative encoding is performed until the encoded video satisfies a target quality metric and has a file size less than the source file size, wherein a bit rate used in the iterative encoding is determined based on information indicative of an amount of detail included in the source video and data associated with an optimized video that is similar to the source video and satisfies the target quality metric; and
removing, by the computing system, the first-pass encoded video in response to determining that the encoded video satisfies the target quality metric and has a file size that is less than the source file size.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the encoded video satisfies the target quality metric if a video quality metric for the encoded video is within an allowable deviation from the target quality metric.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein the video quality metric for the encoded video is determined to be outside the allowable deviation when the video quality metric for the encoded video is substantially greater than the target quality metric, and wherein a bit rate used in an iteration of the iterative encoding is determined to be lower than a bit rate used in a previous iteration.

### Claim 4 (depends on 2)

The computer-implemented method of claim 2, wherein the video quality metric for the encoded video is determined to be outside the allowable deviation when the video quality metric for the encoded video is substantially less than the target quality metric, and wherein the bit rate used in an iteration of the iterative encoding is determined to be higher than a bit rate used in a previous iteration.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the target quality metric relates to at least one of a structural similarity (SSIM) index, a multi-scale structural similarity (MS-SSIM) index, or a peak signal-to-noise ratio (P SNR).

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the information indicative of an amount of detail included in the source video is obtained from the first-pass encoding.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the data associated with the optimized video includes a bit rate used to encode the optimized video.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein the bit rate used in the iterative encoding is determined based at least in part on a root finding algorithm.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, wherein the root finding algorithm corresponds to at least one of Brent's method, Newton's method, a bisection method, a secant method, an interpolation method, or a combination thereof.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the bit rate used in the iterative encoding is determined based on historical data associated with at least one of the source video or the first-pass encoded video.

### Claim 11

A system comprising:
at least one processor; and
a memory storing instructions configured to instruct the at least one processor to perform:
performing a first-pass encoding of a source video having a source file size to generate a first-pass encoded video;
performing iterative encoding of the first-pass encoded video to generate an encoded video, wherein the iterative encoding is performed until the encoded video satisfies a target quality metric and has a file size less than the source file size, wherein a bit rate used in the iterative encoding is determined based on information indicative of an amount of detail included in the source video and data associated with an optimized video that is similar to the source video and satisfies the target quality metric; and
removing the first-pass encoded video in response to determining that the encoded video satisfies the target quality metric and has a file size that is less than the source file size.

### Claim 12 (depends on 11)

The system of claim 11, wherein the target quality metric relates to at least one of a structural similarity (SSIM) index, a multi-scale structural similarity (MS-S SIM) index, or a peak signal-to-noise ratio (P SNR).

### Claim 13 (depends on 11)

The system of claim 11, wherein the information indicative of an amount of detail included in the source video is obtained from the first-pass encoding.

### Claim 14 (depends on 11)

The system of claim 11, wherein the data associated with the optimized video includes a bit rate used to encode the optimized video.

### Claim 15 (depends on 11)

The system of claim 11, wherein the bit rate used in the iterative encoding is determined based at least in part on a root finding algorithm.

### Claim 16

A non-transitory computer readable medium storing computer-executable instructions that, when executed, cause a computer system to perform a computer-implemented method comprising:
performing a first-pass encoding of a source video having a source file size to generate a first-pass encoded video;
performing iterative encoding of the first-pass encoded video to generate an encoded video, wherein the iterative encoding is performed until the encoded video satisfies a target quality metric and has a file size less than the source file size, wherein a bit rate used in the iterative encoding is determined based on information indicative of an amount of detail included in the source video and data associated with an optimized video that is similar to the source video and satisfies the target quality metric; and
removing the first-pass encoded video in response to determining that the encoded video satisfies the target quality metric and has a file size that is less than the source file size.

### Claim 17 (depends on 16)

The non-transitory computer readable medium of claim 16, wherein the target quality metric relates to at least one of a structural similarity (SSIM) index, a multi-scale structural similarity (MS-SSIM) index, or a peak signal-to-noise ratio (P SNR).

### Claim 18 (depends on 16)

The non-transitory computer readable medium of claim 16, wherein the information indicative of an amount of detail included in the source video is obtained from the first-pass encoding

### Claim 19 (depends on 16)

The non-transitory computer readable medium of claim 16, wherein the data associated with the optimized video includes a bit rate used to encode the optimized video.

### Claim 20 (depends on 16)

The non-transitory computer readable medium of claim 16, wherein the bit rate used in the iterative encoding is determined based at least in part on a root finding algorithm.
