1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

swscale/utils: fill xyz tables only when they will be used

makes the first call to sws_getContext() 1ms faster

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-07 02:04:31 +01:00
parent f52852098d
commit 4d18060e56

View File

@ -985,8 +985,6 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
c->srcRange = srcRange; c->srcRange = srcRange;
c->dstRange = dstRange; c->dstRange = dstRange;
fill_xyztables(c);
if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))
return -1; return -1;
@ -1077,6 +1075,8 @@ static void handle_formats(SwsContext *c)
c->dst0Alpha |= handle_0alpha(&c->dstFormat); c->dst0Alpha |= handle_0alpha(&c->dstFormat);
c->srcXYZ |= handle_xyz(&c->srcFormat); c->srcXYZ |= handle_xyz(&c->srcFormat);
c->dstXYZ |= handle_xyz(&c->dstFormat); c->dstXYZ |= handle_xyz(&c->dstFormat);
if (c->srcXYZ || c->dstXYZ)
fill_xyztables(c);
} }
SwsContext *sws_alloc_context(void) SwsContext *sws_alloc_context(void)