Coverage Report

Created: 2025-12-31 07:21

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/Simd/src/Simd/SimdAvx2Resizer.cpp
Line
Count
Source
1
/*
2
* Simd Library (http://ermig1979.github.io/Simd).
3
*
4
* Copyright (c) 2011-2025 Yermalayeu Ihar.
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to deal
8
* in the Software without restriction, including without limitation the rights
9
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
* copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* SOFTWARE.
23
*/
24
#include "Simd/SimdMemory.h"
25
#include "Simd/SimdResizer.h"
26
#include "Simd/SimdStore.h"
27
#include "Simd/SimdSet.h"
28
#include "Simd/SimdUpdate.h"
29
#include "Simd/SimdSse41.h"
30
31
namespace Simd
32
{
33
#ifdef SIMD_AVX2_ENABLE 
34
    namespace Avx2
35
    {
36
        void * ResizerInit(size_t srcX, size_t srcY, size_t dstX, size_t dstY, size_t channels, SimdResizeChannelType type, SimdResizeMethodType method)
37
0
        {
38
0
            ResParam param(srcX, srcY, dstX, dstY, channels, type, method, sizeof(__m256i));
39
0
            if (param.IsNearest() && dstX >= F)
40
0
                return new ResizerNearest(param);
41
0
            else if (param.IsByteBilinear() && dstX >= A)
42
0
                return new ResizerByteBilinear(param);
43
0
            else if (param.IsByteBilinearOpenCv() && dstX >= A)
44
0
                return new ResizerByteBilinearOpenCv(param);
45
0
            else if (param.IsShortBilinear() && dstX >= F)
46
0
                return new ResizerShortBilinear(param);
47
0
            else if (param.IsFloatBilinear())
48
0
                return new ResizerFloatBilinear(param);
49
0
            else if (param.IsBf16Bilinear())
50
0
                return new ResizerBf16Bilinear(param);
51
0
            else if (param.IsByteBicubic())
52
0
                return new ResizerByteBicubic(param);
53
0
            else if (param.IsByteArea2x2())
54
#if defined(SIMD_X86_ENABLE) && defined(NDEBUG) && defined(_MSC_VER) && _MSC_VER <= 1900
55
                return new Sse41::ResizerByteArea2x2(param);
56
#else
57
0
                return new ResizerByteArea2x2(param);
58
0
#endif
59
0
            else if (param.IsByteArea1x1())
60
0
                return new ResizerByteArea1x1(param);
61
0
            else
62
0
                return Sse41::ResizerInit(srcX, srcY, dstX, dstY, channels, type, method);
63
0
        }
64
    }
65
#endif 
66
}
67