revised palette API, courtesy of Roberto Togni (rtogni at freemail.it)
Originally committed as revision 2451 to svn://svn.ffmpeg.org/ffmpeg/trunk