Auto-detects whether to decode or encode now