- Timestamp:
- Jun 1, 2009 4:43:45 PM (15 years ago)
- Location:
- pjproject/trunk/third_party
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/build/g7221/libg7221codec.vcproj
r2678 r2731 3217 3217 </File> 3218 3218 <File 3219 RelativePath="..\..\g7221\common\config.h" 3220 > 3221 </File> 3222 <File 3219 3223 RelativePath="..\..\g7221\common\count.h" 3220 3224 > -
pjproject/trunk/third_party/g7221/common/basic_op.c
r2660 r2731 1 #include "config.h" 2 3 #if !PJMEDIA_LIBG7221_FUNCS_INLINED || \ 4 (PJMEDIA_LIBG7221_FUNCS_INLINED && defined(__BASIC_OP_H__)) 5 1 6 /*___________________________________________________________________________ 2 7 | | … … 73 78 |___________________________________________________________________________| 74 79 */ 75 Word16shr (Word16 var1, Word16 var2)80 LIBG7221_DEF(Word16) shr (Word16 var1, Word16 var2) 76 81 { 77 82 if (var2 < 0) … … 123 128 |___________________________________________________________________________| 124 129 */ 125 Word16shl (Word16 var1, Word16 var2)130 LIBG7221_DEF(Word16) shl (Word16 var1, Word16 var2) 126 131 { 127 132 if (var2 < 0) … … 172 177 |___________________________________________________________________________| 173 178 */ 174 Word16mult (Word16 var1, Word16 var2)179 LIBG7221_DEF(Word16) mult (Word16 var1, Word16 var2) 175 180 { 176 181 Word16 var_out; … … 229 234 |___________________________________________________________________________| 230 235 */ 231 Word32L_msu (Word32 L_var3, Word16 var1, Word16 var2)236 LIBG7221_DEF(Word32) L_msu (Word32 L_var3, Word16 var1, Word16 var2) 232 237 { 233 238 Word32 L_var_out; … … 290 295 |___________________________________________________________________________| 291 296 */ 292 Word32L_macNs (Word32 L_var3, Word16 var1, Word16 var2)297 LIBG7221_DEF(Word32) L_macNs (Word32 L_var3, Word16 var1, Word16 var2) 293 298 { 294 299 Word32 L_var_out; … … 351 356 |___________________________________________________________________________| 352 357 */ 353 Word32L_msuNs (Word32 L_var3, Word16 var1, Word16 var2)358 LIBG7221_DEF(Word32) L_msuNs (Word32 L_var3, Word16 var1, Word16 var2) 354 359 { 355 360 Word32 L_var_out; … … 409 414 |___________________________________________________________________________| 410 415 */ 411 Word32L_add_c (Word32 L_var1, Word32 L_var2)416 LIBG7221_DEF(Word32) L_add_c (Word32 L_var1, Word32 L_var2) 412 417 { 413 418 Word32 L_var_out; … … 525 530 |___________________________________________________________________________| 526 531 */ 527 Word32L_sub_c (Word32 L_var1, Word32 L_var2)532 LIBG7221_DEF(Word32) L_sub_c (Word32 L_var1, Word32 L_var2) 528 533 { 529 534 Word32 L_var_out; … … 618 623 |___________________________________________________________________________| 619 624 */ 620 Word32L_negate (Word32 L_var1)625 LIBG7221_DEF(Word32) L_negate (Word32 L_var1) 621 626 { 622 627 Word32 L_var_out; … … 664 669 |___________________________________________________________________________| 665 670 */ 666 Word16mult_r (Word16 var1, Word16 var2)671 LIBG7221_DEF(Word16) mult_r (Word16 var1, Word16 var2) 667 672 { 668 673 Word16 var_out; … … 729 734 |___________________________________________________________________________| 730 735 */ 731 Word16shr_r (Word16 var1, Word16 var2)736 LIBG7221_DEF(Word16) shr_r (Word16 var1, Word16 var2) 732 737 { 733 738 Word16 var_out; … … 798 803 |___________________________________________________________________________| 799 804 */ 800 Word16mac_r (Word32 L_var3, Word16 var1, Word16 var2)805 LIBG7221_DEF(Word16) mac_r (Word32 L_var3, Word16 var1, Word16 var2) 801 806 { 802 807 Word16 var_out; … … 858 863 |___________________________________________________________________________| 859 864 */ 860 Word16msu_r (Word32 L_var3, Word16 var1, Word16 var2)865 LIBG7221_DEF(Word16) msu_r (Word32 L_var3, Word16 var1, Word16 var2) 861 866 { 862 867 Word16 var_out; … … 908 913 |___________________________________________________________________________| 909 914 */ 910 Word32L_deposit_h (Word16 var1)915 LIBG7221_DEF(Word32) L_deposit_h (Word16 var1) 911 916 { 912 917 Word32 L_var_out; … … 949 954 |___________________________________________________________________________| 950 955 */ 951 Word32L_deposit_l (Word16 var1)956 LIBG7221_DEF(Word32) L_deposit_l (Word16 var1) 952 957 { 953 958 Word32 L_var_out; … … 1003 1008 |___________________________________________________________________________| 1004 1009 */ 1005 Word32L_shr_r (Word32 L_var1, Word16 var2)1010 LIBG7221_DEF(Word32) L_shr_r (Word32 L_var1, Word16 var2) 1006 1011 { 1007 1012 Word32 L_var_out; … … 1061 1066 |___________________________________________________________________________| 1062 1067 */ 1063 Word32L_abs (Word32 L_var1)1068 LIBG7221_DEF(Word32) L_abs (Word32 L_var1) 1064 1069 { 1065 1070 Word32 L_var_out; … … 1121 1126 |___________________________________________________________________________| 1122 1127 */ 1123 Word16norm_s (Word16 var1)1128 LIBG7221_DEF(Word16) norm_s (Word16 var1) 1124 1129 { 1125 1130 Word16 var_out; … … 1131 1136 else 1132 1137 { 1133 if (var1 == ( Word16)0xffff)1138 if (var1 == (UWord16)0xffff) 1134 1139 { 1135 1140 var_out = 15; … … 1192 1197 |___________________________________________________________________________| 1193 1198 */ 1194 Word16div_s (Word16 var1, Word16 var2)1199 LIBG7221_DEF(Word16) div_s (Word16 var1, Word16 var2) 1195 1200 { 1196 1201 Word16 var_out = 0; … … 1292 1297 |___________________________________________________________________________| 1293 1298 */ 1294 Word16norm_l (Word32 L_var1)1299 LIBG7221_DEF(Word16) norm_l (Word32 L_var1) 1295 1300 { 1296 1301 Word16 var_out; … … 1373 1378 |___________________________________________________________________________| 1374 1379 */ 1375 Word32L_mls (Word32 Lv, Word16 v)1380 LIBG7221_DEF(Word32) L_mls (Word32 Lv, Word16 v) 1376 1381 { 1377 1382 Word32 Temp ; … … 1432 1437 |___________________________________________________________________________| 1433 1438 */ 1434 Word16div_l (Word32 L_num, Word16 den)1439 LIBG7221_DEF(Word16) div_l (Word32 L_num, Word16 den) 1435 1440 { 1436 1441 Word16 var_out = (Word16)0; … … 1520 1525 |___________________________________________________________________________| 1521 1526 */ 1522 Word16i_mult (Word16 a, Word16 b)1527 LIBG7221_DEF(Word16) i_mult (Word16 a, Word16 b) 1523 1528 { 1524 1529 #ifdef ORIGINAL_G7231 … … 1569 1574 |___________________________________________________________________________ 1570 1575 */ 1571 Word32L_mult0 (Word16 var1,Word16 var2)1576 LIBG7221_DEF(Word32) L_mult0 (Word16 var1,Word16 var2) 1572 1577 { 1573 1578 Word32 L_var_out; … … 1613 1618 |___________________________________________________________________________ 1614 1619 */ 1615 Word32L_mac0 (Word32 L_var3, Word16 var1, Word16 var2)1620 LIBG7221_DEF(Word32) L_mac0 (Word32 L_var3, Word16 var1, Word16 var2) 1616 1621 { 1617 1622 Word32 L_var_out; … … 1661 1666 |___________________________________________________________________________ 1662 1667 */ 1663 Word32L_msu0 (Word32 L_var3, Word16 var1, Word16 var2)1668 LIBG7221_DEF(Word32) L_msu0 (Word32 L_var3, Word16 var1, Word16 var2) 1664 1669 { 1665 1670 Word32 L_var_out; … … 1712 1717 |___________________________________________________________________________| 1713 1718 */ 1714 UWord32LU_shl (UWord32 L_var1, Word16 var2)1719 LIBG7221_DEF(UWord32) LU_shl (UWord32 L_var1, Word16 var2) 1715 1720 { 1716 1721 Word16 neg_var2; … … 1743 1748 { 1744 1749 SET_OVERFLOW(1); 1745 L_var_out = MIN_32;1750 L_var_out = (UWord32)MIN_32; 1746 1751 break; 1747 1752 } … … 1792 1797 |___________________________________________________________________________| 1793 1798 */ 1794 UWord32LU_shr (UWord32 L_var1, Word16 var2)1799 LIBG7221_DEF(UWord32) LU_shr (UWord32 L_var1, Word16 var2) 1795 1800 { 1796 1801 Word16 neg_var2; … … 1826 1831 /* ------------------------- End of LU_shr() ------------------------- */ 1827 1832 1833 #endif /* PJMEDIA_LIBG7221_FUNCS_INLINED */ 1828 1834 1829 1835 /* ************************** END OF BASOP32.C ************************** */ -
pjproject/trunk/third_party/g7221/common/basic_op.h
r2660 r2731 1 1 #ifndef __BASIC_OP_H__ 2 2 #define __BASIC_OP_H__ 3 4 #include "config.h" 3 5 4 6 /*___________________________________________________________________________ 5 7 | | 6 8 | Constants and Globals | 7 | |8 | $Id $9 9 |___________________________________________________________________________| 10 10 */ … … 28 28 PJ_INLINE(Word16) sub (Word16 var1, Word16 var2); /* Short sub, 1 */ 29 29 PJ_INLINE(Word16) abs_s (Word16 var1); /* Short abs, 1 */ 30 Word16shl (Word16 var1, Word16 var2); /* Short shift left, 1 */30 LIBG7221_DECL(Word16) shl (Word16 var1, Word16 var2); /* Short shift left, 1 */ 31 31 PJ_INLINE(Word16) shl_nocheck(Word16 var1, Word16 var2); 32 Word16shr (Word16 var1, Word16 var2); /* Short shift right, 1 */32 LIBG7221_DECL(Word16) shr (Word16 var1, Word16 var2); /* Short shift right, 1 */ 33 33 PJ_INLINE(Word16) shr_nocheck(Word16 var1, Word16 var2); 34 Word16mult (Word16 var1, Word16 var2); /* Short mult, 1 */34 LIBG7221_DECL(Word16) mult (Word16 var1, Word16 var2); /* Short mult, 1 */ 35 35 PJ_INLINE(Word32) L_mult (Word16 var1, Word16 var2); /* Long mult, 1 */ 36 36 PJ_INLINE(Word16) negate (Word16 var1); /* Short negate, 1 */ … … 39 39 PJ_INLINE(Word16) itu_round (Word32 L_var1); /* Round, 1 */ 40 40 PJ_INLINE(Word32) L_mac (Word32 L_var3, Word16 var1, Word16 var2); /* Mac, 1 */ 41 Word32L_msu (Word32 L_var3, Word16 var1, Word16 var2); /* Msu, 1 */42 Word32L_macNs (Word32 L_var3, Word16 var1, Word16 var2); /* Mac without43 44 Word32L_msuNs (Word32 L_var3, Word16 var1, Word16 var2); /* Msu without45 41 LIBG7221_DECL(Word32) L_msu (Word32 L_var3, Word16 var1, Word16 var2); /* Msu, 1 */ 42 LIBG7221_DECL(Word32) L_macNs (Word32 L_var3, Word16 var1, Word16 var2); /* Mac without 43 sat, 1 */ 44 LIBG7221_DECL(Word32) L_msuNs (Word32 L_var3, Word16 var1, Word16 var2); /* Msu without 45 sat, 1 */ 46 46 //PJ_INLINE(Word32) L_add (Word32 L_var1, Word32 L_var2); /* Long add, 2 */ 47 47 PJ_INLINE(Word32) L_sub (Word32 L_var1, Word32 L_var2); /* Long sub, 2 */ 48 Word32L_add_c (Word32 L_var1, Word32 L_var2); /* Long add with c, 2 */49 Word32L_sub_c (Word32 L_var1, Word32 L_var2); /* Long sub with c, 2 */50 Word32L_negate (Word32 L_var1); /* Long negate, 2 */51 Word16mult_r (Word16 var1, Word16 var2); /* Mult with round, 2 */48 LIBG7221_DECL(Word32) L_add_c (Word32 L_var1, Word32 L_var2); /* Long add with c, 2 */ 49 LIBG7221_DECL(Word32) L_sub_c (Word32 L_var1, Word32 L_var2); /* Long sub with c, 2 */ 50 LIBG7221_DECL(Word32) L_negate (Word32 L_var1); /* Long negate, 2 */ 51 LIBG7221_DECL(Word16) mult_r (Word16 var1, Word16 var2); /* Mult with round, 2 */ 52 52 PJ_INLINE(Word32) L_shl (Word32 L_var1, Word16 var2); /* Long shift left, 2 */ 53 53 PJ_INLINE(Word32) L_shr (Word32 L_var1, Word16 var2); /* Long shift right, 2*/ 54 Word16shr_r (Word16 var1, Word16 var2); /* Shift right with55 56 Word16mac_r (Word32 L_var3, Word16 var1, Word16 var2); /* Mac with54 LIBG7221_DECL(Word16) shr_r (Word16 var1, Word16 var2); /* Shift right with 55 round, 2 */ 56 LIBG7221_DECL(Word16) mac_r (Word32 L_var3, Word16 var1, Word16 var2); /* Mac with 57 57 rounding,2 */ 58 Word16msu_r (Word32 L_var3, Word16 var1, Word16 var2); /* Msu with58 LIBG7221_DECL(Word16) msu_r (Word32 L_var3, Word16 var1, Word16 var2); /* Msu with 59 59 rounding,2 */ 60 Word32L_deposit_h (Word16 var1); /* 16 bit var1 -> MSB, 2 */61 Word32L_deposit_l (Word16 var1); /* 16 bit var1 -> LSB, 2 */60 LIBG7221_DECL(Word32) L_deposit_h (Word16 var1); /* 16 bit var1 -> MSB, 2 */ 61 LIBG7221_DECL(Word32) L_deposit_l (Word16 var1); /* 16 bit var1 -> LSB, 2 */ 62 62 63 Word32L_shr_r (Word32 L_var1, Word16 var2); /* Long shift right with64 65 Word32L_abs (Word32 L_var1); /* Long abs, 3 */66 Word32L_sat (Word32 L_var1); /* Long saturation, 4 */67 Word16norm_s (Word16 var1); /* Short norm, 15 */68 Word16div_s (Word16 var1, Word16 var2); /* Short division, 18 */69 Word16norm_l (Word32 L_var1); /* Long norm, 30 */63 LIBG7221_DECL(Word32) L_shr_r (Word32 L_var1, Word16 var2); /* Long shift right with 64 round, 3 */ 65 LIBG7221_DECL(Word32) L_abs (Word32 L_var1); /* Long abs, 3 */ 66 LIBG7221_DECL(Word32) L_sat (Word32 L_var1); /* Long saturation, 4 */ 67 LIBG7221_DECL(Word16) norm_s (Word16 var1); /* Short norm, 15 */ 68 LIBG7221_DECL(Word16) div_s (Word16 var1, Word16 var2); /* Short division, 18 */ 69 LIBG7221_DECL(Word16) norm_l (Word32 L_var1); /* Long norm, 30 */ 70 70 71 71 /* 72 72 Additional G.723.1 operators 73 73 */ 74 Word32L_mls( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */75 Word16div_l( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */76 Word16i_mult(Word16 a, Word16 b); /* Weight FFS; currently assigned 1 */74 LIBG7221_DECL(Word32) L_mls( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */ 75 LIBG7221_DECL(Word16) div_l( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */ 76 LIBG7221_DECL(Word16) i_mult(Word16 a, Word16 b); /* Weight FFS; currently assigned 1 */ 77 77 78 78 /* 79 79 New shiftless operators, not used in G.729/G.723.1 80 80 */ 81 Word32L_mult0(Word16 v1, Word16 v2); /* 32-bit Multiply w/o shift 1 */82 Word32L_mac0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Mac w/o shift 1 */83 Word32L_msu0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Msu w/o shift 1 */81 LIBG7221_DECL(Word32) L_mult0(Word16 v1, Word16 v2); /* 32-bit Multiply w/o shift 1 */ 82 LIBG7221_DECL(Word32) L_mac0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Mac w/o shift 1 */ 83 LIBG7221_DECL(Word32) L_msu0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Msu w/o shift 1 */ 84 84 85 85 /* 86 86 Additional G.722.1 operators 87 87 */ 88 UWord32LU_shl (UWord32 L_var1, Word16 var2);89 UWord32LU_shr (UWord32 L_var1, Word16 var2);88 LIBG7221_DECL(UWord32) LU_shl (UWord32 L_var1, Word16 var2); 89 LIBG7221_DECL(UWord32) LU_shr (UWord32 L_var1, Word16 var2); 90 90 91 91 #define INCLUDE_UNSAFE 0 … … 109 109 #include "basic_op_i.h" 110 110 111 111 #if PJMEDIA_LIBG7221_FUNCS_INLINED 112 # include "basic_op.c" 113 #endif 112 114 113 115 #endif /* __BASIC_OP_H__ */
Note: See TracChangeset
for help on using the changeset viewer.