Improvements of Memory Efficiency and Discrimination Power for Real-Time Document Image Retrieval on a Large-Scale Database