An apparatus for adaptive filtering a set of samples (115; 215) of a reconstructed image using a filter (120; 220) with adaptive multiplier coefficients C x represented by integer numbers, the apparatus comprising processing circuitry which is configured to deriving the values of the multiplier coefficients using the least squares method by assuming no restrictions to the value of each multiplier coefficient C x by solving for C x the equation X x, y * C x = P x wherein X x,y is the expected value of R ( i + k, j + l) ∗ R ( i + m,j + n), the correlation between 2 reconstructed samples before filtering, wherein x = 0,.., w, y = 0,.., w, w+1 being the number of the multiplier coefficients, i and j are the coordinates and the indices k, l, m and n are selected according to the shape of the filter to be applied and P x is the expected value of R ( i + k,j + l) ∗ 0(i, j), wherein 0(i, j) denotes the sample of the original image corresponding to the reconstructed image; group the multiplier coefficients of the filter (120; 220) into at least two groups; determine the value of each multiplier coefficient in a first group of the at least two groups C 0,.., C u, so as to be allowed to assume any value in a first set of allowed values of multiplier coefficients, determine the value of each multiplier coefficient in a second group of the at least two groups C v,.., C w, so as to be allowed to assume any value in a second set of allowed values of multiplier coefficients, wherein the allowed values of the second set are restricted as compared to a full range of allowed integer values of the first set having absolute values up to a predetermined maximum value N max, and filter the set of samples (115; 215) of an image with the filter (120; 220), wherein at least one of the first and second sets has at least one value that is not in the other set, and wherein the value of each multiplier coefficient in the second group is determined by rounding the derived value of each multiplier coefficient in the second group C v,.., C w to the closest allowed value to obtain rounded derived values of each multiplier coefficient in the second group C' v,.., C' w, and the value of each multiplier coefficient in the first group is determined by re-estimating the derived value of each multiplier coefficient in the first group C 0,.., C, in order to compensate for quantization errors caused by rounding the derived value of each multiplier coefficient in the second group to the closest allowed value by solving the equation for C 0,.., C u X 0,0 X 0,1 ⋯ X 0, u ⋮ ⋱ ⋮ X u − 1,0 X u − 1,1 X u, 0 X u, 1 ⋯ X u − 1, u X u, u C 0 ⋮ C u − 1 C u = P 0 − C ′ v ∗ X 0, v − ⋯ − C ′ w ∗ X 0, w ⋮ P u − 1 − C ′ v ∗ X u − 1, v − ⋯ − C ′ w ∗ X u − 1, w P u − C ′ v ∗ X u, v − ⋯ − C ′ w ∗ X u, w. deriving the values of the multiplier coefficients using the least squares method by assuming no restrictions to the value of each multiplier coefficient C x by solving for C x the equation X x, y * C x = P x wherein X x,y is the expected value of R ( i + k, j + l) ∗ R ( i + m,j + n), the correlation between 2 reconstructed samples before filtering, wherein x = 0,.., w, y = 0,.., w, w+1 being the number of the multiplier coefficients, i and j are the coordinates and the indices k, l, m and n are selected according to the shape of the filter to be applied and P x is the expected value of R ( i + k,j + l) ∗ 0(i, j), wherein 0(i, j) denotes the sample of the original image corresponding to the reconstructed image; group the multiplier coefficients of the filter (120; 220) into at least two groups; determine the value of each multiplier coefficient in a first group of the at least two groups C 0,.., C u, so as to be allowed to assume any value in a first set of allowed values of multiplier coefficients, determine the value of each multiplier coefficient in a second group of the at least two groups C v,.., C w, so as to be allowed to assume any value in a second set of allowed values of multiplier coefficients, wherein the allowed values of the second set are restricted as compared to a full range of allowed integer values of the first set having absolute values up to a predetermined maximum value N max, and filter the set of samples (115; 215) of an image with the filter (120; 220), wherein at least one of the first and second sets has at least one value that is not in the other set, and wherein the value of each multiplier coefficient in the second group is determined by rounding the derived value of each multiplier coefficient in the second group C v,.., C w to the closest allowed value to obtain rounded derived values of each multiplier coefficient in the second group C' v,.., C' w, and the value of each multiplier coefficient in the first group is determined by re-estimating the derived value of each multiplier coefficient in the first group C 0,.., C, in order to compensate for quantization errors caused by rounding the derived value of each multiplier coefficient in the second group to the closest allowed value by solving the equation for C 0,.., C u X 0,0 X 0,1 ⋯ X 0, u ⋮ ⋱ ⋮ X u − 1,0 X u − 1,1 X u, 0 X u, 1 ⋯ X u − 1, u X u, u C 0 ⋮ C u − 1 C u = P 0 − C ′ v ∗ X 0, v − ⋯ − C ′ w ∗ X 0, w ⋮ P u − 1 − C ′ v ∗ X u − 1, v − ⋯ − C ′ w ∗ X u − 1, w P u − C ′ v ∗ X u, v − ⋯ − C ′ w ∗ X u, w.