blob: 5d3e6589e7366fb6f395aa0926575d67c7ad7572 [file] [log] [blame]
#ifndef SAMPLES_RISP4ML_COMMON_CONSTANTS_H_
#define SAMPLES_RISP4ML_COMMON_CONSTANTS_H_
#include <stdint.h>
// Input and output are expected to be 8 bits per pixel
static const uint16_t kPipeInputBpp = 8;
static const uint16_t kPipeOutputBpp = 8;
// TODO(b/149969920): modify sign,bitwidths and internal precision for risp4ml
// Assume 8.8 format
static const uint16_t kRawPipelineBpp = 16;
static const uint16_t kRawPipelineInteger = 8;
static const uint16_t kRawPipelineFraction = 8;
// max = 0xFF.FF = 65535
// represnting 255 + 255/256
static const uint16_t kRawPipelineMaxVal = 0xFFFF;
static const uint16_t kRawPipelineMinVal = 0;
// min fraction = 0x00.01 = 1/256
static const uint16_t kRawPipelineMinFraction = 1;
// BayerIndex defines the order in 2x2 normal Bayer quad.
// +---+---+
// | R | Gr|
// +---+---+
// | Gb| B |
// +---+---+
typedef enum {
kR = 0,
kGr = 1,
kGb = 2,
kB = 3,
} BayerIndex;
typedef enum {
kRggb = 0,
kGrbg = 1,
kGbrg = 2,
kBggr = 3,
} BayerPattern;
#define kNumBayerPatterns 4
// TODO(alexkaplan): Add a way to update this based on the image
// or to make sure the BayerType corresponds to the loaded image
static const BayerPattern kBayerType = kRggb;
#endif // SAMPLES_RISP4ML_COMMON_CONSTANTS_H_