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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_mcomp.c

Issue 1217053002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_firstpass.c ('k') | source/libvpx/vp9/encoder/vp9_pickmode.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); \ 279 const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX); \
280 const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); \ 280 const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX); \
281 const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); \ 281 const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX); \
282 const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); \ 282 const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX); \
283 int tr = br; \ 283 int tr = br; \
284 int tc = bc; \ 284 int tc = bc; \
285 \ 285 \
286 bestmv->row *= 8; \ 286 bestmv->row *= 8; \
287 bestmv->col *= 8; 287 bestmv->col *= 8;
288 288
289 static INLINE unsigned int setup_center_error(const MACROBLOCKD *xd, 289 static unsigned int setup_center_error(const MACROBLOCKD *xd,
290 const MV *bestmv, 290 const MV *bestmv,
291 const MV *ref_mv, 291 const MV *ref_mv,
292 int error_per_bit, 292 int error_per_bit,
293 const vp9_variance_fn_ptr_t *vfp, 293 const vp9_variance_fn_ptr_t *vfp,
294 const uint8_t *const src, 294 const uint8_t *const src,
295 const int src_stride, 295 const int src_stride,
296 const uint8_t *const y, 296 const uint8_t *const y,
297 int y_stride, 297 int y_stride,
298 const uint8_t *second_pred, 298 const uint8_t *second_pred,
299 int w, int h, int offset, 299 int w, int h, int offset,
300 int *mvjcost, int *mvcost[2], 300 int *mvjcost, int *mvcost[2],
301 unsigned int *sse1, 301 unsigned int *sse1,
302 int *distortion) { 302 int *distortion) {
303 unsigned int besterr; 303 unsigned int besterr;
304 #if CONFIG_VP9_HIGHBITDEPTH 304 #if CONFIG_VP9_HIGHBITDEPTH
305 if (second_pred != NULL) { 305 if (second_pred != NULL) {
306 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { 306 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
307 DECLARE_ALIGNED(16, uint16_t, comp_pred16[64 * 64]); 307 DECLARE_ALIGNED(16, uint16_t, comp_pred16[64 * 64]);
308 vpx_highbd_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset, 308 vpx_highbd_comp_avg_pred(comp_pred16, second_pred, w, h, y + offset,
309 y_stride); 309 y_stride);
310 besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, src, src_stride, 310 besterr = vfp->vf(CONVERT_TO_BYTEPTR(comp_pred16), w, src, src_stride,
311 sse1); 311 sse1);
312 } else { 312 } else {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 bestmv->row = br; 603 bestmv->row = br;
604 bestmv->col = bc; 604 bestmv->col = bc;
605 605
606 if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) || 606 if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) ||
607 (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3))) 607 (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3)))
608 return INT_MAX; 608 return INT_MAX;
609 609
610 return besterr; 610 return besterr;
611 } 611 }
612 612
613 const MV search_step_table[12] = { 613 static const MV search_step_table[12] = {
614 // left, right, up, down 614 // left, right, up, down
615 {0, -4}, {0, 4}, {-4, 0}, {4, 0}, 615 {0, -4}, {0, 4}, {-4, 0}, {4, 0},
616 {0, -2}, {0, 2}, {-2, 0}, {2, 0}, 616 {0, -2}, {0, 2}, {-2, 0}, {2, 0},
617 {0, -1}, {0, 1}, {-1, 0}, {1, 0} 617 {0, -1}, {0, 1}, {-1, 0}, {1, 0}
618 }; 618 };
619 619
620 int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x, 620 int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x,
621 MV *bestmv, const MV *ref_mv, 621 MV *bestmv, const MV *ref_mv,
622 int allow_hp, 622 int allow_hp,
623 int error_per_bit, 623 int error_per_bit,
(...skipping 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 break; 2348 break;
2349 default: 2349 default:
2350 assert(0 && "Invalid search method."); 2350 assert(0 && "Invalid search method.");
2351 } 2351 }
2352 2352
2353 if (method != NSTEP && rd && var < var_max) 2353 if (method != NSTEP && rd && var < var_max)
2354 var = vp9_get_mvpred_var(x, tmp_mv, ref_mv, fn_ptr, 1); 2354 var = vp9_get_mvpred_var(x, tmp_mv, ref_mv, fn_ptr, 1);
2355 2355
2356 return var; 2356 return var;
2357 } 2357 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_firstpass.c ('k') | source/libvpx/vp9/encoder/vp9_pickmode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698