Just to clarify, the raangecoded bitstream is decoded in function flif16_read_second_header in libavcodec/flif16dec.c. Here the aforementioned switch statement - segment variable system is used. Regards, Anamitra