| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 (*t)->token = token; | 477 (*t)->token = token; |
| 478 (*t)->context_tree = context_tree; | 478 (*t)->context_tree = context_tree; |
| 479 (*t)->skip_eob_node = skip_eob_node; | 479 (*t)->skip_eob_node = skip_eob_node; |
| 480 (*t)++; | 480 (*t)++; |
| 481 ++counts[token]; | 481 ++counts[token]; |
| 482 } | 482 } |
| 483 | 483 |
| 484 static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id, | 484 static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id, |
| 485 TX_SIZE tx_size) { | 485 TX_SIZE tx_size) { |
| 486 const int eob_max = 16 << (tx_size << 1); | 486 const int eob_max = 16 << (tx_size << 1); |
| 487 return vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max; | 487 return segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max; |
| 488 } | 488 } |
| 489 | 489 |
| 490 static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, | 490 static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize, |
| 491 TX_SIZE tx_size, void *arg) { | 491 TX_SIZE tx_size, void *arg) { |
| 492 struct tokenize_b_args* const args = arg; | 492 struct tokenize_b_args* const args = arg; |
| 493 VP9_COMP *cpi = args->cpi; | 493 VP9_COMP *cpi = args->cpi; |
| 494 ThreadData *const td = args->td; | 494 ThreadData *const td = args->td; |
| 495 MACROBLOCK *const x = &td->mb; | 495 MACROBLOCK *const x = &td->mb; |
| 496 MACROBLOCKD *const xd = &x->e_mbd; | 496 MACROBLOCKD *const xd = &x->e_mbd; |
| 497 TOKENEXTRA **tp = args->tp; | 497 TOKENEXTRA **tp = args->tp; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 return result; | 608 return result; |
| 609 } | 609 } |
| 610 | 610 |
| 611 void vp9_tokenize_sb(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t, | 611 void vp9_tokenize_sb(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t, |
| 612 int dry_run, BLOCK_SIZE bsize) { | 612 int dry_run, BLOCK_SIZE bsize) { |
| 613 VP9_COMMON *const cm = &cpi->common; | 613 VP9_COMMON *const cm = &cpi->common; |
| 614 MACROBLOCK *const x = &td->mb; | 614 MACROBLOCK *const x = &td->mb; |
| 615 MACROBLOCKD *const xd = &x->e_mbd; | 615 MACROBLOCKD *const xd = &x->e_mbd; |
| 616 MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; | 616 MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; |
| 617 const int ctx = vp9_get_skip_context(xd); | 617 const int ctx = vp9_get_skip_context(xd); |
| 618 const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id, | 618 const int skip_inc = !segfeature_active(&cm->seg, mbmi->segment_id, |
| 619 SEG_LVL_SKIP); | 619 SEG_LVL_SKIP); |
| 620 struct tokenize_b_args arg = {cpi, td, t}; | 620 struct tokenize_b_args arg = {cpi, td, t}; |
| 621 if (mbmi->skip) { | 621 if (mbmi->skip) { |
| 622 if (!dry_run) | 622 if (!dry_run) |
| 623 td->counts->skip[ctx][1] += skip_inc; | 623 td->counts->skip[ctx][1] += skip_inc; |
| 624 reset_skip_context(xd, bsize); | 624 reset_skip_context(xd, bsize); |
| 625 return; | 625 return; |
| 626 } | 626 } |
| 627 | 627 |
| 628 if (!dry_run) { | 628 if (!dry_run) { |
| 629 td->counts->skip[ctx][0] += skip_inc; | 629 td->counts->skip[ctx][0] += skip_inc; |
| 630 vp9_foreach_transformed_block(xd, bsize, tokenize_b, &arg); | 630 vp9_foreach_transformed_block(xd, bsize, tokenize_b, &arg); |
| 631 } else { | 631 } else { |
| 632 vp9_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg); | 632 vp9_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg); |
| 633 } | 633 } |
| 634 } | 634 } |
| OLD | NEW |