Liver sonography is a widely used noninvasive diagnostic tool. Analyzing histology changes in sonograms provides a means of diagnosing and monitoring chronic liver diseases. Nonetheless, conventional ultrasonography is still qualitative. To improve reliability of liver diagnosis, quantitative image analysis is highly desirable for the assessment of various liver states. In this paper, a novel approach, called Texture Feature Coding Method (TFCM) is presented for texture classification of liver sonography, more specifically, classification of normal liver, hepatitis and cirrhosis. TFCM is a texture analysis technique based on gray-level gradient variations in a 3x3 texture unit. It transforms an image into a texture feature image in which each pixel is represented by a texture feature number (TFN) coded by TFCM. The obtained texture feature numbers are then used to generate a TFN histogram and a TFN co-occurrence matrix which will produce texture feature descriptors. By coupling with a supervised maximum likelihood (ML) classifier, these descriptors form a classification system to discriminate the three above-mentioned liver classes. The TFCM-supervised ML system is trained by 30 liver samples proven by biopsy and tested on a set of 90 samples. The results show that the designed TFN-supervised ML system performs better than do existing techniques, and the correct classification rate can reach as high as 83.3%.