libcamera: software_isp: Move benchmark code to its own class
Move the code for the builtin benchmark to its own small Benchmark class. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> [bod: Fixed up some drift in this patch since initial propostion] Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
4da17de043
commit
bf51f39f3b
39
include/libcamera/internal/software_isp/benchmark.h
Normal file
39
include/libcamera/internal/software_isp/benchmark.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
/*
|
||||
* Copyright (C) 2024, Red Hat Inc.
|
||||
*
|
||||
* Authors:
|
||||
* Hans de Goede <hdegoede@redhat.com>
|
||||
*
|
||||
* Simple builtin benchmark to measure software ISP processing times
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <libcamera/base/log.h>
|
||||
#include "libcamera/internal/global_configuration.h"
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class Benchmark
|
||||
{
|
||||
public:
|
||||
Benchmark(const GlobalConfiguration &configuration);
|
||||
~Benchmark();
|
||||
|
||||
void startFrame(void);
|
||||
void finishFrame(void);
|
||||
|
||||
private:
|
||||
timespec frameStartTime_;
|
||||
bool measure;
|
||||
/* Skip 30 frames for things to stabilize then measure 30 frames */
|
||||
unsigned int encounteredFrames_ = 0;
|
||||
int64_t frameProcessTime_ = 0;
|
||||
unsigned int skipBeforeMeasure_ = 30;
|
||||
unsigned int framesToMeasure_ = 30;
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
@@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
libcamera_internal_headers += files([
|
||||
'benchmark.h',
|
||||
'debayer_params.h',
|
||||
'software_isp.h',
|
||||
'swisp_stats.h',
|
||||
|
||||
Reference in New Issue
Block a user