this seems to improve RD performance. Originally committed as revision 22550 to svn://svn.ffmpeg.org/ffmpeg/trunk