extern "C"
{
#include <avformat.h>
+#ifdef HAVE_LIBSWSCALE
+# include <ffmpeg/swscale.h>
+#endif
}
#include <synfig/general.h>
if ( pict && context->pix_fmt != PIX_FMT_RGB24 )
{
//We're using RGBA at the moment, write custom conversion code later (get less accuracy errors)
+#ifdef HAVE_LIBSWSCALE
+ struct SwsContext* img_convert_ctx =
+ sws_getContext(context->width, context->height, PIX_FMT_RGB24,
+ context->width, context->height, context->pix_fmt,
+ SWS_BICUBIC, NULL, NULL, NULL);
+
+ sws_scale(img_convert_ctx, pict->data, pict->linesize,
+
+ 0, context->height, encodable->data,
+ encodable->linesize);
+
+ sws_freeContext (img_convert_ctx);
+#else
img_convert((AVPicture *)encodable, context->pix_fmt,
(AVPicture *)pict, PIX_FMT_RGB24,
context->width, context->height);
+#endif
pict = encodable;
}