diff options
author | Niklas Haas <git@haasn.dev> | 2024-10-09 19:44:33 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-10-24 22:50:00 +0200 |
commit | 67adb303228a5d8e2abe860b7748004cc83ca65f (patch) | |
tree | 5b987107804eb246b68414da8e43789658594c7c /tests/checkasm/sw_rgb.c | |
parent | 153a6dc8faafc4de263a493484ffc1dc2b5b26b2 (diff) | |
download | ffmpeg-67adb303228a5d8e2abe860b7748004cc83ca65f.tar.gz |
swscale: rename SwsContext to SwsInternal
And preserve the public SwsContext as separate name. The motivation here
is that I want to turn SwsContext into a public struct, while keeping the
internal implementation hidden. Additionally, I also want to be able to
use multiple internal implementations, e.g. for GPU devices.
This commit does not include any functional changes. For the most part, it is
a simple rename. The only complications arise from the public facing API
functions, which preserve their current type (and hence require an additional
unwrapping step internally), and the checkasm test framework, which directly
accesses SwsInternal.
For consistency, the affected functions that need to maintain a distionction
have generally been changed to refer to the SwsContext as *sws, and the
SwsInternal as *c.
In an upcoming commit, I will provide a backing definition for the public
SwsContext, and update `sws_internal()` to dereference the internal struct
instead of merely casting it.
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'tests/checkasm/sw_rgb.c')
-rw-r--r-- | tests/checkasm/sw_rgb.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index cdd43df8ba..7af82f0fc7 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -127,7 +127,7 @@ static int cmp_off_by_n(const uint8_t *ref, const uint8_t *test, size_t n, int a return 0; } -static void check_rgb24toyv12(struct SwsContext *ctx) +static void check_rgb24toyv12(SwsInternal *ctx) { static const int input_sizes[] = {16, 128, 512, MAX_LINE_SIZE, -MAX_LINE_SIZE}; @@ -353,7 +353,7 @@ static const enum AVPixelFormat rgb_formats[] = { AV_PIX_FMT_ARGB, }; -static void check_rgb_to_y(struct SwsContext *ctx) +static void check_rgb_to_y(SwsInternal *ctx) { LOCAL_ALIGNED_16(uint8_t, src24, [MAX_LINE_SIZE * 3]); LOCAL_ALIGNED_16(uint8_t, src32, [MAX_LINE_SIZE * 4]); @@ -396,7 +396,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) } } -static void check_rgb_to_uv(struct SwsContext *ctx) +static void check_rgb_to_uv(SwsInternal *ctx) { LOCAL_ALIGNED_16(uint8_t, src24, [MAX_LINE_SIZE * 3]); LOCAL_ALIGNED_16(uint8_t, src32, [MAX_LINE_SIZE * 4]); @@ -450,7 +450,8 @@ static void check_rgb_to_uv(struct SwsContext *ctx) void checkasm_check_sw_rgb(void) { - struct SwsContext *ctx; + SwsContext *sws; + SwsInternal *c; ff_sws_rgb2rgb_init(); @@ -478,20 +479,21 @@ void checkasm_check_sw_rgb(void) check_deinterleave_bytes(); report("deinterleave_bytes"); - ctx = sws_getContext(MAX_LINE_SIZE, MAX_LINE_SIZE, AV_PIX_FMT_RGB24, + sws = sws_getContext(MAX_LINE_SIZE, MAX_LINE_SIZE, AV_PIX_FMT_RGB24, MAX_LINE_SIZE, MAX_LINE_SIZE, AV_PIX_FMT_YUV420P, SWS_ACCURATE_RND | SWS_BITEXACT, NULL, NULL, NULL); - if (!ctx) + if (!sws) fail(); - check_rgb_to_y(ctx); + c = sws_internal(sws); + check_rgb_to_y(c); report("rgb_to_y"); - check_rgb_to_uv(ctx); + check_rgb_to_uv(c); report("rgb_to_uv"); - check_rgb24toyv12(ctx); + check_rgb24toyv12(c); report("rgb24toyv12"); - sws_freeContext(ctx); + sws_freeContext(sws); } |