Patent ID: 8451902

Claim:
A method of encoding a pixel block in a frame of an image or a video sequence, said method comprising: estimating, based on said property values of said pixel block, a displacement vector identifying a reference pixel block in a reference frame of said image or said video sequence; defining a template comprising multiple pixels and being positioned adjacent said pixel block in said frame; identifying a reference template comprising multiple pixels and being positioned adjacent said reference pixel block in said reference frame; determining a prediction template based on said reference template and at least one interpolation filter; determining a difference template based on property values of said multiple pixels of said template and property values of multiple pixels of said prediction template; determining a tuning template by filtering said property values of said multiple pixels of said reference template with an adaptive filter; determining at least one filter parameter of said adaptive filter by reducing a least squares error between said difference template and said tuning template; determining filtered property values based on property values of said reference pixel block and said adaptive filter; determining an encoded representation of said pixel block based on property values of said pixel block and said filtered property values, wherein said encoded representation comprises an encoded representation of said displacement vector; calculating a first variance representation for said property values of said multiple pixels in said template; calculating a second variance representation for said property values of said multiple pixels in said reference template; and determining, if an absolute difference between said first variance representation and said second variance representation does not a exceed a variance threshold, a DC offset based on an average of said property values of said multiple pixels in said template and an average of said property values of said multiple pixels in said reference template, wherein said determining said at least one filter parameter comprises determining said at least one filter parameter of said adaptive filter based on said property values of said multiple pixels in said template, said property values of said multiple pixels in said reference template and said DC offset, and wherein said determining said encoded representation comprises determining said encoded representation based on said property values of said pixel block, said filtered property values and said DC offset.