diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-05-20 13:37:06 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-07-03 15:57:13 +0200 |
commit | fe490ec16531ac2d10a6bd8d3be560d31b00af67 (patch) | |
tree | ee06bc9cbb4285f4eef28a65bf7fbd1ef316ae2d /libswscale/swscale.c | |
parent | 0f8e0957d23038f80c8c6193b4f940cfd0b42c9c (diff) | |
download | ffmpeg-fe490ec16531ac2d10a6bd8d3be560d31b00af67.tar.gz |
sws: separate the calls to scaled vs unscaled conversion
Call the scaler function directly rather than through a function
pointer. Drop the now-unused return value from ff_getSwsFunc() and
rename the function to reflect its new role.
This will be useful in the following commits, where it will become
important that the amount of output is different for scaled vs unscaled
case.
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r-- | libswscale/swscale.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 2db40a6807..4b577ef263 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -579,7 +579,7 @@ static av_cold void sws_init_swscale(SwsContext *c) c->needs_hcscale = 1; } -SwsFunc ff_getSwsFunc(SwsContext *c) +void ff_sws_init_scale(SwsContext *c) { sws_init_swscale(c); @@ -591,8 +591,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c) ff_sws_init_swscale_aarch64(c); if (ARCH_ARM) ff_sws_init_swscale_arm(c); - - return swscale; } static void reset_ptr(const uint8_t *src[], enum AVPixelFormat format) @@ -988,7 +986,11 @@ int attribute_align_arg sws_scale(struct SwsContext *c, /* reset slice direction at end of frame */ if (srcSliceY_internal + srcSliceH == c->srcH) c->sliceDir = 0; - ret = c->swscale(c, src2, srcStride2, srcSliceY_internal, srcSliceH, dst2, dstStride2); + + if (c->swscale) + ret = c->swscale(c, src2, srcStride2, srcSliceY_internal, srcSliceH, dst2, dstStride2); + else + ret = swscale(c, src2, srcStride2, srcSliceY_internal, srcSliceH, dst2, dstStride2); if (c->dstXYZ && !(c->srcXYZ && c->srcW==c->dstW && c->srcH==c->dstH)) { int dstY = c->dstY ? c->dstY : srcSliceY + srcSliceH; |