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

Side by Side Diff: source/libvpx/vp8/encoder/mcomp.c

Issue 812033011: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp8/encoder/firstpass.c ('k') | source/libvpx/vp8/encoder/onyx_if.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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 int k = -1; 881 int k = -1;
882 int all_in; 882 int all_in;
883 int best_site = -1; 883 int best_site = -1;
884 int hex_range = 127; 884 int hex_range = 127;
885 int dia_range = 8; 885 int dia_range = 8;
886 886
887 int_mv fcenter_mv; 887 int_mv fcenter_mv;
888 fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3; 888 fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
889 fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3; 889 fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
890 890
891 (void)mvcost;
892
891 /* adjust ref_mv to make sure it is within MV range */ 893 /* adjust ref_mv to make sure it is within MV range */
892 vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_ max); 894 vp8_clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_ max);
893 br = ref_mv->as_mv.row; 895 br = ref_mv->as_mv.row;
894 bc = ref_mv->as_mv.col; 896 bc = ref_mv->as_mv.col;
895 897
896 /* Work out the start point for the search */ 898 /* Work out the start point for the search */
897 base_offset = (unsigned char *)(base_pre + d->offset); 899 base_offset = (unsigned char *)(base_pre + d->offset);
898 this_offset = base_offset + (br * (pre_stride)) + bc; 900 this_offset = base_offset + (br * (pre_stride)) + bc;
899 this_mv.as_mv.row = br; 901 this_mv.as_mv.row = br;
900 this_mv.as_mv.col = bc; 902 this_mv.as_mv.col = bc;
901 bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, UINT_MAX) 903 bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, UINT_MAX)
902 + mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, sad_per_bit); 904 + mvsad_err_cost(&this_mv, &fcenter_mv, mvsadcost, sad_per_bit);
903 905
904 #if CONFIG_MULTI_RES_ENCODING 906 #if CONFIG_MULTI_RES_ENCODING
905 /* Lower search range based on prediction info */ 907 /* Lower search range based on prediction info */
906 if (search_param >= 6) goto cal_neighbors; 908 if (search_param >= 6) goto cal_neighbors;
907 else if (search_param >= 5) hex_range = 4; 909 else if (search_param >= 5) hex_range = 4;
908 else if (search_param >= 4) hex_range = 6; 910 else if (search_param >= 4) hex_range = 6;
909 else if (search_param >= 3) hex_range = 15; 911 else if (search_param >= 3) hex_range = 15;
910 else if (search_param >= 2) hex_range = 31; 912 else if (search_param >= 2) hex_range = 31;
911 else if (search_param >= 1) hex_range = 63; 913 else if (search_param >= 1) hex_range = 63;
912 914
913 dia_range = 8; 915 dia_range = 8;
916 #else
917 (void)search_param;
914 #endif 918 #endif
915 919
916 /* hex search */ 920 /* hex search */
917 CHECK_BOUNDS(2) 921 CHECK_BOUNDS(2)
918 922
919 if(all_in) 923 if(all_in)
920 { 924 {
921 for (i = 0; i < 6; i++) 925 for (i = 0; i < 6; i++)
922 { 926 {
923 this_mv.as_mv.row = br + hex[i].row; 927 this_mv.as_mv.row = br + hex[i].row;
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 ++mv_mode_cts[3][1]; 2025 ++mv_mode_cts[3][1];
2022 } 2026 }
2023 } 2027 }
2024 } 2028 }
2025 } 2029 }
2026 } 2030 }
2027 2031
2028 #endif/* END MV ref count VP8_ENTROPY_STATS stats code */ 2032 #endif/* END MV ref count VP8_ENTROPY_STATS stats code */
2029 2033
2030 #endif 2034 #endif
OLDNEW
« no previous file with comments | « source/libvpx/vp8/encoder/firstpass.c ('k') | source/libvpx/vp8/encoder/onyx_if.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698