Replace VP9 screen sharing.

- Remove referencing control from encoder wrapper. Use fixed temporal
prediction structure.
- Remove flexible mode from encoder wrapper. It only worked with
referencing control which this CL removes.
- Remove external framerate/bitrate controller. Keep codec's internal
frame dropping enabled at screen sharing.
- Use GetSvcConfig() to configure layering.

Bug: webrtc:9261
Change-Id: I355baa6aab7b98ac5028b3851d1f8ccc82a308e0
Reviewed-on: https://webrtc-review.googlesource.com/76801
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23311}
This commit is contained in:
Sergey Silkin
2018-05-17 16:46:43 +02:00
committed by Commit Bot
parent 21219a0e43
commit be71a1ee08
10 changed files with 92 additions and 757 deletions

View File

@ -24,8 +24,6 @@
namespace webrtc {
class ScreenshareLayersVP9;
class VP9EncoderImpl : public VP9Encoder {
public:
VP9EncoderImpl();
@ -51,20 +49,6 @@ class VP9EncoderImpl : public VP9Encoder {
const char* ImplementationName() const override;
struct LayerFrameRefSettings {
int8_t upd_buf = -1; // -1 - no update, 0..7 - update buffer 0..7
int8_t ref_buf1 = -1; // -1 - no reference, 0..7 - reference buffer 0..7
int8_t ref_buf2 = -1; // -1 - no reference, 0..7 - reference buffer 0..7
int8_t ref_buf3 = -1; // -1 - no reference, 0..7 - reference buffer 0..7
};
struct SuperFrameRefSettings {
LayerFrameRefSettings layer[kMaxVp9NumberOfSpatialLayers];
uint8_t start_layer = 0; // The first spatial layer to be encoded.
uint8_t stop_layer = 0; // The last spatial layer to be encoded.
bool is_keyframe = false;
};
private:
// Determine number of encoder threads to use.
int NumberOfThreads(int width, int height, int number_of_cores);
@ -80,15 +64,6 @@ class VP9EncoderImpl : public VP9Encoder {
bool ExplicitlyConfiguredSpatialLayers() const;
bool SetSvcRates(const VideoBitrateAllocation& bitrate_allocation);
// Used for flexible mode to set the flags and buffer references used
// by the encoder. Also calculates the references used by the RTP
// packetizer.
//
// Has to be called for every frame (keyframes included) to update the
// state used to calculate references.
vpx_svc_ref_frame_config GenerateRefsAndFlags(
const SuperFrameRefSettings& settings);
virtual int GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt);
// Callback function for outputting packets per spatial layer.
@ -97,6 +72,8 @@ class VP9EncoderImpl : public VP9Encoder {
void DeliverBufferedFrame(bool end_of_picture);
bool DropFrame(uint32_t rtp_timestamp);
// Determine maximum target for Intra frames
//
// Input:
@ -128,11 +105,6 @@ class VP9EncoderImpl : public VP9Encoder {
// Used for flexible mode.
bool is_flexible_mode_;
int64_t buffer_updated_at_frame_[kNumVp9Buffers];
int64_t frames_encoded_;
uint8_t num_ref_pics_[kMaxVp9NumberOfSpatialLayers];
uint8_t p_diff_[kMaxVp9NumberOfSpatialLayers][kMaxVp9RefPics];
std::unique_ptr<ScreenshareLayersVP9> spatial_layer_;
};
class VP9DecoderImpl : public VP9Decoder {