summaryrefslogtreecommitdiff
path: root/libswscale/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-07 02:04:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-07 02:04:31 +0100
commit4d18060e56aac9d7248854ba75d5fc19f5cd3db8 (patch)
tree1b56d835cb309b324482c253b1df5f35b485be3b /libswscale/utils.c
parentf52852098d7a3a01dbc1e5d76925b9d69ae9b087 (diff)
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>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 0f5cd052a9..90ddbf1e06 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -985,8 +985,6 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
c->srcRange = srcRange;
c->dstRange = dstRange;
- fill_xyztables(c);
-
if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat)))
return -1;
@@ -1077,6 +1075,8 @@ static void handle_formats(SwsContext *c)
c->dst0Alpha |= handle_0alpha(&c->dstFormat);
c->srcXYZ |= handle_xyz(&c->srcFormat);
c->dstXYZ |= handle_xyz(&c->dstFormat);
+ if (c->srcXYZ || c->dstXYZ)
+ fill_xyztables(c);
}
SwsContext *sws_alloc_context(void)