Patent ID: 7376187

Claim:
A computer-readable recording medium having stored therein a computer program for use in a variable length code, the program when executed by a computer, causing the computer to execute steps comprising: selecting a code word corresponding to an inputted source symbol from a code word table, the code word table storing code words having code length according to occurrence probability of a plurality of source symbols, the code words being assigned for the source symbols, the code words being capable of being decoded both in forward and backward directions and being formed so that delimiters of the code words are capable of being identified by a predetermined weight of the code words, the code word table associating the code words with the inputted source symbols; assigning the selected code word to every synchronization interval; and inserting a stuffing code capable of being decoded in backward direction to set a code length corresponding to the synchronization interval when code length of the code word assigned to the synchronization interval is less than code length of the synchronization interval.