pkasting@chromium.org
2014-11-20 22:28:14 +00:00
parent edc6e57a92
commit 4591fbd09f
341 changed files with 2610 additions and 2613 deletions

View File

@ -148,7 +148,7 @@ class TestVp8Impl : public ::testing::Test {
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1));
}
int WaitForEncodedFrame() const {
size_t WaitForEncodedFrame() const {
int64_t startTime = TickTime::MillisecondTimestamp();
while (TickTime::MillisecondTimestamp() - startTime < kMaxWaitEncTimeMs) {
if (encode_complete_callback_->EncodeComplete()) {
@ -158,7 +158,7 @@ class TestVp8Impl : public ::testing::Test {
return 0;
}
int WaitForDecodedFrame() const {
size_t WaitForDecodedFrame() const {
int64_t startTime = TickTime::MillisecondTimestamp();
while (TickTime::MillisecondTimestamp() - startTime < kMaxWaitDecTimeMs) {
if (decode_complete_callback_->DecodeComplete()) {
@ -188,7 +188,7 @@ class TestVp8Impl : public ::testing::Test {
scoped_ptr<VideoDecoder> decoder_;
VideoFrame encoded_video_frame_;
I420VideoFrame decoded_video_frame_;
unsigned int length_source_frame_;
size_t length_source_frame_;
VideoCodec codec_inst_;
};
@ -239,14 +239,14 @@ TEST_F(TestVp8Impl, EncoderParameterTest) {
TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(AlignedStrideEncodeDecode)) {
SetUpEncodeDecode();
encoder_->Encode(input_frame_, NULL, NULL);
EXPECT_GT(WaitForEncodedFrame(), 0);
EXPECT_GT(WaitForEncodedFrame(), 0u);
EncodedImage encodedImage;
VideoFrameToEncodedImage(encoded_video_frame_, encodedImage);
// First frame should be a key frame.
encodedImage._frameType = kKeyFrame;
encodedImage.ntp_time_ms_ = kTestNtpTimeMs;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->Decode(encodedImage, false, NULL));
EXPECT_GT(WaitForDecodedFrame(), 0);
EXPECT_GT(WaitForDecodedFrame(), 0u);
// Compute PSNR on all planes (faster than SSIM).
EXPECT_GT(I420PSNR(&input_frame_, &decoded_video_frame_), 36);
EXPECT_EQ(kTestTimestamp, decoded_video_frame_.timestamp());
@ -256,7 +256,7 @@ TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(AlignedStrideEncodeDecode)) {
TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(DecodeWithACompleteKeyFrame)) {
SetUpEncodeDecode();
encoder_->Encode(input_frame_, NULL, NULL);
EXPECT_GT(WaitForEncodedFrame(), 0);
EXPECT_GT(WaitForEncodedFrame(), 0u);
EncodedImage encodedImage;
VideoFrameToEncodedImage(encoded_video_frame_, encodedImage);
// Setting complete to false -> should return an error.

View File

@ -116,7 +116,7 @@ int VP8EncoderImpl::SetRates(uint32_t new_bitrate_kbit,
int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
int number_of_cores,
uint32_t /*max_payload_size*/) {
size_t /*max_payload_size*/) {
if (inst == NULL) {
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
}
@ -791,7 +791,7 @@ int VP8DecoderImpl::DecodePartitions(
for (int i = 0; i < fragmentation->fragmentationVectorSize; ++i) {
const uint8_t* partition = input_image._buffer +
fragmentation->fragmentationOffset[i];
const uint32_t partition_length =
const size_t partition_length =
fragmentation->fragmentationLength[i];
if (vpx_codec_decode(decoder_,
partition,

View File

@ -39,7 +39,7 @@ class VP8EncoderImpl : public VP8Encoder {
virtual int InitEncode(const VideoCodec* codec_settings,
int number_of_cores,
uint32_t max_payload_size);
size_t max_payload_size);
virtual int Encode(const I420VideoFrame& input_image,
const CodecSpecificInfo* codec_specific_info,

View File

@ -30,11 +30,11 @@ class Vp8SequenceCoderEncodeCallback : public webrtc::EncodedImageCallback {
const webrtc::RTPFragmentationHeader*);
// Returns the encoded image.
webrtc::EncodedImage encoded_image() { return encoded_image_; }
int encoded_bytes() { return encoded_bytes_; }
size_t encoded_bytes() { return encoded_bytes_; }
private:
webrtc::EncodedImage encoded_image_;
FILE* encoded_file_;
int encoded_bytes_;
size_t encoded_bytes_;
};
Vp8SequenceCoderEncodeCallback::~Vp8SequenceCoderEncodeCallback() {
@ -141,7 +141,7 @@ int SequenceCoder(webrtc::test::CommandLineParser& parser) {
}
EXPECT_EQ(0, decoder->InitDecode(&inst, 1));
webrtc::I420VideoFrame input_frame;
unsigned int length = webrtc::CalcBufferSize(webrtc::kI420, width, height);
size_t length = webrtc::CalcBufferSize(webrtc::kI420, width, height);
webrtc::scoped_ptr<uint8_t[]> frame_buffer(new uint8_t[length]);
int half_width = (width + 1) / 2;
@ -175,9 +175,8 @@ int SequenceCoder(webrtc::test::CommandLineParser& parser) {
int64_t totalExecutionTime = endtime - starttime;
printf("Total execution time: %.2lf ms\n",
static_cast<double>(totalExecutionTime));
int sum_enc_bytes = encoder_callback.encoded_bytes();
double actual_bit_rate = 8.0 * sum_enc_bytes /
(frame_cnt / inst.maxFramerate);
double actual_bit_rate =
8.0 * encoder_callback.encoded_bytes() / (frame_cnt / inst.maxFramerate);
printf("Actual bitrate: %f kbps\n", actual_bit_rate / 1000);
webrtc::test::QualityMetricsResult psnr_result, ssim_result;
EXPECT_EQ(0, webrtc::test::I420MetricsFromFiles(