opendlg: use state matchine to guess width and height

改进从文件名猜测长宽的方法。比如说mp3_320x240.i420不能被认成宽为3,高为320.