-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcxgo.yml
886 lines (876 loc) · 19.4 KB
/
cxgo.yml
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
package: libopus
subpackage: true
vcs: https://gitlab.xiph.org/xiph/opus.git
branch: 'v1.4'
root: .
out: ./libopus
int_size: 8
ptr_size: 8
use_go_int: true
include:
- './include'
- './celt'
- './silk'
- './silk/float'
predef: |
// TODO
define:
- name: USE_ALLOCA
- name: OPUS_BUILD
- name: ALLOC_NONE
value: '1'
- name: alloca
value: malloc
- name: opus_alloc
value: malloc
- name: opus_free
value: free
# TODO: add to cxgo
- name: HAVE_STDINT_H
- name: __STDC__
value: '1'
- name: __STDC_VERSION__
value: '199901'
idents:
- name: ec_ctx
fields:
- name: buf
type: slice
- name: silk_NLSF_CB_struct
fields:
- name: CB1_NLSF_Q8
type: slice
- name: CB1_Wght_Q9
type: slice
- name: CB1_iCDF
type: slice
- name: pred_Q8
type: slice
- name: ec_sel
type: slice
- name: ec_iCDF
type: slice
- name: ec_Rates_Q5
type: slice
- name: deltaMin_Q15
type: slice
- name: silk_encoder_state
fields:
- name: pitch_lag_low_bits_iCDF
type: slice
- name: pitch_contour_iCDF
type: slice
- name: silk_decoder_state
fields:
- name: pitch_lag_low_bits_iCDF
type: slice
- name: pitch_contour_iCDF
type: slice
- name: _silk_resampler_state_struct
fields:
- name: Coefs
type: slice
- name: DenseLayer
fields:
- name: bias
type: slice
- name: input_weights
type: slice
- name: GRULayer
fields:
- name: bias
type: slice
- name: input_weights
type: slice
- name: recurrent_weights
type: slice
- name: compute_dense
fields:
- name: output
type: slice
- name: input
type: slice
- name: compute_gru
fields:
- name: state
type: slice
- name: input
type: slice
- name: gemm_accum
fields:
- name: out
type: slice
- name: weights
type: slice
- name: x
type: slice
- name: ec_get_buffer
fields:
- name: return
type: slice
- name: celt_maxabs16
fields:
- name: x
type: slice
- name: is_digital_silence
fields:
- name: pcm
type: slice
- name: compute_frame_energy
fields:
- name: pcm
type: slice
- name: celt_inner_prod_c
fields:
- name: x
type: slice
- name: y
type: slice
- name: xcorr_kernel_c
fields:
- name: x
type: slice
- name: y
type: slice
- name: dual_inner_prod_c
fields:
- name: x
type: slice
- name: y01
type: slice
- name: y02
type: slice
- name: stereo_merge
fields:
- name: X
type: slice
- name: Y
type: slice
- name: opus_encode_native
fields:
- name: pcm
type: slice
- name: data
type: slice
- name: ec_dec_icdf
fields:
- name: _icdf
type: slice
- name: ec_enc_icdf
fields:
- name: _icdf
type: slice
- name: silk_Decode
fields:
- name: samplesOut
type: slice
- name: combine_pulses
fields:
- name: out
type: slice
- name: in
type: slice
- name: encode_split
fields:
- name: shell_table
type: slice
- name: decode_split
fields:
- name: shell_table
type: slice
- name: silk_shell_encoder
fields:
- name: pulses0
type: slice
- name: silk_shell_decoder
fields:
- name: pulses0
type: slice
- name: combine_and_check
fields:
- name: pulses_comb
type: slice
- name: pulses_in
type: slice
- name: silk_bwexpander
fields:
- name: ar
type: slice
- name: silk_bwexpander_32
fields:
- name: ar
type: slice
- name: silk_NLSF_decode
fields:
- name: pNLSF_Q15
type: slice
- name: NLSFIndices
type: slice
- name: silk_NLSF_stabilize
fields:
- name: NLSF_Q15
type: slice
- name: NDeltaMin_Q15
type: slice
- name: silk_insertion_sort_increasing_all_values_int16
fields:
- name: a
type: slice
- name: silk_insertion_sort_increasing
fields:
- name: a
type: slice
- name: idx
type: slice
- name: silk_NLSF2A_find_poly
fields:
- name: out
type: slice
- name: cLSF
type: slice
- name: silk_NLSF2A
fields:
- name: a_Q12
type: slice
- name: NLSF
type: slice
- name: silk_LPC_fit
fields:
- name: a_QOUT
type: slice
- name: a_QIN
type: slice
- name: silk_LPC_inverse_pred_gain_c
fields:
- name: A_Q12
type: slice
- name: silk_LPC_analysis_filter
fields:
- name: out
type: slice
- name: in
type: slice
- name: B
type: slice
- name: silk_sum_sqr_shift
fields:
- name: x
type: slice
- name: silk_PLC_energy
fields:
- name: exc_Q14
type: slice
- name: prevGain_Q10
type: slice
- name: silk_resampler_private_up2_HQ
fields:
- name: S
type: slice
- name: out
type: slice
- name: in
type: slice
- name: silk_resampler_private_up2_HQ_wrapper
fields:
- name: out
type: slice
- name: in
type: slice
- name: silk_resampler_private_IIR_FIR_INTERPOL
fields:
- name: out
type: slice
- name: buf
type: slice
- name: return
type: slice
- name: silk_resampler_private_down_FIR_INTERPOL
fields:
- name: out
type: slice
- name: buf
type: slice
- name: FIR_Coefs
type: slice
- name: return
type: slice
- name: silk_ana_filt_bank_1
fields:
- name: in
type: slice
- name: S
type: slice
- name: outL
type: slice
- name: outH
type: slice
- name: silk_float2short_array
fields:
- name: in
type: slice
- name: out
type: slice
- name: silk_short2float_array
fields:
- name: in
type: slice
- name: out
type: slice
- name: silk_A2NLSF_trans_poly
fields:
- name: p
type: slice
- name: silk_A2NLSF_eval_poly
fields:
- name: p
type: slice
- name: silk_A2NLSF_init
fields:
- name: a_Q16
type: slice
- name: P
type: slice
- name: Q
type: slice
- name: silk_A2NLSF
fields:
- name: NLSF
type: slice
- name: a_Q16
type: slice
- name: silk_A2NLSF_FLP
fields:
- name: NLSF_Q15
type: slice
- name: pAR
type: slice
- name: silk_NLSF2A_FLP
fields:
- name: pAR
type: slice
- name: NLSF_Q15
type: slice
- name: silk_NLSF_encode
fields:
- name: NLSFIndices
type: slice
- name: pNLSF_Q15
type: slice
- name: pW_Q2
type: slice
- name: silk_NLSF_VQ_weights_laroia
fields:
- name: pNLSFW_Q_OUT
type: slice
- name: pNLSF_Q15
type: slice
- name: silk_noise_shape_quantizer_short_prediction_c
fields:
- name: buf32
type: slice
- name: coef16
type: slice
- name: silk_NSQ_noise_shape_feedback_loop_c
fields:
- name: data1
type: slice
- name: coef
type: slice
- name: silk_VQ_WMat_EC_c
fields:
- name: XX_Q17
type: slice
- name: xX_Q17
type: slice
- name: cb_Q7
type: slice
- name: cb_gain_Q7
type: slice
- name: cl_Q5
type: slice
- name: silk_energy_FLP
fields:
- name: data
type: slice
- name: silk_inner_product_FLP
fields:
- name: data1
type: slice
- name: data2
type: slice
- name: silk_residual_energy_covar_FLP
fields:
- name: c
type: slice
- name: wXX
type: slice
- name: wXx
type: slice
- name: silk_corrVector_FLP
fields:
- name: x
type: slice
- name: t
type: slice
- name: Xt
type: slice
- name: silk_corrMatrix_FLP
fields:
- name: x
type: slice
- name: XX
type: slice
- name: silk_scale_vector_FLP
fields:
- name: data1
type: slice
- name: silk_scale_copy_vector_FLP
fields:
- name: data_out
type: slice
- name: data_in
type: slice
- name: silk_LTP_analysis_filter_FLP
fields:
- name: x
type: slice
- name: LTP_res
type: slice
- name: silk_biquad_alt_stride1
fields:
- name: in
type: slice
- name: B_Q28
type: slice
- name: A_Q28
type: slice
- name: S
type: slice
- name: out
type: slice
- name: silk_biquad_alt_stride2_c
fields:
- name: in
type: slice
- name: B_Q28
type: slice
- name: A_Q28
type: slice
- name: S
type: slice
- name: out
type: slice
- name: silk_LP_variable_cutoff
fields:
- name: frame
type: slice
- name: silk_resampler_down2
fields:
- name: S
type: slice
- name: in
type: slice
- name: out
type: slice
- name: silk_resampler_down2_3
fields:
- name: S
type: slice
- name: in
type: slice
- name: out
type: slice
- name: celt_pitch_xcorr_c
fields:
- name: _x
type: slice
- name: _y
type: slice
- name: xcorr
type: slice
- name: celt_fir5
fields:
- name: x
type: slice
- name: num
type: slice
- name: pitch_downsample
fields:
- name: x_lp
type: slice
- name: find_best_pitch
fields:
- name: xcorr
type: slice
- name: y
type: slice
- name: best_pitch
type: slice
- name: pitch_search
fields:
- name: x_lp
type: slice
- name: y
type: slice
- name: pitch
type: slice
- name: remove_doubling
fields:
- name: x
type: slice
- name: silk_insertion_sort_decreasing_FLP
fields:
- name: a
type: slice
- name: idx
type: slice
- name: silk_pitch_analysis_core_FLP
fields:
- name: frame
type: slice
- name: pitch_out
type: slice
- name: silk_bwexpander_FLP
fields:
- name: ar
type: slice
- name: silk_k2a_FLP
fields:
- name: A
type: slice
- name: rc
type: slice
- name: _celt_lpc
fields:
- name: _lpc
type: slice
- name: ac
type: slice
- name: celt_fir_c
fields:
- name: x
type: slice
- name: num
type: slice
- name: y
type: slice
- name: celt_iir
fields:
- name: _x
type: slice
- name: den
type: slice
- name: _y
type: slice
- name: mem
type: slice
- name: _celt_autocorr
fields:
- name: x
type: slice
- name: ac
type: slice
- name: window
type: slice
- name: silk_autocorrelation_FLP
fields:
- name: results
type: slice
- name: inputData
type: slice
- name: warped_gain
fields:
- name: coefs
type: slice
- name: warped_true2monic_coefs
fields:
- name: coefs
type: slice
- name: limit_coefs
fields:
- name: coefs
type: slice
- name: silk_noise_shape_analysis_FLP
fields:
- name: pitch_res
type: slice
- name: x
type: slice
- name: silk_warped_autocorrelation_FLP
fields:
- name: corr
type: slice
- name: input
type: slice
- name: silk_inner_prod_aligned_scale
fields:
- name: inVec1
type: slice
- name: inVec2
type: slice
- name: silk_Encode
fields:
- name: samplesIn
type: slice
src_files:
- name: include/opus_types.h
content: |
#ifndef OPUS_TYPES_H
#define OPUS_TYPES_H
#include <stdint.h>
#define opus_int int
#define opus_uint unsigned int
#define opus_int8 int8_t
#define opus_int16 int16_t
#define opus_int32 int32_t
#define opus_int64 int64_t
#define opus_uint8 uint8_t
#define opus_uint16 uint16_t
#define opus_uint32 uint32_t
#define opus_uint64 uint64_t
#endif // OPUS_TYPES_H
files:
- name: src/tansig_table.h
- name: src/opus_private.h
- name: include/opus_defines.h
- name: src/analysis.c
- name: src/mlp.c
- name: src/mlp_data.c
- name: src/opus.c
- name: src/opus_decoder.c
- name: src/opus_encoder.c
- name: src/repacketizer.c
# ==== SILK ====
- name: silk/macros.h
- name: silk/define.h
replace:
- old: 'uint8 = math.MaxUint8'
new: '= math.MaxUint8'
- name: silk/errors.h
# - name: silk/structs.h # DONE
- name: silk/typedef.h
replace:
- old: 'uint32 ='
new: '='
- old: 'uint16 ='
new: '='
- old: 'uint8 ='
new: '='
- name: silk/tuning_parameters.h
- name: silk/pitch_est_defines.h
- name: silk/resampler_private.h
# - name: silk/resampler_structs.h # DONE
- name: silk/float/SigProc_FLP.h
- name: silk/SigProc_FIX.h
- name: silk/Inlines.h
predef: |
#include <stdint.h>
#include "opus_types.h"
#include "SigProc_FIX.h"
#define silk_int32_MAX INT32_MAX
#define OPUS_INLINE
- name: silk/NLSF_unpack.c
disabled: true # DONE
- name: silk/stereo_decode_pred.c
disabled: true # DONE
- name: silk/decode_indices.c
disabled: true # DONE
- name: silk/code_signs.c
disabled: true # DONE
- name: silk/decode_pulses.c
disabled: true # DONE
- name: silk/encode_pulses.c
disabled: true # DONE
- name: silk/shell_coder.c
disabled: true # DONE
- name: silk/gain_quant.c
disabled: true # DONE
- name: silk/bwexpander.c
disabled: true # DONE
- name: silk/bwexpander_32.c
disabled: true # DONE
- name: silk/NLSF_decode.c
disabled: true # DONE
- name: silk/NLSF_stabilize.c
disabled: true # DONE
- name: silk/NLSF2A.c
disabled: true # DONE
- name: silk/LPC_fit.c
disabled: true # DONE
- name: silk/decode_pitch.c
disabled: true # DONE
- name: silk/decode_core.c
disabled: true # DONE
- name: silk/decode_parameters.c
disabled: true # DONE
- name: silk/PLC.c
disabled: true # DONE
- name: silk/CNG.c
disabled: true # DONE
- name: silk/init_decoder.c
disabled: true # DONE
- name: silk/control.h
disabled: true # DONE
- name: silk/decode_frame.c
disabled: true # DONE
- name: silk/decode_frame.c
disabled: true # DONE
- name: silk/resampler_private_up2_HQ.c
disabled: true # DONE
- name: silk/resampler_private_IIR_FIR.c
disabled: true # DONE
- name: silk/resampler_private_AR2.c
disabled: true # DONE
- name: silk/resampler_private_down_FIR.c
disabled: true # DONE
- name: silk/resampler.c
disabled: true # DONE
- name: silk/decoder_set_fs.c
disabled: true # DONE
- name: silk/stereo_MS_to_LR.c
disabled: true # DONE
- name: silk/dec_API.c
disabled: true # DONE
- name: silk/check_control_input.c
disabled: true # DONE
- name: silk/float/structs_FLP.h
disabled: true # DONE
- name: silk/VAD.c
disabled: true # DONE
- name: silk/ana_filt_bank_1.c
disabled: true # DONE
- name: silk/sigm_Q15.c
disabled: true # DONE
- name: silk/init_encoder.c
disabled: true # DONE
- name: silk/control_codec.c
disabled: true # DONE
- name: silk/control_audio_bandwidth.c
disabled: true # DONE
- name: silk/HP_variable_cutoff.c
disabled: true # DONE
- name: silk/stereo_encode_pred.c
disabled: true # DONE
- name: silk/A2NLSF.c
disabled: true # DONE
- name: silk/NLSF_VQ.c
disabled: true # DONE
- name: silk/NLSF_del_dec_quant.c
disabled: true # DONE
- name: silk/NLSF_encode.c
disabled: true # DONE
- name: silk/process_NLSFs.c
disabled: true # DONE
- name: silk/NLSF_VQ_weights_laroia.c
disabled: true # DONE
- name: silk/NSQ_del_dec.c
disabled: true # DONE
- name: silk/NSQ.c
disabled: true # DONE
- name: silk/quant_LTP_gains.c
disabled: true # DONE
- name: silk/VQ_WMat_EC.c
disabled: true # DONE
- name: silk/float/wrappers_FLP.c
disabled: true # DONE
- name: silk/float/burg_modified_FLP.c
disabled: true # DONE
- name: silk/float/LPC_analysis_filter_FLP.c
disabled: true # DONE
- name: silk/float/find_LPC_FLP.c
disabled: true # DONE
- name: silk/float/residual_energy_FLP.c
disabled: true # DONE
- name: silk/float/find_LTP_FLP.c
disabled: true # DONE
- name: silk/float/scale_vector_FLP.c
disabled: true # DONE
- name: silk/float/corrMatrix_FLP.c
disabled: true # DONE
- name: silk/float/LTP_analysis_filter_FLP.c
disabled: true # DONE
- name: silk/float/find_pred_coefs_FLP.c
disabled: true # DONE
- name: silk/float/scale_copy_vector_FLP.c
disabled: true # DONE
- name: silk/float/LTP_scale_ctrl_FLP.c
disabled: true # DONE
- name: silk/float/process_gains_FLP.c
disabled: true # DONE
- name: silk/LP_variable_cutoff.c
disabled: true # DONE
- name: silk/biquad_alt.c
disabled: true # DONE
- name: silk/resampler_down2.c
disabled: true # DONE
- name: silk/resampler_down2_3.c
disabled: true # DONE
- name: silk/resampler_private_AR2.c
disabled: true # DONE
- name: silk/float/pitch_analysis_core_FLP.c
disabled: true # DONE
- name: silk/float/find_pitch_lags_FLP.c
disabled: true # DONE
- name: silk/float/noise_shape_analysis_FLP.c
disabled: true # DONE
- name: silk/encode_indices.c
disabled: true # DONE
- name: silk/float/encode_frame_FLP.c
disabled: true # DONE
- name: silk/stereo_LR_to_MS.c
disabled: true # DONE
- name: silk/enc_API.c
disabled: true # DONE
- name: silk/*.c
- name: silk/float/*.c
# ==== CELT ====
- name: celt/arch.h
- name: celt/entcode.c
disabled: true # DONE
- name: celt/entdec.c
disabled: true # DONE
- name: celt/entenc.c
disabled: true # DONE
- name: celt/mathops.c
replace:
- old: PI
new: celtPI
- name: celt/celt_encoder.c
disabled: true # FIXME: if in for init incorrectly unwrapped
- name: celt/opus_custom_demo.c
disabled: true
- name: celt/static_modes_float.h
predef: |
#include "opus_types.h"
static const opus_int16 eband5ms[22];
static const unsigned char band_allocation[231];
- name: celt/quant_bands.c
replace:
- old: 'float64(1<<'
new: 'float64(int64(1)<<'
- name: celt/*.c
# ==== Additional Go code ====
- name: celt_mathops_const.go
content: |
package libopus
const (
cA = 0.43157974
cB = 0.67848403
cC = 0.08595542
cE = float32(celtPI)/2
)
- name: hacks.go
content: |
package libopus
func opus_select_arch() int { panic("TODO") }
- name: types.go
content: |
package libopus
const ALLOC_NONE = 1
const CHAR_BIT = 8
- name: opus_test.go
content: |
package libopus
import "testing"
func TestOpus(t *testing.T) {
}