Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information. This CL was reviewed and approved in pieces in the following CLs: https://webrtc-codereview.appspot.com/24209004/ https://webrtc-codereview.appspot.com/24229004/ https://webrtc-codereview.appspot.com/24259004/ https://webrtc-codereview.appspot.com/25109004/ https://webrtc-codereview.appspot.com/26099004/ https://webrtc-codereview.appspot.com/27069004/ https://webrtc-codereview.appspot.com/27969004/ https://webrtc-codereview.appspot.com/27989004/ https://webrtc-codereview.appspot.com/29009004/ https://webrtc-codereview.appspot.com/30929004/ https://webrtc-codereview.appspot.com/30939004/ https://webrtc-codereview.appspot.com/31999004/ Committing as TBR to the original reviewers. BUG=chromium:81439 TEST=none TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom Review URL: https://webrtc-codereview.appspot.com/23129004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -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.
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user