fixed a number of serious bugs:  now getting 30 ms for 16 MP encoding!