2 /* -----------------------------------------------------------------------------------------------------------
3 Software License for The Fraunhofer FDK AAC Codec Library for Android
5 © Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
9 The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
10 the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
11 This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
13 AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
14 audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
15 independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
16 of the MPEG specifications.
18 Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
19 may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
20 individually for the purpose of encoding or decoding bit streams in products that are compliant with
21 the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
22 these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
23 software may already be covered under those patent licenses when it is used for those licensed purposes only.
25 Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
26 are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
27 applications information and documentation.
31 Redistribution and use in source and binary forms, with or without modification, are permitted without
32 payment of copyright license fees provided that you satisfy the following conditions:
34 You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
35 your modifications thereto in source code form.
37 You must retain the complete text of this software license in the documentation and/or other materials
38 provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
39 You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
40 modifications thereto to recipients of copies in binary form.
42 The name of Fraunhofer may not be used to endorse or promote products derived from this library without
43 prior written permission.
45 You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
46 software or your modifications thereto.
48 Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
49 and the date of any change. For modified versions of the FDK AAC Codec, the term
50 "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term
51 "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android."
55 NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
56 ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
57 respect to this software.
59 You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
60 by appropriate patent licenses.
64 This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors
65 "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties
66 of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
67 CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
68 including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
69 or business interruption, however caused and on any theory of liability, whether in contract, strict
70 liability, or tort (including negligence), arising in any way out of the use of this software, even if
71 advised of the possibility of such damage.
73 5. CONTACT INFORMATION
75 Fraunhofer Institute for Integrated Circuits IIS
76 Attention: Audio and Multimedia Departments - FDK AAC LL
78 91058 Erlangen, Germany
80 www.iis.fraunhofer.de/amm
81 amm-info@iis.fraunhofer.de
82 ----------------------------------------------------------------------------------------------------------- */
84 /******************************** MPEG Audio Encoder **************************
86 Initial author: M.Werner
87 contents/description: Huffman Bitcounter & coder
89 ******************************************************************************/
93 #include "aacEnc_ram.h"
95 #define HI_LTAB(a) (a>>16)
96 #define LO_LTAB(a) (a & 0xffff)
98 /*****************************************************************************
101 functionname: FDKaacEnc_count1_2_3_4_5_6_7_8_9_10_11
102 description: counts tables 1-11
104 input: quantized spectrum
105 output: bitCount for tables 1-11
107 *****************************************************************************/
109 static void FDKaacEnc_count1_2_3_4_5_6_7_8_9_10_11(const SHORT
*RESTRICT values
,
115 INT bc1_2
,bc3_4
,bc5_6
,bc7_8
,bc9_10
,bc11
,sc
;
125 for(i
=0;i
<width
;i
+=4){
134 bc1_2
+=FDKaacEnc_huff_ltab1_2
[t0
+1][t1
+1][t2
+1][t3
+1];
137 bc5_6
+=FDKaacEnc_huff_ltab5_6
[t0
+4][t1
+4];
138 bc5_6
+=FDKaacEnc_huff_ltab5_6
[t2
+4][t3
+4];
146 bc3_4
+= FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
];
148 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t0
][t1
];
149 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t2
][t3
];
151 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t0
][t1
];
152 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t2
][t3
];
154 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
155 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t2
][t3
];
157 sc
+=(t0
>0)+(t1
>0)+(t2
>0)+(t3
>0);
160 bitCount
[1]=HI_LTAB(bc1_2
);
161 bitCount
[2]=LO_LTAB(bc1_2
);
162 bitCount
[3]=HI_LTAB(bc3_4
)+sc
;
163 bitCount
[4]=LO_LTAB(bc3_4
)+sc
;
164 bitCount
[5]=HI_LTAB(bc5_6
);
165 bitCount
[6]=LO_LTAB(bc5_6
);
166 bitCount
[7]=HI_LTAB(bc7_8
)+sc
;
167 bitCount
[8]=LO_LTAB(bc7_8
)+sc
;
168 bitCount
[9]=HI_LTAB(bc9_10
)+sc
;
169 bitCount
[10]=LO_LTAB(bc9_10
)+sc
;
170 bitCount
[11]=bc11
+sc
;
175 /*****************************************************************************
177 functionname: FDKaacEnc_count3_4_5_6_7_8_9_10_11
178 description: counts tables 3-11
180 input: quantized spectrum
181 output: bitCount for tables 3-11
183 *****************************************************************************/
185 static void FDKaacEnc_count3_4_5_6_7_8_9_10_11(const SHORT
*RESTRICT values
,
191 INT bc3_4
,bc5_6
,bc7_8
,bc9_10
,bc11
,sc
;
201 for(i
=0;i
<width
;i
+=4){
208 bc5_6
+=FDKaacEnc_huff_ltab5_6
[t0
+4][t1
+4];
209 bc5_6
+=FDKaacEnc_huff_ltab5_6
[t2
+4][t3
+4];
216 bc3_4
+= FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
];
218 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t0
][t1
];
219 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t2
][t3
];
221 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t0
][t1
];
222 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t2
][t3
];
224 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
225 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t2
][t3
];
227 sc
+=(t0
>0)+(t1
>0)+(t2
>0)+(t3
>0);
230 bitCount
[1]=INVALID_BITCOUNT
;
231 bitCount
[2]=INVALID_BITCOUNT
;
232 bitCount
[3]=HI_LTAB(bc3_4
)+sc
;
233 bitCount
[4]=LO_LTAB(bc3_4
)+sc
;
234 bitCount
[5]=HI_LTAB(bc5_6
);
235 bitCount
[6]=LO_LTAB(bc5_6
);
236 bitCount
[7]=HI_LTAB(bc7_8
)+sc
;
237 bitCount
[8]=LO_LTAB(bc7_8
)+sc
;
238 bitCount
[9]=HI_LTAB(bc9_10
)+sc
;
239 bitCount
[10]=LO_LTAB(bc9_10
)+sc
;
240 bitCount
[11]=bc11
+sc
;
245 /*****************************************************************************
247 functionname: FDKaacEnc_count5_6_7_8_9_10_11
248 description: counts tables 5-11
250 input: quantized spectrum
251 output: bitCount for tables 5-11
253 *****************************************************************************/
256 static void FDKaacEnc_count5_6_7_8_9_10_11(const SHORT
*RESTRICT values
,
262 INT bc5_6
,bc7_8
,bc9_10
,bc11
,sc
;
270 for(i
=0;i
<width
;i
+=2){
275 bc5_6
+=FDKaacEnc_huff_ltab5_6
[t0
+4][t1
+4];
280 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t0
][t1
];
281 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t0
][t1
];
282 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
286 bitCount
[1]=INVALID_BITCOUNT
;
287 bitCount
[2]=INVALID_BITCOUNT
;
288 bitCount
[3]=INVALID_BITCOUNT
;
289 bitCount
[4]=INVALID_BITCOUNT
;
290 bitCount
[5]=HI_LTAB(bc5_6
);
291 bitCount
[6]=LO_LTAB(bc5_6
);
292 bitCount
[7]=HI_LTAB(bc7_8
)+sc
;
293 bitCount
[8]=LO_LTAB(bc7_8
)+sc
;
294 bitCount
[9]=HI_LTAB(bc9_10
)+sc
;
295 bitCount
[10]=LO_LTAB(bc9_10
)+sc
;
296 bitCount
[11]=bc11
+sc
;
301 /*****************************************************************************
303 functionname: FDKaacEnc_count7_8_9_10_11
304 description: counts tables 7-11
306 input: quantized spectrum
307 output: bitCount for tables 7-11
309 *****************************************************************************/
311 static void FDKaacEnc_count7_8_9_10_11(const SHORT
*RESTRICT values
,
317 INT bc7_8
,bc9_10
,bc11
,sc
;
325 for(i
=0;i
<width
;i
+=2){
326 t0
=fixp_abs(values
[i
+0]);
327 t1
=fixp_abs(values
[i
+1]);
329 bc7_8
+=FDKaacEnc_huff_ltab7_8
[t0
][t1
];
330 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t0
][t1
];
331 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
335 bitCount
[1]=INVALID_BITCOUNT
;
336 bitCount
[2]=INVALID_BITCOUNT
;
337 bitCount
[3]=INVALID_BITCOUNT
;
338 bitCount
[4]=INVALID_BITCOUNT
;
339 bitCount
[5]=INVALID_BITCOUNT
;
340 bitCount
[6]=INVALID_BITCOUNT
;
341 bitCount
[7]=HI_LTAB(bc7_8
)+sc
;
342 bitCount
[8]=LO_LTAB(bc7_8
)+sc
;
343 bitCount
[9]=HI_LTAB(bc9_10
)+sc
;
344 bitCount
[10]=LO_LTAB(bc9_10
)+sc
;
345 bitCount
[11]=bc11
+sc
;
349 /*****************************************************************************
351 functionname: FDKaacEnc_count9_10_11
352 description: counts tables 9-11
354 input: quantized spectrum
355 output: bitCount for tables 9-11
357 *****************************************************************************/
361 static void FDKaacEnc_count9_10_11(const SHORT
*RESTRICT values
,
374 for(i
=0;i
<width
;i
+=2){
375 t0
=fixp_abs(values
[i
+0]);
376 t1
=fixp_abs(values
[i
+1]);
378 bc9_10
+=FDKaacEnc_huff_ltab9_10
[t0
][t1
];
379 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
384 bitCount
[1]=INVALID_BITCOUNT
;
385 bitCount
[2]=INVALID_BITCOUNT
;
386 bitCount
[3]=INVALID_BITCOUNT
;
387 bitCount
[4]=INVALID_BITCOUNT
;
388 bitCount
[5]=INVALID_BITCOUNT
;
389 bitCount
[6]=INVALID_BITCOUNT
;
390 bitCount
[7]=INVALID_BITCOUNT
;
391 bitCount
[8]=INVALID_BITCOUNT
;
392 bitCount
[9]=HI_LTAB(bc9_10
)+sc
;
393 bitCount
[10]=LO_LTAB(bc9_10
)+sc
;
394 bitCount
[11]=bc11
+sc
;
398 /*****************************************************************************
400 functionname: FDKaacEnc_count11
401 description: counts table 11
403 input: quantized spectrum
404 output: bitCount for table 11
406 *****************************************************************************/
408 static void FDKaacEnc_count11(const SHORT
*RESTRICT values
,
419 for(i
=0;i
<width
;i
+=2){
420 t0
=fixp_abs(values
[i
+0]);
421 t1
=fixp_abs(values
[i
+1]);
422 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t0
][t1
];
426 bitCount
[1]=INVALID_BITCOUNT
;
427 bitCount
[2]=INVALID_BITCOUNT
;
428 bitCount
[3]=INVALID_BITCOUNT
;
429 bitCount
[4]=INVALID_BITCOUNT
;
430 bitCount
[5]=INVALID_BITCOUNT
;
431 bitCount
[6]=INVALID_BITCOUNT
;
432 bitCount
[7]=INVALID_BITCOUNT
;
433 bitCount
[8]=INVALID_BITCOUNT
;
434 bitCount
[9]=INVALID_BITCOUNT
;
435 bitCount
[10]=INVALID_BITCOUNT
;
436 bitCount
[11]=bc11
+sc
;
439 /*****************************************************************************
441 functionname: FDKaacEnc_countEsc
442 description: counts table 11 (with Esc)
444 input: quantized spectrum
445 output: bitCount for tables 11 (with Esc)
447 *****************************************************************************/
449 static void FDKaacEnc_countEsc(const SHORT
*RESTRICT values
,
451 INT
*RESTRICT bitCount
)
461 for(i
=0;i
<width
;i
+=2){
462 t0
=fixp_abs(values
[i
+0]);
463 t1
=fixp_abs(values
[i
+1]);
469 bc11
+= (INT
) FDKaacEnc_huff_ltab11
[t00
][t01
];
473 while((t0
>>=1) >= 16)
479 while((t1
>>=1) >= 16)
485 bitCount
[i
]=INVALID_BITCOUNT
;
487 bitCount
[11]=bc11
+sc
+ec
;
491 typedef void (*COUNT_FUNCTION
)(const SHORT
*RESTRICT values
,
493 INT
*RESTRICT bitCount
);
495 static const COUNT_FUNCTION countFuncTable
[CODE_BOOK_ESC_LAV
+1] =
498 FDKaacEnc_count1_2_3_4_5_6_7_8_9_10_11
, /* 0 */
499 FDKaacEnc_count1_2_3_4_5_6_7_8_9_10_11
, /* 1 */
500 FDKaacEnc_count3_4_5_6_7_8_9_10_11
, /* 2 */
501 FDKaacEnc_count5_6_7_8_9_10_11
, /* 3 */
502 FDKaacEnc_count5_6_7_8_9_10_11
, /* 4 */
503 FDKaacEnc_count7_8_9_10_11
, /* 5 */
504 FDKaacEnc_count7_8_9_10_11
, /* 6 */
505 FDKaacEnc_count7_8_9_10_11
, /* 7 */
506 FDKaacEnc_count9_10_11
, /* 8 */
507 FDKaacEnc_count9_10_11
, /* 9 */
508 FDKaacEnc_count9_10_11
, /* 10 */
509 FDKaacEnc_count9_10_11
, /* 11 */
510 FDKaacEnc_count9_10_11
, /* 12 */
511 FDKaacEnc_count11
, /* 13 */
512 FDKaacEnc_count11
, /* 14 */
513 FDKaacEnc_count11
, /* 15 */
514 FDKaacEnc_countEsc
/* 16 */
519 INT
FDKaacEnc_bitCount(const SHORT
*values
,
526 check if we can use codebook 0
532 bitCount
[0] = INVALID_BITCOUNT
;
534 maxVal
= fixMin(maxVal
,(INT
)CODE_BOOK_ESC_LAV
);
535 countFuncTable
[maxVal
](values
,width
,bitCount
);
543 count difference between actual and zeroed lines
545 INT
FDKaacEnc_countValues(SHORT
*RESTRICT values
, INT width
, INT codeBook
)
548 INT i
,t0
,t1
,t2
,t3
,t00
,t01
;
554 case CODE_BOOK_ZERO_NO
:
558 for(i
=0; i
<width
; i
+=4) {
563 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab1_2
[t0
+1][t1
+1][t2
+1][t3
+1]);
569 for(i
=0; i
<width
; i
+=4) {
574 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab1_2
[t0
+1][t1
+1][t2
+1][t3
+1]);
580 for(i
=0; i
<width
; i
+=4) {
603 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
]);
604 bitCnt
+=codeLength
+signLength
;
609 for(i
=0; i
<width
; i
+=4) {
631 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
]);
632 bitCnt
+=codeLength
+signLength
;
637 for(i
=0; i
<width
; i
+=2) {
640 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab5_6
[t0
+4][t1
+4]);
646 for(i
=0; i
<width
; i
+=2) {
649 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab5_6
[t0
+4][t1
+4]);
655 for(i
=0; i
<width
; i
+=2){
668 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab7_8
[t0
][t1
]);
669 bitCnt
+=codeLength
+signLength
;
674 for(i
=0; i
<width
; i
+=2) {
687 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab7_8
[t0
][t1
]);
688 bitCnt
+=codeLength
+signLength
;
693 for(i
=0; i
<width
; i
+=2) {
705 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab9_10
[t0
][t1
]);
706 bitCnt
+=codeLength
+signLength
;
710 case CODE_BOOK_10_NO
:
711 for(i
=0; i
<width
; i
+=2) {
724 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab9_10
[t0
][t1
]);
725 bitCnt
+=codeLength
+signLength
;
729 case CODE_BOOK_ESC_NO
:
730 for(i
=0; i
<width
; i
+=2) {
745 codeLength
= (INT
) FDKaacEnc_huff_ltab11
[t00
][t01
];
746 bitCnt
+=codeLength
+signLength
;
779 INT
FDKaacEnc_codeValues(SHORT
*RESTRICT values
, INT width
, INT codeBook
, HANDLE_FDK_BITSTREAM hBitstream
)
782 INT i
,t0
,t1
,t2
,t3
,t00
,t01
;
783 INT codeWord
,codeLength
;
787 case CODE_BOOK_ZERO_NO
:
791 for(i
=0; i
<width
; i
+=4) {
796 codeWord
= FDKaacEnc_huff_ctab1
[t0
][t1
][t2
][t3
];
797 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab1_2
[t0
][t1
][t2
][t3
]);
798 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
803 for(i
=0; i
<width
; i
+=4) {
808 codeWord
= FDKaacEnc_huff_ctab2
[t0
][t1
][t2
][t3
];
809 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab1_2
[t0
][t1
][t2
][t3
]);
810 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
815 for(i
=0; i
<width
; i
+=4) {
855 codeWord
= FDKaacEnc_huff_ctab3
[t0
][t1
][t2
][t3
];
856 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
]);
857 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
858 FDKwriteBits(hBitstream
,sign
,signLength
);
863 for(i
=0; i
<width
; i
+=4) {
902 codeWord
= FDKaacEnc_huff_ctab4
[t0
][t1
][t2
][t3
];
903 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab3_4
[t0
][t1
][t2
][t3
]);
904 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
905 FDKwriteBits(hBitstream
,sign
,signLength
);
910 for(i
=0; i
<width
; i
+=2) {
913 codeWord
= FDKaacEnc_huff_ctab5
[t0
][t1
];
914 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab5_6
[t0
][t1
]);
915 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
920 for(i
=0; i
<width
; i
+=2) {
923 codeWord
= FDKaacEnc_huff_ctab6
[t0
][t1
];
924 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab5_6
[t0
][t1
]);
925 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
930 for(i
=0; i
<width
; i
+=2){
952 codeWord
= FDKaacEnc_huff_ctab7
[t0
][t1
];
953 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab7_8
[t0
][t1
]);
954 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
955 FDKwriteBits(hBitstream
,sign
,signLength
);
960 for(i
=0; i
<width
; i
+=2) {
982 codeWord
= FDKaacEnc_huff_ctab8
[t0
][t1
];
983 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab7_8
[t0
][t1
]);
984 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
985 FDKwriteBits(hBitstream
,sign
,signLength
);
990 for(i
=0; i
<width
; i
+=2) {
1011 codeWord
= FDKaacEnc_huff_ctab9
[t0
][t1
];
1012 codeLength
= HI_LTAB(FDKaacEnc_huff_ltab9_10
[t0
][t1
]);
1013 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
1014 FDKwriteBits(hBitstream
,sign
,signLength
);
1018 case CODE_BOOK_10_NO
:
1019 for(i
=0; i
<width
; i
+=2) {
1041 codeWord
= FDKaacEnc_huff_ctab10
[t0
][t1
];
1042 codeLength
= LO_LTAB(FDKaacEnc_huff_ltab9_10
[t0
][t1
]);
1043 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
1044 FDKwriteBits(hBitstream
,sign
,signLength
);
1048 case CODE_BOOK_ESC_NO
:
1049 for(i
=0; i
<width
; i
+=2) {
1070 t00
= fixMin(t0
,16);
1071 t01
= fixMin(t1
,16);
1073 codeWord
= FDKaacEnc_huff_ctab11
[t00
][t01
];
1074 codeLength
= (INT
) FDKaacEnc_huff_ltab11
[t00
][t01
];
1075 FDKwriteBits(hBitstream
,codeWord
,codeLength
);
1076 FDKwriteBits(hBitstream
,sign
,signLength
);
1081 while((p
>>=1) >=16){
1082 FDKwriteBits(hBitstream
,1,1);
1085 FDKwriteBits(hBitstream
,0,1);
1086 FDKwriteBits(hBitstream
,t0
-(1<<(n
+4)),n
+4);
1092 while((p
>>=1) >=16){
1093 FDKwriteBits(hBitstream
,1,1);
1096 FDKwriteBits(hBitstream
,0,1);
1097 FDKwriteBits(hBitstream
,t1
-(1<<(n
+4)),n
+4);
1108 INT
FDKaacEnc_codeScalefactorDelta(INT delta
, HANDLE_FDK_BITSTREAM hBitstream
)
1110 INT codeWord
,codeLength
;
1112 if(fixp_abs(delta
) >CODE_BOOK_SCF_LAV
)
1115 codeWord
= FDKaacEnc_huff_ctabscf
[delta
+CODE_BOOK_SCF_LAV
];
1116 codeLength
= (INT
)FDKaacEnc_huff_ltabscf
[delta
+CODE_BOOK_SCF_LAV
];
1117 FDKwriteBits(hBitstream
,codeWord
,codeLength
);