sws_getCachedContext will set a default sampling method if 0 is passed
to the flags argument. This means that when it is called again, the
flags argument will not match the flags in the context, so a new one
will be allocated every time.
To get around this problem, we assign an explicit sampling method, one
that also happens to be more efficient and just as good for this
use-case as the default one, which is bicubic interpolation.
(cherry picked from commit
c68714aee15f1e6c75d53c398ea9b9178f64fcfb)
sws = sws_getCachedContext(sws, frame->width, frame->height, avctx->pix_fmt,
frame->width, frame->height, AV_PIX_FMT_RGB32,
- 0, NULL, NULL, NULL);
+ SWS_POINT, NULL, NULL, NULL);
int inFull, outFull, brightness, contrast, saturation;
const int* inTable;