aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/StubExtFlashReadResponse.pb-c.c
blob: 94e08a943ad2046646d4efdb3dccdd7c7ea2baf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: StubExtFlashReadResponse.proto */

/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif

#include "StubExtFlashReadResponse.pb-c.h"
void   stub_ext_flash_read_response__init
                     (StubExtFlashReadResponse         *message)
{
  static const StubExtFlashReadResponse init_value = STUB_EXT_FLASH_READ_RESPONSE__INIT;
  *message = init_value;
}
size_t stub_ext_flash_read_response__get_packed_size
                     (const StubExtFlashReadResponse *message)
{
  assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t stub_ext_flash_read_response__pack
                     (const StubExtFlashReadResponse *message,
                      uint8_t       *out)
{
  assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t stub_ext_flash_read_response__pack_to_buffer
                     (const StubExtFlashReadResponse *message,
                      ProtobufCBuffer *buffer)
{
  assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
StubExtFlashReadResponse *
       stub_ext_flash_read_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data)
{
  return (StubExtFlashReadResponse *)
     protobuf_c_message_unpack (&stub_ext_flash_read_response__descriptor,
                                allocator, len, data);
}
void   stub_ext_flash_read_response__free_unpacked
                     (StubExtFlashReadResponse *message,
                      ProtobufCAllocator *allocator)
{
  if(!message)
    return;
  assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor stub_ext_flash_read_response__field_descriptors[7] =
{
  {
    "",
    1,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_INT32,
    offsetof(StubExtFlashReadResponse, has_readword_1),
    offsetof(StubExtFlashReadResponse, readword_1),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    2,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_INT32,
    offsetof(StubExtFlashReadResponse, has_readword_2),
    offsetof(StubExtFlashReadResponse, readword_2),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    3,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_INT32,
    offsetof(StubExtFlashReadResponse, has_readword_3),
    offsetof(StubExtFlashReadResponse, readword_3),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    4,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_INT32,
    offsetof(StubExtFlashReadResponse, has_readword_4),
    offsetof(StubExtFlashReadResponse, readword_4),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    5,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_INT32,
    offsetof(StubExtFlashReadResponse, has_readword_5),
    offsetof(StubExtFlashReadResponse, readword_5),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    6,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_STRING,
    0,   /* quantifier_offset */
    offsetof(StubExtFlashReadResponse, status),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "",
    7,
    PROTOBUF_C_LABEL_OPTIONAL,
    PROTOBUF_C_TYPE_UINT32,
    offsetof(StubExtFlashReadResponse, has_statusword),
    offsetof(StubExtFlashReadResponse, statusword),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
};
static const unsigned stub_ext_flash_read_response__field_indices_by_name[] = {
  0,   /* field[0] = ReadWord_1 */
  1,   /* field[1] = ReadWord_2 */
  2,   /* field[2] = ReadWord_3 */
  3,   /* field[3] = ReadWord_4 */
  4,   /* field[4] = ReadWord_5 */
  5,   /* field[5] = Status */
  6,   /* field[6] = StatusWord */
};
static const ProtobufCIntRange stub_ext_flash_read_response__number_ranges[1 + 1] =
{
  { 1, 0 },
  { 0, 7 }
};
const ProtobufCMessageDescriptor stub_ext_flash_read_response__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "",
  "",
  "",
  "",
  sizeof(StubExtFlashReadResponse),
  7,
  stub_ext_flash_read_response__field_descriptors,
  stub_ext_flash_read_response__field_indices_by_name,
  1,  stub_ext_flash_read_response__number_ranges,
  (ProtobufCMessageInit) stub_ext_flash_read_response__init,
  NULL,NULL,NULL    /* reserved[123] */
};
ilter(&_photoreceptorsOutput[0], &_horizontalCellsOutput[0], 1); _OPL_OnOffWaysComputing(); if (useParvoOutput) { // local adaptation processes on ON and OFF ways _spatiotemporalLPfilter(&_bipolarCellsOutputON[0], &(*_localAdaptationON)[0], 2); _localLuminanceAdaptation(&_parvocellularOutputON[0], &(*_localAdaptationON)[0]); _spatiotemporalLPfilter(&_bipolarCellsOutputOFF[0], &_localAdaptationOFF[0], 2); _localLuminanceAdaptation(&_parvocellularOutputOFF[0], &_localAdaptationOFF[0]); //// Final loop that computes the main output of this filter // //// loop that makes the difference between photoreceptor cells output and horizontal cells //// positive part goes on the ON way, negative pat goes on the OFF way float *parvocellularOutputONminusOFF_PTR=&(*_parvocellularOutputONminusOFF)[0]; float *parvocellularOutputON_PTR=&_parvocellularOutputON[0]; float *parvocellularOutputOFF_PTR=&_parvocellularOutputOFF[0]; for (unsigned int IDpixel=0 ; IDpixel<_filterOutput.getNBpixels() ; ++IDpixel) *(parvocellularOutputONminusOFF_PTR++)= (*(parvocellularOutputON_PTR++)-*(parvocellularOutputOFF_PTR++)); } return (*_parvocellularOutputONminusOFF); } void ParvoRetinaFilter::_OPL_OnOffWaysComputing() // WARNING : this method requires many buffer accesses, parallelizing can increase bandwith & core efficacy { // loop that makes the difference between photoreceptor cells output and horizontal cells // positive part goes on the ON way, negative pat goes on the OFF way #ifdef MAKE_PARALLEL cv::parallel_for_(cv::Range(0,_filterOutput.getNBpixels()), Parallel_OPL_OnOffWaysComputing(&_photoreceptorsOutput[0], &_horizontalCellsOutput[0], &_bipolarCellsOutputON[0], &_bipolarCellsOutputOFF[0], &_parvocellularOutputON[0], &_parvocellularOutputOFF[0])); #else float *photoreceptorsOutput_PTR= &_photoreceptorsOutput[0]; float *horizontalCellsOutput_PTR= &_horizontalCellsOutput[0]; float *bipolarCellsON_PTR = &_bipolarCellsOutputON[0]; float *bipolarCellsOFF_PTR = &_bipolarCellsOutputOFF[0]; float *parvocellularOutputON_PTR= &_parvocellularOutputON[0]; float *parvocellularOutputOFF_PTR= &_parvocellularOutputOFF[0]; // compute bipolar cells response equal to photoreceptors minus horizontal cells response // and copy the result on parvo cellular outputs... keeping time before their local contrast adaptation for final result for (unsigned int IDpixel=0 ; IDpixel<_filterOutput.getNBpixels() ; ++IDpixel) { float pixelDifference = *(photoreceptorsOutput_PTR++) -*(horizontalCellsOutput_PTR++); // test condition to allow write pixelDifference in ON or OFF buffer and 0 in the over float isPositive=(float) (pixelDifference>0.0f); // ON and OFF channels writing step *(parvocellularOutputON_PTR++)=*(bipolarCellsON_PTR++) = isPositive*pixelDifference; *(parvocellularOutputOFF_PTR++)=*(bipolarCellsOFF_PTR++)= (isPositive-1.0f)*pixelDifference; } #endif } }// end of namespace bioinspired }// end of namespace cv