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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 while (++i < BLOCK_TYPES); | 973 while (++i < BLOCK_TYPES); |
974 return savings; | 974 return savings; |
975 } | 975 } |
976 | 976 |
977 void vp8_calc_ref_frame_costs(int *ref_frame_cost, | 977 void vp8_calc_ref_frame_costs(int *ref_frame_cost, |
978 int prob_intra, | 978 int prob_intra, |
979 int prob_last, | 979 int prob_last, |
980 int prob_garf | 980 int prob_garf |
981 ) | 981 ) |
982 { | 982 { |
| 983 assert(prob_intra >= 0); |
| 984 assert(prob_intra <= 255); |
| 985 assert(prob_last >= 0); |
| 986 assert(prob_last <= 255); |
| 987 assert(prob_garf >= 0); |
| 988 assert(prob_garf <= 255); |
983 ref_frame_cost[INTRA_FRAME] = vp8_cost_zero(prob_intra); | 989 ref_frame_cost[INTRA_FRAME] = vp8_cost_zero(prob_intra); |
984 ref_frame_cost[LAST_FRAME] = vp8_cost_one(prob_intra) | 990 ref_frame_cost[LAST_FRAME] = vp8_cost_one(prob_intra) |
985 + vp8_cost_zero(prob_last); | 991 + vp8_cost_zero(prob_last); |
986 ref_frame_cost[GOLDEN_FRAME] = vp8_cost_one(prob_intra) | 992 ref_frame_cost[GOLDEN_FRAME] = vp8_cost_one(prob_intra) |
987 + vp8_cost_one(prob_last) | 993 + vp8_cost_one(prob_last) |
988 + vp8_cost_zero(prob_garf); | 994 + vp8_cost_zero(prob_garf); |
989 ref_frame_cost[ALTREF_FRAME] = vp8_cost_one(prob_intra) | 995 ref_frame_cost[ALTREF_FRAME] = vp8_cost_one(prob_intra) |
990 + vp8_cost_one(prob_last) | 996 + vp8_cost_one(prob_last) |
991 + vp8_cost_one(prob_garf); | 997 + vp8_cost_one(prob_garf); |
992 | 998 |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 fprintf(f, " },\n"); | 1729 fprintf(f, " },\n"); |
1724 } | 1730 } |
1725 | 1731 |
1726 fprintf(f, " },\n"); | 1732 fprintf(f, " },\n"); |
1727 } | 1733 } |
1728 | 1734 |
1729 fprintf(f, "};\n"); | 1735 fprintf(f, "};\n"); |
1730 fclose(f); | 1736 fclose(f); |
1731 } | 1737 } |
1732 #endif | 1738 #endif |
OLD | NEW |