forked from dillonhuff/clockwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera_pipeline_new_compute.h
6747 lines (6701 loc) · 227 KB
/
camera_pipeline_new_compute.h
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include "hw_classes.h"
#include "clockwork_standard_compute_units.h"
//store is: hw_input_global_wrapper.stencil((hw_input_global_wrapper_s0_x + 4), (hw_input_global_wrapper_s0_y + 4)) = hw_input.stencil(hw_input_global_wrapper_s0_x, hw_input_global_wrapper_s0_y)
hw_uint<16> hcompute_hw_input_global_wrapper_stencil(hw_uint<16>& hw_input_stencil) {
uint16_t _hw_input_stencil_1 = (uint16_t) hw_input_stencil.extract<0, 15>();
return _hw_input_stencil_1;
}
//store is: denoised$1.stencil((denoised_1_s0_x + 2), (denoised_1_s0_y + 2)) = min(hw_input_global_wrapper.stencil((denoised_1_s0_x + 4), (denoised_1_s0_y + 4)), max(hw_input_global_wrapper.stencil((denoised_1_s0_x + 4), (denoised_1_s0_y + 6)), max(hw_input_global_wrapper.stencil((denoised_1_s0_x + 4), (denoised_1_s0_y + 2)), max(hw_input_global_wrapper.stencil((denoised_1_s0_x + 2), (denoised_1_s0_y + 4)), hw_input_global_wrapper.stencil((denoised_1_s0_x + 6), (denoised_1_s0_y + 4))))))
hw_uint<16> hcompute_denoised_1_stencil(hw_uint<80>& hw_input_global_wrapper_stencil) {
uint16_t _hw_input_global_wrapper_stencil_1 = (uint16_t) hw_input_global_wrapper_stencil.extract<0, 15>();
uint16_t _hw_input_global_wrapper_stencil_2 = (uint16_t) hw_input_global_wrapper_stencil.extract<16, 31>();
uint16_t _hw_input_global_wrapper_stencil_3 = (uint16_t) hw_input_global_wrapper_stencil.extract<32, 47>();
uint16_t _hw_input_global_wrapper_stencil_4 = (uint16_t) hw_input_global_wrapper_stencil.extract<48, 63>();
uint16_t _hw_input_global_wrapper_stencil_5 = (uint16_t) hw_input_global_wrapper_stencil.extract<64, 79>();
uint16_t _323 = max(_hw_input_global_wrapper_stencil_4, _hw_input_global_wrapper_stencil_5);
uint16_t _324 = max(_hw_input_global_wrapper_stencil_3, _323);
uint16_t _325 = max(_hw_input_global_wrapper_stencil_2, _324);
uint16_t _326 = min(_hw_input_global_wrapper_stencil_1, _325);
return _326;
}
//store is: b_b.stencil(b_b_s0_x, (b_b_s0_y + 1)) = denoised$1.stencil(((b_b_s0_x*2) + 2), ((b_b_s0_y*2) + 3))
hw_uint<16> hcompute_b_b_stencil(hw_uint<16>& denoised_1_stencil) {
uint16_t _denoised_1_stencil_1 = (uint16_t) denoised_1_stencil.extract<0, 15>();
return _denoised_1_stencil_1;
}
//store is: g_gb.stencil((g_gb_s0_x + 1), (g_gb_s0_y + 1)) = denoised$1.stencil(((g_gb_s0_x*2) + 3), ((g_gb_s0_y*2) + 3))
hw_uint<16> hcompute_g_gb_stencil(hw_uint<16>& denoised_1_stencil) {
uint16_t _denoised_1_stencil_2 = (uint16_t) denoised_1_stencil.extract<0, 15>();
return _denoised_1_stencil_2;
}
//store is: g_gr.stencil((g_gr_s0_x + 1), (g_gr_s0_y + 1)) = denoised$1.stencil(((g_gr_s0_x*2) + 2), ((g_gr_s0_y*2) + 2))
hw_uint<16> hcompute_g_gr_stencil(hw_uint<16>& denoised_1_stencil) {
uint16_t _denoised_1_stencil_3 = (uint16_t) denoised_1_stencil.extract<0, 15>();
return _denoised_1_stencil_3;
}
//store is: r_r.stencil((r_r_s0_x + 1), r_r_s0_y) = denoised$1.stencil(((r_r_s0_x*2) + 3), ((r_r_s0_y*2) + 2))
hw_uint<16> hcompute_r_r_stencil(hw_uint<16>& denoised_1_stencil) {
uint16_t _denoised_1_stencil_4 = (uint16_t) denoised_1_stencil.extract<0, 15>();
return _denoised_1_stencil_4;
}
//store is: demosaicked$1.stencil(demosaicked_1_s0_x, demosaicked_1_s0_y, 0) = select(((demosaicked_1_s0_y % 2) == 0), select(((demosaicked_1_s0_x % 2) == 0), ((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + (((r_r.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2)) + r_r.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2)) - (((select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2)) + select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)), g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gb.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2)), g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)))), (((g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2)), r_r.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))), select(((demosaicked_1_s0_x % 2) == 0), select((absd(r_r.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2)), r_r.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1))) < absd(r_r.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2)), r_r.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((((r_r.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + r_r.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2) + select((absd(g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2))) - (((select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)), g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 2))) < absd(g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)), g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 2)))), (((g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2))) + (uint16)1)/(uint16)2), (((g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 2)) + g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2)) + select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2)), (((((r_r.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + r_r.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2) + select((absd(g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2))) - (((select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)), g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gb.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2)), g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)))), (((g_gr.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil((demosaicked_1_s0_x/2), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil((demosaicked_1_s0_x/2), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2)) + select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2))) < absd(g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)))), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2))), ((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + (((r_r.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + r_r.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2)) - (((select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), (demosaicked_1_s0_y/2))) + (uint16)1)/(uint16)2)) + select((absd(g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2))) < absd(g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)))), (((g_gr.stencil(((demosaicked_1_s0_x/2) + 2), ((demosaicked_1_s0_y/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 2)) + g_gb.stencil(((demosaicked_1_s0_x/2) + 1), ((demosaicked_1_s0_y/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2))))
hw_uint<16> hcompute_demosaicked_1_stencil(hw_uint<96>& g_gb_stencil, hw_uint<96>& g_gr_stencil, hw_uint<64>& r_r_stencil, const int _demosaicked_1_s0_x, const int _demosaicked_1_s0_y) {
uint16_t _g_gb_stencil_1 = (uint16_t) g_gb_stencil.extract<0, 15>();
uint16_t _g_gb_stencil_2 = (uint16_t) g_gb_stencil.extract<16, 31>();
uint16_t _g_gb_stencil_3 = (uint16_t) g_gb_stencil.extract<32, 47>();
uint16_t _g_gb_stencil_4 = (uint16_t) g_gb_stencil.extract<48, 63>();
uint16_t _g_gb_stencil_5 = (uint16_t) g_gb_stencil.extract<64, 79>();
uint16_t _g_gb_stencil_6 = (uint16_t) g_gb_stencil.extract<80, 95>();
uint16_t _g_gr_stencil_1 = (uint16_t) g_gr_stencil.extract<0, 15>();
uint16_t _g_gr_stencil_2 = (uint16_t) g_gr_stencil.extract<16, 31>();
uint16_t _g_gr_stencil_3 = (uint16_t) g_gr_stencil.extract<32, 47>();
uint16_t _g_gr_stencil_4 = (uint16_t) g_gr_stencil.extract<48, 63>();
uint16_t _g_gr_stencil_5 = (uint16_t) g_gr_stencil.extract<64, 79>();
uint16_t _g_gr_stencil_6 = (uint16_t) g_gr_stencil.extract<80, 95>();
uint16_t _r_r_stencil_1 = (uint16_t) r_r_stencil.extract<0, 15>();
uint16_t _r_r_stencil_2 = (uint16_t) r_r_stencil.extract<16, 31>();
uint16_t _r_r_stencil_3 = (uint16_t) r_r_stencil.extract<32, 47>();
uint16_t _r_r_stencil_4 = (uint16_t) r_r_stencil.extract<48, 63>();
uint16_t _372 = _r_r_stencil_1 + _r_r_stencil_2;
uint16_t _373 = (uint16_t)(1);
uint16_t _374 = _372 + _373;
uint16_t _375 = _374 >> _373;
uint16_t _376 = _g_gr_stencil_1 + _375;
uint16_t _377 = _g_gr_stencil_1 + _g_gr_stencil_2;
uint16_t _378 = _377 + _373;
uint16_t _379 = _378 >> _373;
uint16_t _380 = _g_gb_stencil_2 + _g_gb_stencil_1;
uint16_t _381 = _380 + _373;
uint16_t _382 = _381 >> _373;
uint16_t _383 = _g_gr_stencil_1 - _g_gr_stencil_2;
uint16_t _384 = _g_gr_stencil_2 - _g_gr_stencil_1;
bool _385 = _g_gr_stencil_2 < _g_gr_stencil_1;
uint16_t _386 = (uint16_t)(_385 ? _383 : _384);
uint16_t _387 = _386;
uint16_t _388 = _g_gb_stencil_2 - _g_gb_stencil_1;
uint16_t _389 = _g_gb_stencil_1 - _g_gb_stencil_2;
bool _390 = _g_gb_stencil_1 < _g_gb_stencil_2;
uint16_t _391 = (uint16_t)(_390 ? _388 : _389);
uint16_t _392 = _391;
bool _393 = _387 < _392;
uint16_t _394 = (uint16_t)(_393 ? _379 : _382);
uint16_t _395 = _g_gr_stencil_3 + _g_gr_stencil_1;
uint16_t _396 = _395 + _373;
uint16_t _397 = _396 >> _373;
uint16_t _398 = _g_gb_stencil_4 + _g_gb_stencil_3;
uint16_t _399 = _398 + _373;
uint16_t _400 = _399 >> _373;
uint16_t _401 = _g_gr_stencil_3 - _g_gr_stencil_1;
uint16_t _402 = _g_gr_stencil_1 - _g_gr_stencil_3;
bool _403 = _g_gr_stencil_1 < _g_gr_stencil_3;
uint16_t _404 = (uint16_t)(_403 ? _401 : _402);
uint16_t _405 = _404;
uint16_t _406 = _g_gb_stencil_4 - _g_gb_stencil_3;
uint16_t _407 = _g_gb_stencil_3 - _g_gb_stencil_4;
bool _408 = _g_gb_stencil_3 < _g_gb_stencil_4;
uint16_t _409 = (uint16_t)(_408 ? _406 : _407);
uint16_t _410 = _409;
bool _411 = _405 < _410;
uint16_t _412 = (uint16_t)(_411 ? _397 : _400);
uint16_t _413 = _394 + _412;
uint16_t _414 = _413 + _373;
uint16_t _415 = _414 >> _373;
uint16_t _416 = _376 - _415;
int32_t _417 = _demosaicked_1_s0_x & 1;
bool _418 = _417 == 0;
uint16_t _419 = (uint16_t)(_418 ? _416 : _r_r_stencil_2);
uint16_t _420 = _r_r_stencil_3 + _r_r_stencil_2;
uint16_t _421 = _420 + _373;
uint16_t _422 = _421 >> _373;
uint16_t _423 = _g_gb_stencil_4 + _g_gb_stencil_2;
uint16_t _424 = _423 + _373;
uint16_t _425 = _424 >> _373;
uint16_t _426 = _g_gr_stencil_4 + _g_gr_stencil_1;
uint16_t _427 = _426 + _373;
uint16_t _428 = _427 >> _373;
uint16_t _429 = _g_gb_stencil_2 - _g_gb_stencil_4;
uint16_t _430 = _g_gb_stencil_4 - _g_gb_stencil_2;
bool _431 = _g_gb_stencil_4 < _g_gb_stencil_2;
uint16_t _432 = (uint16_t)(_431 ? _429 : _430);
uint16_t _433 = _432;
uint16_t _434 = _g_gr_stencil_1 - _g_gr_stencil_4;
uint16_t _435 = _g_gr_stencil_4 - _g_gr_stencil_1;
bool _436 = _g_gr_stencil_4 < _g_gr_stencil_1;
uint16_t _437 = (uint16_t)(_436 ? _434 : _435);
uint16_t _438 = _437;
bool _439 = _433 < _438;
uint16_t _440 = (uint16_t)(_439 ? _425 : _428);
uint16_t _441 = _422 + _440;
uint16_t _442 = _g_gr_stencil_5 + _g_gr_stencil_4;
uint16_t _443 = _442 + _373;
uint16_t _444 = _443 >> _373;
uint16_t _445 = _g_gb_stencil_5 + _g_gb_stencil_4;
uint16_t _446 = _445 + _373;
uint16_t _447 = _446 >> _373;
uint16_t _448 = _g_gr_stencil_5 - _g_gr_stencil_4;
uint16_t _449 = _g_gr_stencil_4 - _g_gr_stencil_5;
bool _450 = _g_gr_stencil_4 < _g_gr_stencil_5;
uint16_t _451 = (uint16_t)(_450 ? _448 : _449);
uint16_t _452 = _451;
uint16_t _453 = _g_gb_stencil_5 - _g_gb_stencil_4;
uint16_t _454 = _g_gb_stencil_4 - _g_gb_stencil_5;
bool _455 = _g_gb_stencil_4 < _g_gb_stencil_5;
uint16_t _456 = (uint16_t)(_455 ? _453 : _454);
uint16_t _457 = _456;
bool _458 = _452 < _457;
uint16_t _459 = (uint16_t)(_458 ? _444 : _447);
uint16_t _460 = _459 + _394;
uint16_t _461 = _460 + _373;
uint16_t _462 = _461 >> _373;
uint16_t _463 = _441 - _462;
uint16_t _464 = _r_r_stencil_4 + _r_r_stencil_1;
uint16_t _465 = _464 + _373;
uint16_t _466 = _465 >> _373;
uint16_t _467 = _466 + _440;
uint16_t _468 = _g_gr_stencil_6 + _g_gr_stencil_4;
uint16_t _469 = _468 + _373;
uint16_t _470 = _469 >> _373;
uint16_t _471 = _g_gb_stencil_6 + _g_gb_stencil_2;
uint16_t _472 = _471 + _373;
uint16_t _473 = _472 >> _373;
uint16_t _474 = _g_gr_stencil_4 - _g_gr_stencil_6;
uint16_t _475 = _g_gr_stencil_6 - _g_gr_stencil_4;
bool _476 = _g_gr_stencil_6 < _g_gr_stencil_4;
uint16_t _477 = (uint16_t)(_476 ? _474 : _475);
uint16_t _478 = _477;
uint16_t _479 = _g_gb_stencil_6 - _g_gb_stencil_2;
uint16_t _480 = _g_gb_stencil_2 - _g_gb_stencil_6;
bool _481 = _g_gb_stencil_2 < _g_gb_stencil_6;
uint16_t _482 = (uint16_t)(_481 ? _479 : _480);
uint16_t _483 = _482;
bool _484 = _478 < _483;
uint16_t _485 = (uint16_t)(_484 ? _470 : _473);
uint16_t _486 = _412 + _485;
uint16_t _487 = _486 + _373;
uint16_t _488 = _487 >> _373;
uint16_t _489 = _467 - _488;
uint16_t _490 = _r_r_stencil_3 - _r_r_stencil_2;
uint16_t _491 = _r_r_stencil_2 - _r_r_stencil_3;
bool _492 = _r_r_stencil_2 < _r_r_stencil_3;
uint16_t _493 = (uint16_t)(_492 ? _490 : _491);
uint16_t _494 = _493;
uint16_t _495 = _r_r_stencil_4 - _r_r_stencil_1;
uint16_t _496 = _r_r_stencil_1 - _r_r_stencil_4;
bool _497 = _r_r_stencil_1 < _r_r_stencil_4;
uint16_t _498 = (uint16_t)(_497 ? _495 : _496);
uint16_t _499 = _498;
bool _500 = _494 < _499;
uint16_t _501 = (uint16_t)(_500 ? _463 : _489);
uint16_t _502 = _r_r_stencil_4 + _r_r_stencil_2;
uint16_t _503 = _502 + _373;
uint16_t _504 = _503 >> _373;
uint16_t _505 = _g_gb_stencil_2 + _504;
uint16_t _506 = _394 + _485;
uint16_t _507 = _506 + _373;
uint16_t _508 = _507 >> _373;
uint16_t _509 = _505 - _508;
uint16_t _510 = (uint16_t)(_418 ? _501 : _509);
int32_t _511 = _demosaicked_1_s0_y & 1;
bool _512 = _511 == 0;
uint16_t _513 = (uint16_t)(_512 ? _419 : _510);
return _513;
}
//store is: demosaicked$1.stencil(demosaicked_1_s0_x_1, demosaicked_1_s0_y_1, 1) = select(((demosaicked_1_s0_y_1 % 2) == 0), select(((demosaicked_1_s0_x_1 % 2) == 0), g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1)), select((absd(g_gr.stencil(((demosaicked_1_s0_x_1/2) + 2), ((demosaicked_1_s0_y_1/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), (demosaicked_1_s0_y_1/2)), g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x_1/2) + 2), ((demosaicked_1_s0_y_1/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), (demosaicked_1_s0_y_1/2))) + (uint16)1)/(uint16)2))), select(((demosaicked_1_s0_x_1 % 2) == 0), select((absd(g_gb.stencil((demosaicked_1_s0_x_1/2), ((demosaicked_1_s0_y_1/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x_1/2), ((demosaicked_1_s0_y_1/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1))) + (uint16)1)/(uint16)2)), g_gb.stencil(((demosaicked_1_s0_x_1/2) + 1), ((demosaicked_1_s0_y_1/2) + 1))))
hw_uint<16> hcompute_demosaicked_1_stencil_1(hw_uint<48>& g_gb_stencil, hw_uint<48>& g_gr_stencil, const int _demosaicked_1_s0_x_1, const int _demosaicked_1_s0_y_1) {
uint16_t _g_gb_stencil_7 = (uint16_t) g_gb_stencil.extract<0, 15>();
uint16_t _g_gb_stencil_8 = (uint16_t) g_gb_stencil.extract<16, 31>();
uint16_t _g_gb_stencil_9 = (uint16_t) g_gb_stencil.extract<32, 47>();
uint16_t _g_gr_stencil_7 = (uint16_t) g_gr_stencil.extract<0, 15>();
uint16_t _g_gr_stencil_8 = (uint16_t) g_gr_stencil.extract<16, 31>();
uint16_t _g_gr_stencil_9 = (uint16_t) g_gr_stencil.extract<32, 47>();
uint16_t _773 = _g_gr_stencil_7 + _g_gr_stencil_8;
uint16_t _774 = (uint16_t)(1);
uint16_t _775 = _773 + _774;
uint16_t _776 = _775 >> _774;
uint16_t _777 = _g_gb_stencil_8 + _g_gb_stencil_7;
uint16_t _778 = _777 + _774;
uint16_t _779 = _778 >> _774;
uint16_t _780 = _g_gr_stencil_7 - _g_gr_stencil_8;
uint16_t _781 = _g_gr_stencil_8 - _g_gr_stencil_7;
bool _782 = _g_gr_stencil_8 < _g_gr_stencil_7;
uint16_t _783 = (uint16_t)(_782 ? _780 : _781);
uint16_t _784 = _783;
uint16_t _785 = _g_gb_stencil_8 - _g_gb_stencil_7;
uint16_t _786 = _g_gb_stencil_7 - _g_gb_stencil_8;
bool _787 = _g_gb_stencil_7 < _g_gb_stencil_8;
uint16_t _788 = (uint16_t)(_787 ? _785 : _786);
uint16_t _789 = _788;
bool _790 = _784 < _789;
uint16_t _791 = (uint16_t)(_790 ? _776 : _779);
int32_t _792 = _demosaicked_1_s0_x_1 & 1;
bool _793 = _792 == 0;
uint16_t _794 = (uint16_t)(_793 ? _g_gr_stencil_7 : _791);
uint16_t _795 = _g_gb_stencil_9 + _g_gb_stencil_8;
uint16_t _796 = _795 + _774;
uint16_t _797 = _796 >> _774;
uint16_t _798 = _g_gr_stencil_9 + _g_gr_stencil_7;
uint16_t _799 = _798 + _774;
uint16_t _800 = _799 >> _774;
uint16_t _801 = _g_gb_stencil_8 - _g_gb_stencil_9;
uint16_t _802 = _g_gb_stencil_9 - _g_gb_stencil_8;
bool _803 = _g_gb_stencil_9 < _g_gb_stencil_8;
uint16_t _804 = (uint16_t)(_803 ? _801 : _802);
uint16_t _805 = _804;
uint16_t _806 = _g_gr_stencil_7 - _g_gr_stencil_9;
uint16_t _807 = _g_gr_stencil_9 - _g_gr_stencil_7;
bool _808 = _g_gr_stencil_9 < _g_gr_stencil_7;
uint16_t _809 = (uint16_t)(_808 ? _806 : _807);
uint16_t _810 = _809;
bool _811 = _805 < _810;
uint16_t _812 = (uint16_t)(_811 ? _797 : _800);
uint16_t _813 = (uint16_t)(_793 ? _812 : _g_gb_stencil_8);
int32_t _814 = _demosaicked_1_s0_y_1 & 1;
bool _815 = _814 == 0;
uint16_t _816 = (uint16_t)(_815 ? _794 : _813);
return _816;
}
//store is: demosaicked$1.stencil(demosaicked_1_s0_x_2, demosaicked_1_s0_y_2, 2) = select(((demosaicked_1_s0_y_2 % 2) == 0), select(((demosaicked_1_s0_x_2 % 2) == 0), ((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + (((b_b.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)) + b_b.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) - (((select((absd(g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) + select((absd(g_gb.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)))), (((g_gb.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2)), select((absd(b_b.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)), b_b.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) < absd(b_b.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)), b_b.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)))), (((((b_b.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)) + b_b.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2) + select((absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) + (uint16)1)/(uint16)2))) - (((select((absd(g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), (demosaicked_1_s0_y_2/2))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), (demosaicked_1_s0_y_2/2)))), (((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), (demosaicked_1_s0_y_2/2)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), (demosaicked_1_s0_y_2/2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) + select((absd(g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2)), (((((b_b.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)) + b_b.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2) + select((absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) + (uint16)1)/(uint16)2))) - (((select((absd(g_gb.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)))), (((g_gb.stencil((demosaicked_1_s0_x_2/2), (demosaicked_1_s0_y_2/2)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), (demosaicked_1_s0_y_2/2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) + select((absd(g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2)))), select(((demosaicked_1_s0_x_2 % 2) == 0), b_b.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)), ((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + (((b_b.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)) + b_b.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) - (((select((absd(g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gb.stencil((demosaicked_1_s0_x_2/2), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2)) + select((absd(g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1)), g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) < absd(g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 2)), g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)))), (((g_gb.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1)) + g_gb.stencil(((demosaicked_1_s0_x_2/2) + 1), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2), (((g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 2)) + g_gr.stencil(((demosaicked_1_s0_x_2/2) + 2), ((demosaicked_1_s0_y_2/2) + 1))) + (uint16)1)/(uint16)2))) + (uint16)1)/(uint16)2))))
hw_uint<16> hcompute_demosaicked_1_stencil_2(hw_uint<64>& b_b_stencil, hw_uint<96>& g_gb_stencil, hw_uint<96>& g_gr_stencil, const int _demosaicked_1_s0_x_2, const int _demosaicked_1_s0_y_2) {
uint16_t _b_b_stencil_1 = (uint16_t) b_b_stencil.extract<0, 15>();
uint16_t _b_b_stencil_2 = (uint16_t) b_b_stencil.extract<16, 31>();
uint16_t _b_b_stencil_3 = (uint16_t) b_b_stencil.extract<32, 47>();
uint16_t _b_b_stencil_4 = (uint16_t) b_b_stencil.extract<48, 63>();
uint16_t _g_gb_stencil_10 = (uint16_t) g_gb_stencil.extract<0, 15>();
uint16_t _g_gb_stencil_11 = (uint16_t) g_gb_stencil.extract<16, 31>();
uint16_t _g_gb_stencil_12 = (uint16_t) g_gb_stencil.extract<32, 47>();
uint16_t _g_gb_stencil_13 = (uint16_t) g_gb_stencil.extract<48, 63>();
uint16_t _g_gb_stencil_14 = (uint16_t) g_gb_stencil.extract<64, 79>();
uint16_t _g_gb_stencil_15 = (uint16_t) g_gb_stencil.extract<80, 95>();
uint16_t _g_gr_stencil_10 = (uint16_t) g_gr_stencil.extract<0, 15>();
uint16_t _g_gr_stencil_11 = (uint16_t) g_gr_stencil.extract<16, 31>();
uint16_t _g_gr_stencil_12 = (uint16_t) g_gr_stencil.extract<32, 47>();
uint16_t _g_gr_stencil_13 = (uint16_t) g_gr_stencil.extract<48, 63>();
uint16_t _g_gr_stencil_14 = (uint16_t) g_gr_stencil.extract<64, 79>();
uint16_t _g_gr_stencil_15 = (uint16_t) g_gr_stencil.extract<80, 95>();
uint16_t _902 = _b_b_stencil_1 + _b_b_stencil_2;
uint16_t _903 = (uint16_t)(1);
uint16_t _904 = _902 + _903;
uint16_t _905 = _904 >> _903;
uint16_t _906 = _g_gr_stencil_10 + _905;
uint16_t _907 = _g_gb_stencil_10 + _g_gb_stencil_11;
uint16_t _908 = _907 + _903;
uint16_t _909 = _908 >> _903;
uint16_t _910 = _g_gr_stencil_11 + _g_gr_stencil_10;
uint16_t _911 = _910 + _903;
uint16_t _912 = _911 >> _903;
uint16_t _913 = _g_gb_stencil_11 - _g_gb_stencil_10;
uint16_t _914 = _g_gb_stencil_10 - _g_gb_stencil_11;
bool _915 = _g_gb_stencil_10 < _g_gb_stencil_11;
uint16_t _916 = (uint16_t)(_915 ? _913 : _914);
uint16_t _917 = _916;
uint16_t _918 = _g_gr_stencil_10 - _g_gr_stencil_11;
uint16_t _919 = _g_gr_stencil_11 - _g_gr_stencil_10;
bool _920 = _g_gr_stencil_11 < _g_gr_stencil_10;
uint16_t _921 = (uint16_t)(_920 ? _918 : _919);
uint16_t _922 = _921;
bool _923 = _917 < _922;
uint16_t _924 = (uint16_t)(_923 ? _909 : _912);
uint16_t _925 = _g_gb_stencil_12 + _g_gb_stencil_13;
uint16_t _926 = _925 + _903;
uint16_t _927 = _926 >> _903;
uint16_t _928 = _g_gr_stencil_12 + _g_gr_stencil_10;
uint16_t _929 = _928 + _903;
uint16_t _930 = _929 >> _903;
uint16_t _931 = _g_gb_stencil_13 - _g_gb_stencil_12;
uint16_t _932 = _g_gb_stencil_12 - _g_gb_stencil_13;
bool _933 = _g_gb_stencil_12 < _g_gb_stencil_13;
uint16_t _934 = (uint16_t)(_933 ? _931 : _932);
uint16_t _935 = _934;
uint16_t _936 = _g_gr_stencil_12 - _g_gr_stencil_10;
uint16_t _937 = _g_gr_stencil_10 - _g_gr_stencil_12;
bool _938 = _g_gr_stencil_10 < _g_gr_stencil_12;
uint16_t _939 = (uint16_t)(_938 ? _936 : _937);
uint16_t _940 = _939;
bool _941 = _935 < _940;
uint16_t _942 = (uint16_t)(_941 ? _927 : _930);
uint16_t _943 = _924 + _942;
uint16_t _944 = _943 + _903;
uint16_t _945 = _944 >> _903;
uint16_t _946 = _906 - _945;
uint16_t _947 = _b_b_stencil_3 + _b_b_stencil_2;
uint16_t _948 = _947 + _903;
uint16_t _949 = _948 >> _903;
uint16_t _950 = _g_gr_stencil_10 + _g_gr_stencil_13;
uint16_t _951 = _950 + _903;
uint16_t _952 = _951 >> _903;
uint16_t _953 = _g_gb_stencil_11 + _g_gb_stencil_13;
uint16_t _954 = _953 + _903;
uint16_t _955 = _954 >> _903;
uint16_t _956 = _g_gr_stencil_10 - _g_gr_stencil_13;
uint16_t _957 = _g_gr_stencil_13 - _g_gr_stencil_10;
bool _958 = _g_gr_stencil_13 < _g_gr_stencil_10;
uint16_t _959 = (uint16_t)(_958 ? _956 : _957);
uint16_t _960 = _959;
uint16_t _961 = _g_gb_stencil_11 - _g_gb_stencil_13;
uint16_t _962 = _g_gb_stencil_13 - _g_gb_stencil_11;
bool _963 = _g_gb_stencil_13 < _g_gb_stencil_11;
uint16_t _964 = (uint16_t)(_963 ? _961 : _962);
uint16_t _965 = _964;
bool _966 = _960 < _965;
uint16_t _967 = (uint16_t)(_966 ? _952 : _955);
uint16_t _968 = _949 + _967;
uint16_t _969 = _g_gb_stencil_14 + _g_gb_stencil_13;
uint16_t _970 = _969 + _903;
uint16_t _971 = _970 >> _903;
uint16_t _972 = _g_gr_stencil_14 + _g_gr_stencil_13;
uint16_t _973 = _972 + _903;
uint16_t _974 = _973 >> _903;
uint16_t _975 = _g_gb_stencil_14 - _g_gb_stencil_13;
uint16_t _976 = _g_gb_stencil_13 - _g_gb_stencil_14;
bool _977 = _g_gb_stencil_13 < _g_gb_stencil_14;
uint16_t _978 = (uint16_t)(_977 ? _975 : _976);
uint16_t _979 = _978;
uint16_t _980 = _g_gr_stencil_14 - _g_gr_stencil_13;
uint16_t _981 = _g_gr_stencil_13 - _g_gr_stencil_14;
bool _982 = _g_gr_stencil_13 < _g_gr_stencil_14;
uint16_t _983 = (uint16_t)(_982 ? _980 : _981);
uint16_t _984 = _983;
bool _985 = _979 < _984;
uint16_t _986 = (uint16_t)(_985 ? _971 : _974);
uint16_t _987 = _986 + _924;
uint16_t _988 = _987 + _903;
uint16_t _989 = _988 >> _903;
uint16_t _990 = _968 - _989;
uint16_t _991 = _b_b_stencil_1 + _b_b_stencil_4;
uint16_t _992 = _991 + _903;
uint16_t _993 = _992 >> _903;
uint16_t _994 = _993 + _967;
uint16_t _995 = _g_gb_stencil_15 + _g_gb_stencil_11;
uint16_t _996 = _995 + _903;
uint16_t _997 = _996 >> _903;
uint16_t _998 = _g_gr_stencil_15 + _g_gr_stencil_13;
uint16_t _999 = _998 + _903;
uint16_t _1000 = _999 >> _903;
uint16_t _1001 = _g_gb_stencil_15 - _g_gb_stencil_11;
uint16_t _1002 = _g_gb_stencil_11 - _g_gb_stencil_15;
bool _1003 = _g_gb_stencil_11 < _g_gb_stencil_15;
uint16_t _1004 = (uint16_t)(_1003 ? _1001 : _1002);
uint16_t _1005 = _1004;
uint16_t _1006 = _g_gr_stencil_13 - _g_gr_stencil_15;
uint16_t _1007 = _g_gr_stencil_15 - _g_gr_stencil_13;
bool _1008 = _g_gr_stencil_15 < _g_gr_stencil_13;
uint16_t _1009 = (uint16_t)(_1008 ? _1006 : _1007);
uint16_t _1010 = _1009;
bool _1011 = _1005 < _1010;
uint16_t _1012 = (uint16_t)(_1011 ? _997 : _1000);
uint16_t _1013 = _942 + _1012;
uint16_t _1014 = _1013 + _903;
uint16_t _1015 = _1014 >> _903;
uint16_t _1016 = _994 - _1015;
uint16_t _1017 = _b_b_stencil_3 - _b_b_stencil_2;
uint16_t _1018 = _b_b_stencil_2 - _b_b_stencil_3;
bool _1019 = _b_b_stencil_2 < _b_b_stencil_3;
uint16_t _1020 = (uint16_t)(_1019 ? _1017 : _1018);
uint16_t _1021 = _1020;
uint16_t _1022 = _b_b_stencil_1 - _b_b_stencil_4;
uint16_t _1023 = _b_b_stencil_4 - _b_b_stencil_1;
bool _1024 = _b_b_stencil_4 < _b_b_stencil_1;
uint16_t _1025 = (uint16_t)(_1024 ? _1022 : _1023);
uint16_t _1026 = _1025;
bool _1027 = _1021 < _1026;
uint16_t _1028 = (uint16_t)(_1027 ? _990 : _1016);
int32_t _1029 = _demosaicked_1_s0_x_2 & 1;
bool _1030 = _1029 == 0;
uint16_t _1031 = (uint16_t)(_1030 ? _946 : _1028);
uint16_t _1032 = _b_b_stencil_4 + _b_b_stencil_2;
uint16_t _1033 = _1032 + _903;
uint16_t _1034 = _1033 >> _903;
uint16_t _1035 = _g_gb_stencil_11 + _1034;
uint16_t _1036 = _924 + _1012;
uint16_t _1037 = _1036 + _903;
uint16_t _1038 = _1037 >> _903;
uint16_t _1039 = _1035 - _1038;
uint16_t _1040 = (uint16_t)(_1030 ? _b_b_stencil_2 : _1039);
int32_t _1041 = _demosaicked_1_s0_y_2 & 1;
bool _1042 = _1041 == 0;
uint16_t _1043 = (uint16_t)(_1042 ? _1031 : _1040);
return _1043;
}
//store is: corrected.stencil(corrected_s0_x, corrected_s0_y, 0) = (((int16(((int32(min(demosaicked$1.stencil(corrected_s0_x, corrected_s0_y, 0), (uint16)10000))*549)/256)) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x, corrected_s0_y, 1), (uint16)10000))*-103)/256))) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x, corrected_s0_y, 2), (uint16)10000))*7)/256))) + (int16)-40)
hw_uint<16> hcompute_corrected_stencil(hw_uint<48>& demosaicked_1_stencil) {
uint16_t _demosaicked_1_stencil_1 = (uint16_t) demosaicked_1_stencil.extract<0, 15>();
uint16_t _demosaicked_1_stencil_2 = (uint16_t) demosaicked_1_stencil.extract<16, 31>();
uint16_t _demosaicked_1_stencil_3 = (uint16_t) demosaicked_1_stencil.extract<32, 47>();
uint16_t _1303 = (uint16_t)(10000);
uint16_t _1304 = min(_demosaicked_1_stencil_1, _1303);
int32_t _1305 = (int32_t)(_1304);
int32_t _1306 = _1305 * 549;
int32_t _1307 = _1306 >> 8;
int16_t _1308 = (int16_t)(_1307);
uint16_t _1309 = min(_demosaicked_1_stencil_2, _1303);
int32_t _1310 = (int32_t)(_1309);
int32_t _1311 = _1310 * -103;
int32_t _1312 = _1311 >> 8;
int16_t _1313 = (int16_t)(_1312);
int16_t _1314 = _1308 + _1313;
uint16_t _1315 = min(_demosaicked_1_stencil_3, _1303);
int32_t _1316 = (int32_t)(_1315);
int32_t _1317 = _1316 * 7;
int32_t _1318 = _1317 >> 8;
int16_t _1319 = (int16_t)(_1318);
int16_t _1320 = _1314 + _1319;
int16_t _1321 = (int16_t)(-40);
int16_t _1322 = _1320 + _1321;
return _1322;
}
//store is: corrected.stencil(corrected_s0_x_1, corrected_s0_y_1, 1) = (((int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_1, corrected_s0_y_1, 0), (uint16)10000))*-96)/256)) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_1, corrected_s0_y_1, 1), (uint16)10000))*373)/256))) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_1, corrected_s0_y_1, 2), (uint16)10000))*62)/256))) + (int16)-29)
hw_uint<16> hcompute_corrected_stencil_1(hw_uint<48>& demosaicked_1_stencil) {
uint16_t _demosaicked_1_stencil_4 = (uint16_t) demosaicked_1_stencil.extract<0, 15>();
uint16_t _demosaicked_1_stencil_5 = (uint16_t) demosaicked_1_stencil.extract<16, 31>();
uint16_t _demosaicked_1_stencil_6 = (uint16_t) demosaicked_1_stencil.extract<32, 47>();
uint16_t _1370 = (uint16_t)(10000);
uint16_t _1371 = min(_demosaicked_1_stencil_4, _1370);
int32_t _1372 = (int32_t)(_1371);
int32_t _1373 = _1372 * -96;
int32_t _1374 = _1373 >> 8;
int16_t _1375 = (int16_t)(_1374);
uint16_t _1376 = min(_demosaicked_1_stencil_5, _1370);
int32_t _1377 = (int32_t)(_1376);
int32_t _1378 = _1377 * 373;
int32_t _1379 = _1378 >> 8;
int16_t _1380 = (int16_t)(_1379);
int16_t _1381 = _1375 + _1380;
uint16_t _1382 = min(_demosaicked_1_stencil_6, _1370);
int32_t _1383 = (int32_t)(_1382);
int32_t _1384 = _1383 * 62;
int32_t _1385 = _1384 >> 8;
int16_t _1386 = (int16_t)(_1385);
int16_t _1387 = _1381 + _1386;
int16_t _1388 = (int16_t)(-29);
int16_t _1389 = _1387 + _1388;
return _1389;
}
//store is: corrected.stencil(corrected_s0_x_2, corrected_s0_y_2, 2) = (((int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_2, corrected_s0_y_2, 0), (uint16)10000))*-31)/256)) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_2, corrected_s0_y_2, 1), (uint16)10000))*-261)/256))) + int16(((int32(min(demosaicked$1.stencil(corrected_s0_x_2, corrected_s0_y_2, 2), (uint16)10000))*883)/256))) + (int16)-22)
hw_uint<16> hcompute_corrected_stencil_2(hw_uint<48>& demosaicked_1_stencil) {
uint16_t _demosaicked_1_stencil_7 = (uint16_t) demosaicked_1_stencil.extract<0, 15>();
uint16_t _demosaicked_1_stencil_8 = (uint16_t) demosaicked_1_stencil.extract<16, 31>();
uint16_t _demosaicked_1_stencil_9 = (uint16_t) demosaicked_1_stencil.extract<32, 47>();
uint16_t _1437 = (uint16_t)(10000);
uint16_t _1438 = min(_demosaicked_1_stencil_7, _1437);
int32_t _1439 = (int32_t)(_1438);
int32_t _1440 = _1439 * -31;
int32_t _1441 = _1440 >> 8;
int16_t _1442 = (int16_t)(_1441);
uint16_t _1443 = min(_demosaicked_1_stencil_8, _1437);
int32_t _1444 = (int32_t)(_1443);
int32_t _1445 = _1444 * -261;
int32_t _1446 = _1445 >> 8;
int16_t _1447 = (int16_t)(_1446);
int16_t _1448 = _1442 + _1447;
uint16_t _1449 = min(_demosaicked_1_stencil_9, _1437);
int32_t _1450 = (int32_t)(_1449);
int32_t _1451 = _1450 * 883;
int32_t _1452 = _1451 >> 8;
int16_t _1453 = (int16_t)(_1452);
int16_t _1454 = _1448 + _1453;
int16_t _1455 = (int16_t)(-22);
int16_t _1456 = _1454 + _1455;
return _1456;
}
//store is: curved.stencil(curved_s0_x, curved_s0_y, 0) = curvea0[int32(uint16(max(min(corrected.stencil(curved_s0_x, curved_s0_y, 0), (int16)1023), (int16)0)))]
hw_uint<16> hcompute_curved_stencil(hw_uint<16>& corrected_stencil) {
int16_t _corrected_stencil_1 = (int16_t) corrected_stencil.extract<0, 15>();
uint16_t _curvea0[1024];
// produce curvea0
uint16_t _2528 = (uint16_t)(0);
_curvea0[0] = _2528;
uint16_t _2529 = (uint16_t)(4);
_curvea0[1] = _2529;
uint16_t _2530 = (uint16_t)(7);
_curvea0[2] = _2530;
uint16_t _2531 = (uint16_t)(8);
_curvea0[3] = _2531;
uint16_t _2532 = (uint16_t)(10);
_curvea0[4] = _2532;
uint16_t _2533 = (uint16_t)(11);
_curvea0[5] = _2533;
uint16_t _2534 = (uint16_t)(12);
_curvea0[6] = _2534;
uint16_t _2535 = (uint16_t)(13);
_curvea0[7] = _2535;
uint16_t _2536 = (uint16_t)(14);
_curvea0[8] = _2536;
uint16_t _2537 = (uint16_t)(15);
_curvea0[9] = _2537;
uint16_t _2538 = (uint16_t)(16);
_curvea0[10] = _2538;
uint16_t _2539 = (uint16_t)(17);
_curvea0[11] = _2539;
uint16_t _2540 = (uint16_t)(18);
_curvea0[12] = _2540;
uint16_t _2541 = (uint16_t)(19);
_curvea0[13] = _2541;
uint16_t _2542 = (uint16_t)(20);
_curvea0[14] = _2542;
uint16_t _2543 = (uint16_t)(21);
_curvea0[15] = _2543;
uint16_t _2544 = (uint16_t)(22);
_curvea0[16] = _2544;
uint16_t _2545 = (uint16_t)(22);
_curvea0[17] = _2545;
uint16_t _2546 = (uint16_t)(23);
_curvea0[18] = _2546;
uint16_t _2547 = (uint16_t)(24);
_curvea0[19] = _2547;
uint16_t _2548 = (uint16_t)(25);
_curvea0[20] = _2548;
uint16_t _2549 = (uint16_t)(25);
_curvea0[21] = _2549;
uint16_t _2550 = (uint16_t)(26);
_curvea0[22] = _2550;
uint16_t _2551 = (uint16_t)(27);
_curvea0[23] = _2551;
uint16_t _2552 = (uint16_t)(27);
_curvea0[24] = _2552;
uint16_t _2553 = (uint16_t)(28);
_curvea0[25] = _2553;
uint16_t _2554 = (uint16_t)(29);
_curvea0[26] = _2554;
uint16_t _2555 = (uint16_t)(29);
_curvea0[27] = _2555;
uint16_t _2556 = (uint16_t)(30);
_curvea0[28] = _2556;
uint16_t _2557 = (uint16_t)(31);
_curvea0[29] = _2557;
uint16_t _2558 = (uint16_t)(31);
_curvea0[30] = _2558;
uint16_t _2559 = (uint16_t)(32);
_curvea0[31] = _2559;
uint16_t _2560 = (uint16_t)(33);
_curvea0[32] = _2560;
uint16_t _2561 = (uint16_t)(33);
_curvea0[33] = _2561;
uint16_t _2562 = (uint16_t)(34);
_curvea0[34] = _2562;
uint16_t _2563 = (uint16_t)(34);
_curvea0[35] = _2563;
uint16_t _2564 = (uint16_t)(35);
_curvea0[36] = _2564;
uint16_t _2565 = (uint16_t)(36);
_curvea0[37] = _2565;
uint16_t _2566 = (uint16_t)(36);
_curvea0[38] = _2566;
uint16_t _2567 = (uint16_t)(37);
_curvea0[39] = _2567;
uint16_t _2568 = (uint16_t)(37);
_curvea0[40] = _2568;
uint16_t _2569 = (uint16_t)(38);
_curvea0[41] = _2569;
uint16_t _2570 = (uint16_t)(39);
_curvea0[42] = _2570;
uint16_t _2571 = (uint16_t)(39);
_curvea0[43] = _2571;
uint16_t _2572 = (uint16_t)(40);
_curvea0[44] = _2572;
uint16_t _2573 = (uint16_t)(40);
_curvea0[45] = _2573;
uint16_t _2574 = (uint16_t)(41);
_curvea0[46] = _2574;
uint16_t _2575 = (uint16_t)(41);
_curvea0[47] = _2575;
uint16_t _2576 = (uint16_t)(42);
_curvea0[48] = _2576;
uint16_t _2577 = (uint16_t)(42);
_curvea0[49] = _2577;
uint16_t _2578 = (uint16_t)(43);
_curvea0[50] = _2578;
uint16_t _2579 = (uint16_t)(44);
_curvea0[51] = _2579;
uint16_t _2580 = (uint16_t)(44);
_curvea0[52] = _2580;
uint16_t _2581 = (uint16_t)(45);
_curvea0[53] = _2581;
uint16_t _2582 = (uint16_t)(45);
_curvea0[54] = _2582;
uint16_t _2583 = (uint16_t)(46);
_curvea0[55] = _2583;
uint16_t _2584 = (uint16_t)(46);
_curvea0[56] = _2584;
uint16_t _2585 = (uint16_t)(47);
_curvea0[57] = _2585;
uint16_t _2586 = (uint16_t)(47);
_curvea0[58] = _2586;
uint16_t _2587 = (uint16_t)(48);
_curvea0[59] = _2587;
uint16_t _2588 = (uint16_t)(48);
_curvea0[60] = _2588;
uint16_t _2589 = (uint16_t)(49);
_curvea0[61] = _2589;
uint16_t _2590 = (uint16_t)(49);
_curvea0[62] = _2590;
uint16_t _2591 = (uint16_t)(50);
_curvea0[63] = _2591;
uint16_t _2592 = (uint16_t)(50);
_curvea0[64] = _2592;
uint16_t _2593 = (uint16_t)(51);
_curvea0[65] = _2593;
uint16_t _2594 = (uint16_t)(51);
_curvea0[66] = _2594;
uint16_t _2595 = (uint16_t)(52);
_curvea0[67] = _2595;
uint16_t _2596 = (uint16_t)(52);
_curvea0[68] = _2596;
uint16_t _2597 = (uint16_t)(53);
_curvea0[69] = _2597;
uint16_t _2598 = (uint16_t)(53);
_curvea0[70] = _2598;
uint16_t _2599 = (uint16_t)(54);
_curvea0[71] = _2599;
uint16_t _2600 = (uint16_t)(54);
_curvea0[72] = _2600;
uint16_t _2601 = (uint16_t)(55);
_curvea0[73] = _2601;
uint16_t _2602 = (uint16_t)(55);
_curvea0[74] = _2602;
uint16_t _2603 = (uint16_t)(56);
_curvea0[75] = _2603;
uint16_t _2604 = (uint16_t)(56);
_curvea0[76] = _2604;
uint16_t _2605 = (uint16_t)(57);
_curvea0[77] = _2605;
uint16_t _2606 = (uint16_t)(57);
_curvea0[78] = _2606;
uint16_t _2607 = (uint16_t)(58);
_curvea0[79] = _2607;
uint16_t _2608 = (uint16_t)(58);
_curvea0[80] = _2608;
uint16_t _2609 = (uint16_t)(58);
_curvea0[81] = _2609;
uint16_t _2610 = (uint16_t)(59);
_curvea0[82] = _2610;
uint16_t _2611 = (uint16_t)(59);
_curvea0[83] = _2611;
uint16_t _2612 = (uint16_t)(60);
_curvea0[84] = _2612;
uint16_t _2613 = (uint16_t)(60);
_curvea0[85] = _2613;
uint16_t _2614 = (uint16_t)(61);
_curvea0[86] = _2614;
uint16_t _2615 = (uint16_t)(61);
_curvea0[87] = _2615;
uint16_t _2616 = (uint16_t)(62);
_curvea0[88] = _2616;
uint16_t _2617 = (uint16_t)(62);
_curvea0[89] = _2617;
uint16_t _2618 = (uint16_t)(63);
_curvea0[90] = _2618;
uint16_t _2619 = (uint16_t)(63);
_curvea0[91] = _2619;
uint16_t _2620 = (uint16_t)(64);
_curvea0[92] = _2620;
uint16_t _2621 = (uint16_t)(64);
_curvea0[93] = _2621;
uint16_t _2622 = (uint16_t)(64);
_curvea0[94] = _2622;
uint16_t _2623 = (uint16_t)(65);
_curvea0[95] = _2623;
uint16_t _2624 = (uint16_t)(65);
_curvea0[96] = _2624;
uint16_t _2625 = (uint16_t)(66);
_curvea0[97] = _2625;
uint16_t _2626 = (uint16_t)(66);
_curvea0[98] = _2626;
uint16_t _2627 = (uint16_t)(67);
_curvea0[99] = _2627;
uint16_t _2628 = (uint16_t)(67);
_curvea0[100] = _2628;
uint16_t _2629 = (uint16_t)(68);
_curvea0[101] = _2629;
uint16_t _2630 = (uint16_t)(68);
_curvea0[102] = _2630;
uint16_t _2631 = (uint16_t)(68);
_curvea0[103] = _2631;
uint16_t _2632 = (uint16_t)(69);
_curvea0[104] = _2632;
uint16_t _2633 = (uint16_t)(69);
_curvea0[105] = _2633;
uint16_t _2634 = (uint16_t)(70);
_curvea0[106] = _2634;
uint16_t _2635 = (uint16_t)(70);
_curvea0[107] = _2635;
uint16_t _2636 = (uint16_t)(71);
_curvea0[108] = _2636;
uint16_t _2637 = (uint16_t)(71);
_curvea0[109] = _2637;
uint16_t _2638 = (uint16_t)(71);
_curvea0[110] = _2638;
uint16_t _2639 = (uint16_t)(72);
_curvea0[111] = _2639;
uint16_t _2640 = (uint16_t)(72);
_curvea0[112] = _2640;
uint16_t _2641 = (uint16_t)(73);
_curvea0[113] = _2641;
uint16_t _2642 = (uint16_t)(73);
_curvea0[114] = _2642;
uint16_t _2643 = (uint16_t)(74);
_curvea0[115] = _2643;
uint16_t _2644 = (uint16_t)(74);
_curvea0[116] = _2644;
uint16_t _2645 = (uint16_t)(74);
_curvea0[117] = _2645;
uint16_t _2646 = (uint16_t)(75);
_curvea0[118] = _2646;
uint16_t _2647 = (uint16_t)(75);
_curvea0[119] = _2647;
uint16_t _2648 = (uint16_t)(76);
_curvea0[120] = _2648;
uint16_t _2649 = (uint16_t)(76);
_curvea0[121] = _2649;
uint16_t _2650 = (uint16_t)(77);
_curvea0[122] = _2650;
uint16_t _2651 = (uint16_t)(77);
_curvea0[123] = _2651;
uint16_t _2652 = (uint16_t)(77);
_curvea0[124] = _2652;
uint16_t _2653 = (uint16_t)(78);
_curvea0[125] = _2653;
uint16_t _2654 = (uint16_t)(78);
_curvea0[126] = _2654;
uint16_t _2655 = (uint16_t)(79);
_curvea0[127] = _2655;
uint16_t _2656 = (uint16_t)(79);
_curvea0[128] = _2656;
uint16_t _2657 = (uint16_t)(79);
_curvea0[129] = _2657;
uint16_t _2658 = (uint16_t)(80);
_curvea0[130] = _2658;
uint16_t _2659 = (uint16_t)(80);
_curvea0[131] = _2659;
uint16_t _2660 = (uint16_t)(81);
_curvea0[132] = _2660;
uint16_t _2661 = (uint16_t)(81);
_curvea0[133] = _2661;
uint16_t _2662 = (uint16_t)(82);
_curvea0[134] = _2662;
uint16_t _2663 = (uint16_t)(82);
_curvea0[135] = _2663;
uint16_t _2664 = (uint16_t)(82);
_curvea0[136] = _2664;
uint16_t _2665 = (uint16_t)(83);
_curvea0[137] = _2665;
uint16_t _2666 = (uint16_t)(83);
_curvea0[138] = _2666;
uint16_t _2667 = (uint16_t)(84);
_curvea0[139] = _2667;
uint16_t _2668 = (uint16_t)(84);
_curvea0[140] = _2668;
uint16_t _2669 = (uint16_t)(84);
_curvea0[141] = _2669;
uint16_t _2670 = (uint16_t)(85);
_curvea0[142] = _2670;
uint16_t _2671 = (uint16_t)(85);
_curvea0[143] = _2671;
uint16_t _2672 = (uint16_t)(86);
_curvea0[144] = _2672;
uint16_t _2673 = (uint16_t)(86);
_curvea0[145] = _2673;
uint16_t _2674 = (uint16_t)(86);
_curvea0[146] = _2674;
uint16_t _2675 = (uint16_t)(87);
_curvea0[147] = _2675;
uint16_t _2676 = (uint16_t)(87);
_curvea0[148] = _2676;
uint16_t _2677 = (uint16_t)(88);
_curvea0[149] = _2677;
uint16_t _2678 = (uint16_t)(88);
_curvea0[150] = _2678;
uint16_t _2679 = (uint16_t)(88);
_curvea0[151] = _2679;
uint16_t _2680 = (uint16_t)(89);
_curvea0[152] = _2680;
uint16_t _2681 = (uint16_t)(89);
_curvea0[153] = _2681;
uint16_t _2682 = (uint16_t)(90);
_curvea0[154] = _2682;
uint16_t _2683 = (uint16_t)(90);
_curvea0[155] = _2683;
uint16_t _2684 = (uint16_t)(90);
_curvea0[156] = _2684;
uint16_t _2685 = (uint16_t)(91);
_curvea0[157] = _2685;
uint16_t _2686 = (uint16_t)(91);
_curvea0[158] = _2686;
uint16_t _2687 = (uint16_t)(92);
_curvea0[159] = _2687;
uint16_t _2688 = (uint16_t)(92);
_curvea0[160] = _2688;
uint16_t _2689 = (uint16_t)(92);
_curvea0[161] = _2689;
uint16_t _2690 = (uint16_t)(93);
_curvea0[162] = _2690;
uint16_t _2691 = (uint16_t)(93);
_curvea0[163] = _2691;
uint16_t _2692 = (uint16_t)(93);
_curvea0[164] = _2692;
uint16_t _2693 = (uint16_t)(94);
_curvea0[165] = _2693;
uint16_t _2694 = (uint16_t)(94);
_curvea0[166] = _2694;
uint16_t _2695 = (uint16_t)(95);
_curvea0[167] = _2695;
uint16_t _2696 = (uint16_t)(95);
_curvea0[168] = _2696;
uint16_t _2697 = (uint16_t)(95);
_curvea0[169] = _2697;
uint16_t _2698 = (uint16_t)(96);
_curvea0[170] = _2698;
uint16_t _2699 = (uint16_t)(96);
_curvea0[171] = _2699;
uint16_t _2700 = (uint16_t)(97);
_curvea0[172] = _2700;
uint16_t _2701 = (uint16_t)(97);
_curvea0[173] = _2701;
uint16_t _2702 = (uint16_t)(97);
_curvea0[174] = _2702;
uint16_t _2703 = (uint16_t)(98);
_curvea0[175] = _2703;
uint16_t _2704 = (uint16_t)(98);
_curvea0[176] = _2704;
uint16_t _2705 = (uint16_t)(99);
_curvea0[177] = _2705;
uint16_t _2706 = (uint16_t)(99);
_curvea0[178] = _2706;
uint16_t _2707 = (uint16_t)(99);
_curvea0[179] = _2707;
uint16_t _2708 = (uint16_t)(100);
_curvea0[180] = _2708;
uint16_t _2709 = (uint16_t)(100);
_curvea0[181] = _2709;
uint16_t _2710 = (uint16_t)(100);
_curvea0[182] = _2710;
uint16_t _2711 = (uint16_t)(101);
_curvea0[183] = _2711;
uint16_t _2712 = (uint16_t)(101);
_curvea0[184] = _2712;
uint16_t _2713 = (uint16_t)(102);
_curvea0[185] = _2713;
uint16_t _2714 = (uint16_t)(102);
_curvea0[186] = _2714;
uint16_t _2715 = (uint16_t)(102);
_curvea0[187] = _2715;
uint16_t _2716 = (uint16_t)(103);
_curvea0[188] = _2716;
uint16_t _2717 = (uint16_t)(103);
_curvea0[189] = _2717;
uint16_t _2718 = (uint16_t)(103);
_curvea0[190] = _2718;
uint16_t _2719 = (uint16_t)(104);
_curvea0[191] = _2719;
uint16_t _2720 = (uint16_t)(104);
_curvea0[192] = _2720;
uint16_t _2721 = (uint16_t)(105);
_curvea0[193] = _2721;
uint16_t _2722 = (uint16_t)(105);
_curvea0[194] = _2722;
uint16_t _2723 = (uint16_t)(105);
_curvea0[195] = _2723;
uint16_t _2724 = (uint16_t)(106);
_curvea0[196] = _2724;
uint16_t _2725 = (uint16_t)(106);
_curvea0[197] = _2725;
uint16_t _2726 = (uint16_t)(106);
_curvea0[198] = _2726;
uint16_t _2727 = (uint16_t)(107);
_curvea0[199] = _2727;
uint16_t _2728 = (uint16_t)(107);
_curvea0[200] = _2728;
uint16_t _2729 = (uint16_t)(108);
_curvea0[201] = _2729;
uint16_t _2730 = (uint16_t)(108);
_curvea0[202] = _2730;
uint16_t _2731 = (uint16_t)(108);
_curvea0[203] = _2731;
uint16_t _2732 = (uint16_t)(109);
_curvea0[204] = _2732;
uint16_t _2733 = (uint16_t)(109);
_curvea0[205] = _2733;
uint16_t _2734 = (uint16_t)(109);
_curvea0[206] = _2734;
uint16_t _2735 = (uint16_t)(110);
_curvea0[207] = _2735;
uint16_t _2736 = (uint16_t)(110);
_curvea0[208] = _2736;
uint16_t _2737 = (uint16_t)(111);
_curvea0[209] = _2737;
uint16_t _2738 = (uint16_t)(111);
_curvea0[210] = _2738;
uint16_t _2739 = (uint16_t)(111);
_curvea0[211] = _2739;
uint16_t _2740 = (uint16_t)(112);
_curvea0[212] = _2740;
uint16_t _2741 = (uint16_t)(112);
_curvea0[213] = _2741;
uint16_t _2742 = (uint16_t)(112);
_curvea0[214] = _2742;
uint16_t _2743 = (uint16_t)(113);
_curvea0[215] = _2743;
uint16_t _2744 = (uint16_t)(113);
_curvea0[216] = _2744;
uint16_t _2745 = (uint16_t)(113);
_curvea0[217] = _2745;
uint16_t _2746 = (uint16_t)(114);
_curvea0[218] = _2746;
uint16_t _2747 = (uint16_t)(114);
_curvea0[219] = _2747;
uint16_t _2748 = (uint16_t)(115);
_curvea0[220] = _2748;
uint16_t _2749 = (uint16_t)(115);
_curvea0[221] = _2749;
uint16_t _2750 = (uint16_t)(115);
_curvea0[222] = _2750;
uint16_t _2751 = (uint16_t)(116);
_curvea0[223] = _2751;
uint16_t _2752 = (uint16_t)(116);
_curvea0[224] = _2752;
uint16_t _2753 = (uint16_t)(116);
_curvea0[225] = _2753;
uint16_t _2754 = (uint16_t)(117);
_curvea0[226] = _2754;
uint16_t _2755 = (uint16_t)(117);
_curvea0[227] = _2755;
uint16_t _2756 = (uint16_t)(117);
_curvea0[228] = _2756;
uint16_t _2757 = (uint16_t)(118);
_curvea0[229] = _2757;
uint16_t _2758 = (uint16_t)(118);
_curvea0[230] = _2758;
uint16_t _2759 = (uint16_t)(119);