Hardware VP8 encoding: Use QP as metric for resize.

Add vp8 frame header parser to get QP from vp8 bitstream.

BUG= 4273
R=glaznev@webrtc.org, marpan@google.com, pbos@webrtc.org
TBR=stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9256}
This commit is contained in:
jackychen
2015-05-21 11:12:02 -07:00
parent 5fdcdf66d0
commit 98d8cf58ee
9 changed files with 305 additions and 66 deletions

View File

@ -15,6 +15,7 @@
#include "webrtc/modules/video_coding/utility/include/moving_average.h"
namespace webrtc {
const int kDefaultLowQpDenominator = 3;
class QualityScaler {
public:
struct Resolution {
@ -23,15 +24,10 @@ class QualityScaler {
};
QualityScaler();
void Init(int max_qp);
void Init(int low_qp_threshold);
void SetMinResolution(int min_width, int min_height);
void ReportFramerate(int framerate);
// Report QP for SW encoder, report framesize fluctuation for HW encoder,
// only one of these two functions should be called, framesize fluctuation
// is to be used only if qp isn't available.
void ReportNormalizedQP(int qp);
void ReportNormalizedFrameSizeFluctuation(double framesize_deviation);
void ReportQP(int qp);
void ReportDroppedFrame();
void Reset(int framerate, int bitrate, int width, int height);
Resolution GetScaledResolution(const I420VideoFrame& frame);
@ -45,10 +41,9 @@ class QualityScaler {
I420VideoFrame scaled_frame_;
size_t num_samples_;
int target_framesize_;
int low_qp_threshold_;
MovingAverage<int> framedrop_percent_;
MovingAverage<double> frame_quality_;
MovingAverage<int> average_qp_;
int downscale_shift_;
int min_width_;