Original commit message from CVS: call xvid_init() only once, and move duplicated code into one place