Patent attributes
For sample adaptive offset, classification may be used to classify the pixels into multiple categories and pixels in each category are offset compensated using an offset value for the category. The classification may be based on values of the current pixel and its neighboring pixels before SAO compensation. Therefore, the SAO compensated pixel cannot be written back to the current pixel location until the category for all pixels are determined. An embodiment of the present invention stores the relation between the current pixel and said one or more neighboring pixels so that the SAO compensated current pixel can replace the current pixel without buffering the to-be-processed pixels for classification. The SAO process may be performed on a region by region basis to adapt to the local characteristics of the picture. Rate-distortion optimization (RDO) is often used to guide the mode decision, such as region splitting/region merging decision. Computations associated with the RDO process usually are very computational intensive. Accordingly, distortion reduction estimation is developed which can substantially reduce the required computation associated with RDO.