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

Unified Diff: webrtc/common_video/h264/h264_bitstream_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
« no previous file with comments | « no previous file | webrtc/common_video/h264/h264_common.h » ('j') | webrtc/common_video/h264/pps_parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/h264_bitstream_parser.cc
diff --git a/webrtc/common_video/h264/h264_bitstream_parser.cc b/webrtc/common_video/h264/h264_bitstream_parser.cc
index 4ad0ed4b283dcbf22b29f359dfcdcd5b73732214..09977ebee9810bb4f757fdaaf78a7a097b27105c 100644
--- a/webrtc/common_video/h264/h264_bitstream_parser.cc
+++ b/webrtc/common_video/h264/h264_bitstream_parser.cc
@@ -46,13 +46,13 @@ H264BitstreamParser::Result H264BitstreamParser::ParseNonParameterSetNalu(
return kInvalidStream;
last_slice_qp_delta_ = rtc::Optional<int32_t>();
- std::unique_ptr<rtc::Buffer> slice_rbsp(
- H264::ParseRbsp(source, source_length));
- if (slice_rbsp->size() < H264::kNaluTypeSize)
+ const std::vector<uint8_t> slice_rbsp =
+ H264::ParseRbsp(source, source_length);
+ if (slice_rbsp.size() < H264::kNaluTypeSize)
return kInvalidStream;
- rtc::BitBuffer slice_reader(slice_rbsp->data() + H264::kNaluTypeSize,
- slice_rbsp->size() - H264::kNaluTypeSize);
+ rtc::BitBuffer slice_reader(slice_rbsp.data() + H264::kNaluTypeSize,
+ slice_rbsp.size() - H264::kNaluTypeSize);
// Check to see if this is an IDR slice, which has an extra field to parse
// out.
bool is_idr = (source[0] & 0x0F) == H264::NaluType::kIdr;
« no previous file with comments | « no previous file | webrtc/common_video/h264/h264_common.h » ('j') | webrtc/common_video/h264/pps_parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698