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 "./vpx_config.h" | 12 #include "./vpx_config.h" |
13 #include "./vp9_rtcd.h" | 13 #include "./vp9_rtcd.h" |
14 #include "vp9/encoder/vp9_encodeframe.h" | 14 #include "vp9/encoder/vp9_encodeframe.h" |
15 #include "vp9/encoder/vp9_encodemb.h" | 15 #include "vp9/encoder/vp9_encodemb.h" |
16 #include "vp9/encoder/vp9_encodemv.h" | 16 #include "vp9/encoder/vp9_encodemv.h" |
17 #include "vp9/common/vp9_common.h" | 17 #include "vp9/common/vp9_common.h" |
18 #include "vp9/encoder/vp9_onyx_int.h" | 18 #include "vp9/encoder/vp9_onyx_int.h" |
19 #include "vp9/common/vp9_extend.h" | 19 #include "vp9/common/vp9_extend.h" |
20 #include "vp9/common/vp9_entropy.h" | 20 #include "vp9/common/vp9_entropy.h" |
21 #include "vp9/common/vp9_entropymode.h" | 21 #include "vp9/common/vp9_entropymode.h" |
22 #include "vp9/common/vp9_quant_common.h" | 22 #include "vp9/common/vp9_quant_common.h" |
23 #include "vp9/encoder/vp9_segmentation.h" | 23 #include "vp9/encoder/vp9_segmentation.h" |
24 #include "vp9/encoder/vp9_encodeintra.h" | 24 #include "vp9/encoder/vp9_encodeintra.h" |
25 #include "vp9/common/vp9_reconinter.h" | 25 #include "vp9/common/vp9_reconinter.h" |
26 #include "vp9/common/vp9_invtrans.h" | |
27 #include "vp9/encoder/vp9_rdopt.h" | 26 #include "vp9/encoder/vp9_rdopt.h" |
28 #include "vp9/common/vp9_findnearmv.h" | 27 #include "vp9/common/vp9_findnearmv.h" |
29 #include "vp9/common/vp9_reconintra.h" | 28 #include "vp9/common/vp9_reconintra.h" |
30 #include "vp9/common/vp9_seg_common.h" | 29 #include "vp9/common/vp9_seg_common.h" |
31 #include "vp9/common/vp9_tile_common.h" | 30 #include "vp9/common/vp9_tile_common.h" |
32 #include "vp9/encoder/vp9_tokenize.h" | 31 #include "vp9/encoder/vp9_tokenize.h" |
33 #include "./vp9_rtcd.h" | 32 #include "./vp9_rtcd.h" |
34 #include <stdio.h> | 33 #include <stdio.h> |
35 #include <math.h> | 34 #include <math.h> |
36 #include <limits.h> | 35 #include <limits.h> |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 } | 595 } |
597 } | 596 } |
598 | 597 |
599 static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col, | 598 static void pick_sb_modes(VP9_COMP *cpi, int mi_row, int mi_col, |
600 TOKENEXTRA **tp, int *totalrate, int *totaldist, | 599 TOKENEXTRA **tp, int *totalrate, int *totaldist, |
601 BLOCK_SIZE_TYPE bsize, PICK_MODE_CONTEXT *ctx) { | 600 BLOCK_SIZE_TYPE bsize, PICK_MODE_CONTEXT *ctx) { |
602 VP9_COMMON *const cm = &cpi->common; | 601 VP9_COMMON *const cm = &cpi->common; |
603 MACROBLOCK *const x = &cpi->mb; | 602 MACROBLOCK *const x = &cpi->mb; |
604 MACROBLOCKD *const xd = &x->e_mbd; | 603 MACROBLOCKD *const xd = &x->e_mbd; |
605 | 604 |
| 605 x->rd_search = 1; |
| 606 |
606 if (bsize < BLOCK_SIZE_SB8X8) | 607 if (bsize < BLOCK_SIZE_SB8X8) |
607 if (xd->ab_index != 0) | 608 if (xd->ab_index != 0) |
608 return; | 609 return; |
609 | 610 |
610 set_offsets(cpi, mi_row, mi_col, bsize); | 611 set_offsets(cpi, mi_row, mi_col, bsize); |
611 xd->mode_info_context->mbmi.sb_type = bsize; | 612 xd->mode_info_context->mbmi.sb_type = bsize; |
612 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) | 613 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) |
613 vp9_activity_masking(cpi, x); | 614 vp9_activity_masking(cpi, x); |
614 | 615 |
615 /* Find best coding mode & reconstruct the MB so it is available | 616 /* Find best coding mode & reconstruct the MB so it is available |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 VP9_COMMON *const cm = &cpi->common; | 1969 VP9_COMMON *const cm = &cpi->common; |
1969 MACROBLOCK *const x = &cpi->mb; | 1970 MACROBLOCK *const x = &cpi->mb; |
1970 MACROBLOCKD *const xd = &x->e_mbd; | 1971 MACROBLOCKD *const xd = &x->e_mbd; |
1971 int n; | 1972 int n; |
1972 MODE_INFO *mi = xd->mode_info_context; | 1973 MODE_INFO *mi = xd->mode_info_context; |
1973 MB_MODE_INFO *mbmi = &mi->mbmi; | 1974 MB_MODE_INFO *mbmi = &mi->mbmi; |
1974 unsigned int segment_id = mbmi->segment_id; | 1975 unsigned int segment_id = mbmi->segment_id; |
1975 const int mis = cm->mode_info_stride; | 1976 const int mis = cm->mode_info_stride; |
1976 const int bwl = mi_width_log2(bsize); | 1977 const int bwl = mi_width_log2(bsize); |
1977 const int bw = 1 << bwl, bh = 1 << mi_height_log2(bsize); | 1978 const int bw = 1 << bwl, bh = 1 << mi_height_log2(bsize); |
| 1979 x->rd_search = 0; |
1978 | 1980 |
1979 if (cm->frame_type == KEY_FRAME) { | 1981 if (cm->frame_type == KEY_FRAME) { |
1980 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { | 1982 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { |
1981 adjust_act_zbin(cpi, x); | 1983 adjust_act_zbin(cpi, x); |
1982 vp9_update_zbin_extra(cpi, x); | 1984 vp9_update_zbin_extra(cpi, x); |
1983 } | 1985 } |
1984 } else { | 1986 } else { |
1985 vp9_setup_interp_filters(xd, mbmi->interp_filter, cm); | 1987 vp9_setup_interp_filters(xd, mbmi->interp_filter, cm); |
1986 | 1988 |
1987 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { | 1989 if (cpi->oxcf.tuning == VP8_TUNE_SSIM) { |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 for (y = 0; y < bh; y++) { | 2100 for (y = 0; y < bh; y++) { |
2099 for (x = 0; x < bw; x++) { | 2101 for (x = 0; x < bw; x++) { |
2100 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) { | 2102 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) { |
2101 mi[mis * y + x].mbmi.txfm_size = sz; | 2103 mi[mis * y + x].mbmi.txfm_size = sz; |
2102 } | 2104 } |
2103 } | 2105 } |
2104 } | 2106 } |
2105 } | 2107 } |
2106 } | 2108 } |
2107 } | 2109 } |
OLD | NEW |