aboutsummaryrefslogtreecommitdiff
path: root/media/libs/faad2/faad2-2.6.1.diff
blob: bb246163da5165e9ce8575a060d71f37c9f5a03c (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
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
diff -urNad faad2-svn~/include/neaacdec.h faad2-svn/include/neaacdec.h
--- faad2-svn~/include/neaacdec.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/include/neaacdec.h	2007-11-28 23:29:27.000000000 +0000
@@ -35,6 +35,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
+#include <stdint.h>
 
 #if 1
 /* MACROS FOR BACKWARDS COMPATIBILITY */
@@ -197,51 +198,51 @@
     unsigned char ps;
 } NeAACDecFrameInfo;
 
-char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
+int8_t* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
 
-unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
+uint32_t NEAACDECAPI NeAACDecGetCapabilities(void);
 
 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
 
 NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
 
-unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
+uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
                                                    NeAACDecConfigurationPtr config);
 
 /* Init the library based on info from the AAC file (ADTS/ADIF) */
-long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
-                              unsigned char *buffer,
-                              unsigned long buffer_size,
-                              unsigned long *samplerate,
-                              unsigned char *channels);
+int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
+                              uint8_t *buffer,
+                              uint32_t buffer_size,
+                              uint32_t *samplerate,
+                              uint8_t *channels);
 
 /* Init the library using a DecoderSpecificInfo */
-char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
-                               unsigned long SizeOfDecoderSpecificInfo,
-                               unsigned long *samplerate, unsigned char *channels);
+int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
+                               uint32_t SizeOfDecoderSpecificInfo,
+                               uint32_t *samplerate, uint8_t *channels);
 
 /* Init the library for DRM */
-char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
-                                 unsigned char channels);
+int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
+                                 uint8_t channels);
 
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
+void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame);
 
 void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
 
 void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
                                  NeAACDecFrameInfo *hInfo,
-                                 unsigned char *buffer,
-                                 unsigned long buffer_size);
+                                 uint8_t *buffer,
+                                 uint32_t buffer_size);
 
 void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
                                   NeAACDecFrameInfo *hInfo,
-                                  unsigned char *buffer,
-                                  unsigned long buffer_size,
+                                  uint8_t *buffer,
+                                  uint32_t buffer_size,
                                   void **sample_buffer,
-                                  unsigned long sample_buffer_size);
+                                  uint32_t sample_buffer_size);
 
-char NEAACDECAPI NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
-                                             unsigned long buffer_size,
+int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
+                                             uint32_t buffer_size,
                                              mp4AudioSpecificConfig *mp4ASC);
 
 #ifdef _WIN32
diff -urNad faad2-svn~/libfaad/Makefile.am faad2-svn/libfaad/Makefile.am
--- faad2-svn~/libfaad/Makefile.am	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/Makefile.am	2007-11-28 23:31:03.000000000 +0000
@@ -1,28 +1,29 @@
 lib_LTLIBRARIES = libfaad.la
 
+AM_CFLAGS	= -iquote $(top_srcdir)/include
 include_HEADERS = $(top_srcdir)/include/faad.h \
-                  $(top_srcdir)/include/neaacdec.h
+		  $(top_srcdir)/include/neaacdec.h
 
 libfaad_la_LDFLAGS = -lm
 
 libfaad_la_SOURCES = bits.c cfft.c decoder.c drc.c \
-drm_dec.c error.c filtbank.c \
-ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
-ps_dec.c ps_syntax.c \
-pulse.c specrec.c syntax.c tns.c hcr.c huffman.c \
-rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
-sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
-sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c \
-analysis.h bits.h cfft.h cfft_tab.h common.h \
-decoder.h drc.h drm_dec.h error.h fixed.h filtbank.h \
-huffman.h ic_predict.h iq_table.h is.h kbd_win.h lt_predict.h \
-mdct.h mdct_tab.h mp4.h ms.h output.h pns.h ps_dec.h ps_tables.h \
-pulse.h rvlc.h \
-sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
-sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
-sine_win.h specrec.h ssr.h ssr_fb.h ssr_ipqf.h \
-ssr_win.h syntax.h structs.h tns.h \
-sbr_qmf_c.h codebook/hcb.h \
-codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
-codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
-codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
\ No newline at end of file
+		     drm_dec.c error.c filtbank.c \
+		     ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
+		     ps_dec.c ps_syntax.c \
+		     pulse.c specrec.c syntax.c tns.c hcr.c huffman.c \
+		     rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
+		     sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
+		     sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c \
+		     analysis.h bits.h cfft.h cfft_tab.h common.h \
+		     decoder.h drc.h drm_dec.h error.h fixed.h filtbank.h \
+		     huffman.h ic_predict.h iq_table.h is.h kbd_win.h lt_predict.h \
+		     mdct.h mdct_tab.h mp4.h ms.h output.h pns.h ps_dec.h ps_tables.h \
+		     pulse.h rvlc.h \
+		     sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
+		     sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
+		     sine_win.h specrec.h ssr.h ssr_fb.h ssr_ipqf.h \
+		     ssr_win.h syntax.h structs.h tns.h \
+		     sbr_qmf_c.h codebook/hcb.h \
+		     codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
+		     codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
+		     codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
diff -urNad faad2-svn~/libfaad/common.h faad2-svn/libfaad/common.h
--- faad2-svn~/libfaad/common.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/common.h	2007-11-28 23:29:27.000000000 +0000
@@ -39,6 +39,8 @@
 #  include "../config.h"
 #endif
 
+#include "neaacdec.h"
+
 #if 1
 #define INLINE __inline
 #else
@@ -210,7 +212,7 @@
 #else
 # if HAVE_STDINT_H
 #  include <stdint.h>
-# else
+# else /* !HAVE_STDINT_H */
 /* we need these... */
 #ifndef __TCS__
 typedef unsigned long long uint64_t;
@@ -225,7 +227,7 @@
 typedef long int32_t;
 typedef short int16_t;
 typedef char int8_t;
-# endif
+# endif /* !HAVE_STDINT_H */
 #endif
 #if HAVE_UNISTD_H
 //# include <unistd.h>
diff -urNad faad2-svn~/libfaad/decoder.c faad2-svn/libfaad/decoder.c
--- faad2-svn~/libfaad/decoder.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/decoder.c	2007-11-28 23:29:27.000000000 +0000
@@ -34,7 +34,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "decoder.h"
 #include "mp4.h"
 #include "syntax.h"
 #include "error.h"
@@ -54,13 +53,13 @@
 #endif
 
 /* static function declarations */
-static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+static void* aac_frame_decode(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                               uint8_t *buffer, uint32_t buffer_size,
                               void **sample_buffer, uint32_t sample_buffer_size);
-static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo);
+static void create_channel_config(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo);
 
 
-char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
+int8_t* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode)
 {
     if (errcode >= NUM_ERROR_MESSAGES)
         return NULL;
@@ -97,9 +96,9 @@
 NeAACDecHandle NEAACDECAPI NeAACDecOpen(void)
 {
     uint8_t i;
-    NeAACDecHandle hDecoder = NULL;
+    NeAACDecStruct* hDecoder = NULL;
 
-    if ((hDecoder = (NeAACDecHandle)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
+    if ((hDecoder = (NeAACDecStruct*)faad_malloc(sizeof(NeAACDecStruct))) == NULL)
         return NULL;
 
     memset(hDecoder, 0, sizeof(NeAACDecStruct));
@@ -154,8 +153,9 @@
     return hDecoder;
 }
 
-NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder)
+NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
     if (hDecoder)
     {
         NeAACDecConfigurationPtr config = &(hDecoder->config);
@@ -166,9 +166,10 @@
     return NULL;
 }
 
-uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
+uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hpDecoder,
                                              NeAACDecConfigurationPtr config)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
     if (hDecoder && config)
     {
         /* check if we can decode this object type */
@@ -203,7 +204,7 @@
 }
 
 
-int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer,
+int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hpDecoder, uint8_t *buffer,
                                  uint32_t buffer_size,
                                  uint32_t *samplerate, uint8_t *channels)
 {
@@ -211,7 +212,7 @@
     bitfile ld;
     adif_header adif;
     adts_header adts;
-
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
 
     if ((hDecoder == NULL) || (samplerate == NULL) || (channels == NULL))
         return -1;
@@ -310,12 +311,13 @@
 }
 
 /* Init the library using a DecoderSpecificInfo */
-int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
+int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hpDecoder, uint8_t *pBuffer,
                                  uint32_t SizeOfDecoderSpecificInfo,
                                  uint32_t *samplerate, uint8_t *channels)
 {
     int8_t rc;
     mp4AudioSpecificConfig mp4ASC;
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
 
     if((hDecoder == NULL)
         || (pBuffer == NULL)
@@ -401,9 +403,11 @@
 }
 
 #ifdef DRM
-int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
+int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hpDecoder, uint32_t samplerate,
                                    uint8_t channels)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
+    
     if (hDecoder == NULL)
         return 1; /* error */
 
@@ -442,9 +446,10 @@
 }
 #endif
 
-void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder)
+void NEAACDECAPI NeAACDecClose(NeAACDecHandle hpDecoder)
 {
     uint8_t i;
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
 
     if (hDecoder == NULL)
         return;
@@ -495,8 +500,10 @@
     if (hDecoder) faad_free(hDecoder);
 }
 
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame)
+void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, int32_t frame)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
+    
     if (hDecoder)
     {
         hDecoder->postSeekResetFlag = 1;
@@ -506,7 +513,7 @@
     }
 }
 
-static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo)
+static void create_channel_config(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo)
 {
     hInfo->num_front_channels = 0;
     hInfo->num_side_channels = 0;
@@ -724,18 +731,22 @@
     }
 }
 
-void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
+void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hpDecoder,
                                  NeAACDecFrameInfo *hInfo,
                                  uint8_t *buffer, uint32_t buffer_size)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
+    
     return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
 }
 
-void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
+void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hpDecoder,
                                   NeAACDecFrameInfo *hInfo,
                                   uint8_t *buffer, uint32_t buffer_size,
                                   void **sample_buffer, uint32_t sample_buffer_size)
 {
+    NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
+    
     if ((sample_buffer == NULL) || (sample_buffer_size == 0))
     {
         hInfo->error = 27;
@@ -750,14 +761,14 @@
 
 #define ERROR_STATE_INIT 6
 
-static void conceal_output(NeAACDecHandle hDecoder, uint16_t frame_len,
+static void conceal_output(NeAACDecStruct* hDecoder, uint16_t frame_len,
                            uint8_t out_ch, void *sample_buffer)
 {
     return;
 }
 #endif
 
-static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+static void* aac_frame_decode(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                               uint8_t *buffer, uint32_t buffer_size,
                               void **sample_buffer2, uint32_t sample_buffer_size)
 {
diff -urNad faad2-svn~/libfaad/decoder.h faad2-svn/libfaad/decoder.h
--- faad2-svn~/libfaad/decoder.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/decoder.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,124 +0,0 @@
-/*
-** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
-** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-** 
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-** GNU General Public License for more details.
-** 
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software 
-** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**
-** Any non-GPL usage of this software or parts of this software is strictly
-** forbidden.
-**
-** The "appropriate copyright message" mentioned in section 2c of the GPLv2
-** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
-**
-** Commercial non-GPL licensing of this software is possible.
-** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
-**
-** $Id: decoder.h,v 1.48 2007/11/01 12:33:30 menno Exp $
-**/
-
-#ifndef __DECODER_H__
-#define __DECODER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
-  #pragma pack(push, 8)
-  #ifndef NEAACDECAPI
-    #define NEAACDECAPI __cdecl
-  #endif
-#else
-  #ifndef NEAACDECAPI
-    #define NEAACDECAPI
-  #endif
-#endif
-
-
-/* library output formats */
-#define FAAD_FMT_16BIT  1
-#define FAAD_FMT_24BIT  2
-#define FAAD_FMT_32BIT  3
-#define FAAD_FMT_FLOAT  4
-#define FAAD_FMT_FIXED  FAAD_FMT_FLOAT
-#define FAAD_FMT_DOUBLE 5
-
-#define LC_DEC_CAP            (1<<0)
-#define MAIN_DEC_CAP          (1<<1)
-#define LTP_DEC_CAP           (1<<2)
-#define LD_DEC_CAP            (1<<3)
-#define ERROR_RESILIENCE_CAP  (1<<4)
-#define FIXED_POINT_CAP       (1<<5)
-
-#define FRONT_CHANNEL_CENTER (1)
-#define FRONT_CHANNEL_LEFT   (2)
-#define FRONT_CHANNEL_RIGHT  (3)
-#define SIDE_CHANNEL_LEFT    (4)
-#define SIDE_CHANNEL_RIGHT   (5)
-#define BACK_CHANNEL_LEFT    (6)
-#define BACK_CHANNEL_RIGHT   (7)
-#define BACK_CHANNEL_CENTER  (8)
-#define LFE_CHANNEL          (9)
-#define UNKNOWN_CHANNEL      (0)
-
-char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode);
-
-uint32_t NEAACDECAPI NeAACDecGetCapabilities(void);
-
-NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
-
-NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
-
-uint8_t NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
-                                             NeAACDecConfigurationPtr config);
-
-/* Init the library based on info from the AAC file (ADTS/ADIF) */
-int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
-                                 uint8_t *buffer,
-                                 uint32_t buffer_size,
-                                 uint32_t *samplerate,
-                                 uint8_t *channels);
-
-/* Init the library using a DecoderSpecificInfo */
-int8_t NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, uint8_t *pBuffer,
-                                 uint32_t SizeOfDecoderSpecificInfo,
-                                 uint32_t *samplerate, uint8_t *channels);
-
-/* Init the library for DRM */
-int8_t NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, uint32_t samplerate,
-                                   uint8_t channels);
-
-void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
-
-void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, int32_t frame);
-
-void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
-                                 NeAACDecFrameInfo *hInfo,
-                                 uint8_t *buffer,
-                                 uint32_t buffer_size);
-
-void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
-                                  NeAACDecFrameInfo *hInfo,
-                                  uint8_t *buffer, uint32_t buffer_size,
-                                  void **sample_buffer, uint32_t sample_buffer_size);
-
-#ifdef _WIN32
-  #pragma pack(pop)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -urNad faad2-svn~/libfaad/filtbank.c faad2-svn/libfaad/filtbank.c
--- faad2-svn~/libfaad/filtbank.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/filtbank.c	2007-11-28 23:29:27.000000000 +0000
@@ -40,7 +40,6 @@
 #endif
 
 #include "filtbank.h"
-#include "decoder.h"
 #include "syntax.h"
 #include "kbd_win.h"
 #include "sine_win.h"
diff -urNad faad2-svn~/libfaad/hcr.c faad2-svn/libfaad/hcr.c
--- faad2-svn~/libfaad/hcr.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/hcr.c	2007-11-28 23:29:27.000000000 +0000
@@ -214,7 +214,7 @@
     codeword[index].bits.len = 0;
 }
 
-uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, 
+uint8_t reordered_spectral_data(NeAACDecStruct* hDecoder, ic_stream *ics, 
                                 bitfile *ld, int16_t *spectral_data)
 {   
     uint16_t PCWs_done;
diff -urNad faad2-svn~/libfaad/mp4.h faad2-svn/libfaad/mp4.h
--- faad2-svn~/libfaad/mp4.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/mp4.h	2007-11-28 23:29:27.000000000 +0000
@@ -35,11 +35,7 @@
 extern "C" {
 #endif
 
-#include "decoder.h"
-
-int8_t NEAACDECAPI NeAACDecAudioSpecificConfig(uint8_t *pBuffer,
-                                               uint32_t buffer_size,
-                                               mp4AudioSpecificConfig *mp4ASC);
+#include "neaacdec.h"
 
 int8_t AudioSpecificConfig2(uint8_t *pBuffer,
                             uint32_t buffer_size,
diff -urNad faad2-svn~/libfaad/output.c faad2-svn/libfaad/output.c
--- faad2-svn~/libfaad/output.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/output.c	2007-11-28 23:29:27.000000000 +0000
@@ -32,7 +32,6 @@
 #include "structs.h"
 
 #include "output.h"
-#include "decoder.h"
 
 #ifndef FIXED_POINT
 
@@ -87,7 +86,7 @@
 
 #define CONV(a,b) ((a<<1)|(b&0x1))
 
-static void to_PCM_16bit(NeAACDecHandle hDecoder, real_t **input,
+static void to_PCM_16bit(NeAACDecStruct* hDecoder, real_t **input,
                          uint8_t channels, uint16_t frame_len,
                          int16_t **sample_buffer)
 {
@@ -152,7 +151,7 @@
     }
 }
 
-static void to_PCM_24bit(NeAACDecHandle hDecoder, real_t **input,
+static void to_PCM_24bit(NeAACDecStruct* hDecoder, real_t **input,
                          uint8_t channels, uint16_t frame_len,
                          int32_t **sample_buffer)
 {
@@ -222,7 +221,7 @@
     }
 }
 
-static void to_PCM_32bit(NeAACDecHandle hDecoder, real_t **input,
+static void to_PCM_32bit(NeAACDecStruct* hDecoder, real_t **input,
                          uint8_t channels, uint16_t frame_len,
                          int32_t **sample_buffer)
 {
@@ -292,7 +291,7 @@
     }
 }
 
-static void to_PCM_float(NeAACDecHandle hDecoder, real_t **input,
+static void to_PCM_float(NeAACDecStruct* hDecoder, real_t **input,
                          uint8_t channels, uint16_t frame_len,
                          float32_t **sample_buffer)
 {
@@ -344,7 +343,7 @@
     }
 }
 
-static void to_PCM_double(NeAACDecHandle hDecoder, real_t **input,
+static void to_PCM_double(NeAACDecStruct* hDecoder, real_t **input,
                           uint8_t channels, uint16_t frame_len,
                           double **sample_buffer)
 {
@@ -396,7 +395,7 @@
     }
 }
 
-void *output_to_PCM(NeAACDecHandle hDecoder,
+void *output_to_PCM(NeAACDecStruct* hDecoder,
                     real_t **input, void *sample_buffer, uint8_t channels,
                     uint16_t frame_len, uint8_t format)
 {
@@ -466,7 +465,7 @@
     }
 }
 
-void* output_to_PCM(NeAACDecHandle hDecoder,
+void* output_to_PCM(NeAACDecStruct* hDecoder,
                     real_t **input, void *sample_buffer, uint8_t channels,
                     uint16_t frame_len, uint8_t format)
 {
diff -urNad faad2-svn~/libfaad/output.h faad2-svn/libfaad/output.h
--- faad2-svn~/libfaad/output.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/output.h	2007-11-28 23:29:27.000000000 +0000
@@ -35,7 +35,7 @@
 extern "C" {
 #endif
 
-void* output_to_PCM(NeAACDecHandle hDecoder,
+void* output_to_PCM(NeAACDecStruct* hDecoder,
                     real_t **input,
                     void *samplebuffer,
                     uint8_t channels,
diff -urNad faad2-svn~/libfaad/specrec.c faad2-svn/libfaad/specrec.c
--- faad2-svn~/libfaad/specrec.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/specrec.c	2007-11-28 23:29:27.000000000 +0000
@@ -58,7 +58,7 @@
 
 
 /* static function declarations */
-static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
+static uint8_t quant_to_spec(NeAACDecStruct* hDecoder,
                              ic_stream *ics, int16_t *quant_data,
                              real_t *spec_data, uint16_t frame_len);
 
@@ -300,10 +300,9 @@
     in section named section. This offset depends on window_sequence and
     scale_factor_grouping and is needed to decode the spectral_data().
 */
-uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics)
+uint8_t window_grouping_info(NeAACDecStruct* hDecoder, ic_stream *ics)
 {
     uint8_t i, g;
-
     uint8_t sf_index = hDecoder->sf_index;
 
     switch (ics->window_sequence) {
@@ -546,7 +545,7 @@
   - Within a scalefactor window band, the coefficients are in ascending
     spectral order.
 */
-static uint8_t quant_to_spec(NeAACDecHandle hDecoder,
+static uint8_t quant_to_spec(NeAACDecStruct* hDecoder,
                              ic_stream *ics, int16_t *quant_data,
                              real_t *spec_data, uint16_t frame_len)
 {
@@ -680,7 +679,7 @@
     return error;
 }
 
-static uint8_t allocate_single_channel(NeAACDecHandle hDecoder, uint8_t channel,
+static uint8_t allocate_single_channel(NeAACDecStruct* hDecoder, uint8_t channel,
                                        uint8_t output_channels)
 {
     int mul = 1;
@@ -781,7 +780,7 @@
     return 0;
 }
 
-static uint8_t allocate_channel_pair(NeAACDecHandle hDecoder,
+static uint8_t allocate_channel_pair(NeAACDecStruct* hDecoder,
                                      uint8_t channel, uint8_t paired_channel)
 {
     int mul = 1;
@@ -886,7 +885,7 @@
     return 0;
 }
 
-uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
+uint8_t reconstruct_single_channel(NeAACDecStruct* hDecoder, ic_stream *ics,
                                    element *sce, int16_t *spec_data)
 {
     uint8_t retval;
@@ -1096,7 +1095,7 @@
     return 0;
 }
 
-uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
+uint8_t reconstruct_channel_pair(NeAACDecStruct* hDecoder, ic_stream *ics1, ic_stream *ics2,
                                  element *cpe, int16_t *spec_data1, int16_t *spec_data2)
 {
     uint8_t retval;
@@ -1106,6 +1105,7 @@
 #ifdef PROFILE
     int64_t count = faad_get_ts();
 #endif
+    
     if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
     {
         retval = allocate_channel_pair(hDecoder, cpe->channel, (uint8_t)cpe->paired_channel);
diff -urNad faad2-svn~/libfaad/specrec.h faad2-svn/libfaad/specrec.h
--- faad2-svn~/libfaad/specrec.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/specrec.h	2007-11-28 23:29:27.000000000 +0000
@@ -37,10 +37,10 @@
 
 #include "syntax.h"
 
-uint8_t window_grouping_info(NeAACDecHandle hDecoder, ic_stream *ics);
-uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
+uint8_t window_grouping_info(NeAACDecStruct* hDecoder, ic_stream *ics);
+uint8_t reconstruct_channel_pair(NeAACDecStruct* hDecoder, ic_stream *ics1, ic_stream *ics2,
                                  element *cpe, int16_t *spec_data1, int16_t *spec_data2);
-uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics, element *sce,
+uint8_t reconstruct_single_channel(NeAACDecStruct* hDecoder, ic_stream *ics, element *sce,
                                 int16_t *spec_data);
 
 #ifdef __cplusplus
diff -urNad faad2-svn~/libfaad/structs.h faad2-svn/libfaad/structs.h
--- faad2-svn~/libfaad/structs.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/structs.h	2007-11-28 23:29:27.000000000 +0000
@@ -312,67 +312,6 @@
     ic_stream ics2;
 } element; /* syntax element (SCE, CPE, LFE) */
 
-typedef struct mp4AudioSpecificConfig
-{
-    /* Audio Specific Info */
-    /*uint8_t*/ unsigned char objectTypeIndex;
-    /*uint8_t*/ unsigned char samplingFrequencyIndex;
-    /*uint32_t*/ unsigned long samplingFrequency;
-    /*uint8_t*/ unsigned char channelsConfiguration;
-
-    /* GA Specific Info */
-    /*uint8_t*/ unsigned char frameLengthFlag;
-    /*uint8_t*/ unsigned char dependsOnCoreCoder;
-    /*uint16_t*/ unsigned short coreCoderDelay;
-    /*uint8_t*/ unsigned char extensionFlag;
-    /*uint8_t*/ unsigned char aacSectionDataResilienceFlag;
-    /*uint8_t*/ unsigned char aacScalefactorDataResilienceFlag;
-    /*uint8_t*/ unsigned char aacSpectralDataResilienceFlag;
-    /*uint8_t*/ unsigned char epConfig;
-
-    /*uint8_t*/ char sbr_present_flag;
-    /*uint8_t*/ char forceUpSampling;
-    /*uint8_t*/ char downSampledSBR;
-} mp4AudioSpecificConfig;
-
-typedef struct NeAACDecConfiguration
-{
-    /*uint8_t*/ unsigned char defObjectType;
-    /*uint32_t*/ unsigned long defSampleRate;
-    /*uint8_t*/ unsigned char outputFormat;
-    /*uint8_t*/ unsigned char downMatrix;
-    /*uint8_t*/ unsigned char useOldADTSFormat;
-    /*uint8_t*/ unsigned char dontUpSampleImplicitSBR;
-} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
-
-typedef struct NeAACDecFrameInfo
-{
-    /*uint32_t*/ unsigned long bytesconsumed;
-    /*uint32_t*/ unsigned long samples;
-    /*uint8_t*/ unsigned char channels;
-    /*uint8_t*/ unsigned char error;
-    /*uint32_t*/ unsigned long samplerate;
-
-    /* SBR: 0: off, 1: on; normal, 2: on; downsampled */
-    /*uint8_t*/ unsigned char sbr;
-
-    /* MPEG-4 ObjectType */
-    /*uint8_t*/ unsigned char object_type;
-
-    /* AAC header type; MP4 will be signalled as RAW also */
-    /*uint8_t*/ unsigned char header_type;
-
-    /* multichannel configuration */
-    /*uint8_t*/ unsigned char num_front_channels;
-    /*uint8_t*/ unsigned char num_side_channels;
-    /*uint8_t*/ unsigned char num_back_channels;
-    /*uint8_t*/ unsigned char num_lfe_channels;
-    /*uint8_t*/ unsigned char channel_position[MAX_CHANNELS];
-
-    /* PS: 0: off, 1: on */
-    /*uint8_t*/ unsigned char ps;
-} NeAACDecFrameInfo;
-
 typedef struct
 {
     uint8_t adts_header_present;
@@ -477,9 +416,7 @@
     int64_t requant_cycles;
 #endif
 	const unsigned char *cmes;
-} NeAACDecStruct, *NeAACDecHandle;
-
-
+} NeAACDecStruct;
 
 #ifdef __cplusplus
 }
diff -urNad faad2-svn~/libfaad/syntax.c faad2-svn/libfaad/syntax.c
--- faad2-svn~/libfaad/syntax.c	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/syntax.c	2007-11-28 23:29:27.000000000 +0000
@@ -38,7 +38,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "decoder.h"
 #include "syntax.h"
 #include "specrec.h"
 #include "huffman.h"
@@ -55,51 +54,51 @@
 
 
 /* static function declarations */
-static void decode_sce_lfe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
+static void decode_sce_lfe(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
                            uint8_t id_syn_ele);
-static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
+static void decode_cpe(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
                        uint8_t id_syn_ele);
-static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
+static uint8_t single_lfe_channel_element(NeAACDecStruct* hDecoder, bitfile *ld,
                                           uint8_t channel, uint8_t *tag);
-static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
+static uint8_t channel_pair_element(NeAACDecStruct* hDecoder, bitfile *ld,
                                     uint8_t channel, uint8_t *tag);
 #ifdef COUPLING_DEC
-static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld);
+static uint8_t coupling_channel_element(NeAACDecStruct* hDecoder, bitfile *ld);
 #endif
-static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld);
+static uint16_t data_stream_element(NeAACDecStruct* hDecoder, bitfile *ld);
 static uint8_t program_config_element(program_config *pce, bitfile *ld);
-static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
+static uint8_t fill_element(NeAACDecStruct* hDecoder, bitfile *ld, drc_info *drc
 #ifdef SBR_DEC
                             ,uint8_t sbr_ele
 #endif
                             );
-static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
+static uint8_t individual_channel_stream(NeAACDecStruct* hDecoder, element *ele,
                                          bitfile *ld, ic_stream *ics, uint8_t scal_flag,
                                          int16_t *spec_data);
-static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
+static uint8_t ics_info(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld,
                         uint8_t common_window);
-static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
-static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld);
+static uint8_t section_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld);
+static uint8_t scale_factor_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld);
 #ifdef SSR_DEC
 static void gain_control_data(bitfile *ld, ic_stream *ics);
 #endif
-static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
+static uint8_t spectral_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld,
                              int16_t *spectral_data);
 static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count);
 static uint8_t pulse_data(ic_stream *ics, pulse_info *pul, bitfile *ld);
 static void tns_data(ic_stream *ics, tns_info *tns, bitfile *ld);
 #ifdef LTP_DEC
-static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld);
+static uint8_t ltp_data(NeAACDecStruct* hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld);
 #endif
 static uint8_t adts_fixed_header(adts_header *adts, bitfile *ld);
 static void adts_variable_header(adts_header *adts, bitfile *ld);
 static void adts_error_check(adts_header *adts, bitfile *ld);
 static uint8_t dynamic_range_info(bitfile *ld, drc_info *drc);
 static uint8_t excluded_channels(bitfile *ld, drc_info *drc);
-static uint8_t side_info(NeAACDecHandle hDecoder, element *ele,
+static uint8_t side_info(NeAACDecStruct* hDecoder, element *ele,
                          bitfile *ld, ic_stream *ics, uint8_t scal_flag);
 #ifdef DRM
-static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
+static int8_t DRM_aac_scalable_main_header(NeAACDecStruct* hDecoder, ic_stream *ics1, ic_stream *ics2,
                                            bitfile *ld, uint8_t this_layer_stereo);
 #endif
 
@@ -321,7 +320,7 @@
     return 0;
 }
 
-static void decode_sce_lfe(NeAACDecHandle hDecoder,
+static void decode_sce_lfe(NeAACDecStruct* hDecoder,
                            NeAACDecFrameInfo *hInfo, bitfile *ld,
                            uint8_t id_syn_ele)
 {
@@ -366,7 +365,7 @@
     hDecoder->fr_ch_ele++;
 }
 
-static void decode_cpe(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
+static void decode_cpe(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo, bitfile *ld,
                        uint8_t id_syn_ele)
 {
     uint8_t channels = hDecoder->fr_channels;
@@ -414,7 +413,7 @@
     hDecoder->fr_ch_ele++;
 }
 
-void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+void raw_data_block(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                     bitfile *ld, program_config *pce, drc_info *drc)
 {
     uint8_t id_syn_ele;
@@ -584,7 +583,7 @@
 
 /* Table 4.4.4 and */
 /* Table 4.4.9 */
-static uint8_t single_lfe_channel_element(NeAACDecHandle hDecoder, bitfile *ld,
+static uint8_t single_lfe_channel_element(NeAACDecStruct* hDecoder, bitfile *ld,
                                           uint8_t channel, uint8_t *tag)
 {
     uint8_t retval = 0;
@@ -631,7 +630,7 @@
 }
 
 /* Table 4.4.5 */
-static uint8_t channel_pair_element(NeAACDecHandle hDecoder, bitfile *ld,
+static uint8_t channel_pair_element(NeAACDecStruct* hDecoder, bitfile *ld,
                                     uint8_t channels, uint8_t *tag)
 {
     ALIGN int16_t spec_data1[1024] = {0};
@@ -761,7 +760,7 @@
 }
 
 /* Table 4.4.6 */
-static uint8_t ics_info(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
+static uint8_t ics_info(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld,
                         uint8_t common_window)
 {
     uint8_t retval = 0;
@@ -912,7 +911,7 @@
 
 #ifdef COUPLING_DEC
 /* Table 4.4.8: Currently just for skipping the bits... */
-static uint8_t coupling_channel_element(NeAACDecHandle hDecoder, bitfile *ld)
+static uint8_t coupling_channel_element(NeAACDecStruct* hDecoder, bitfile *ld)
 {
     uint8_t c, result = 0;
     uint8_t ind_sw_cce_flag = 0;
@@ -1005,7 +1004,7 @@
 #endif
 
 /* Table 4.4.10 */
-static uint16_t data_stream_element(NeAACDecHandle hDecoder, bitfile *ld)
+static uint16_t data_stream_element(NeAACDecStruct* hDecoder, bitfile *ld)
 {
     uint8_t byte_aligned;
     uint16_t i, count;
@@ -1034,7 +1033,7 @@
 }
 
 /* Table 4.4.11 */
-static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
+static uint8_t fill_element(NeAACDecStruct* hDecoder, bitfile *ld, drc_info *drc
 #ifdef SBR_DEC
                             ,uint8_t sbr_ele
 #endif
@@ -1213,7 +1212,7 @@
 
 #ifdef DRM
 /* Table 4.4.13 ASME */
-void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+void DRM_aac_scalable_main_element(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                                    bitfile *ld, program_config *pce, drc_info *drc)
 {
     uint8_t retval = 0;
@@ -1423,7 +1422,7 @@
 }
 
 /* Table 4.4.15 */
-static int8_t DRM_aac_scalable_main_header(NeAACDecHandle hDecoder, ic_stream *ics1, ic_stream *ics2,
+static int8_t DRM_aac_scalable_main_header(NeAACDecStruct* hDecoder, ic_stream *ics1, ic_stream *ics2,
                                            bitfile *ld, uint8_t this_layer_stereo)
 {
     uint8_t retval = 0;
@@ -1491,7 +1490,7 @@
 }
 #endif
 
-static uint8_t side_info(NeAACDecHandle hDecoder, element *ele,
+static uint8_t side_info(NeAACDecStruct* hDecoder, element *ele,
                          bitfile *ld, ic_stream *ics, uint8_t scal_flag)
 {
     uint8_t result;
@@ -1584,7 +1583,7 @@
 }
 
 /* Table 4.4.24 */
-static uint8_t individual_channel_stream(NeAACDecHandle hDecoder, element *ele,
+static uint8_t individual_channel_stream(NeAACDecStruct* hDecoder, element *ele,
                                          bitfile *ld, ic_stream *ics, uint8_t scal_flag,
                                          int16_t *spec_data)
 {
@@ -1644,7 +1643,7 @@
 }
 
 /* Table 4.4.25 */
-static uint8_t section_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
+static uint8_t section_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld)
 {
     uint8_t g;
     uint8_t sect_esc_val, sect_bits;
@@ -1891,7 +1890,7 @@
 }
 
 /* Table 4.4.26 */
-static uint8_t scale_factor_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld)
+static uint8_t scale_factor_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld)
 {
     uint8_t ret = 0;
 #ifdef PROFILE
@@ -1999,7 +1998,7 @@
 
 #ifdef LTP_DEC
 /* Table 4.4.28 */
-static uint8_t ltp_data(NeAACDecHandle hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld)
+static uint8_t ltp_data(NeAACDecStruct* hDecoder, ic_stream *ics, ltp_info *ltp, bitfile *ld)
 {
     uint8_t sfb, w;
 
@@ -2062,7 +2061,7 @@
 #endif
 
 /* Table 4.4.29 */
-static uint8_t spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
+static uint8_t spectral_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld,
                              int16_t *spectral_data)
 {
     int8_t i;
diff -urNad faad2-svn~/libfaad/syntax.h faad2-svn/libfaad/syntax.h
--- faad2-svn~/libfaad/syntax.h	2007-11-28 23:28:14.000000000 +0000
+++ faad2-svn/libfaad/syntax.h	2007-11-28 23:29:27.000000000 +0000
@@ -35,7 +35,6 @@
 extern "C" {
 #endif
 
-#include "decoder.h"
 #include "bits.h"
 
 #define MAIN       1
@@ -113,12 +112,12 @@
 
 uint8_t adts_frame(adts_header *adts, bitfile *ld);
 void get_adif_header(adif_header *adif, bitfile *ld);
-void raw_data_block(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+void raw_data_block(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                     bitfile *ld, program_config *pce, drc_info *drc);
-uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld,
+uint8_t reordered_spectral_data(NeAACDecStruct* hDecoder, ic_stream *ics, bitfile *ld,
                                 int16_t *spectral_data);
 #ifdef DRM
-void DRM_aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo,
+void DRM_aac_scalable_main_element(NeAACDecStruct* hDecoder, NeAACDecFrameInfo *hInfo,
                                    bitfile *ld, program_config *pce, drc_info *drc);
 #endif