| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include <assert.h> | 11 #include <assert.h> |
| 12 #include <limits.h> | 12 #include <limits.h> |
| 13 #include <math.h> | 13 #include <math.h> |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <stdlib.h> | 15 #include <stdlib.h> |
| 16 #include <string.h> | 16 #include <string.h> |
| 17 |
| 17 #include "vp9/common/vp9_common.h" | 18 #include "vp9/common/vp9_common.h" |
| 18 #include "vp9/encoder/vp9_resize.h" | 19 #include "vp9/encoder/vp9_resize.h" |
| 19 | 20 |
| 20 #define FILTER_BITS 7 | 21 #define FILTER_BITS 7 |
| 21 | 22 |
| 22 #define INTERP_TAPS 8 | 23 #define INTERP_TAPS 8 |
| 23 #define SUBPEL_BITS 5 | 24 #define SUBPEL_BITS 5 |
| 24 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) | 25 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) |
| 25 #define INTERP_PRECISION_BITS 32 | 26 #define INTERP_PRECISION_BITS 32 |
| 26 | 27 |
| 27 #define ROUND_POWER_OF_TWO(value, n) \ | |
| 28 (((value) + (1 << ((n) - 1))) >> (n)) | |
| 29 | |
| 30 typedef int16_t interp_kernel[INTERP_TAPS]; | 28 typedef int16_t interp_kernel[INTERP_TAPS]; |
| 31 | 29 |
| 32 // Filters for interpolation (0.5-band) - note this also filters integer pels. | 30 // Filters for interpolation (0.5-band) - note this also filters integer pels. |
| 33 const interp_kernel vp9_filteredinterp_filters500[(1 << SUBPEL_BITS)] = { | 31 const interp_kernel vp9_filteredinterp_filters500[(1 << SUBPEL_BITS)] = { |
| 34 {-3, 0, 35, 64, 35, 0, -3, 0}, | 32 {-3, 0, 35, 64, 35, 0, -3, 0}, |
| 35 {-3, -1, 34, 64, 36, 1, -3, 0}, | 33 {-3, -1, 34, 64, 36, 1, -3, 0}, |
| 36 {-3, -1, 32, 64, 38, 1, -3, 0}, | 34 {-3, -1, 32, 64, 38, 1, -3, 0}, |
| 37 {-2, -2, 31, 63, 39, 2, -3, 0}, | 35 {-2, -2, 31, 63, 39, 2, -3, 0}, |
| 38 {-2, -2, 29, 63, 41, 2, -3, 0}, | 36 {-2, -2, 29, 63, 41, 2, -3, 0}, |
| 39 {-2, -2, 28, 63, 42, 3, -4, 0}, | 37 {-2, -2, 28, 63, 42, 3, -4, 0}, |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 uint8_t *oy, int oy_stride, | 567 uint8_t *oy, int oy_stride, |
| 570 uint8_t *ou, uint8_t *ov, int ouv_stride, | 568 uint8_t *ou, uint8_t *ov, int ouv_stride, |
| 571 int oheight, int owidth) { | 569 int oheight, int owidth) { |
| 572 vp9_resize_plane(y, height, width, y_stride, | 570 vp9_resize_plane(y, height, width, y_stride, |
| 573 oy, oheight, owidth, oy_stride); | 571 oy, oheight, owidth, oy_stride); |
| 574 vp9_resize_plane(u, height, width, uv_stride, | 572 vp9_resize_plane(u, height, width, uv_stride, |
| 575 ou, oheight, owidth, ouv_stride); | 573 ou, oheight, owidth, ouv_stride); |
| 576 vp9_resize_plane(v, height, width, uv_stride, | 574 vp9_resize_plane(v, height, width, uv_stride, |
| 577 ov, oheight, owidth, ouv_stride); | 575 ov, oheight, owidth, ouv_stride); |
| 578 } | 576 } |
| OLD | NEW |