diff options
author | Cheng Chen <chengchen@google.com> | 2020-01-28 09:58:42 -0800 |
---|---|---|
committer | Cheng Chen <chengchen@google.com> | 2020-01-28 09:58:42 -0800 |
commit | 22b23e4d98a363cc94ec38c18ddb4940066cf76a (patch) | |
tree | 6833d20ee6ab0df0ee2d3662bb05c4cd474ec5ec | |
parent | d53645f4982bca27ec69ef41004c3d72ad1f6f22 (diff) | |
download | libvpx-22b23e4d98a363cc94ec38c18ddb4940066cf76a.tar libvpx-22b23e4d98a363cc94ec38c18ddb4940066cf76a.tar.gz libvpx-22b23e4d98a363cc94ec38c18ddb4940066cf76a.tar.bz2 libvpx-22b23e4d98a363cc94ec38c18ddb4940066cf76a.zip |
Change partition_info to a vector
Change-Id: Ia59229da51671045448ea904ed65026155868993
-rw-r--r-- | vp9/simple_encode.cc | 6 | ||||
-rw-r--r-- | vp9/simple_encode.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc index 6885f6597..9ee4853f8 100644 --- a/vp9/simple_encode.cc +++ b/vp9/simple_encode.cc @@ -353,7 +353,7 @@ static void update_encode_frame_result( update_partition_info(encode_frame_info->partition_info, encode_frame_result->num_rows_4x4, encode_frame_result->num_cols_4x4, - encode_frame_result->partition_info.get()); + &encode_frame_result->partition_info[0]); update_frame_counts(&encode_frame_info->frame_counts, &encode_frame_result->frame_counts); } @@ -591,9 +591,7 @@ void SimpleEncode::EncodeFrame(EncodeFrameResult *encode_frame_result) { std::unique_ptr<uint8_t[]>(new uint8_t[max_coding_data_byte_size])); encode_frame_result->num_rows_4x4 = num_rows_4x4_; encode_frame_result->num_cols_4x4 = num_cols_4x4_; - encode_frame_result->partition_info = - std::move(std::unique_ptr<PartitionInfo[]>( - new PartitionInfo[num_rows_4x4_ * num_cols_4x4_])); + encode_frame_result->partition_info.resize(num_rows_4x4_ * num_cols_4x4_); int64_t time_stamp; int64_t time_end; int flush = 1; // Make vp9_get_compressed_data encode a frame diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h index 079547142..b30fa635f 100644 --- a/vp9/simple_encode.h +++ b/vp9/simple_encode.h @@ -144,12 +144,16 @@ struct EncodeFrameResult { FrameCounts frame_counts; int num_rows_4x4; // number of row units, in size of 4. int num_cols_4x4; // number of column units, in size of 4. - // The pointer to the partition information of the frame. + // A vector of the partition information of the frame. + // The number of elements is |num_rows_4x4| * |num_cols_4x4|. // The frame is divided 4x4 blocks of |num_rows_4x4| rows and // |num_cols_4x4| columns. // Each 4x4 block contains the current pixel position (|row|, |column|), // the start pixel position of the partition (|row_start|, |column_start|), // and the |width|, |height| of the partition. + // The current pixel position can be the same as the start pixel position + // if the 4x4 block is the top-left block in the partition. Otherwise, they + // are different. // Within the same partition, all 4x4 blocks have the same |row_start|, // |column_start|, |width| and |height|. // For example, if the frame is partitioned to a 32x32 block, @@ -159,7 +163,7 @@ struct EncodeFrameResult { // the start of the next partition block. // Horizontal next: |column_start| + |width|, // Vertical next: |row_start| + |height|. - std::unique_ptr<PartitionInfo[]> partition_info; + std::vector<PartitionInfo> partition_info; }; struct GroupOfPicture { |