int chrBufIndex; ///< Index in ring buffer of the last scaled horizontal chroma line from source.
//@}
- uint8_t formatConvBuffer[VOF]; //FIXME dynamic allocation, but we have to change a lot of code for this to be useful
+ uint8_t *formatConvBuffer;
/**
* @name Horizontal and vertical filters.
src2 += c->chrSrcOffset;
if (c->chrToYV12) {
- c->chrToYV12(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal);
+ uint8_t *buf2 = formatConvBuffer + FFALIGN(srcW, 16);
+ c->chrToYV12(formatConvBuffer, buf2, src1, src2, srcW, pal);
src1= formatConvBuffer;
- src2= formatConvBuffer+VOFW;
+ src2= buf2;
}
if (!c->hcscale_fast) {
srcW, srcH, dstW, dstH);
return AVERROR(EINVAL);
}
- if(srcW > VOFW || dstW > VOFW) {
- av_log(NULL, AV_LOG_ERROR, "swScaler: Compile-time maximum width is "AV_STRINGIFY(VOFW)" change VOF/VOFW and recompile\n");
- return AVERROR(EINVAL);
- }
+ FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW, 16) * 2, fail);
if (!dstFilter) dstFilter= &dummyFilter;
if (!srcFilter) srcFilter= &dummyFilter;
#endif /* HAVE_MMX */
av_freep(&c->yuvTable);
+ av_free(c->formatConvBuffer);
av_free(c);
}