| 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 |
| 11 | 11 |
| 12 #include "vp8/common/common.h" | 12 #include "vp8/common/common.h" |
| 13 #include "encodemv.h" | 13 #include "encodemv.h" |
| 14 #include "vp8/common/entropymode.h" | 14 #include "vp8/common/entropymode.h" |
| 15 #include "vp8/common/systemdependent.h" | 15 #include "vp8/common/systemdependent.h" |
| 16 | 16 |
| 17 #include <math.h> | 17 #include <math.h> |
| 18 | 18 |
| 19 #ifdef ENTROPY_STATS | 19 #ifdef VP8_ENTROPY_STATS |
| 20 extern unsigned int active_section; | 20 extern unsigned int active_section; |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 static void encode_mvcomponent( | 23 static void encode_mvcomponent( |
| 24 vp8_writer *const w, | 24 vp8_writer *const w, |
| 25 const int v, | 25 const int v, |
| 26 const struct mv_context *mvc | 26 const struct mv_context *mvc |
| 27 ) | 27 ) |
| 28 { | 28 { |
| 29 const vp8_prob *p = mvc->prob; | 29 const vp8_prob *p = mvc->prob; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 while (++j < mvlong_width); | 353 while (++j < mvlong_width); |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 void vp8_write_mvprobs(VP8_COMP *cpi) | 357 void vp8_write_mvprobs(VP8_COMP *cpi) |
| 358 { | 358 { |
| 359 vp8_writer *const w = cpi->bc; | 359 vp8_writer *const w = cpi->bc; |
| 360 MV_CONTEXT *mvc = cpi->common.fc.mvc; | 360 MV_CONTEXT *mvc = cpi->common.fc.mvc; |
| 361 int flags[2] = {0, 0}; | 361 int flags[2] = {0, 0}; |
| 362 #ifdef ENTROPY_STATS | 362 #ifdef VP8_ENTROPY_STATS |
| 363 active_section = 4; | 363 active_section = 4; |
| 364 #endif | 364 #endif |
| 365 write_component_probs( | 365 write_component_probs( |
| 366 w, &mvc[0], &vp8_default_mv_context[0], &vp8_mv_update_probs[0], | 366 w, &mvc[0], &vp8_default_mv_context[0], &vp8_mv_update_probs[0], |
| 367 cpi->mb.MVcount[0], 0, &flags[0] | 367 cpi->mb.MVcount[0], 0, &flags[0] |
| 368 ); | 368 ); |
| 369 write_component_probs( | 369 write_component_probs( |
| 370 w, &mvc[1], &vp8_default_mv_context[1], &vp8_mv_update_probs[1], | 370 w, &mvc[1], &vp8_default_mv_context[1], &vp8_mv_update_probs[1], |
| 371 cpi->mb.MVcount[1], 1, &flags[1] | 371 cpi->mb.MVcount[1], 1, &flags[1] |
| 372 ); | 372 ); |
| 373 | 373 |
| 374 if (flags[0] || flags[1]) | 374 if (flags[0] || flags[1]) |
| 375 vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi-
>common.fc.mvc, flags); | 375 vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi-
>common.fc.mvc, flags); |
| 376 | 376 |
| 377 #ifdef ENTROPY_STATS | 377 #ifdef VP8_ENTROPY_STATS |
| 378 active_section = 5; | 378 active_section = 5; |
| 379 #endif | 379 #endif |
| 380 } | 380 } |
| OLD | NEW |