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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // block we are currently looking at. Shift is used to position the | 495 // block we are currently looking at. Shift is used to position the |
496 // 1's we produce. | 496 // 1's we produce. |
497 // TODO(JBB) Need another function for different resolution color.. | 497 // TODO(JBB) Need another function for different resolution color.. |
498 static void build_masks(const loop_filter_info_n *const lfi_n, | 498 static void build_masks(const loop_filter_info_n *const lfi_n, |
499 const MODE_INFO *mi, const int shift_y, | 499 const MODE_INFO *mi, const int shift_y, |
500 const int shift_uv, | 500 const int shift_uv, |
501 LOOP_FILTER_MASK *lfm) { | 501 LOOP_FILTER_MASK *lfm) { |
502 const MB_MODE_INFO *mbmi = &mi->mbmi; | 502 const MB_MODE_INFO *mbmi = &mi->mbmi; |
503 const BLOCK_SIZE block_size = mbmi->sb_type; | 503 const BLOCK_SIZE block_size = mbmi->sb_type; |
504 const TX_SIZE tx_size_y = mbmi->tx_size; | 504 const TX_SIZE tx_size_y = mbmi->tx_size; |
505 const TX_SIZE tx_size_uv = get_uv_tx_size(mbmi); | 505 const TX_SIZE tx_size_uv = get_uv_tx_size_impl(tx_size_y, block_size, 1, 1); |
506 const int filter_level = get_filter_level(lfi_n, mbmi); | 506 const int filter_level = get_filter_level(lfi_n, mbmi); |
507 uint64_t *const left_y = &lfm->left_y[tx_size_y]; | 507 uint64_t *const left_y = &lfm->left_y[tx_size_y]; |
508 uint64_t *const above_y = &lfm->above_y[tx_size_y]; | 508 uint64_t *const above_y = &lfm->above_y[tx_size_y]; |
509 uint64_t *const int_4x4_y = &lfm->int_4x4_y; | 509 uint64_t *const int_4x4_y = &lfm->int_4x4_y; |
510 uint16_t *const left_uv = &lfm->left_uv[tx_size_uv]; | 510 uint16_t *const left_uv = &lfm->left_uv[tx_size_uv]; |
511 uint16_t *const above_uv = &lfm->above_uv[tx_size_uv]; | 511 uint16_t *const above_uv = &lfm->above_uv[tx_size_uv]; |
512 uint16_t *const int_4x4_uv = &lfm->int_4x4_uv; | 512 uint16_t *const int_4x4_uv = &lfm->int_4x4_uv; |
513 int i; | 513 int i; |
514 | 514 |
515 // If filter level is 0 we don't loop filter. | 515 // If filter level is 0 we don't loop filter. |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 const int skip_this = mi[0].mbmi.skip && is_inter_block(&mi[0].mbmi); | 932 const int skip_this = mi[0].mbmi.skip && is_inter_block(&mi[0].mbmi); |
933 // left edge of current unit is block/partition edge -> no skip | 933 // left edge of current unit is block/partition edge -> no skip |
934 const int block_edge_left = (num_4x4_blocks_wide_lookup[sb_type] > 1) ? | 934 const int block_edge_left = (num_4x4_blocks_wide_lookup[sb_type] > 1) ? |
935 !(c & (num_8x8_blocks_wide_lookup[sb_type] - 1)) : 1; | 935 !(c & (num_8x8_blocks_wide_lookup[sb_type] - 1)) : 1; |
936 const int skip_this_c = skip_this && !block_edge_left; | 936 const int skip_this_c = skip_this && !block_edge_left; |
937 // top edge of current unit is block/partition edge -> no skip | 937 // top edge of current unit is block/partition edge -> no skip |
938 const int block_edge_above = (num_4x4_blocks_high_lookup[sb_type] > 1) ? | 938 const int block_edge_above = (num_4x4_blocks_high_lookup[sb_type] > 1) ? |
939 !(r & (num_8x8_blocks_high_lookup[sb_type] - 1)) : 1; | 939 !(r & (num_8x8_blocks_high_lookup[sb_type] - 1)) : 1; |
940 const int skip_this_r = skip_this && !block_edge_above; | 940 const int skip_this_r = skip_this && !block_edge_above; |
941 const TX_SIZE tx_size = (plane->plane_type == PLANE_TYPE_UV) | 941 const TX_SIZE tx_size = (plane->plane_type == PLANE_TYPE_UV) |
942 ? get_uv_tx_size(&mi[0].mbmi) | 942 ? get_uv_tx_size(&mi[0].mbmi, plane) |
943 : mi[0].mbmi.tx_size; | 943 : mi[0].mbmi.tx_size; |
944 const int skip_border_4x4_c = ss_x && mi_col + c == cm->mi_cols - 1; | 944 const int skip_border_4x4_c = ss_x && mi_col + c == cm->mi_cols - 1; |
945 const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1; | 945 const int skip_border_4x4_r = ss_y && mi_row + r == cm->mi_rows - 1; |
946 | 946 |
947 // Filter level can vary per MI | 947 // Filter level can vary per MI |
948 if (!(lfl[(r << 3) + (c >> ss_x)] = | 948 if (!(lfl[(r << 3) + (c >> ss_x)] = |
949 get_filter_level(&cm->lf_info, &mi[0].mbmi))) | 949 get_filter_level(&cm->lf_info, &mi[0].mbmi))) |
950 continue; | 950 continue; |
951 | 951 |
952 // Build masks based on the transform size of each block | 952 // Build masks based on the transform size of each block |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 y_only); | 1245 y_only); |
1246 } | 1246 } |
1247 | 1247 |
1248 int vp9_loop_filter_worker(void *arg1, void *arg2) { | 1248 int vp9_loop_filter_worker(void *arg1, void *arg2) { |
1249 LFWorkerData *const lf_data = (LFWorkerData*)arg1; | 1249 LFWorkerData *const lf_data = (LFWorkerData*)arg1; |
1250 (void)arg2; | 1250 (void)arg2; |
1251 vp9_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes, | 1251 vp9_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes, |
1252 lf_data->start, lf_data->stop, lf_data->y_only); | 1252 lf_data->start, lf_data->stop, lf_data->y_only); |
1253 return 1; | 1253 return 1; |
1254 } | 1254 } |
OLD | NEW |