summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp9/decoder/vp9_decodeframe.c4
-rw-r--r--vp9/encoder/vp9_encodeframe.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index c183cf38e..8840750fd 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1926,7 +1926,7 @@ void dec_build_inter_predictors(VP9Decoder *const pbi, MACROBLOCKD *xd,
// pixels of each superblock row can be changed by next superblock row.
if (pbi->frame_parallel_decode)
vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf,
- (y1 + 7) << (plane == 0 ? 0 : 1));
+ MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1)));
// Skip border extension if block is inside the frame.
if (x0 < 0 || x0 > frame_width - 1 || x1 < 0 || x1 > frame_width - 1 ||
@@ -1982,7 +1982,7 @@ void dec_build_inter_predictors(VP9Decoder *const pbi, MACROBLOCKD *xd,
// pixels of each superblock row can be changed by next superblock row.
if (pbi->frame_parallel_decode)
vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf,
- (y1 + 7) << (plane == 0 ? 0 : 1));
+ MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1)));
}
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index a86981a71..4949997db 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -595,9 +595,16 @@ static void choose_partitioning(VP9_COMP *cpi,
for (i = 1; i <= 2; ++i) {
struct macroblock_plane *p = &x->plane[i];
struct macroblockd_plane *pd = &xd->plane[i];
+#if GLOBAL_MOTION
+ const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
+#else
const BLOCK_SIZE bs = get_plane_block_size(BLOCK_64X64, pd);
- uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
- pd->dst.buf, pd->dst.stride);
+#endif
+ if (bs == BLOCK_INVALID)
+ uv_sad = INT_MAX;
+ else
+ uv_sad = cpi->fn_ptr[bs].sdf(p->src.buf, p->src.stride,
+ pd->dst.buf, pd->dst.stride);
#if GLOBAL_MOTION
x->color_sensitivity[i - 1] = uv_sad * 4 > y_sad;