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 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1326 |
1327 static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile, | 1327 static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile, |
1328 TOKENEXTRA **tp, int mi_row, int mi_col, | 1328 TOKENEXTRA **tp, int mi_row, int mi_col, |
1329 int output_enabled, BLOCK_SIZE bsize, | 1329 int output_enabled, BLOCK_SIZE bsize, |
1330 PICK_MODE_CONTEXT *ctx) { | 1330 PICK_MODE_CONTEXT *ctx) { |
1331 | 1331 |
1332 | 1332 |
1333 set_offsets(cpi, tile, mi_row, mi_col, bsize); | 1333 set_offsets(cpi, tile, mi_row, mi_col, bsize); |
1334 update_state_rt(cpi, ctx, mi_row, mi_col, bsize); | 1334 update_state_rt(cpi, ctx, mi_row, mi_col, bsize); |
1335 | 1335 |
| 1336 #if CONFIG_DENOISING |
| 1337 if (cpi->oxcf.noise_sensitivity > 0 && output_enabled) { |
| 1338 vp9_denoiser_denoise(&cpi->denoiser, &cpi->mb, mi_row, mi_col, |
| 1339 MAX(BLOCK_8X8, bsize), ctx); |
| 1340 } |
| 1341 #endif |
| 1342 |
1336 encode_superblock(cpi, tp, output_enabled, mi_row, mi_col, bsize, ctx); | 1343 encode_superblock(cpi, tp, output_enabled, mi_row, mi_col, bsize, ctx); |
1337 update_stats(cpi); | 1344 update_stats(cpi); |
1338 | 1345 |
1339 (*tp)->token = EOSB_TOKEN; | 1346 (*tp)->token = EOSB_TOKEN; |
1340 (*tp)++; | 1347 (*tp)++; |
1341 } | 1348 } |
1342 | 1349 |
1343 static void encode_sb_rt(VP9_COMP *cpi, const TileInfo *const tile, | 1350 static void encode_sb_rt(VP9_COMP *cpi, const TileInfo *const tile, |
1344 TOKENEXTRA **tp, int mi_row, int mi_col, | 1351 TOKENEXTRA **tp, int mi_row, int mi_col, |
1345 int output_enabled, BLOCK_SIZE bsize, | 1352 int output_enabled, BLOCK_SIZE bsize, |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2388 } else { | 2395 } else { |
2389 return cpi->common.tx_mode; | 2396 return cpi->common.tx_mode; |
2390 } | 2397 } |
2391 } | 2398 } |
2392 } | 2399 } |
2393 } | 2400 } |
2394 | 2401 |
2395 static void nonrd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile, | 2402 static void nonrd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile, |
2396 int mi_row, int mi_col, | 2403 int mi_row, int mi_col, |
2397 int *rate, int64_t *dist, | 2404 int *rate, int64_t *dist, |
2398 BLOCK_SIZE bsize) { | 2405 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { |
2399 VP9_COMMON *const cm = &cpi->common; | 2406 VP9_COMMON *const cm = &cpi->common; |
2400 MACROBLOCK *const x = &cpi->mb; | 2407 MACROBLOCK *const x = &cpi->mb; |
2401 MACROBLOCKD *const xd = &x->e_mbd; | 2408 MACROBLOCKD *const xd = &x->e_mbd; |
2402 MB_MODE_INFO *mbmi; | 2409 MB_MODE_INFO *mbmi; |
2403 set_offsets(cpi, tile, mi_row, mi_col, bsize); | 2410 set_offsets(cpi, tile, mi_row, mi_col, bsize); |
2404 mbmi = &xd->mi[0]->mbmi; | 2411 mbmi = &xd->mi[0]->mbmi; |
2405 mbmi->sb_type = bsize; | 2412 mbmi->sb_type = bsize; |
2406 | 2413 |
2407 if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) | 2414 if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) |
2408 if (mbmi->segment_id && x->in_static_area) | 2415 if (mbmi->segment_id && x->in_static_area) |
2409 x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); | 2416 x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh); |
2410 | 2417 |
2411 if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) | 2418 if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) |
2412 set_mode_info_seg_skip(x, cm->tx_mode, rate, dist, bsize); | 2419 set_mode_info_seg_skip(x, cm->tx_mode, rate, dist, bsize); |
2413 else | 2420 else |
2414 vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col, rate, dist, bsize); | 2421 vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col, rate, dist, bsize, ctx); |
2415 | 2422 |
2416 duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize); | 2423 duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize); |
2417 } | 2424 } |
2418 | 2425 |
2419 static void fill_mode_info_sb(VP9_COMMON *cm, MACROBLOCK *x, | 2426 static void fill_mode_info_sb(VP9_COMMON *cm, MACROBLOCK *x, |
2420 int mi_row, int mi_col, | 2427 int mi_row, int mi_col, |
2421 BLOCK_SIZE bsize, BLOCK_SIZE subsize, | 2428 BLOCK_SIZE bsize, BLOCK_SIZE subsize, |
2422 PC_TREE *pc_tree) { | 2429 PC_TREE *pc_tree) { |
2423 MACROBLOCKD *xd = &x->e_mbd; | 2430 MACROBLOCKD *xd = &x->e_mbd; |
2424 int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4; | 2431 int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2521 do_split &= bsize > cpi->sf.min_partition_size; | 2528 do_split &= bsize > cpi->sf.min_partition_size; |
2522 } | 2529 } |
2523 if (cpi->sf.use_square_partition_only) { | 2530 if (cpi->sf.use_square_partition_only) { |
2524 partition_horz_allowed &= force_horz_split; | 2531 partition_horz_allowed &= force_horz_split; |
2525 partition_vert_allowed &= force_vert_split; | 2532 partition_vert_allowed &= force_vert_split; |
2526 } | 2533 } |
2527 | 2534 |
2528 // PARTITION_NONE | 2535 // PARTITION_NONE |
2529 if (partition_none_allowed) { | 2536 if (partition_none_allowed) { |
2530 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, | 2537 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, |
2531 &this_rate, &this_dist, bsize); | 2538 &this_rate, &this_dist, bsize, ctx); |
2532 ctx->mic.mbmi = xd->mi[0]->mbmi; | 2539 ctx->mic.mbmi = xd->mi[0]->mbmi; |
2533 ctx->skip_txfm = x->skip_txfm; | 2540 ctx->skip_txfm = x->skip_txfm; |
2534 ctx->skip = x->skip; | 2541 ctx->skip = x->skip; |
2535 | 2542 |
2536 if (this_rate != INT_MAX) { | 2543 if (this_rate != INT_MAX) { |
2537 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); | 2544 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); |
2538 this_rate += cpi->partition_cost[pl][PARTITION_NONE]; | 2545 this_rate += cpi->partition_cost[pl][PARTITION_NONE]; |
2539 sum_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_dist); | 2546 sum_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_dist); |
2540 if (sum_rd < best_rd) { | 2547 if (sum_rd < best_rd) { |
2541 int64_t stop_thresh = 4096; | 2548 int64_t stop_thresh = 4096; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2604 } | 2611 } |
2605 } | 2612 } |
2606 | 2613 |
2607 // PARTITION_HORZ | 2614 // PARTITION_HORZ |
2608 if (partition_horz_allowed && do_rect) { | 2615 if (partition_horz_allowed && do_rect) { |
2609 subsize = get_subsize(bsize, PARTITION_HORZ); | 2616 subsize = get_subsize(bsize, PARTITION_HORZ); |
2610 if (cpi->sf.adaptive_motion_search) | 2617 if (cpi->sf.adaptive_motion_search) |
2611 load_pred_mv(x, ctx); | 2618 load_pred_mv(x, ctx); |
2612 | 2619 |
2613 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, | 2620 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, |
2614 &this_rate, &this_dist, subsize); | 2621 &this_rate, &this_dist, subsize, |
| 2622 &pc_tree->horizontal[0]); |
2615 | 2623 |
2616 pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi; | 2624 pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi; |
2617 pc_tree->horizontal[0].skip_txfm = x->skip_txfm; | 2625 pc_tree->horizontal[0].skip_txfm = x->skip_txfm; |
2618 pc_tree->horizontal[0].skip = x->skip; | 2626 pc_tree->horizontal[0].skip = x->skip; |
2619 | 2627 |
2620 sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist); | 2628 sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist); |
2621 | 2629 |
2622 if (sum_rd < best_rd && mi_row + ms < cm->mi_rows) { | 2630 if (sum_rd < best_rd && mi_row + ms < cm->mi_rows) { |
2623 load_pred_mv(x, ctx); | 2631 load_pred_mv(x, ctx); |
2624 nonrd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col, | 2632 nonrd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col, |
2625 &this_rate, &this_dist, subsize); | 2633 &this_rate, &this_dist, subsize, |
| 2634 &pc_tree->horizontal[1]); |
2626 | 2635 |
2627 pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi; | 2636 pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi; |
2628 pc_tree->horizontal[1].skip_txfm = x->skip_txfm; | 2637 pc_tree->horizontal[1].skip_txfm = x->skip_txfm; |
2629 pc_tree->horizontal[1].skip = x->skip; | 2638 pc_tree->horizontal[1].skip = x->skip; |
2630 | 2639 |
2631 if (this_rate == INT_MAX) { | 2640 if (this_rate == INT_MAX) { |
2632 sum_rd = INT64_MAX; | 2641 sum_rd = INT64_MAX; |
2633 } else { | 2642 } else { |
2634 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); | 2643 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); |
2635 this_rate += cpi->partition_cost[pl][PARTITION_HORZ]; | 2644 this_rate += cpi->partition_cost[pl][PARTITION_HORZ]; |
(...skipping 11 matching lines...) Expand all Loading... |
2647 } | 2656 } |
2648 | 2657 |
2649 // PARTITION_VERT | 2658 // PARTITION_VERT |
2650 if (partition_vert_allowed && do_rect) { | 2659 if (partition_vert_allowed && do_rect) { |
2651 subsize = get_subsize(bsize, PARTITION_VERT); | 2660 subsize = get_subsize(bsize, PARTITION_VERT); |
2652 | 2661 |
2653 if (cpi->sf.adaptive_motion_search) | 2662 if (cpi->sf.adaptive_motion_search) |
2654 load_pred_mv(x, ctx); | 2663 load_pred_mv(x, ctx); |
2655 | 2664 |
2656 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, | 2665 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, |
2657 &this_rate, &this_dist, subsize); | 2666 &this_rate, &this_dist, subsize, |
| 2667 &pc_tree->vertical[0]); |
2658 pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi; | 2668 pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi; |
2659 pc_tree->vertical[0].skip_txfm = x->skip_txfm; | 2669 pc_tree->vertical[0].skip_txfm = x->skip_txfm; |
2660 pc_tree->vertical[0].skip = x->skip; | 2670 pc_tree->vertical[0].skip = x->skip; |
2661 sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist); | 2671 sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist); |
2662 if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) { | 2672 if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) { |
2663 load_pred_mv(x, ctx); | 2673 load_pred_mv(x, ctx); |
2664 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms, | 2674 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms, |
2665 &this_rate, &this_dist, subsize); | 2675 &this_rate, &this_dist, subsize, |
| 2676 &pc_tree->vertical[1]); |
2666 pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi; | 2677 pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi; |
2667 pc_tree->vertical[1].skip_txfm = x->skip_txfm; | 2678 pc_tree->vertical[1].skip_txfm = x->skip_txfm; |
2668 pc_tree->vertical[1].skip = x->skip; | 2679 pc_tree->vertical[1].skip = x->skip; |
2669 if (this_rate == INT_MAX) { | 2680 if (this_rate == INT_MAX) { |
2670 sum_rd = INT64_MAX; | 2681 sum_rd = INT64_MAX; |
2671 } else { | 2682 } else { |
2672 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); | 2683 int pl = partition_plane_context(xd, mi_row, mi_col, bsize); |
2673 this_rate += cpi->partition_cost[pl][PARTITION_VERT]; | 2684 this_rate += cpi->partition_cost[pl][PARTITION_VERT]; |
2674 sum_rate += this_rate; | 2685 sum_rate += this_rate; |
2675 sum_dist += this_dist; | 2686 sum_dist += this_dist; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2745 int64_t dist = INT64_MAX; | 2756 int64_t dist = INT64_MAX; |
2746 | 2757 |
2747 if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) | 2758 if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) |
2748 return; | 2759 return; |
2749 | 2760 |
2750 subsize = (bsize >= BLOCK_8X8) ? mi[0]->mbmi.sb_type : BLOCK_4X4; | 2761 subsize = (bsize >= BLOCK_8X8) ? mi[0]->mbmi.sb_type : BLOCK_4X4; |
2751 partition = partition_lookup[bsl][subsize]; | 2762 partition = partition_lookup[bsl][subsize]; |
2752 | 2763 |
2753 switch (partition) { | 2764 switch (partition) { |
2754 case PARTITION_NONE: | 2765 case PARTITION_NONE: |
2755 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize); | 2766 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, |
| 2767 subsize, &pc_tree->none); |
2756 pc_tree->none.mic.mbmi = xd->mi[0]->mbmi; | 2768 pc_tree->none.mic.mbmi = xd->mi[0]->mbmi; |
2757 pc_tree->none.skip_txfm = x->skip_txfm; | 2769 pc_tree->none.skip_txfm = x->skip_txfm; |
2758 pc_tree->none.skip = x->skip; | 2770 pc_tree->none.skip = x->skip; |
2759 break; | 2771 break; |
2760 case PARTITION_VERT: | 2772 case PARTITION_VERT: |
2761 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize); | 2773 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, |
| 2774 subsize, &pc_tree->vertical[0]); |
2762 pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi; | 2775 pc_tree->vertical[0].mic.mbmi = xd->mi[0]->mbmi; |
2763 pc_tree->vertical[0].skip_txfm = x->skip_txfm; | 2776 pc_tree->vertical[0].skip_txfm = x->skip_txfm; |
2764 pc_tree->vertical[0].skip = x->skip; | 2777 pc_tree->vertical[0].skip = x->skip; |
2765 if (mi_col + hbs < cm->mi_cols) { | 2778 if (mi_col + hbs < cm->mi_cols) { |
2766 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs, | 2779 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs, |
2767 &rate, &dist, subsize); | 2780 &rate, &dist, subsize, &pc_tree->vertical[1]); |
2768 pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi; | 2781 pc_tree->vertical[1].mic.mbmi = xd->mi[0]->mbmi; |
2769 pc_tree->vertical[1].skip_txfm = x->skip_txfm; | 2782 pc_tree->vertical[1].skip_txfm = x->skip_txfm; |
2770 pc_tree->vertical[1].skip = x->skip; | 2783 pc_tree->vertical[1].skip = x->skip; |
2771 if (rate != INT_MAX && dist != INT64_MAX && | 2784 if (rate != INT_MAX && dist != INT64_MAX && |
2772 *totrate != INT_MAX && *totdist != INT64_MAX) { | 2785 *totrate != INT_MAX && *totdist != INT64_MAX) { |
2773 *totrate += rate; | 2786 *totrate += rate; |
2774 *totdist += dist; | 2787 *totdist += dist; |
2775 } | 2788 } |
2776 } | 2789 } |
2777 break; | 2790 break; |
2778 case PARTITION_HORZ: | 2791 case PARTITION_HORZ: |
2779 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize); | 2792 nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, |
| 2793 subsize, &pc_tree->horizontal[0]); |
2780 pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi; | 2794 pc_tree->horizontal[0].mic.mbmi = xd->mi[0]->mbmi; |
2781 pc_tree->horizontal[0].skip_txfm = x->skip_txfm; | 2795 pc_tree->horizontal[0].skip_txfm = x->skip_txfm; |
2782 pc_tree->horizontal[0].skip = x->skip; | 2796 pc_tree->horizontal[0].skip = x->skip; |
2783 if (mi_row + hbs < cm->mi_rows) { | 2797 if (mi_row + hbs < cm->mi_rows) { |
2784 nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col, | 2798 nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col, |
2785 &rate, &dist, subsize); | 2799 &rate, &dist, subsize, &pc_tree->horizontal[0]); |
2786 pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi; | 2800 pc_tree->horizontal[1].mic.mbmi = xd->mi[0]->mbmi; |
2787 pc_tree->horizontal[1].skip_txfm = x->skip_txfm; | 2801 pc_tree->horizontal[1].skip_txfm = x->skip_txfm; |
2788 pc_tree->horizontal[1].skip = x->skip; | 2802 pc_tree->horizontal[1].skip = x->skip; |
2789 if (rate != INT_MAX && dist != INT64_MAX && | 2803 if (rate != INT_MAX && dist != INT64_MAX && |
2790 *totrate != INT_MAX && *totdist != INT64_MAX) { | 2804 *totrate != INT_MAX && *totdist != INT64_MAX) { |
2791 *totrate += rate; | 2805 *totrate += rate; |
2792 *totdist += dist; | 2806 *totdist += dist; |
2793 } | 2807 } |
2794 } | 2808 } |
2795 break; | 2809 break; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3027 encode_nonrd_sb_row(cpi, &tile, mi_row, &tok); | 3041 encode_nonrd_sb_row(cpi, &tile, mi_row, &tok); |
3028 else | 3042 else |
3029 encode_rd_sb_row(cpi, &tile, mi_row, &tok); | 3043 encode_rd_sb_row(cpi, &tile, mi_row, &tok); |
3030 } | 3044 } |
3031 cpi->tok_count[tile_row][tile_col] = (unsigned int)(tok - old_tok); | 3045 cpi->tok_count[tile_row][tile_col] = (unsigned int)(tok - old_tok); |
3032 assert(tok - cpi->tok <= get_token_alloc(cm->mb_rows, cm->mb_cols)); | 3046 assert(tok - cpi->tok <= get_token_alloc(cm->mb_rows, cm->mb_cols)); |
3033 } | 3047 } |
3034 } | 3048 } |
3035 } | 3049 } |
3036 | 3050 |
| 3051 #if CONFIG_FP_MB_STATS |
| 3052 static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats, |
| 3053 VP9_COMMON *cm, uint8_t **this_frame_mb_stats) { |
| 3054 uint8_t *mb_stats_in = firstpass_mb_stats->mb_stats_start + |
| 3055 cm->current_video_frame * cm->MBs * sizeof(uint8_t); |
| 3056 |
| 3057 if (mb_stats_in > firstpass_mb_stats->mb_stats_end) |
| 3058 return EOF; |
| 3059 |
| 3060 *this_frame_mb_stats = mb_stats_in; |
| 3061 |
| 3062 return 1; |
| 3063 } |
| 3064 #endif |
| 3065 |
3037 static void encode_frame_internal(VP9_COMP *cpi) { | 3066 static void encode_frame_internal(VP9_COMP *cpi) { |
3038 SPEED_FEATURES *const sf = &cpi->sf; | 3067 SPEED_FEATURES *const sf = &cpi->sf; |
3039 RD_OPT *const rd_opt = &cpi->rd; | 3068 RD_OPT *const rd_opt = &cpi->rd; |
3040 MACROBLOCK *const x = &cpi->mb; | 3069 MACROBLOCK *const x = &cpi->mb; |
3041 VP9_COMMON *const cm = &cpi->common; | 3070 VP9_COMMON *const cm = &cpi->common; |
3042 MACROBLOCKD *const xd = &x->e_mbd; | 3071 MACROBLOCKD *const xd = &x->e_mbd; |
3043 | 3072 |
3044 xd->mi = cm->mi_grid_visible; | 3073 xd->mi = cm->mi_grid_visible; |
3045 xd->mi[0] = cm->mi; | 3074 xd->mi[0] = cm->mi; |
3046 | 3075 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 vp9_zero(x->zcoeff_blk); | 3123 vp9_zero(x->zcoeff_blk); |
3095 | 3124 |
3096 if (sf->partition_search_type == SOURCE_VAR_BASED_PARTITION) | 3125 if (sf->partition_search_type == SOURCE_VAR_BASED_PARTITION) |
3097 source_var_based_partition_search_method(cpi); | 3126 source_var_based_partition_search_method(cpi); |
3098 } | 3127 } |
3099 | 3128 |
3100 { | 3129 { |
3101 struct vpx_usec_timer emr_timer; | 3130 struct vpx_usec_timer emr_timer; |
3102 vpx_usec_timer_start(&emr_timer); | 3131 vpx_usec_timer_start(&emr_timer); |
3103 | 3132 |
| 3133 #if CONFIG_FP_MB_STATS |
| 3134 if (cpi->use_fp_mb_stats) { |
| 3135 input_fpmb_stats(&cpi->twopass.firstpass_mb_stats, cm, |
| 3136 &cpi->twopass.this_frame_mb_stats); |
| 3137 } |
| 3138 #endif |
| 3139 |
3104 encode_tiles(cpi); | 3140 encode_tiles(cpi); |
3105 | 3141 |
3106 vpx_usec_timer_mark(&emr_timer); | 3142 vpx_usec_timer_mark(&emr_timer); |
3107 cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer); | 3143 cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer); |
3108 } | 3144 } |
3109 | 3145 |
3110 sf->skip_encode_frame = sf->skip_encode_sb ? get_skip_encode_frame(cm) : 0; | 3146 sf->skip_encode_frame = sf->skip_encode_sb ? get_skip_encode_frame(cm) : 0; |
3111 | 3147 |
3112 #if 0 | 3148 #if 0 |
3113 // Keep record of the total distortion this time around for future use | 3149 // Keep record of the total distortion this time around for future use |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3390 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; | 3426 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; |
3391 } | 3427 } |
3392 | 3428 |
3393 for (y = 0; y < mi_height; y++) | 3429 for (y = 0; y < mi_height; y++) |
3394 for (x = 0; x < mi_width; x++) | 3430 for (x = 0; x < mi_width; x++) |
3395 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) | 3431 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) |
3396 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size; | 3432 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size; |
3397 } | 3433 } |
3398 } | 3434 } |
3399 } | 3435 } |
OLD | NEW |