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

Unified Diff: source/libvpx/vp9/encoder/vp9_extend.c

Issue 1302353004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 4 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 | « source/libvpx/vp9/encoder/vp9_ethread.c ('k') | source/libvpx/vp9/encoder/vp9_fastssim.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/encoder/vp9_extend.c
diff --git a/source/libvpx/vp9/encoder/vp9_extend.c b/source/libvpx/vp9/encoder/vp9_extend.c
index 6e1ed365dabc3103ed8e154dda81b89568354bc3..4a47f877483a0ab384a36f50705aaba93e3df337 100644
--- a/source/libvpx/vp9/encoder/vp9_extend.c
+++ b/source/libvpx/vp9/encoder/vp9_extend.c
@@ -74,7 +74,7 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
for (i = 0; i < h; i++) {
vpx_memset16(dst_ptr1, src_ptr1[0], extend_left);
- memcpy(dst_ptr1 + extend_left, src_ptr1, w * sizeof(uint16_t));
+ memcpy(dst_ptr1 + extend_left, src_ptr1, w * sizeof(src_ptr1[0]));
vpx_memset16(dst_ptr2, src_ptr2[0], extend_right);
src_ptr1 += src_pitch;
src_ptr2 += src_pitch;
@@ -91,12 +91,12 @@ static void highbd_copy_and_extend_plane(const uint8_t *src8, int src_pitch,
linesize = extend_left + extend_right + w;
for (i = 0; i < extend_top; i++) {
- memcpy(dst_ptr1, src_ptr1, linesize * sizeof(uint16_t));
+ memcpy(dst_ptr1, src_ptr1, linesize * sizeof(src_ptr1[0]));
dst_ptr1 += dst_pitch;
}
for (i = 0; i < extend_bottom; i++) {
- memcpy(dst_ptr2, src_ptr2, linesize * sizeof(uint16_t));
+ memcpy(dst_ptr2, src_ptr2, linesize * sizeof(src_ptr2[0]));
dst_ptr2 += dst_pitch;
}
}
@@ -111,10 +111,12 @@ void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
// Motion estimation may use src block variance with the block size up
// to 64x64, so the right and bottom need to be extended to 64 multiple
// or up to 16, whichever is greater.
- const int er_y = MAX(src->y_width + 16, ALIGN_POWER_OF_TWO(src->y_width, 6))
- - src->y_crop_width;
- const int eb_y = MAX(src->y_height + 16, ALIGN_POWER_OF_TWO(src->y_height, 6))
- - src->y_crop_height;
+ const int er_y =
+ VPXMAX(src->y_width + 16, ALIGN_POWER_OF_TWO(src->y_width, 6)) -
+ src->y_crop_width;
+ const int eb_y =
+ VPXMAX(src->y_height + 16, ALIGN_POWER_OF_TWO(src->y_height, 6)) -
+ src->y_crop_height;
const int uv_width_subsampling = (src->uv_width != src->y_width);
const int uv_height_subsampling = (src->uv_height != src->y_height);
const int et_uv = et_y >> uv_height_subsampling;
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_ethread.c ('k') | source/libvpx/vp9/encoder/vp9_fastssim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698