diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-07 02:04:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-07 03:05:30 +0100 |
commit | 08808084f6e9d3fbccb67d53b4f9a25f9bf81e2f (patch) | |
tree | 8b7c355402601c26c79b04ab643456c531312bf5 /libswscale | |
parent | e779595dcae46c1c1cde64e084759e9585f76e3f (diff) | |
download | ffmpeg-08808084f6e9d3fbccb67d53b4f9a25f9bf81e2f.tar.gz |
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>
(cherry picked from commit 4d18060e56aac9d7248854ba75d5fc19f5cd3db8)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 6c5fa56fce..3cc2c9d4d7 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -975,8 +975,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; @@ -1067,6 +1065,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) |