A method of encoding input data (D1) in an encoder to generate corresponding encoded data (E2) is provided. The method includes: (a) splitting and/or transforming the input data (D1) into one or more data chunks, and analyzing symbols present in the input data (D1) and compressing the symbols as a function of occurrence of the symbols in the one or more data chunks; (b) generating one or more code tables, and/or one or more frequency tables, and/or one or more length of code word tables for the symbols present in the one or more data chunks; (c) computing one or more sets of indices relating the symbols in each data chunk and/or the compressed symbols to entries in the one or more code tables, and/or the one or more frequency tables, and/or the one or more length of code word tables; and (d) assembling the one or more sets of indices, together with the one or more frequency tables, and/or the one or more code tables, and/or information indicative of such one or more tables, for generating the encoded data (E2). There is also provided an encoder (50) which utilizes the method, together with a corresponding decoder (60), wherein the encoder (50) and the decoder (60) in combination form a codec (100).