Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: webrtc/common_video/h264/sps_parser.cc

Issue 2728093002: Optimize ParseRbsp method in H264 bitstream parser. (Closed)
Patch Set: return vector to avoid copy Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/common_video/h264/sps_parser.cc
diff --git a/webrtc/common_video/h264/sps_parser.cc b/webrtc/common_video/h264/sps_parser.cc
index 86a39de83f522aaa8796c617650e1f1606a4a33e..9f61de9fc793ca870352cb5bdaefaad795adc088 100644
--- a/webrtc/common_video/h264/sps_parser.cc
+++ b/webrtc/common_video/h264/sps_parser.cc
@@ -11,6 +11,7 @@
#include "webrtc/common_video/h264/sps_parser.h"
#include <memory>
+#include <vector>
#include "webrtc/common_video/h264/h264_common.h"
#include "webrtc/base/bitbuffer.h"
@@ -33,8 +34,8 @@ namespace webrtc {
// Unpack RBSP and parse SPS state from the supplied buffer.
rtc::Optional<SpsParser::SpsState> SpsParser::ParseSps(const uint8_t* data,
size_t length) {
- std::unique_ptr<rtc::Buffer> unpacked_buffer = H264::ParseRbsp(data, length);
- rtc::BitBuffer bit_buffer(unpacked_buffer->data(), unpacked_buffer->size());
+ std::vector<uint8_t> unpacked_buffer = H264::ParseRbsp(data, length);
+ rtc::BitBuffer bit_buffer(unpacked_buffer.data(), unpacked_buffer.size());
return ParseSpsUpToVui(&bit_buffer);
}

Powered by Google App Engine
This is Rietveld 408576698