| 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 <stdio.h> | 12 #include <stdio.h> |
| 13 #include <math.h> | 13 #include <math.h> |
| 14 #include <limits.h> | 14 #include <limits.h> |
| 15 #include <assert.h> | 15 #include <assert.h> |
| 16 #include "vpx_config.h" | 16 #include "vpx_config.h" |
| 17 #include "vp8_rtcd.h" | 17 #include "vp8_rtcd.h" |
| 18 #include "./vpx_dsp_rtcd.h" |
| 18 #include "tokenize.h" | 19 #include "tokenize.h" |
| 19 #include "treewriter.h" | 20 #include "treewriter.h" |
| 20 #include "onyx_int.h" | 21 #include "onyx_int.h" |
| 21 #include "modecosts.h" | 22 #include "modecosts.h" |
| 22 #include "encodeintra.h" | 23 #include "encodeintra.h" |
| 23 #include "pickinter.h" | 24 #include "pickinter.h" |
| 24 #include "vp8/common/entropymode.h" | 25 #include "vp8/common/entropymode.h" |
| 25 #include "vp8/common/reconinter.h" | 26 #include "vp8/common/reconinter.h" |
| 26 #include "vp8/common/reconintra4x4.h" | 27 #include "vp8/common/reconintra4x4.h" |
| 27 #include "vp8/common/findnearmv.h" | 28 #include "vp8/common/findnearmv.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 if ((mv_row | mv_col) & 7) | 501 if ((mv_row | mv_col) & 7) |
| 501 { | 502 { |
| 502 vp8_sub_pixel_variance8x8(uptr, pre_stride, | 503 vp8_sub_pixel_variance8x8(uptr, pre_stride, |
| 503 mv_col & 7, mv_row & 7, upred_ptr, uv_stride, &sse2); | 504 mv_col & 7, mv_row & 7, upred_ptr, uv_stride, &sse2); |
| 504 vp8_sub_pixel_variance8x8(vptr, pre_stride, | 505 vp8_sub_pixel_variance8x8(vptr, pre_stride, |
| 505 mv_col & 7, mv_row & 7, vpred_ptr, uv_stride, &sse1); | 506 mv_col & 7, mv_row & 7, vpred_ptr, uv_stride, &sse1); |
| 506 sse2 += sse1; | 507 sse2 += sse1; |
| 507 } | 508 } |
| 508 else | 509 else |
| 509 { | 510 { |
| 510 vp8_variance8x8(uptr, pre_stride, | 511 vpx_variance8x8(uptr, pre_stride, |
| 511 upred_ptr, uv_stride, &sse2); | 512 upred_ptr, uv_stride, &sse2); |
| 512 vp8_variance8x8(vptr, pre_stride, | 513 vpx_variance8x8(vptr, pre_stride, |
| 513 vpred_ptr, uv_stride, &sse1); | 514 vpred_ptr, uv_stride, &sse1); |
| 514 sse2 += sse1; | 515 sse2 += sse1; |
| 515 } | 516 } |
| 516 return sse2; | 517 return sse2; |
| 517 | 518 |
| 518 } | 519 } |
| 519 | 520 |
| 520 static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type, ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l) | 521 static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type, ENTROPY_CONTEXT *a,
ENTROPY_CONTEXT *l) |
| 521 { | 522 { |
| 522 int c = !type; /* start at coef 0, unless Y with Y2 */ | 523 int c = !type; /* start at coef 0, unless Y with Y2 */ |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 else if (x->encode_breakout) | 1777 else if (x->encode_breakout) |
| 1777 { | 1778 { |
| 1778 unsigned int sse; | 1779 unsigned int sse; |
| 1779 unsigned int var; | 1780 unsigned int var; |
| 1780 unsigned int threshold = (xd->block[0].dequant[1] | 1781 unsigned int threshold = (xd->block[0].dequant[1] |
| 1781 * xd->block[0].dequant[1] >>4); | 1782 * xd->block[0].dequant[1] >>4); |
| 1782 | 1783 |
| 1783 if(threshold < x->encode_breakout) | 1784 if(threshold < x->encode_breakout) |
| 1784 threshold = x->encode_breakout; | 1785 threshold = x->encode_breakout; |
| 1785 | 1786 |
| 1786 var = vp8_variance16x16 | 1787 var = vpx_variance16x16 |
| 1787 (*(b->base_src), b->src_stride, | 1788 (*(b->base_src), b->src_stride, |
| 1788 x->e_mbd.predictor, 16, &sse); | 1789 x->e_mbd.predictor, 16, &sse); |
| 1789 | 1790 |
| 1790 if (sse < threshold) | 1791 if (sse < threshold) |
| 1791 { | 1792 { |
| 1792 unsigned int q2dc = xd->block[24].dequant[0]; | 1793 unsigned int q2dc = xd->block[24].dequant[0]; |
| 1793 /* If theres is no codeable 2nd order dc | 1794 /* If theres is no codeable 2nd order dc |
| 1794 or a very small uniform pixel change change */ | 1795 or a very small uniform pixel change change */ |
| 1795 if ((sse - var < q2dc * q2dc >>4) || | 1796 if ((sse - var < q2dc * q2dc >>4) || |
| 1796 (sse /2 > var && sse-var < 64)) | 1797 (sse /2 > var && sse-var < 64)) |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 x->e_mbd.mode_info_context->mbmi.mode = B_PRED; | 2635 x->e_mbd.mode_info_context->mbmi.mode = B_PRED; |
| 2635 rate += rate4x4; | 2636 rate += rate4x4; |
| 2636 } | 2637 } |
| 2637 else | 2638 else |
| 2638 { | 2639 { |
| 2639 rate += rate16x16; | 2640 rate += rate16x16; |
| 2640 } | 2641 } |
| 2641 | 2642 |
| 2642 *rate_ = rate; | 2643 *rate_ = rate; |
| 2643 } | 2644 } |
| OLD | NEW |