31#include <benchmark/benchmark.h>
39using std::integral_constant;
43template <
int N>
using v = integral_constant<int, N>;
45template <const iPo
int2D& subSampling,
typename version>
47 static const array<int, 3> sraw_coeffs = {{999, 1000, 1001}};
48 static const int hue = 1269;
54 if constexpr (subSampling.y == 2)
58 iPoint2D subsampledDim = interpolatedDims;
59 subsampledDim.
x /= subSampling.x;
60 subsampledDim.
y /= subSampling.y;
61 subsampledDim.
x *= 2 + subSampling.x * subSampling.y;
76 state.SetComplexityN(interpolatedDims.
area());
77 state.counters.insert(
78 {{
"Pixels", benchmark::Counter(
79 state.complexity_length_n(),
80 benchmark::Counter::Flags::kIsIterationInvariantRate)},
82 benchmark::Counter(3UL *
sizeof(
uint16_t) * state.complexity_length_n(),
83 benchmark::Counter::Flags::kIsIterationInvariantRate,
84 benchmark::Counter::kIs1024)}});
88 b->MeasureProcessCPUTime();
92 static constexpr int L2dByteSize = 512U * (1U << 10U);
93 b->Arg((L2dByteSize / (16 / 8)) / (3 * 2));
97 b->RangeMultiplier(2);
98 if constexpr ((
true)) {
99 b->Arg(2 * 3 * 2 * 1'000'000);
101 b->Range(1, 256 << 20)->Complexity(benchmark::oN);
103 b->Unit(benchmark::kMillisecond);
constexpr uint64_t RAWSPEED_READNONE roundUp(uint64_t value, uint64_t multiple)
constexpr uint64_t RAWSPEED_READNONE roundUp(uint64_t value, uint64_t multiple)
bool RAWSPEED_READNONE benchmarkDryRun()
rawspeed::iPoint2D RAWSPEED_READNONE areaToRectangle(uint64_t area, rawspeed::iPoint2D aspect={2, 2})
static RawImage create(RawImageType type=RawImageType::UINT16)
void interpolate(int version)
Array2DRef< uint16_t > getU16DataAsUncroppedArray2DRef() noexcept
area_type RAWSPEED_READONLY area() const
integral_constant< int, N > v
BENCHMARK_TEMPLATE(BM_Cr2sRawInterpolator, S422, v< 0 >) -> Apply(CustomArguments)
constexpr const iPoint2D S420(2, 2)
void BM_Cr2sRawInterpolator(benchmark::State &state)
void CustomArguments(benchmark::internal::Benchmark *b)
constexpr const iPoint2D S422(2, 1)
constexpr uint64_t RAWSPEED_READNONE roundUp(uint64_t value, uint64_t multiple)
constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value)