OLD | NEW |
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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 vp9_write_token(w, vp9_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]); | 210 vp9_write_token(w, vp9_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]); |
211 if (mv_joint_vertical(j)) | 211 if (mv_joint_vertical(j)) |
212 encode_mv_component(w, diff.row, &mvctx->comps[0], usehp); | 212 encode_mv_component(w, diff.row, &mvctx->comps[0], usehp); |
213 | 213 |
214 if (mv_joint_horizontal(j)) | 214 if (mv_joint_horizontal(j)) |
215 encode_mv_component(w, diff.col, &mvctx->comps[1], usehp); | 215 encode_mv_component(w, diff.col, &mvctx->comps[1], usehp); |
216 | 216 |
217 // If auto_mv_step_size is enabled then keep track of the largest | 217 // If auto_mv_step_size is enabled then keep track of the largest |
218 // motion vector component used. | 218 // motion vector component used. |
219 if (!cpi->dummy_packing && cpi->sf.auto_mv_step_size) { | 219 if (!cpi->dummy_packing && cpi->sf.mv.auto_mv_step_size) { |
220 unsigned int maxv = MAX(abs(mv->row), abs(mv->col)) >> 3; | 220 unsigned int maxv = MAX(abs(mv->row), abs(mv->col)) >> 3; |
221 cpi->max_mv_magnitude = MAX(maxv, cpi->max_mv_magnitude); | 221 cpi->max_mv_magnitude = MAX(maxv, cpi->max_mv_magnitude); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], | 225 void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2], |
226 const nmv_context* ctx, int usehp) { | 226 const nmv_context* ctx, int usehp) { |
227 vp9_cost_tokens(mvjoint, ctx->joints, vp9_mv_joint_tree); | 227 vp9_cost_tokens(mvjoint, ctx->joints, vp9_mv_joint_tree); |
228 build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], usehp); | 228 build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], usehp); |
229 build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp); | 229 build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp); |
(...skipping 26 matching lines...) Expand all Loading... |
256 if (mi->bmi[i].as_mode == NEWMV) | 256 if (mi->bmi[i].as_mode == NEWMV) |
257 inc_mvs(mbmi, mi->bmi[i].as_mv, &cm->counts.mv); | 257 inc_mvs(mbmi, mi->bmi[i].as_mv, &cm->counts.mv); |
258 } | 258 } |
259 } | 259 } |
260 } else { | 260 } else { |
261 if (mbmi->mode == NEWMV) | 261 if (mbmi->mode == NEWMV) |
262 inc_mvs(mbmi, mbmi->mv, &cm->counts.mv); | 262 inc_mvs(mbmi, mbmi->mv, &cm->counts.mv); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
OLD | NEW |