| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 if (sharpness_lvl > 0) | 76 if (sharpness_lvl > 0) |
| 77 { | 77 { |
| 78 if (block_inside_limit > (9 - sharpness_lvl)) | 78 if (block_inside_limit > (9 - sharpness_lvl)) |
| 79 block_inside_limit = (9 - sharpness_lvl); | 79 block_inside_limit = (9 - sharpness_lvl); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (block_inside_limit < 1) | 82 if (block_inside_limit < 1) |
| 83 block_inside_limit = 1; | 83 block_inside_limit = 1; |
| 84 | 84 |
| 85 vpx_memset(lfi->lim[i], block_inside_limit, SIMD_WIDTH); | 85 memset(lfi->lim[i], block_inside_limit, SIMD_WIDTH); |
| 86 vpx_memset(lfi->blim[i], (2 * filt_lvl + block_inside_limit), | 86 memset(lfi->blim[i], (2 * filt_lvl + block_inside_limit), SIMD_WIDTH); |
| 87 SIMD_WIDTH); | 87 memset(lfi->mblim[i], (2 * (filt_lvl + 2) + block_inside_limit), |
| 88 vpx_memset(lfi->mblim[i], (2 * (filt_lvl + 2) + block_inside_limit), | 88 SIMD_WIDTH); |
| 89 SIMD_WIDTH); | |
| 90 } | 89 } |
| 91 } | 90 } |
| 92 | 91 |
| 93 void vp8_loop_filter_init(VP8_COMMON *cm) | 92 void vp8_loop_filter_init(VP8_COMMON *cm) |
| 94 { | 93 { |
| 95 loop_filter_info_n *lfi = &cm->lf_info; | 94 loop_filter_info_n *lfi = &cm->lf_info; |
| 96 int i; | 95 int i; |
| 97 | 96 |
| 98 /* init limits for given sharpness*/ | 97 /* init limits for given sharpness*/ |
| 99 vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); | 98 vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); |
| 100 cm->last_sharpness_level = cm->sharpness_level; | 99 cm->last_sharpness_level = cm->sharpness_level; |
| 101 | 100 |
| 102 /* init LUT for lvl and hev thr picking */ | 101 /* init LUT for lvl and hev thr picking */ |
| 103 lf_init_lut(lfi); | 102 lf_init_lut(lfi); |
| 104 | 103 |
| 105 /* init hev threshold const vectors */ | 104 /* init hev threshold const vectors */ |
| 106 for(i = 0; i < 4 ; i++) | 105 for(i = 0; i < 4 ; i++) |
| 107 { | 106 { |
| 108 vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH); | 107 memset(lfi->hev_thr[i], i, SIMD_WIDTH); |
| 109 } | 108 } |
| 110 } | 109 } |
| 111 | 110 |
| 112 void vp8_loop_filter_frame_init(VP8_COMMON *cm, | 111 void vp8_loop_filter_frame_init(VP8_COMMON *cm, |
| 113 MACROBLOCKD *mbd, | 112 MACROBLOCKD *mbd, |
| 114 int default_filt_lvl) | 113 int default_filt_lvl) |
| 115 { | 114 { |
| 116 int seg, /* segment number */ | 115 int seg, /* segment number */ |
| 117 ref, /* index in ref_lf_deltas */ | 116 ref, /* index in ref_lf_deltas */ |
| 118 mode; /* index in mode_lf_deltas */ | 117 mode; /* index in mode_lf_deltas */ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 144 lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg]; | 143 lvl_seg += mbd->segment_feature_data[MB_LVL_ALT_LF][seg]; |
| 145 lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0; | 144 lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0; |
| 146 } | 145 } |
| 147 } | 146 } |
| 148 | 147 |
| 149 if (!mbd->mode_ref_lf_delta_enabled) | 148 if (!mbd->mode_ref_lf_delta_enabled) |
| 150 { | 149 { |
| 151 /* we could get rid of this if we assume that deltas are set to | 150 /* we could get rid of this if we assume that deltas are set to |
| 152 * zero when not in use; encoder always uses deltas | 151 * zero when not in use; encoder always uses deltas |
| 153 */ | 152 */ |
| 154 vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); | 153 memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); |
| 155 continue; | 154 continue; |
| 156 } | 155 } |
| 157 | 156 |
| 158 /* INTRA_FRAME */ | 157 /* INTRA_FRAME */ |
| 159 ref = INTRA_FRAME; | 158 ref = INTRA_FRAME; |
| 160 | 159 |
| 161 /* Apply delta for reference frame */ | 160 /* Apply delta for reference frame */ |
| 162 lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; | 161 lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref]; |
| 163 | 162 |
| 164 /* Apply delta for Intra modes */ | 163 /* Apply delta for Intra modes */ |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 } | 652 } |
| 654 | 653 |
| 655 y_ptr += 16; | 654 y_ptr += 16; |
| 656 mode_info_context += 1; /* step to next MB */ | 655 mode_info_context += 1; /* step to next MB */ |
| 657 } | 656 } |
| 658 | 657 |
| 659 y_ptr += post->y_stride * 16 - post->y_width; | 658 y_ptr += post->y_stride * 16 - post->y_width; |
| 660 mode_info_context += 1; /* Skip border mb */ | 659 mode_info_context += 1; /* Skip border mb */ |
| 661 } | 660 } |
| 662 } | 661 } |
| OLD | NEW |