Use uint8 pointer instead of std::vector in NV12Scale.

To prepare for landing 536773.

Bug: webrtc:7785
Change-Id: I841218dca3fb9d83f362f7f2b9076f3f189e7c15
Reviewed-on: https://chromium-review.googlesource.com/539577
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18662}
This commit is contained in:
Anders Carlsson
2017-06-19 16:46:31 +02:00
committed by Commit Bot
parent 652abc9a47
commit bfe45c29c5
4 changed files with 33 additions and 12 deletions

View File

@ -277,8 +277,9 @@ TEST_F(TestLibYuv, NV12Scale2x2to2x2) {
std::vector<uint8_t> dst_y(4);
std::vector<uint8_t> dst_uv(2);
std::vector<uint8_t> tmp_buffer;
NV12Scale(&tmp_buffer,
uint8_t* tmp_buffer = nullptr;
NV12Scale(tmp_buffer,
src_y.data(), 2,
src_uv.data(), 2,
2, 2,
@ -301,7 +302,15 @@ TEST_F(TestLibYuv, NV12Scale4x4to2x2) {
std::vector<uint8_t> dst_uv(2);
std::vector<uint8_t> tmp_buffer;
NV12Scale(&tmp_buffer,
const int src_chroma_width = (4 + 1) / 2;
const int src_chroma_height = (4 + 1) / 2;
const int dst_chroma_width = (2 + 1) / 2;
const int dst_chroma_height = (2 + 1) / 2;
tmp_buffer.resize(src_chroma_width * src_chroma_height * 2 +
dst_chroma_width * dst_chroma_height * 2);
tmp_buffer.shrink_to_fit();
NV12Scale(tmp_buffer.data(),
src_y, 4,
src_uv, 4,
4, 4,