FIG. 8 is a diagram illustrating four representative edge types of the edge offset with respect to a current pixel (C). In FIG. 8, FIG. 8(a) illustrates an edge of 0 degrees in one dimension, FIG. 8(b) illustrates an edge of 90 degrees in one dimension, FIG. 8(c) illustrates an edge of 135 degrees in one dimension, and FIG. 8(d) illustrates an edge of 45 degrees in one dimension. Four edge types may be used depending on the edge types of the four directions illustrated in FIG. 8. An offset corresponding to one of the four edge types may be applied to each SAO application unit.
After the edge type is determined, the relationship between a current pixel and neighboring pixels may be considered to apply an edge offset.