Dynamic resolution change for VP8 HW encode.

Off by default for now.

BUG=
R=glaznev@webrtc.org, stefan@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/45849004

Cr-Commit-Position: refs/heads/master@{#9045}
This commit is contained in:
jackychen
2015-04-21 15:30:11 -07:00
parent 5464a6e548
commit 61b4d518af
17 changed files with 222 additions and 94 deletions

View File

@ -77,6 +77,8 @@ class I420Encoder : public VideoEncoder {
return WEBRTC_VIDEO_CODEC_OK;
}
void OnDroppedFrame() override {}
private:
static uint8_t* InsertHeader(uint8_t* buffer, uint16_t width,
uint16_t height);

View File

@ -501,4 +501,8 @@ bool SimulcastEncoderAdapter::Initialized() const {
return !streaminfos_.empty();
}
void SimulcastEncoderAdapter::OnDroppedFrame() {
streaminfos_[0].encoder->OnDroppedFrame();
}
} // namespace webrtc

View File

@ -55,6 +55,8 @@ class SimulcastEncoderAdapter : public VP8Encoder {
const CodecSpecificInfo* codecSpecificInfo = NULL,
const RTPFragmentationHeader* fragmentation = NULL);
void OnDroppedFrame() override;
private:
struct StreamInfo {
StreamInfo()

View File

@ -1035,7 +1035,7 @@ int VP8EncoderImpl::GetEncodedPartitions(
if (encoded_images_[0]._length > 0) {
int qp;
vpx_codec_control(&encoders_[0], VP8E_GET_LAST_QUANTIZER_64, &qp);
quality_scaler_.ReportEncodedFrame(qp);
quality_scaler_.ReportNormalizedQP(qp);
} else {
quality_scaler_.ReportDroppedFrame();
}

View File

@ -27,7 +27,7 @@
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h"
#include "webrtc/modules/video_coding/utility/include/frame_dropper.h"
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
#include "webrtc/modules/video_coding/utility/include/quality_scaler.h"
#include "webrtc/video_frame.h"
namespace webrtc {
@ -56,6 +56,8 @@ class VP8EncoderImpl : public VP8Encoder {
virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate);
void OnDroppedFrame() override {}
private:
void SetupTemporalLayers(int num_streams, int num_temporal_layers,
const VideoCodec& codec);

View File

@ -41,6 +41,8 @@ class VP9EncoderImpl : public VP9Encoder {
int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate) override;
void OnDroppedFrame() override {}
private:
// Determine number of encoder threads to use.
int NumberOfThreads(int width, int height, int number_of_cores);