webrtc/modules/video_coding/codecs/vp9
Henrik Boström bd9e4a95eb Support native scaling of VideoFrameBuffers in LibvpxVp9Encoder.
This CL is part of Optimized Scaling efforts. In Chromium, the native
frame buffer is getting an optimized CropAndScale() implementation. To
support HW accelerated scaling, returning pre-scaled images and skipping
unnecessary intermediate downscales, WebRTC needs to 1) use CropAndScale
instead of libyuv::XXXXScale and 2) only map buffers it actually intends
to encode.
- To achieve this, WebRTC encoders are updated to map kNative video
  buffers so that in a follow-up CL VideoStreamEncoder can stop mapping
  intermediate buffer sizes.

In this CL LibvpxVp9Encoder is updated to map kNative buffers of pixel
formats it supports and convert ToI420() if the kNative buffer is
something else. A fake native buffer that keeps track of which
resolutions were mapped, MappableNativeBuffer, is added.

Because VP9 is currently an SVC encoder and not a simulcast encoder, it
does not need to invoke CropAndScale.

This CL also fixes MultiplexEncoderAdapter, but because it simply
forwards frames it only cares about the pixel format when
|supports_augmented_data_| is true so this is the only time we map it.
Because this encoder is not used with kNative in practise, we don't care
to make this path optimal.

Bug: webrtc:12469, chromium:1157072
Change-Id: I74edf85b18eccd0d250776bbade7a6444478efce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212580
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Cr-Commit-Position: refs/heads/master@{#33526}
2021-03-22 13:35:35 +00:00
..
include Add decoder support for VP9 profile 1 I444 2020-06-12 05:17:24 +00:00
test Support native scaling of VideoFrameBuffers in LibvpxVp9Encoder. 2021-03-22 13:35:35 +00:00
DEPS Add VP9 profile negotiation to SDP 2018-07-02 23:38:41 +00:00
libvpx_vp9_decoder.cc Delete rtc::Callback0 and friends. 2021-02-16 12:41:35 +00:00
libvpx_vp9_decoder.h Adds VideoDecoder::GetDecoderInfo() 2021-01-14 13:33:22 +00:00
libvpx_vp9_encoder.cc Support native scaling of VideoFrameBuffers in LibvpxVp9Encoder. 2021-03-22 13:35:35 +00:00
libvpx_vp9_encoder.h Support native scaling of VideoFrameBuffers in LibvpxVp9Encoder. 2021-03-22 13:35:35 +00:00
svc_config.cc Fix vp9 svc singlecast mode and enable quality scaler for vp9 2020-06-18 21:24:46 +00:00
svc_config.h Move definition of SpatialLayer to api/video_codecs/spatial_layer.h 2020-08-17 09:45:19 +00:00
svc_config_unittest.cc Allow HVGA Vp9 SVC to have 2 spatial layers and remove excessive rounding 2020-06-11 13:50:16 +00:00
svc_rate_allocator.h Move SvcRateAllocator out of codecs/vp9 and make it not vp9 specific 2020-11-05 18:35:37 +00:00
vp9.cc Splits vp9_impl into libvpx_vp9_encoder and libvpx_vp9_decoder. 2020-12-10 19:31:11 +00:00
vp9_frame_buffer_pool.cc Migrate modules/video_coding to webrtc::Mutex. 2020-07-07 11:41:21 +00:00
vp9_frame_buffer_pool.h Migrate modules/video_coding to webrtc::Mutex. 2020-07-07 11:41:21 +00:00