Based on patch by Reinhard Tartler <siretart tauware de> Originally committed as revision 30315 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale