libcamera: include/libcamera/internal/software_isp/benchmark.h Source File

libcamera v0.7.0 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
benchmark.h
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2024, Red Hat Inc.
4 *
5 * Authors:
6 * Hans de Goede <hdegoede@redhat.com>
7 *
8 * Simple builtin benchmark to measure software ISP processing times
9 */
10
11#pragma once
12
13#include <stdint.h>
14#include <time.h>
15#include <libcamera/base/log.h>
16#include "libcamera/internal/global_configuration.h"
17
18namespace libcamera {
19
20 class Benchmark
21{
22public:
23 Benchmark(const GlobalConfiguration &configuration);
24 ~Benchmark();
25
26 void startFrame(void);
27 void finishFrame(void);
28
29private:
30 timespec frameStartTime_;
31 bool measure;
32 /* Skip 30 frames for things to stabilize then measure 30 frames */
33 unsigned int encounteredFrames_ = 0;
34 int64_t frameProcessTime_ = 0;
35 unsigned int skipBeforeMeasure_ = 30;
36 unsigned int framesToMeasure_ = 30;
37};
38
39} /* namespace libcamera */
libcamera::Benchmark::finishFrame
void finishFrame(void)
Finish measuring process time for a single frame.
Definition benchmark.cpp:76
libcamera::Benchmark::startFrame
void startFrame(void)
Start measuring process time for a single frame.
Definition benchmark.cpp:55
libcamera::Benchmark::Benchmark
Benchmark(const GlobalConfiguration &configuration)
Constructs a Benchmark object.
Definition benchmark.cpp:29
libcamera::GlobalConfiguration
Support for global libcamera configuration.
Definition global_configuration.h:22
log.h
Logging infrastructure.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17