General purpose video codec