Update the only 3 remaining kFilterBilinear to kFilterBox.
Bilinear is faster but lesser quality, box is best quality. Our code base has disagreed about which filter to use for quite some time, causing aliasing bug reports. In an effort to avoid aliasing artifacts and make our scaling filters more predictable, we're updating all uses to kFilterBox. WebRTC already uses kFilterBox everywhere except for these three places. The main discrepency was between Chromium and WebRTC but that has already been fixed. This CL fixes the last remaining bilinears. This brings the WebRTC kFilterBox use count up from 11 to 14 and the kFilterBilinear use count down from 3 to 0. Bug: chromium:1212630 Change-Id: I5fe4aa92b9275d65b91ea97925533055d190d317 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221372 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34248}
This commit is contained in:
parent
d9a135b088
commit
58126f92bf
@ -144,11 +144,10 @@ void NV12Buffer::CropAndScaleFrom(const NV12BufferInterface& src,
|
||||
const uint8_t* uv_plane =
|
||||
src.DataUV() + src.StrideUV() * uv_offset_y + uv_offset_x * 2;
|
||||
|
||||
// kFilterBox is unsupported in libyuv, so using kFilterBilinear instead.
|
||||
int res = libyuv::NV12Scale(y_plane, src.StrideY(), uv_plane, src.StrideUV(),
|
||||
crop_width, crop_height, MutableDataY(),
|
||||
StrideY(), MutableDataUV(), StrideUV(), width(),
|
||||
height(), libyuv::kFilterBilinear);
|
||||
height(), libyuv::kFilterBox);
|
||||
|
||||
RTC_DCHECK_EQ(res, 0);
|
||||
}
|
||||
|
||||
@ -445,7 +445,7 @@ int32_t H264EncoderImpl::Encode(
|
||||
pictures_[i].iStride[0], pictures_[i].pData[1],
|
||||
pictures_[i].iStride[1], pictures_[i].pData[2],
|
||||
pictures_[i].iStride[2], configurations_[i].width,
|
||||
configurations_[i].height, libyuv::kFilterBilinear);
|
||||
configurations_[i].height, libyuv::kFilterBox);
|
||||
}
|
||||
|
||||
if (!configurations_[i].sending) {
|
||||
|
||||
@ -61,7 +61,7 @@ rtc::scoped_refptr<I420BufferInterface> CropAndZoom(
|
||||
adjusted_frame->MutableDataY(), adjusted_frame->StrideY(),
|
||||
adjusted_frame->MutableDataU(), adjusted_frame->StrideU(),
|
||||
adjusted_frame->MutableDataV(), adjusted_frame->StrideV(),
|
||||
frame->width(), frame->height(), libyuv::kFilterBilinear);
|
||||
frame->width(), frame->height(), libyuv::kFilterBox);
|
||||
|
||||
return adjusted_frame;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user