Video encoding method using offset adjustments according to pixel classification and apparatus therefor, video decoding method and apparatus thereforпатент