Commit 6d6e170d authored by Timothy B. Terriberry's avatar Timothy B. Terriberry

mcomp: Use valid bit depth in upsampled_pref_error

For some reason xd->cur_buf->bit_depth appears to always be 0.
Use xd->bd instead, as this appears to have the correct value.

Along with commit 49bb8f8c, this fixes the HBD internal quality
loss introduced in commit 5d24b6f0.

BUG=aomedia:649

Change-Id: Ie97e9caf3b13f7493f873258f3863e1314466f1d
parent 464c046d
......@@ -713,15 +713,15 @@ static int upsampled_pref_error(
if (mask)
aom_highbd_comp_mask_upsampled_pred(
pred16, second_pred, w, h, subpel_x_q3, subpel_y_q3, y, y_stride,
mask, mask_stride, invert_mask, xd->cur_buf->bit_depth);
mask, mask_stride, invert_mask, xd->bd);
else
#endif
aom_highbd_comp_avg_upsampled_pred(pred16, second_pred, w, h,
subpel_x_q3, subpel_y_q3, y,
y_stride, xd->cur_buf->bit_depth);
y_stride, xd->bd);
} else {
aom_highbd_upsampled_pred(pred16, w, h, subpel_x_q3, subpel_y_q3, y,
y_stride, xd->cur_buf->bit_depth);
y_stride, xd->bd);
}
besterr = vfp->vf(CONVERT_TO_BYTEPTR(pred16), w, src, src_stride, sse);
......@@ -2712,7 +2712,7 @@ static int upsampled_obmc_pref_error(const MACROBLOCKD *xd, const int32_t *mask,
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
DECLARE_ALIGNED(16, uint16_t, pred16[MAX_SB_SQUARE]);
aom_highbd_upsampled_pred(pred16, w, h, subpel_x_q3, subpel_y_q3, y,
y_stride, xd->cur_buf->bit_depth);
y_stride, xd->bd);
besterr = vfp->ovf(CONVERT_TO_BYTEPTR(pred16), w, wsrc, mask, sse);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment