in AV1 Encoder remove hack of removing temporal delimiter OBU

Bug: webrtc:11174
Change-Id: I70e3ab1af92562b44f974aa415e0215e06fcf1cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177009
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31512}
This commit is contained in:
Danil Chapovalov
2020-06-11 19:44:24 +02:00
committed by Commit Bot
parent ce73ec4a9a
commit 222fdfdace

View File

@ -471,20 +471,9 @@ int32_t LibaomAv1Encoder::Encode(
"one data packet for an input video frame.";
Release();
}
// TODO(bugs.webrtc.org/11174): Remove this hack when
// webrtc_pc_e2e::SingleProcessEncodedImageDataInjector not used or
// fixed not to assume that encoded image transfered as is.
const uint8_t* data = static_cast<const uint8_t*>(pkt->data.frame.buf);
size_t size = pkt->data.frame.sz;
if (size > 2 && data[0] == 0b0'0010'010 && data[1] == 0) {
// Typically frame starts with a Temporal Delimter OBU of size 0 that
// is not need by any component in webrtc and discarded during rtp
// packetization. Before discarded it confuses test framework that
// assumes received encoded frame is exactly same as sent frame.
data += 2;
size -= 2;
}
encoded_image.SetEncodedData(EncodedImageBuffer::Create(data, size));
encoded_image.SetEncodedData(EncodedImageBuffer::Create(
/*data=*/static_cast<const uint8_t*>(pkt->data.frame.buf),
/*size=*/pkt->data.frame.sz));
if ((pkt->data.frame.flags & AOM_EFLAG_FORCE_KF) != 0) {
layer_frame.Keyframe();