move encoders[] out of function
allocate line buffers dynamically, remove MAX_LINE_LEN