IP Library Granted Patent US 12,348,789
Granted Patent B1
US 12,348,789 · App. 17/840,945 · Granted Jul 1, 2025

Optimization of constrained directional enhancement filtering (CDEF)

Inventors: Sujith Srinivasan (Fremont, CA); Junqiang Lan (Fremont, CA); Zhijun Lei (Portland, OR)
Assignee: Meta Platforms, Inc.
H04N19/85H04N19/117H04N19/13H04N19/137H04N19/154H04N19/172H04N19/176H04N19/182H04N19/186H04N19/463H04N19/82
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,348,789
App. No.
17/840,945
Granted
Jul 1, 2025
Kind
B1
Abstract

A video to be encoded using a codec is received Pre-filter encoding of a specific frame of the video is performed. In a single-pass processing of the specific frame, frame-level filter parameters determined using a previous frame are used to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame. Statistics for the specific frame are gathered for determining frame-level filter parameters to be used for a future frame of the video. Post-filter encoding of the specific frame of the video is performed.

Claims (60)

1. A system, comprising:

a processor configured to:

receive a video to be encoded using a codec;

perform pre-filter encoding of a specific frame of the video;

in a single-pass processing of the specific frame:

use a first set of frame-level filter parameters determined based on a previous frame to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame, including:

determining a preset list, wherein the preset list comprises the first set of frame-level filter parameters, and wherein the preset list comprises a plurality of presets selected based on a type of content and a compression rate; and

selecting for a block of the specific frame a preset among the preset list, wherein the preset is selected based on minimizing of a mean squared error (MSE) and wherein the block has its own respective set of parameters; and

gather statistics for the specific frame for determining a second set of frame-level filter parameters to be used for a future frame of the video; and

perform post-filter encoding of the specific frame of the video; and

a memory coupled to the processor and configured to provide the processor with instructions.

2. The system of claim 1 , wherein the in-loop filter comprises a luma primary filter, a luma secondary filter, a chroma primary filter, and a chroma secondary filter, and wherein a preset of the preset list comprises: a luma primary filter strength parameter, a luma secondary filter strength parameter, a chroma primary filter strength parameter, and a chroma secondary filter strength parameter.

3. The system of claim 1 , wherein gathering the statistics for the specific frame for determining the second set of frame-level filter parameters to be used for the future frame of the video comprises:

filtering the blocks of the specific frame using different combinations of filter strength parameters for a primary filter and a secondary filter of the in-loop filter;

gathering distortion metrics associated with the filtered blocks; and

searching the gathered distortion metrics for determining the second set of frame-level filter parameters to be used for the future frame of the video.

4. The system of claim 1 , wherein the determined frame-level filter parameters comprise a preset list for the specific frame, wherein the preset list comprises one of the following: 1 preset, 2 presets, 4 presets, or 8 presets.

5. The system of claim 4 , wherein a preset comprises: a luma primary filter strength parameter, a luma secondary filter strength parameter, a chroma primary filter strength parameter, and a chroma secondary filter strength parameter.

6. The system of claim 1 , wherein the single-pass processing of the specific frame comprises reading pixels after the pre-filter encoding once.

7. The system of claim 1 , wherein the step of using the first set of frame-level filter parameters determined based on the previous frame to apply the in-loop filter on the blocks of the specific frame during encoding of the specific frame and the step of gathering the statistics for the specific frame for determining the second set of frame-level filter parameters to be used for the future frame of the video are performed in parallel.

8. The system of claim 1 , wherein the processor is further configured to:

detect whether one of a plurality of criteria is met; and

in response to detecting that one of the plurality of criteria is met:

use a third set of predetermined frame-level filter parameters to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame; and

gather statistics for the specific frame for determining the second set of frame-level filter parameters to be used for the future frame of the video.

9. The system of claim 8 , wherein the plurality of criteria comprises one of the following: the specific frame is a first frame of the video, the specific frame is a frame after a scene change, or the specific frame is an intra frame.

10. The system of claim 1 , wherein the pre-filter encoding comprises motion detection and motion decision, and wherein the post-filter encoding comprises loop reconstruction and entropy coding, and wherein the in-loop filter comprises a Constrained Directional Enhancement Filter (CDEF), and wherein the codec comprises an AV1 video codec.

11. The system of claim 1 , wherein applying an in-loop filter on blocks of the specific frame during encoding of the specific frame further includes filtering the block of the specific frame with the in-loop filter via a luma primary filter, a luma secondary filter, a chroma primary filter, and a chroma secondary filter using the selected preset, and wherein the primary luma filter runs along the selected filter direction, and the secondary luma filter runs across the selected direction at a 45° angle, and the primary chroma filter runs along the selected filter direction, and the secondary chroma filter runs across the selected direction at a 45° angle.

12. A method, comprising:

receiving a video to be encoded using a codec;

performing pre-filter encoding of a specific frame of the video;

in a single-pass processing of the specific frame:

using a first set of frame-level filter parameters determined based on a previous frame to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame, including

determining a preset list, wherein the preset list comprises the first set of frame-level filter parameters, and wherein the preset list comprises a plurality of presets selected based on a type of content and a compression rate; and

filtering the block of the specific frame with the in-loop filter via a luma primary filter, a luma secondary filter, a chroma primary filter, and a chroma secondary filter using the selected presets; and

gathering statistics for the specific frame for determining a second set of frame-level filter parameters to be used for a future frame of the video; and

performing post-filter encoding of the specific frame of the video.

13. The method of claim 12 , wherein the in-loop filter comprises the luma primary filter, the luma secondary filter, h chroma primary filter, and the chroma secondary filter, and wherein a preset of the preset list comprises: a luma primary filter strength parameter, a luma secondary filter strength parameter, a chroma primary filter strength parameter, and a chroma secondary filter strength parameter.

14. The method of claim 12 , wherein gathering the statistics for the specific frame for determining the second set of frame-level filter parameters to be used for the future frame of the video comprises:

filtering the blocks of the specific frame using different combinations of filter strength parameters for a primary filter and a secondary filter of the in-loop filter;

gathering distortion metrics associated with the filtered blocks; and

searching the gathered distortion metrics for determining the second set of frame-level filter parameters to be used for the future frame of the video.

15. The method of claim 12 , wherein the single-pass processing of the specific frame comprises reading pixels after the pre-filter encoding once.

16. The method of claim 12 , wherein using a first set of frame-level filter parameters determined based on a previous frame to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame further includes selecting for a block of the specific frame a preset among the preset list, wherein the preset is selected based on minimizing of a mean squared error (MSE) and wherein the block has its own respective set of parameters.

17. A system, comprising:

an interface to receive a video to be encoded using a codec; and

a circuitry to:

perform pre-filter encoding of a specific frame of the video;

in a single-pass processing of the specific frame:

use a first set of frame-level filter parameters determined based on a previous frame to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame, including

determining a preset list, wherein the preset list comprises the first set of frame-level filter parameters, and wherein the preset list comprises a plurality of presets selected based on a type of content and a compression rate; and

filtering the block of the specific frame with the in-loop filter via a luma primary filter, a luma secondary filter, a chroma primary filter, and a chroma secondary filter using the selected preset; and

gather statistics for the specific frame for determining a second set of frame-level filter parameters to be used for a future frame of the video; and

perform post-filter encoding of the specific frame of the video.

18. The system of claim 17 , wherein the in-loop filter comprises the luma primary filter, the luma secondary filter, h chroma primary filter, and the chroma secondary filter, and wherein a preset of the preset list comprises: a luma primary filter strength parameter, a luma secondary filter strength parameter, a chroma primary filter strength parameter, and a chroma secondary filter strength parameter.

19. The system of claim 17 , wherein gathering the statistics for the specific frame for determining the second set of frame-level filter parameters to be used for the future frame of the video comprises:

filtering the blocks of the specific frame using different combinations of filter strength parameters for a primary filter and a secondary filter of the in-loop filter;

gathering distortion metrics associated with the filtered blocks; and

searching the gathered distortion metrics for determining the second set of frame-level filter parameters to be used for the future frame of the video.

20. The system of claim 17 , wherein using a first set of frame-level filter parameters determined based on a previous frame to apply an in-loop filter on blocks of the specific frame during encoding of the specific frame, further includes selecting for a block of the specific frame a preset among the preset list, wherein the preset is selected based on minimizing of a mean squared error (MSE) and wherein the block has its own respective set of parameters.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 23, 2022
From: SRINIVASAN, SUJITH; LAN, JUNQIANG; LEI, ZHIJUN
To: META PLATFORMS, INC.
Reel/Frame 060876/0031 →
Continuity (1)
Provisional Application 63224576 · Jul 22, 2021
References Cited (19)
US 8849053B2 · Liu et al. · 2014 [cited by applicant]
US 10645383B2 · Zhang et al. · 2020 [cited by applicant]
US 20100074329A1 · Fu · 2010 [cited by examiner]
US 20120183050A1 · Liu · 2012 [cited by examiner]
US 20190045186A1 · Zhang · 2019 [cited by examiner]
US 20200162731A1 · Kim · 2020 [cited by examiner]
US 20200314424A1 · Hu · 2020 [cited by examiner]
US 20200344494A1 · Hu · 2020 [cited by examiner]
US 20200404335A1 · Egilmez · 2020 [cited by examiner]
US 20210266604A1 · Du · 2021 [cited by examiner]
US 20210400266A1 · Du · 2021 [cited by examiner]
US 20220103814A1 · Sahraoui · 2022 [cited by examiner]
US 20220116635A1 · Yea · 2022 [cited by examiner]
US 20220191526A1 · Aggarwal · 2022 [cited by examiner]
US 20220272367A1 · Matsuba · 2022 [cited by examiner]
US 20220279176A1 · Sarwer · 2022 [cited by examiner]
US 20220368897A1 · Du · 2022 [cited by examiner]
US 20220400292A1 · Kotra · 2022 [cited by examiner]
Zummach E., et al., “High-Throughput CDEF Architecture for the AV1 Decoder Targeting 4K@60fps Videos,” IEEE 11th Latin American Symposium on Circuits & Systems (LASCAS), Feb. 28, 2020, 4 pages. [cited by applicant]