| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 25 matching lines...) Expand all Loading... |
| 36 MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf) { | 36 MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf) { |
| 37 const int x_off_q4 = scaled_x(x << SUBPEL_BITS, sf) & SUBPEL_MASK; | 37 const int x_off_q4 = scaled_x(x << SUBPEL_BITS, sf) & SUBPEL_MASK; |
| 38 const int y_off_q4 = scaled_y(y << SUBPEL_BITS, sf) & SUBPEL_MASK; | 38 const int y_off_q4 = scaled_y(y << SUBPEL_BITS, sf) & SUBPEL_MASK; |
| 39 const MV32 res = { | 39 const MV32 res = { |
| 40 scaled_y(mv->row, sf) + y_off_q4, | 40 scaled_y(mv->row, sf) + y_off_q4, |
| 41 scaled_x(mv->col, sf) + x_off_q4 | 41 scaled_x(mv->col, sf) + x_off_q4 |
| 42 }; | 42 }; |
| 43 return res; | 43 return res; |
| 44 } | 44 } |
| 45 | 45 |
| 46 #if CONFIG_VP9_HIGHBITDEPTH |
| 47 void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, |
| 48 int other_w, int other_h, |
| 49 int this_w, int this_h, |
| 50 int use_high) { |
| 51 #else |
| 46 void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, | 52 void vp9_setup_scale_factors_for_frame(struct scale_factors *sf, |
| 47 int other_w, int other_h, | 53 int other_w, int other_h, |
| 48 int this_w, int this_h) { | 54 int this_w, int this_h) { |
| 55 #endif |
| 49 if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) { | 56 if (!valid_ref_frame_size(other_w, other_h, this_w, this_h)) { |
| 50 sf->x_scale_fp = REF_INVALID_SCALE; | 57 sf->x_scale_fp = REF_INVALID_SCALE; |
| 51 sf->y_scale_fp = REF_INVALID_SCALE; | 58 sf->y_scale_fp = REF_INVALID_SCALE; |
| 52 return; | 59 return; |
| 53 } | 60 } |
| 54 | 61 |
| 55 sf->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w); | 62 sf->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w); |
| 56 sf->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h); | 63 sf->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h); |
| 57 sf->x_step_q4 = scaled_x(16, sf); | 64 sf->x_step_q4 = scaled_x(16, sf); |
| 58 sf->y_step_q4 = scaled_y(16, sf); | 65 sf->y_step_q4 = scaled_y(16, sf); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 sf->predict[0][0][1] = vp9_convolve8_avg; | 111 sf->predict[0][0][1] = vp9_convolve8_avg; |
| 105 sf->predict[0][1][0] = vp9_convolve8; | 112 sf->predict[0][1][0] = vp9_convolve8; |
| 106 sf->predict[0][1][1] = vp9_convolve8_avg; | 113 sf->predict[0][1][1] = vp9_convolve8_avg; |
| 107 sf->predict[1][0][0] = vp9_convolve8; | 114 sf->predict[1][0][0] = vp9_convolve8; |
| 108 sf->predict[1][0][1] = vp9_convolve8_avg; | 115 sf->predict[1][0][1] = vp9_convolve8_avg; |
| 109 } | 116 } |
| 110 } | 117 } |
| 111 // 2D subpel motion always gets filtered in both directions | 118 // 2D subpel motion always gets filtered in both directions |
| 112 sf->predict[1][1][0] = vp9_convolve8; | 119 sf->predict[1][1][0] = vp9_convolve8; |
| 113 sf->predict[1][1][1] = vp9_convolve8_avg; | 120 sf->predict[1][1][1] = vp9_convolve8_avg; |
| 121 #if CONFIG_VP9_HIGHBITDEPTH |
| 122 if (use_high) { |
| 123 if (sf->x_step_q4 == 16) { |
| 124 if (sf->y_step_q4 == 16) { |
| 125 // No scaling in either direction. |
| 126 sf->high_predict[0][0][0] = vp9_high_convolve_copy; |
| 127 sf->high_predict[0][0][1] = vp9_high_convolve_avg; |
| 128 sf->high_predict[0][1][0] = vp9_high_convolve8_vert; |
| 129 sf->high_predict[0][1][1] = vp9_high_convolve8_avg_vert; |
| 130 sf->high_predict[1][0][0] = vp9_high_convolve8_horiz; |
| 131 sf->high_predict[1][0][1] = vp9_high_convolve8_avg_horiz; |
| 132 } else { |
| 133 // No scaling in x direction. Must always scale in the y direction. |
| 134 sf->high_predict[0][0][0] = vp9_high_convolve8_vert; |
| 135 sf->high_predict[0][0][1] = vp9_high_convolve8_avg_vert; |
| 136 sf->high_predict[0][1][0] = vp9_high_convolve8_vert; |
| 137 sf->high_predict[0][1][1] = vp9_high_convolve8_avg_vert; |
| 138 sf->high_predict[1][0][0] = vp9_high_convolve8; |
| 139 sf->high_predict[1][0][1] = vp9_high_convolve8_avg; |
| 140 } |
| 141 } else { |
| 142 if (sf->y_step_q4 == 16) { |
| 143 // No scaling in the y direction. Must always scale in the x direction. |
| 144 sf->high_predict[0][0][0] = vp9_high_convolve8_horiz; |
| 145 sf->high_predict[0][0][1] = vp9_high_convolve8_avg_horiz; |
| 146 sf->high_predict[0][1][0] = vp9_high_convolve8; |
| 147 sf->high_predict[0][1][1] = vp9_high_convolve8_avg; |
| 148 sf->high_predict[1][0][0] = vp9_high_convolve8_horiz; |
| 149 sf->high_predict[1][0][1] = vp9_high_convolve8_avg_horiz; |
| 150 } else { |
| 151 // Must always scale in both directions. |
| 152 sf->high_predict[0][0][0] = vp9_high_convolve8; |
| 153 sf->high_predict[0][0][1] = vp9_high_convolve8_avg; |
| 154 sf->high_predict[0][1][0] = vp9_high_convolve8; |
| 155 sf->high_predict[0][1][1] = vp9_high_convolve8_avg; |
| 156 sf->high_predict[1][0][0] = vp9_high_convolve8; |
| 157 sf->high_predict[1][0][1] = vp9_high_convolve8_avg; |
| 158 } |
| 159 } |
| 160 // 2D subpel motion always gets filtered in both directions. |
| 161 sf->high_predict[1][1][0] = vp9_high_convolve8; |
| 162 sf->high_predict[1][1][1] = vp9_high_convolve8_avg; |
| 163 } |
| 164 #endif |
| 114 } | 165 } |
| OLD | NEW |