Before this change the allocated buffer and encoder complexity was set based on the highest resolution configured regardless if that spatial layer was active or not. This should reduce memory pressure and improve visual quality when only a low resolution is requested. In test, increasing the encoder complexity has paradoxically also resulted in increased decoder speed. Bug: webrtc:11551 Change-Id: I3ae47a5856de82ff7d40fddfcb160935b12b1d2b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186301 Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32280}