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

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

Issue 2728093002: Optimize ParseRbsp method in H264 bitstream parser. (Closed)
Patch Set: Remove unused includes Created 3 years, 9 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 | « webrtc/common_video/h264/h264_common.cc ('k') | webrtc/common_video/h264/sps_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/pps_parser.cc
diff --git a/webrtc/common_video/h264/pps_parser.cc b/webrtc/common_video/h264/pps_parser.cc
index b2860c221fdbea48268539daabc3d9f6c95f0970..228d8538d0245d1b4908cfd0f4167be9104cb8ab 100644
--- a/webrtc/common_video/h264/pps_parser.cc
+++ b/webrtc/common_video/h264/pps_parser.cc
@@ -11,10 +11,10 @@
#include "webrtc/common_video/h264/pps_parser.h"
#include <memory>
+#include <vector>
#include "webrtc/common_video/h264/h264_common.h"
#include "webrtc/base/bitbuffer.h"
-#include "webrtc/base/buffer.h"
#include "webrtc/base/logging.h"
#define RETURN_EMPTY_ON_FAIL(x) \
@@ -38,8 +38,8 @@ rtc::Optional<PpsParser::PpsState> PpsParser::ParsePps(const uint8_t* data,
// First, parse out rbsp, which is basically the source buffer minus emulation
// bytes (the last byte of a 0x00 0x00 0x03 sequence). RBSP is defined in
// section 7.3.1 of the H.264 standard.
- 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 ParseInternal(&bit_buffer);
}
@@ -52,15 +52,15 @@ bool PpsParser::ParsePpsIds(const uint8_t* data,
// First, parse out rbsp, which is basically the source buffer minus emulation
// bytes (the last byte of a 0x00 0x00 0x03 sequence). RBSP is defined in
// section 7.3.1 of the H.264 standard.
- 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 ParsePpsIdsInternal(&bit_buffer, pps_id, sps_id);
}
rtc::Optional<uint32_t> PpsParser::ParsePpsIdFromSlice(const uint8_t* data,
size_t length) {
- std::unique_ptr<rtc::Buffer> slice_rbsp(H264::ParseRbsp(data, length));
- rtc::BitBuffer slice_reader(slice_rbsp->data(), slice_rbsp->size());
+ std::vector<uint8_t> unpacked_buffer = H264::ParseRbsp(data, length);
+ rtc::BitBuffer slice_reader(unpacked_buffer.data(), unpacked_buffer.size());
uint32_t golomb_tmp;
// first_mb_in_slice: ue(v)
« no previous file with comments | « webrtc/common_video/h264/h264_common.cc ('k') | webrtc/common_video/h264/sps_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698