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 "vpx_config.h" | 12 #include "vpx_config.h" |
13 #include "./vpx_scale_rtcd.h" | 13 #include "./vpx_scale_rtcd.h" |
| 14 #include "./vp8_rtcd.h" |
14 #include "vp8/common/onyxc_int.h" | 15 #include "vp8/common/onyxc_int.h" |
15 #include "vp8/common/blockd.h" | 16 #include "vp8/common/blockd.h" |
16 #include "onyx_int.h" | 17 #include "onyx_int.h" |
17 #include "vp8/common/systemdependent.h" | 18 #include "vp8/common/systemdependent.h" |
18 #include "quantize.h" | 19 #include "quantize.h" |
19 #include "vp8/common/alloccommon.h" | 20 #include "vp8/common/alloccommon.h" |
20 #include "mcomp.h" | 21 #include "mcomp.h" |
21 #include "firstpass.h" | 22 #include "firstpass.h" |
22 #include "vpx/internal/vpx_psnr.h" | 23 #include "vpx/internal/vpx_psnr.h" |
23 #include "vpx_scale/vpx_scale.h" | 24 #include "vpx_scale/vpx_scale.h" |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 // If the number of temporal layers are changed we must start at the | 1754 // If the number of temporal layers are changed we must start at the |
1754 // base of the pattern cycle, so set the layer id to 0 and reset | 1755 // base of the pattern cycle, so set the layer id to 0 and reset |
1755 // the temporal pattern counter. | 1756 // the temporal pattern counter. |
1756 if (cpi->temporal_layer_id > 0) { | 1757 if (cpi->temporal_layer_id > 0) { |
1757 cpi->temporal_layer_id = 0; | 1758 cpi->temporal_layer_id = 0; |
1758 } | 1759 } |
1759 cpi->temporal_pattern_counter = 0; | 1760 cpi->temporal_pattern_counter = 0; |
1760 reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers); | 1761 reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers); |
1761 } | 1762 } |
1762 | 1763 |
| 1764 if (!cpi->initial_width) |
| 1765 { |
| 1766 cpi->initial_width = cpi->oxcf.Width; |
| 1767 cpi->initial_height = cpi->oxcf.Height; |
| 1768 } |
| 1769 |
1763 cm->Width = cpi->oxcf.Width; | 1770 cm->Width = cpi->oxcf.Width; |
1764 cm->Height = cpi->oxcf.Height; | 1771 cm->Height = cpi->oxcf.Height; |
| 1772 assert(cm->Width <= cpi->initial_width); |
| 1773 assert(cm->Height <= cpi->initial_height); |
1765 | 1774 |
1766 /* TODO(jkoleszar): if an internal spatial resampling is active, | 1775 /* TODO(jkoleszar): if an internal spatial resampling is active, |
1767 * and we downsize the input image, maybe we should clear the | 1776 * and we downsize the input image, maybe we should clear the |
1768 * internal scale immediately rather than waiting for it to | 1777 * internal scale immediately rather than waiting for it to |
1769 * correct. | 1778 * correct. |
1770 */ | 1779 */ |
1771 | 1780 |
1772 /* VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs) */ | 1781 /* VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs) */ |
1773 if (cpi->oxcf.Sharpness > 7) | 1782 if (cpi->oxcf.Sharpness > 7) |
1774 cpi->oxcf.Sharpness = 7; | 1783 cpi->oxcf.Sharpness = 7; |
(...skipping 4204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5979 } | 5988 } |
5980 | 5989 |
5981 return Total; | 5990 return Total; |
5982 } | 5991 } |
5983 | 5992 |
5984 | 5993 |
5985 int vp8_get_quantizer(VP8_COMP *cpi) | 5994 int vp8_get_quantizer(VP8_COMP *cpi) |
5986 { | 5995 { |
5987 return cpi->common.base_qindex; | 5996 return cpi->common.base_qindex; |
5988 } | 5997 } |
OLD | NEW |