ref: e3d19bfc63347b01e30cd6fb8856c5d64d515c56
parent: a2fed22b6ca0d52e35db05466e314a4681118f6b
author: Peter de Rivaz <[email protected]>
date: Tue Dec 16 05:55:49 EST 2014
Fix for crash in highbitdepth rt mode Change 72141 introduced a new use of vp9_avg_4x4. This call needs to switch to using vp9_highbd_avg_4x4 when performing high bitdepth encodes. Change-Id: I6a8ba4b62f8a75d0a917b365a55245e2f0438ea1
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -593,7 +593,16 @@
unsigned int sse = 0;
int sum = 0;
if (x4_idx < pixels_wide && y4_idx < pixels_high) {
+#if CONFIG_VP9_HIGHBITDEPTH
+ int s_avg;
+ if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
+ s_avg = vp9_highbd_avg_4x4(s + y4_idx * sp + x4_idx, sp);
+ } else {
+ s_avg = vp9_avg_4x4(s + y4_idx * sp + x4_idx, sp);
+ }
+#else
int s_avg = vp9_avg_4x4(s + y4_idx * sp + x4_idx, sp);
+#endif
// For key frame, reference is set to 128.
sum = s_avg - 128;
sse = sum * sum;