PURPOSE:To restore picture data from encoded data with a small number of times of memory access and that of AND processing and shift processing by encoding data so that encoded data certainly has a means in each 16-bit unit. CONSTITUTION:A white run and a black run adjacent to each other of run length data of a picture are encoded as follows: if the white run length is equal to or shorter than 1022 picture elements and the black run length is equal to or shorter than 62 picture elements, a code where the white run length is expressed with a 10-bit integer and a code where the black run length is expressed with a 6 bit integer are connected to obtain a 16-bit code as shown in a figure (1). If the white run length is longer than 1022 picture elements and the black run length is equal to or shorter than 62 picture elements, a 10-bit code indicating that the white run length is longer than 1022 picture elements, a code where the black run length is expressed with a 6-bit integer, and a code where the white run length is expressed with a 16-bit integer are connected to obtain a 16X2-bit code as shown in a figure (2). If the white run length is equal to or shorter than 1022 picture elements and the black run length is longer than 62 picture elements, data is compressed into a 16X2-bit code as shown in a figure (3): and if the white run length is longer than 1022 picture elements and the black run length is longer than 62 picture elements, data is compressed into a 16X3-bit code as shown in a figure (4).
展开▼