AudioCodingModuleImpl::Encode: Use a Buffer instead of a stack-allocated array

The Buffer is saved between calls, so after the initial allocation
it'll already be allocated and of the right size. The stack-allocated
array had the advantage of requiring no heap allocation at all, but
for most popular encoders it ended up allocating about 15 kB too much,
and now that we allow user-defined encoders there was also the
(remote) possibility that the buffer would actually be too small.

R=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1303413003 .

Cr-Commit-Position: refs/heads/master@{#9789}
4 files changed