| 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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 static int vp9_sb_block_error_c(int16_t *coeff, int16_t *dqcoeff, | 840 static int vp9_sb_block_error_c(int16_t *coeff, int16_t *dqcoeff, |
| 841 int block_size) { | 841 int block_size) { |
| 842 int i; | 842 int i; |
| 843 int64_t error = 0; | 843 int64_t error = 0; |
| 844 | 844 |
| 845 for (i = 0; i < block_size; i++) { | 845 for (i = 0; i < block_size; i++) { |
| 846 unsigned int this_diff = coeff[i] - dqcoeff[i]; | 846 unsigned int this_diff = coeff[i] - dqcoeff[i]; |
| 847 error += this_diff * this_diff; | 847 error += this_diff * this_diff; |
| 848 } | 848 } |
| 849 | 849 |
| 850 return error > INT_MAX ? INT_MAX : error; | 850 return error > INT_MAX ? INT_MAX : (int)error; |
| 851 } | 851 } |
| 852 | 852 |
| 853 #define DEBUG_ERROR 0 | 853 #define DEBUG_ERROR 0 |
| 854 static void super_block_yrd_32x32(MACROBLOCK *x, | 854 static void super_block_yrd_32x32(MACROBLOCK *x, |
| 855 int *rate, int *distortion, int *skippable, | 855 int *rate, int *distortion, int *skippable, |
| 856 int backup) { | 856 int backup) { |
| 857 SUPERBLOCK * const x_sb = &x->sb_coeff_data; | 857 SUPERBLOCK * const x_sb = &x->sb_coeff_data; |
| 858 MACROBLOCKD * const xd = &x->e_mbd; | 858 MACROBLOCKD * const xd = &x->e_mbd; |
| 859 SUPERBLOCKD * const xd_sb = &xd->sb_coeff_data; | 859 SUPERBLOCKD * const xd_sb = &xd->sb_coeff_data; |
| 860 #if DEBUG_ERROR || CONFIG_DWTDCTHYBRID | 860 #if DEBUG_ERROR || CONFIG_DWTDCTHYBRID |
| (...skipping 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3116 ctx->skip = x->skip; | 3116 ctx->skip = x->skip; |
| 3117 ctx->best_mode_index = mode_index; | 3117 ctx->best_mode_index = mode_index; |
| 3118 vpx_memcpy(&ctx->mic, xd->mode_info_context, | 3118 vpx_memcpy(&ctx->mic, xd->mode_info_context, |
| 3119 sizeof(MODE_INFO)); | 3119 sizeof(MODE_INFO)); |
| 3120 if (partition) | 3120 if (partition) |
| 3121 vpx_memcpy(&ctx->partition_info, partition, | 3121 vpx_memcpy(&ctx->partition_info, partition, |
| 3122 sizeof(PARTITION_INFO)); | 3122 sizeof(PARTITION_INFO)); |
| 3123 ctx->best_ref_mv.as_int = ref_mv->as_int; | 3123 ctx->best_ref_mv.as_int = ref_mv->as_int; |
| 3124 ctx->second_best_ref_mv.as_int = second_ref_mv->as_int; | 3124 ctx->second_best_ref_mv.as_int = second_ref_mv->as_int; |
| 3125 | 3125 |
| 3126 ctx->single_pred_diff = comp_pred_diff[SINGLE_PREDICTION_ONLY]; | 3126 ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_PREDICTION_ONLY]; |
| 3127 ctx->comp_pred_diff = comp_pred_diff[COMP_PREDICTION_ONLY]; | 3127 ctx->comp_pred_diff = (int)comp_pred_diff[COMP_PREDICTION_ONLY]; |
| 3128 ctx->hybrid_pred_diff = comp_pred_diff[HYBRID_PREDICTION]; | 3128 ctx->hybrid_pred_diff = (int)comp_pred_diff[HYBRID_PREDICTION]; |
| 3129 | 3129 |
| 3130 memcpy(ctx->txfm_rd_diff, txfm_size_diff, sizeof(ctx->txfm_rd_diff)); | 3130 memcpy(ctx->txfm_rd_diff, txfm_size_diff, sizeof(ctx->txfm_rd_diff)); |
| 3131 } | 3131 } |
| 3132 | 3132 |
| 3133 static void inter_mode_cost(VP9_COMP *cpi, MACROBLOCK *x, | 3133 static void inter_mode_cost(VP9_COMP *cpi, MACROBLOCK *x, |
| 3134 int *rate2, int *distortion2, int *rate_y, | 3134 int *rate2, int *distortion2, int *rate_y, |
| 3135 int *distortion, int* rate_uv, int *distortion_uv, | 3135 int *distortion, int* rate_uv, int *distortion_uv, |
| 3136 int *skippable, int64_t txfm_cache[NB_TXFM_MODES]) { | 3136 int *skippable, int64_t txfm_cache[NB_TXFM_MODES]) { |
| 3137 int y_skippable, uv_skippable; | 3137 int y_skippable, uv_skippable; |
| 3138 | 3138 |
| (...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 // to simplify development | 5061 // to simplify development |
| 5062 // vp9_pick_inter_mode | 5062 // vp9_pick_inter_mode |
| 5063 | 5063 |
| 5064 // Store metrics so they can be added in to totals if this mode is picked | 5064 // Store metrics so they can be added in to totals if this mode is picked |
| 5065 x->mb_context[xd->sb_index][xd->mb_index].distortion = distortion; | 5065 x->mb_context[xd->sb_index][xd->mb_index].distortion = distortion; |
| 5066 x->mb_context[xd->sb_index][xd->mb_index].intra_error = intra_error; | 5066 x->mb_context[xd->sb_index][xd->mb_index].intra_error = intra_error; |
| 5067 | 5067 |
| 5068 *totalrate = rate; | 5068 *totalrate = rate; |
| 5069 *totaldist = distortion; | 5069 *totaldist = distortion; |
| 5070 } | 5070 } |
| OLD | NEW |