diff options
author | Deb Mukherjee <debargha@google.com> | 2014-09-24 06:36:34 -0700 |
---|---|---|
committer | Deb Mukherjee <debargha@google.com> | 2014-09-25 01:50:36 -0700 |
commit | 993d10a21774a29d6c708131e54ee3331bda20df (patch) | |
tree | 00c2403d7ac6a328dbd1ad1093a3610e1f9305ec /vp9/encoder/vp9_mcomp.c | |
parent | 6989e81d611b438c21cab5576d01b1b30c5b1e34 (diff) | |
download | libvpx-993d10a21774a29d6c708131e54ee3331bda20df.tar libvpx-993d10a21774a29d6c708131e54ee3331bda20df.tar.gz libvpx-993d10a21774a29d6c708131e54ee3331bda20df.tar.bz2 libvpx-993d10a21774a29d6c708131e54ee3331bda20df.zip |
Adds various high bit-depth encode functions
Change-Id: I6f67b171022bbc8199c6d674190b57f6bab1b62f
Diffstat (limited to 'vp9/encoder/vp9_mcomp.c')
-rw-r--r-- | vp9/encoder/vp9_mcomp.c | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_mcomp.c b/vp9/encoder/vp9_mcomp.c index 5366c3c1e..89c37d98e 100644 --- a/vp9/encoder/vp9_mcomp.c +++ b/vp9/encoder/vp9_mcomp.c @@ -284,16 +284,7 @@ static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c) { int tc = bc; \ \ bestmv->row *= 8; \ - bestmv->col *= 8; \ - if (second_pred != NULL) { \ - DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); \ - vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); \ - besterr = vfp->vf(comp_pred, w, z, src_stride, sse1); \ - } else { \ - besterr = vfp->vf(y + offset, y_stride, z, src_stride, sse1); \ - } \ - *distortion = besterr; \ - besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit); + bestmv->col *= 8; int vp9_find_best_sub_pixel_tree_pruned(const MACROBLOCK *x, MV *bestmv, const MV *ref_mv, @@ -309,6 +300,29 @@ int vp9_find_best_sub_pixel_tree_pruned(const MACROBLOCK *x, const uint8_t *second_pred, int w, int h) { SETUP_SUBPEL_SEARCH; + if (second_pred != NULL) { +#if CONFIG_VP9_HIGHBITDEPTH + if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { + DECLARE_ALIGNED_ARRAY(16, uint16_t, comp_pred16, 64 * 64); + vp9_high_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset, + y_stride); + besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, z, src_stride, + sse1); + } else { + DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); + besterr = vfp->vf(comp_pred, w, z, src_stride, sse1); + } +#else + DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); + besterr = vfp->vf(comp_pred, w, z, src_stride, sse1); +#endif // CONFIG_VP9_HIGHBITDEPTH + } else { + besterr = vfp->vf(y + offset, y_stride, z, src_stride, sse1); + } + *distortion = besterr; + besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit); if (sad_list && sad_list[0] != INT_MAX && sad_list[1] != INT_MAX && @@ -401,6 +415,29 @@ int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x, const uint8_t *second_pred, int w, int h) { SETUP_SUBPEL_SEARCH; + if (second_pred != NULL) { +#if CONFIG_VP9_HIGHBITDEPTH + if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { + DECLARE_ALIGNED_ARRAY(16, uint16_t, comp_pred16, 64 * 64); + vp9_high_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset, + y_stride); + besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, z, src_stride, + sse1); + } else { + DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); + besterr = vfp->vf(comp_pred, w, z, src_stride, sse1); + } +#else + DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64); + vp9_comp_avg_pred(comp_pred, second_pred, w, h, y + offset, y_stride); + besterr = vfp->vf(comp_pred, w, z, src_stride, sse1); +#endif // CONFIG_VP9_HIGHBITDEPTH + } else { + besterr = vfp->vf(y + offset, y_stride, z, src_stride, sse1); + } + *distortion = besterr; + besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit); (void) sad_list; // to silence compiler warning // Each subsequent iteration checks at least one point in |