Changeset 931 for pjproject/trunk
- Timestamp:
- Feb 4, 2007 5:04:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r930 r931 68 68 69 69 70 /* These are settings to control the adaptivity of changes in the 71 * signal level of the ports, so that sudden change in signal level 72 * in the port does not cause misaligned signal (which causes noise). 73 */ 74 #if 1 75 # define ATTACK_A 3 76 # define ATTACK_B 2 77 # define DECAY_A 3 78 # define DECAY_B 2 79 #else 80 /* To simulate old behavior */ 81 # define ATTACK_A 0 82 # define ATTACK_B 1 83 # define DECAY_A 0 84 # define DECAY_B 1 85 #endif 86 87 88 70 89 /* 71 90 * DON'T GET CONFUSED WITH TX/RX!! … … 95 114 unsigned clock_rate; /**< Port's clock rate. */ 96 115 unsigned samples_per_frame; /**< Port's samples per frame. */ 116 117 /* Last level calculated from this port */ 118 pj_int32_t last_level; 97 119 98 120 /* Calculated signal levels: */ … … 1717 1739 } 1718 1740 1741 /* Apply simple AGC to the level, to avoid dramatic change in the 1742 * level thus causing noise because the signal now is not aligned 1743 * with the signal from the previous frame. 1744 */ 1745 if (level >= conf_port->last_level) { 1746 level = (conf_port->last_level * ATTACK_A + level * ATTACK_B) / 1747 (ATTACK_A + ATTACK_B); 1748 } else { 1749 level = (conf_port->last_level * DECAY_A + level * DECAY_B) / 1750 (DECAY_A + DECAY_B); 1751 } 1752 conf_port->last_level = level; 1753 1754 1719 1755 /* Convert level to 8bit complement ulaw */ 1720 1756 level = pjmedia_linear2ulaw(level) ^ 0xff;
Note: See TracChangeset
for help on using the changeset viewer.