Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: source/libvpx/vp9/encoder/vp9_encodeframe.c

Issue 390713002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_denoiser.c ('k') | source/libvpx/vp9/encoder/vp9_encodemb.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 MACROBLOCKD *const xd = &cpi->mb.e_mbd; 1820 MACROBLOCKD *const xd = &cpi->mb.e_mbd;
1821 MODE_INFO **mi_8x8 = xd->mi; 1821 MODE_INFO **mi_8x8 = xd->mi;
1822 const int left_in_image = xd->left_available && mi_8x8[-1]; 1822 const int left_in_image = xd->left_available && mi_8x8[-1];
1823 const int above_in_image = xd->up_available && 1823 const int above_in_image = xd->up_available &&
1824 mi_8x8[-xd->mi_stride]; 1824 mi_8x8[-xd->mi_stride];
1825 int row8x8_remaining = tile->mi_row_end - mi_row; 1825 int row8x8_remaining = tile->mi_row_end - mi_row;
1826 int col8x8_remaining = tile->mi_col_end - mi_col; 1826 int col8x8_remaining = tile->mi_col_end - mi_col;
1827 int bh, bw; 1827 int bh, bw;
1828 BLOCK_SIZE min_size = BLOCK_32X32; 1828 BLOCK_SIZE min_size = BLOCK_32X32;
1829 BLOCK_SIZE max_size = BLOCK_8X8; 1829 BLOCK_SIZE max_size = BLOCK_8X8;
1830 int bsl = mi_width_log2_lookup[BLOCK_64X64]; 1830 int bsl = mi_width_log2(BLOCK_64X64);
1831 const int search_range_ctrl = (((mi_row + mi_col) >> bsl) + 1831 const int search_range_ctrl = (((mi_row + mi_col) >> bsl) +
1832 get_chessboard_index(cm)) % 2; 1832 get_chessboard_index(cm)) % 2;
1833 // Trap case where we do not have a prediction. 1833 // Trap case where we do not have a prediction.
1834 if (search_range_ctrl && 1834 if (search_range_ctrl &&
1835 (left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) { 1835 (left_in_image || above_in_image || cm->frame_type != KEY_FRAME)) {
1836 int block; 1836 int block;
1837 MODE_INFO **mi; 1837 MODE_INFO **mi;
1838 BLOCK_SIZE sb_type; 1838 BLOCK_SIZE sb_type;
1839 1839
1840 // Find the min and max partition sizes used in the left SB64. 1840 // Find the min and max partition sizes used in the left SB64.
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 int64_t stop_thresh = 4096; 1969 int64_t stop_thresh = 4096;
1970 int64_t stop_thresh_rd; 1970 int64_t stop_thresh_rd;
1971 1971
1972 best_rate = this_rate; 1972 best_rate = this_rate;
1973 best_dist = this_dist; 1973 best_dist = this_dist;
1974 best_rd = sum_rd; 1974 best_rd = sum_rd;
1975 if (bsize >= BLOCK_8X8) 1975 if (bsize >= BLOCK_8X8)
1976 pc_tree->partitioning = PARTITION_NONE; 1976 pc_tree->partitioning = PARTITION_NONE;
1977 1977
1978 // Adjust threshold according to partition size. 1978 // Adjust threshold according to partition size.
1979 stop_thresh >>= 8 - (b_width_log2_lookup[bsize] + 1979 stop_thresh >>= 8 - (b_width_log2(bsize) +
1980 b_height_log2_lookup[bsize]); 1980 b_height_log2(bsize));
1981 1981
1982 stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh); 1982 stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
1983 // If obtained distortion is very small, choose current partition 1983 // If obtained distortion is very small, choose current partition
1984 // and stop splitting. 1984 // and stop splitting.
1985 if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) { 1985 if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) {
1986 do_split = 0; 1986 do_split = 0;
1987 do_rect = 0; 1987 do_rect = 0;
1988 } 1988 }
1989 } 1989 }
1990 } 1990 }
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 int64_t stop_thresh = 4096; 2541 int64_t stop_thresh = 4096;
2542 int64_t stop_thresh_rd; 2542 int64_t stop_thresh_rd;
2543 2543
2544 best_rate = this_rate; 2544 best_rate = this_rate;
2545 best_dist = this_dist; 2545 best_dist = this_dist;
2546 best_rd = sum_rd; 2546 best_rd = sum_rd;
2547 if (bsize >= BLOCK_8X8) 2547 if (bsize >= BLOCK_8X8)
2548 pc_tree->partitioning = PARTITION_NONE; 2548 pc_tree->partitioning = PARTITION_NONE;
2549 2549
2550 // Adjust threshold according to partition size. 2550 // Adjust threshold according to partition size.
2551 stop_thresh >>= 8 - (b_width_log2_lookup[bsize] + 2551 stop_thresh >>= 8 - (b_width_log2(bsize) +
2552 b_height_log2_lookup[bsize]); 2552 b_height_log2(bsize));
2553 2553
2554 stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh); 2554 stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
2555 // If obtained distortion is very small, choose current partition 2555 // If obtained distortion is very small, choose current partition
2556 // and stop splitting. 2556 // and stop splitting.
2557 if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) { 2557 if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) {
2558 do_split = 0; 2558 do_split = 0;
2559 do_rect = 0; 2559 do_rect = 0;
2560 } 2560 }
2561 } 2561 }
2562 } 2562 }
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4; 3390 tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4;
3391 } 3391 }
3392 3392
3393 for (y = 0; y < mi_height; y++) 3393 for (y = 0; y < mi_height; y++)
3394 for (x = 0; x < mi_width; x++) 3394 for (x = 0; x < mi_width; x++)
3395 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows) 3395 if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows)
3396 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size; 3396 mi_8x8[mis * y + x]->mbmi.tx_size = tx_size;
3397 } 3397 }
3398 } 3398 }
3399 } 3399 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_denoiser.c ('k') | source/libvpx/vp9/encoder/vp9_encodemb.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698