Changed VP8 to follow the style guide a little bit more.
Review URL: https://webrtc-codereview.appspot.com/379003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1593 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
9b3474aff8
commit
4ea57e5e26
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -51,8 +51,8 @@ class VideoProcessorIntegrationTest: public testing::Test {
|
||||
virtual ~VideoProcessorIntegrationTest() {}
|
||||
|
||||
void SetUp() {
|
||||
encoder_ = new VP8Encoder();
|
||||
decoder_ = new VP8Decoder();
|
||||
encoder_ = VP8Encoder::Create();
|
||||
decoder_ = VP8Decoder::Create();
|
||||
|
||||
// Setup the TestConfig struct for processing of a clip in CIF resolution.
|
||||
config_.input_filename =
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -462,8 +462,8 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
PrintConfigurationSummary(config);
|
||||
|
||||
webrtc::VP8Encoder encoder;
|
||||
webrtc::VP8Decoder decoder;
|
||||
webrtc::VP8Encoder* encoder = webrtc::VP8Encoder::Create();
|
||||
webrtc::VP8Decoder* decoder = webrtc::VP8Decoder::Create();
|
||||
webrtc::test::Stats stats;
|
||||
webrtc::test::FrameReaderImpl frame_reader(config.input_filename,
|
||||
config.frame_length_in_bytes);
|
||||
@ -475,7 +475,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
webrtc::test::PacketManipulatorImpl packet_manipulator(
|
||||
&packet_reader, config.networking_config, config.verbose);
|
||||
webrtc::test::VideoProcessorImpl processor(&encoder, &decoder,
|
||||
webrtc::test::VideoProcessorImpl processor(encoder, decoder,
|
||||
&frame_reader,
|
||||
&frame_writer,
|
||||
&packet_manipulator,
|
||||
@ -494,8 +494,8 @@ int main(int argc, char* argv[]) {
|
||||
Log("Processed %d frames\n", frame_number);
|
||||
|
||||
// Release encoder and decoder to make sure they have finished processing.
|
||||
encoder.Release();
|
||||
decoder.Release();
|
||||
encoder->Release();
|
||||
decoder->Release();
|
||||
|
||||
// Verify statistics are correct:
|
||||
assert(frame_number == static_cast<int>(stats.stats_.size()));
|
||||
@ -517,6 +517,8 @@ int main(int argc, char* argv[]) {
|
||||
if (FLAGS_python) {
|
||||
PrintPythonOutput(config, stats, ssim_result, psnr_result);
|
||||
}
|
||||
delete encoder;
|
||||
delete decoder;
|
||||
Log("Quality test finished!");
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,19 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vp8.h
|
||||
*
|
||||
* WEBRTC VP8 wrapper interface
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_H_
|
||||
|
||||
@ -32,243 +28,231 @@ namespace webrtc
|
||||
class TemporalLayers;
|
||||
class ReferencePictureSelection;
|
||||
|
||||
/******************************/
|
||||
/* VP8Encoder class */
|
||||
/******************************/
|
||||
class VP8Encoder : public VideoEncoder
|
||||
{
|
||||
public:
|
||||
VP8Encoder();
|
||||
virtual ~VP8Encoder();
|
||||
class VP8Encoder : public VideoEncoder {
|
||||
public:
|
||||
static VP8Encoder* Create();
|
||||
|
||||
// Free encoder memory.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual WebRtc_Word32 Release();
|
||||
virtual ~VP8Encoder();
|
||||
|
||||
// Reset encoder state and prepare for a new call.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual WebRtc_Word32 Reset();
|
||||
// Free encoder memory.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual int Release();
|
||||
|
||||
// Initialize the encoder with the information from the codecSettings
|
||||
//
|
||||
// Input:
|
||||
// - codecSettings : Codec settings
|
||||
// - numberOfCores : Number of cores available for the encoder
|
||||
// - maxPayloadSize : The maximum size each payload is allowed
|
||||
// to have. Usually MTU - overhead.
|
||||
//
|
||||
// Return value : Set bit rate if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_ERR_SIZE
|
||||
// WEBRTC_VIDEO_CODEC_LEVEL_EXCEEDED
|
||||
// WEBRTC_VIDEO_CODEC_MEMORY
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual WebRtc_Word32 InitEncode(const VideoCodec* codecSettings,
|
||||
WebRtc_Word32 numberOfCores,
|
||||
WebRtc_UWord32 maxPayloadSize);
|
||||
// Reset encoder state and prepare for a new call.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual int Reset();
|
||||
|
||||
// Encode an I420 image (as a part of a video stream). The encoded image
|
||||
// will be returned to the user through the encode complete callback.
|
||||
//
|
||||
// Input:
|
||||
// - inputImage : Image to be encoded
|
||||
// - frameTypes : Frame type to be generated by the encoder.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_MEMORY
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
// WEBRTC_VIDEO_CODEC_TIMEOUT
|
||||
// Initialize the encoder with the information from the codecSettings
|
||||
//
|
||||
// Input:
|
||||
// - codec_settings : Codec settings
|
||||
// - number_of_cores : Number of cores available for the encoder
|
||||
// - max_payload_size : The maximum size each payload is allowed
|
||||
// to have. Usually MTU - overhead.
|
||||
//
|
||||
// Return value : Set bit rate if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_ERR_SIZE
|
||||
// WEBRTC_VIDEO_CODEC_LEVEL_EXCEEDED
|
||||
// WEBRTC_VIDEO_CODEC_MEMORY
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual int InitEncode(const VideoCodec* codec_settings,
|
||||
int number_of_cores,
|
||||
uint32_t max_payload_size);
|
||||
|
||||
virtual WebRtc_Word32 Encode(const RawImage& inputImage,
|
||||
const CodecSpecificInfo* codecSpecificInfo,
|
||||
const VideoFrameType* frameTypes);
|
||||
// Encode an I420 image (as a part of a video stream). The encoded image
|
||||
// will be returned to the user through the encode complete callback.
|
||||
//
|
||||
// Input:
|
||||
// - input_image : Image to be encoded
|
||||
// - frame_types : Frame type to be generated by the encoder.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
// WEBRTC_VIDEO_CODEC_MEMORY
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
// WEBRTC_VIDEO_CODEC_TIMEOUT
|
||||
|
||||
// Register an encode complete callback object.
|
||||
//
|
||||
// Input:
|
||||
// - callback : Callback object which handles encoded images.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual WebRtc_Word32 RegisterEncodeCompleteCallback(EncodedImageCallback*
|
||||
callback);
|
||||
virtual int Encode(const RawImage& input_image,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
const VideoFrameType* frame_types);
|
||||
|
||||
// Inform the encoder of the new packet loss rate and the round-trip time of the
|
||||
// network.
|
||||
//
|
||||
// - packetLoss : Fraction lost
|
||||
// (loss rate in percent = 100 * packetLoss / 255)
|
||||
// - rtt : Round-trip time in milliseconds
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
//
|
||||
virtual WebRtc_Word32 SetChannelParameters(WebRtc_UWord32 packetLoss,
|
||||
int rtt);
|
||||
// Register an encode complete callback object.
|
||||
//
|
||||
// Input:
|
||||
// - callback : Callback object which handles encoded images.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback);
|
||||
|
||||
// Inform the encoder about the new target bit rate.
|
||||
//
|
||||
// - newBitRate : New target bit rate
|
||||
// - frameRate : The target frame rate
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual WebRtc_Word32 SetRates(WebRtc_UWord32 newBitRateKbit,
|
||||
WebRtc_UWord32 frameRate);
|
||||
// Inform the encoder of the new packet loss rate and the round-trip time of
|
||||
// the network.
|
||||
//
|
||||
// - packet_loss : Fraction lost
|
||||
// (loss rate in percent = 100 * packetLoss / 255)
|
||||
// - rtt : Round-trip time in milliseconds
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors: WEBRTC_VIDEO_CODEC_ERROR
|
||||
//
|
||||
virtual int SetChannelParameters(uint32_t packet_loss, int rtt);
|
||||
|
||||
// Get version number for the codec.
|
||||
//
|
||||
// Input:
|
||||
// - version : Pointer to allocated char buffer.
|
||||
// - buflen : Length of provided char buffer.
|
||||
//
|
||||
// Output:
|
||||
// - version : Version number string written to char buffer.
|
||||
//
|
||||
// Return value : >0 - Length of written string.
|
||||
// <0 - WEBRTC_VIDEO_CODEC_ERR_SIZE
|
||||
virtual WebRtc_Word32 Version(WebRtc_Word8 *version,
|
||||
WebRtc_Word32 length) const;
|
||||
static WebRtc_Word32 VersionStatic(WebRtc_Word8 *version,
|
||||
WebRtc_Word32 length);
|
||||
// Inform the encoder about the new target bit rate.
|
||||
//
|
||||
// - new_bitrate_kbit : New target bit rate
|
||||
// - frame_rate : The target frame rate
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual int SetRates(uint32_t new_bitrate_kbit, uint32_t frame_rate);
|
||||
|
||||
private:
|
||||
// Call encoder initialize function and set control settings.
|
||||
WebRtc_Word32 InitAndSetControlSettings();
|
||||
// Get version number for the codec.
|
||||
//
|
||||
// Input:
|
||||
// - version : Pointer to allocated char buffer.
|
||||
// - length : Length of provided char buffer.
|
||||
//
|
||||
// Output:
|
||||
// - version : Version number string written to char buffer.
|
||||
//
|
||||
// Return value : >0 - Length of written string.
|
||||
// <0 - WEBRTC_VIDEO_CODEC_ERR_SIZE
|
||||
virtual int Version(char *version, int length) const;
|
||||
|
||||
void PopulateCodecSpecific(CodecSpecificInfo* codec_specific,
|
||||
const vpx_codec_cx_pkt& pkt);
|
||||
static int VersionStatic(char *version, int length);
|
||||
|
||||
WebRtc_Word32 GetEncodedFrame(const RawImage& input_image);
|
||||
private:
|
||||
VP8Encoder();
|
||||
|
||||
WebRtc_Word32 GetEncodedPartitions(const RawImage& input_image);
|
||||
// Call encoder initialize function and set control settings.
|
||||
int InitAndSetControlSettings();
|
||||
|
||||
// Determine maximum target for Intra frames
|
||||
//
|
||||
// Input:
|
||||
// - optimalBuffersize : Optimal buffer size
|
||||
// Return Value : Max target size for Intra frames represented as
|
||||
// percentage of the per frame bandwidth
|
||||
WebRtc_UWord32 MaxIntraTarget(WebRtc_UWord32 optimalBuffersize);
|
||||
void PopulateCodecSpecific(CodecSpecificInfo* codec_specific,
|
||||
const vpx_codec_cx_pkt& pkt);
|
||||
|
||||
EncodedImage _encodedImage;
|
||||
EncodedImageCallback* _encodedCompleteCallback;
|
||||
WebRtc_Word32 _width;
|
||||
WebRtc_Word32 _height;
|
||||
WebRtc_Word32 _maxBitRateKbit;
|
||||
WebRtc_UWord32 _maxFrameRate;
|
||||
bool _inited;
|
||||
WebRtc_UWord32 _timeStamp;
|
||||
WebRtc_UWord16 _pictureID;
|
||||
WebRtc_UWord8 _simulcastIdx;
|
||||
bool _feedbackModeOn;
|
||||
int _cpuSpeed;
|
||||
WebRtc_UWord32 _rcMaxIntraTarget;
|
||||
int _tokenPartitions;
|
||||
ReferencePictureSelection* _rps;
|
||||
TemporalLayers* _temporalLayers;
|
||||
vpx_codec_ctx_t* _encoder;
|
||||
vpx_codec_enc_cfg_t* _cfg;
|
||||
vpx_image_t* _raw;
|
||||
};// end of VP8Encoder class
|
||||
int GetEncodedFrame(const RawImage& input_image);
|
||||
|
||||
/******************************/
|
||||
/* VP8Decoder class */
|
||||
/******************************/
|
||||
class VP8Decoder : public VideoDecoder
|
||||
{
|
||||
public:
|
||||
VP8Decoder();
|
||||
virtual ~VP8Decoder();
|
||||
int GetEncodedPartitions(const RawImage& input_image);
|
||||
|
||||
// Initialize the decoder.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual WebRtc_Word32 InitDecode(const VideoCodec* inst,
|
||||
WebRtc_Word32 numberOfCores);
|
||||
// Determine maximum target for Intra frames
|
||||
//
|
||||
// Input:
|
||||
// - optimal_buffer_size : Optimal buffer size
|
||||
// Return Value : Max target size for Intra frames represented as
|
||||
// percentage of the per frame bandwidth
|
||||
uint32_t MaxIntraTarget(uint32_t optimal_buffer_size);
|
||||
|
||||
// Decode encoded image (as a part of a video stream). The decoded image
|
||||
// will be returned to the user through the decode complete callback.
|
||||
//
|
||||
// Input:
|
||||
// - inputImage : Encoded image to be decoded
|
||||
// - missingFrames : True if one or more frames have been lost
|
||||
// since the previous decode call.
|
||||
// - fragmentation : Specifies the start and length of each VP8
|
||||
// partition.
|
||||
// - codecSpecificInfo : pointer to specific codec data
|
||||
// - renderTimeMs : Render time in Ms
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
virtual WebRtc_Word32 Decode(const EncodedImage& inputImage,
|
||||
bool missingFrames,
|
||||
const RTPFragmentationHeader* fragmentation,
|
||||
const CodecSpecificInfo* codecSpecificInfo,
|
||||
WebRtc_Word64 /*renderTimeMs*/);
|
||||
EncodedImage encoded_image_;
|
||||
EncodedImageCallback* encoded_complete_callback_;
|
||||
VideoCodec codec_;
|
||||
bool inited_;
|
||||
uint32_t timestamp_;
|
||||
uint16_t picture_id_;
|
||||
bool feedback_mode_;
|
||||
int cpu_speed_;
|
||||
uint32_t rc_max_intra_target_;
|
||||
int token_partitions_;
|
||||
ReferencePictureSelection* rps_;
|
||||
TemporalLayers* temporal_layers_;
|
||||
vpx_codec_ctx_t* encoder_;
|
||||
vpx_codec_enc_cfg_t* config_;
|
||||
vpx_image_t* raw_;
|
||||
}; // end of VP8Encoder class
|
||||
|
||||
// Register a decode complete callback object.
|
||||
//
|
||||
// Input:
|
||||
// - callback : Callback object which handles decoded images.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual WebRtc_Word32 RegisterDecodeCompleteCallback(DecodedImageCallback*
|
||||
callback);
|
||||
|
||||
// Free decoder memory.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual WebRtc_Word32 Release();
|
||||
class VP8Decoder : public VideoDecoder {
|
||||
public:
|
||||
static VP8Decoder* Create();
|
||||
|
||||
// Reset decoder state and prepare for a new call.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_UNINITIALIZED
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual WebRtc_Word32 Reset();
|
||||
virtual ~VP8Decoder();
|
||||
|
||||
// Create a copy of the codec and its internal state.
|
||||
//
|
||||
// Return value : A copy of the instance if OK, NULL otherwise.
|
||||
virtual VideoDecoder* Copy();
|
||||
// Initialize the decoder.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual int InitDecode(const VideoCodec* inst, int number_of_cores);
|
||||
|
||||
private:
|
||||
// Copy reference image from this _decoder to the _decoder in copyTo. Set which
|
||||
// frame type to copy in _refFrame->frame_type before the call to this function.
|
||||
int CopyReference(VP8Decoder* copyTo);
|
||||
// Decode encoded image (as a part of a video stream). The decoded image
|
||||
// will be returned to the user through the decode complete callback.
|
||||
//
|
||||
// Input:
|
||||
// - input_image : Encoded image to be decoded
|
||||
// - missing_frames : True if one or more frames have been lost
|
||||
// since the previous decode call.
|
||||
// - fragmentation : Specifies the start and length of each VP8
|
||||
// partition.
|
||||
// - codec_specific_info : pointer to specific codec data
|
||||
// - render_time_ms : Render time in Ms
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
// WEBRTC_VIDEO_CODEC_ERR_PARAMETER
|
||||
virtual int Decode(const EncodedImage& input_image,
|
||||
bool missing_frames,
|
||||
const RTPFragmentationHeader* fragmentation,
|
||||
const CodecSpecificInfo* codec_specific_info,
|
||||
int64_t /*render_time_ms*/);
|
||||
|
||||
WebRtc_Word32 DecodePartitions(const EncodedImage& input_image,
|
||||
const RTPFragmentationHeader* fragmentation);
|
||||
// Register a decode complete callback object.
|
||||
//
|
||||
// Input:
|
||||
// - callback : Callback object which handles decoded images.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||
virtual int RegisterDecodeCompleteCallback(DecodedImageCallback* callback);
|
||||
|
||||
WebRtc_Word32 ReturnFrame(const vpx_image_t* img, WebRtc_UWord32 timeStamp);
|
||||
// Free decoder memory.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual int Release();
|
||||
|
||||
RawImage _decodedImage;
|
||||
DecodedImageCallback* _decodeCompleteCallback;
|
||||
bool _inited;
|
||||
bool _feedbackModeOn;
|
||||
vpx_dec_ctx_t* _decoder;
|
||||
VideoCodec* _inst;
|
||||
WebRtc_Word32 _numCores;
|
||||
EncodedImage _lastKeyFrame;
|
||||
int _imageFormat;
|
||||
vpx_ref_frame_t* _refFrame;
|
||||
int _propagationCnt;
|
||||
bool _latestKeyFrameComplete;
|
||||
};// end of VP8Decoder class
|
||||
} // namespace webrtc
|
||||
// Reset decoder state and prepare for a new call.
|
||||
//
|
||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||
// <0 - Errors:
|
||||
// WEBRTC_VIDEO_CODEC_UNINITIALIZED
|
||||
// WEBRTC_VIDEO_CODEC_ERROR
|
||||
virtual int Reset();
|
||||
|
||||
// Create a copy of the codec and its internal state.
|
||||
//
|
||||
// Return value : A copy of the instance if OK, NULL otherwise.
|
||||
virtual VideoDecoder* Copy();
|
||||
|
||||
private:
|
||||
VP8Decoder();
|
||||
|
||||
// Copy reference image from this _decoder to the _decoder in copyTo. Set
|
||||
// which frame type to copy in _refFrame->frame_type before the call to
|
||||
// this function.
|
||||
int CopyReference(VP8Decoder* copy);
|
||||
|
||||
int DecodePartitions(const EncodedImage& input_image,
|
||||
const RTPFragmentationHeader* fragmentation);
|
||||
|
||||
int ReturnFrame(const vpx_image_t* img, uint32_t timeStamp);
|
||||
|
||||
RawImage decoded_image_;
|
||||
DecodedImageCallback* decode_complete_callback_;
|
||||
bool inited_;
|
||||
bool feedback_mode_;
|
||||
vpx_dec_ctx_t* decoder_;
|
||||
VideoCodec codec_;
|
||||
EncodedImage last_keyframe_;
|
||||
int image_format_;
|
||||
vpx_ref_frame_t* ref_frame_;
|
||||
int propagation_cnt_;
|
||||
bool latest_keyframe_complete_;
|
||||
}; // end of VP8Decoder class
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_VP8_H_
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -15,34 +15,25 @@
|
||||
using namespace webrtc;
|
||||
|
||||
VP8Benchmark::VP8Benchmark()
|
||||
:
|
||||
Benchmark("VP8Benchmark", "VP8 benchmark over a range of test cases",
|
||||
webrtc::test::OutputPath() + "VP8Benchmark.txt", "VP8")
|
||||
{
|
||||
: Benchmark("VP8Benchmark", "VP8 benchmark over a range of test cases",
|
||||
webrtc::test::OutputPath() + "VP8Benchmark.txt", "VP8") {
|
||||
}
|
||||
|
||||
VP8Benchmark::VP8Benchmark(std::string name, std::string description)
|
||||
:
|
||||
Benchmark(name, description, webrtc::test::OutputPath() + "VP8Benchmark.txt",
|
||||
"VP8")
|
||||
{
|
||||
: Benchmark(name, description,
|
||||
webrtc::test::OutputPath() + "VP8Benchmark.txt",
|
||||
"VP8") {
|
||||
}
|
||||
|
||||
VP8Benchmark::VP8Benchmark(std::string name, std::string description,
|
||||
std::string resultsFileName)
|
||||
:
|
||||
Benchmark(name, description, resultsFileName, "VP8")
|
||||
{
|
||||
: Benchmark(name, description, resultsFileName, "VP8") {
|
||||
}
|
||||
|
||||
VideoEncoder*
|
||||
VP8Benchmark::GetNewEncoder()
|
||||
{
|
||||
return new VP8Encoder();
|
||||
VideoEncoder* VP8Benchmark::GetNewEncoder() {
|
||||
return VP8Encoder::Create();
|
||||
}
|
||||
|
||||
VideoDecoder*
|
||||
VP8Benchmark::GetNewDecoder()
|
||||
{
|
||||
return new VP8Decoder();
|
||||
VideoDecoder* VP8Benchmark::GetNewDecoder() {
|
||||
return VP8Decoder::Create();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -18,14 +18,14 @@
|
||||
|
||||
VP8RpsTest::VP8RpsTest(float bitRate)
|
||||
: VP8NormalAsyncTest(bitRate),
|
||||
decoder2_(new webrtc::VP8Decoder),
|
||||
decoder2_(webrtc::VP8Decoder::Create()),
|
||||
sli_(false) {
|
||||
}
|
||||
|
||||
VP8RpsTest::VP8RpsTest()
|
||||
: VP8NormalAsyncTest("VP8 Reference Picture Selection Test",
|
||||
"VP8 Reference Picture Selection Test", 1),
|
||||
decoder2_(new webrtc::VP8Decoder),
|
||||
decoder2_(webrtc::VP8Decoder::Create()),
|
||||
sli_(false) {
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -45,8 +45,8 @@ int main()
|
||||
std::vector<Test*>::iterator it;
|
||||
for (it = tests.begin() ; it < tests.end(); it++)
|
||||
{
|
||||
enc = new VP8Encoder();
|
||||
dec = new VP8Decoder();
|
||||
enc = VP8Encoder::Create();
|
||||
dec = VP8Decoder::Create();
|
||||
(*it)->SetEncoder(enc);
|
||||
(*it)->SetDecoder(dec);
|
||||
(*it)->SetLog(&log);
|
||||
|
@ -141,9 +141,9 @@ VCMGenericEncoder* VCMCodecDataBase::CreateEncoder(
|
||||
|
||||
switch(type)
|
||||
{
|
||||
#ifdef VIDEOCODEC_VP8
|
||||
#ifdef VIDEOCODEC_VP8
|
||||
case kVideoCodecVP8:
|
||||
return new VCMGenericEncoder(*(new VP8Encoder));
|
||||
return new VCMGenericEncoder(*(VP8Encoder::Create()));
|
||||
#endif
|
||||
#ifdef VIDEOCODEC_I420
|
||||
case kVideoCodecI420:
|
||||
@ -739,7 +739,7 @@ VCMCodecDataBase::CreateDecoder(VideoCodecType type) const
|
||||
{
|
||||
#ifdef VIDEOCODEC_VP8
|
||||
case kVideoCodecVP8:
|
||||
return new VCMGenericDecoder(*(new VP8Decoder), _id);
|
||||
return new VCMGenericDecoder(*(VP8Decoder::Create()), _id);
|
||||
#endif
|
||||
#ifdef VIDEOCODEC_I420
|
||||
case kVideoCodecI420:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
@ -181,12 +181,12 @@ CodecDataBaseTest::Perform(CmdArgs& args)
|
||||
|
||||
|
||||
_vcm->InitializeReceiver();
|
||||
VP8Decoder* decoder = new VP8Decoder;
|
||||
VP8Decoder* decoder = VP8Decoder::Create();
|
||||
VideoCodec vp8DecSettings;
|
||||
VideoCodingModule::Codec(kVideoCodecVP8, &vp8DecSettings);
|
||||
TEST(_vcm->RegisterExternalDecoder(decoder, vp8DecSettings.plType, false) == VCM_OK);
|
||||
TEST(_vcm->RegisterReceiveCodec(&vp8DecSettings, 1, false) == VCM_OK);
|
||||
VP8Encoder* encoder = new VP8Encoder;
|
||||
VP8Encoder* encoder = VP8Encoder::Create();
|
||||
VideoCodec vp8EncSettings;
|
||||
VideoCodingModule::Codec(kVideoCodecVP8, &vp8EncSettings);
|
||||
_vcm->RegisterTransportCallback(_encodeCallback); // encode returns error if callback uninitialized
|
||||
|
Loading…
Reference in New Issue
Block a user