mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1030324: Remove VP8 encoder resize work around. r=rjesup
The VP8 encoder was re-initialized completely when the frame size changed instead of calling the vpx_enc_config_set() method. The work around is not longer needed.
This commit is contained in:
parent
4a43239360
commit
f253f924e8
@ -355,9 +355,6 @@ int VP8EncoderImpl::Encode(const I420VideoFrame& input_frame,
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
#ifndef LIBVPX_ENCODER_CONFIG_ON_RESIZE //work around for bug 1030324
|
||||
frame_type = kKeyFrame;
|
||||
#endif
|
||||
}
|
||||
// Image in vpx_image_t format.
|
||||
// Input frame is const. VP8's raw frame is not defined as const.
|
||||
@ -425,25 +422,7 @@ int VP8EncoderImpl::UpdateCodecFrameSize(const I420VideoFrame& input_image) {
|
||||
// Change of frame size will automatically trigger a key frame.
|
||||
config_->g_w = codec_.width;
|
||||
config_->g_h = codec_.height;
|
||||
#ifndef LIBVPX_ENCODER_CONFIG_ON_RESIZE
|
||||
//work around for bug 1030324
|
||||
// doing only a configuration change causes
|
||||
// horizontal streaking and distortion in the output.
|
||||
vpx_codec_flags_t flags = VPX_CODEC_USE_OUTPUT_PARTITION;
|
||||
|
||||
// Re-initing will leak memory so we have to destroy the old context first.
|
||||
if (vpx_codec_destroy(encoder_)) {
|
||||
return WEBRTC_VIDEO_CODEC_MEMORY;
|
||||
}
|
||||
|
||||
// For full paranoia satisfaction we also do a full reset of |encoder_|.
|
||||
delete encoder_;
|
||||
encoder_ = new vpx_codec_ctx_t;
|
||||
|
||||
if (vpx_codec_enc_init(encoder_, vpx_codec_vp8_cx(), config_, flags)) {
|
||||
#else
|
||||
if (vpx_codec_enc_config_set(encoder_, config_)) {
|
||||
#endif
|
||||
return WEBRTC_VIDEO_CODEC_ERROR;
|
||||
}
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user