Tweaks to the new transient detector

Instead of using the average energy over the frame, we use a half-way
point between the average energy and the max energy.
Update Ogg draft to make it a WG item.

For complete details on what was changed, see
 <http://www.ietf.org/mail-archive/web/codec/current/msg02941.html>
Add support for RFC5576 source-level attributes.

This allows the sender parameters sprop-maxcapturerate and
 sprop-stereo to be specified on a per-SSRC basis, instead of just
 per m-line.
Reword 239e9a33 for better clarity.

Thanks to Randell Jesup for the feedback.
Misc updates to the RTP draft

Made RFC6716 a normative reference, removed non-sensical constraints,
updated contact info, ...
More minor updates to RTP draft
Guard _BitScanReverse on MSVC so that MSVC 6 doesn't break.

This also adds some extra casts to shut up compiler warnings
 reported on MSVC 6 where there is implicit truncation for the
 arguments of bitexact_cos().
Lacking access to CLZ/BSR will make the code a fair bit slower but
 that is better than failing to compile.
Remove obsolete #ifdef OPUS_BUILD.

We always define OPUS_BUILD, so this code has no effect.
Likewise there is no reason for it to be conditional.
According to Jean-Marc it's left over from when we had
an alternate CELT_BUILD define.
Allow the build files to override OPUS_EXPORT.

OPUS_EXPORT was conditionalized on OPUS_BUILD, so that symbols
are export based on public header declarations when building
opus as a library, but not when those headers are included in
other programmes. This doesn't address the case when the opus
source and its caller are both included in the same monolithic
build.

In that case we want to define OPUS_BUILD, to indicate that we
are compiling the codec source, but not export the symbols. To
support this, only define OPUS_EXPORT if it is not already defined.
This allows build scripts to -DOPUS_EXPORT and override the
platform-specific attribute decortation in opus_defines.h.

Based on a patch by Sergey Ulanov.
http://git.chromium.org/gitweb/?p=chromium/deps/opus.git;a=commitdiff;h=6304b9628cb7244e3cc78f740aeb6659562f1857
Improve the !OPUS_BUILD #error.

The README doesn't say anything about this particular define.
Refer people to config.h and the other build files for examples.
Addressing some of Tina's comments on the RTP draft
Fixes many many issues in the CELT PLC

Previous code was so broken that it's`not worth listing the changes.
Aside from quality, one obvious improvement is a 3.75k reduction in stack size
Fixes an overflow in the fixed-point celt_sqrt() for large values.

Was causing problems with the PLC
Remove obsolete check for endianness.

We don't ever use the WORDS_BIGENDIAN cpp symbol in our code.
Better comments in the PLC
RTP draft updates addressing the rest of Tina's comments
bump rtp draft version
Fixes an out-of-bounds read issue with the padding handling code

This was reported by Juri Aedla and is limited to reading memory up
to about 60 kB beyond the compressed buffer. This can only be triggered
by a compressed packet more than about 16 MB long, so it's not a problem
for RTP. In theory, it *could* crash an Ogg decoder if the memory just after
the incoming packet is out-of-range.
Add a regression test for the padding issue.

This is a heavily modified version of the demonstration program
Jüri Aedla posted to the mailing list. Verified to pass with
the current commit, but fail with the tree from two commits ago.

http://lists.xiph.org/pipermail/opus/2012-November/001834.html
Window both sides of overlap when adding them.

Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>