| 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 |
| 18 #include "vpx_ports/mem.h" |
| 18 #include "vp9/common/vp9_common.h" | 19 #include "vp9/common/vp9_common.h" |
| 19 #include "vp9/encoder/vp9_resize.h" | 20 #include "vp9/encoder/vp9_resize.h" |
| 20 | 21 |
| 21 #define FILTER_BITS 7 | 22 #define FILTER_BITS 7 |
| 22 | 23 |
| 23 #define INTERP_TAPS 8 | 24 #define INTERP_TAPS 8 |
| 24 #define SUBPEL_BITS 5 | 25 #define SUBPEL_BITS 5 |
| 25 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) | 26 #define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1) |
| 26 #define INTERP_PRECISION_BITS 32 | 27 #define INTERP_PRECISION_BITS 32 |
| 27 | 28 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 421 } |
| 421 } | 422 } |
| 422 | 423 |
| 423 static int get_down2_length(int length, int steps) { | 424 static int get_down2_length(int length, int steps) { |
| 424 int s; | 425 int s; |
| 425 for (s = 0; s < steps; ++s) | 426 for (s = 0; s < steps; ++s) |
| 426 length = (length + 1) >> 1; | 427 length = (length + 1) >> 1; |
| 427 return length; | 428 return length; |
| 428 } | 429 } |
| 429 | 430 |
| 430 int get_down2_steps(int in_length, int out_length) { | 431 static int get_down2_steps(int in_length, int out_length) { |
| 431 int steps = 0; | 432 int steps = 0; |
| 432 int proj_in_length; | 433 int proj_in_length; |
| 433 while ((proj_in_length = get_down2_length(in_length, 1)) >= out_length) { | 434 while ((proj_in_length = get_down2_length(in_length, 1)) >= out_length) { |
| 434 ++steps; | 435 ++steps; |
| 435 in_length = proj_in_length; | 436 in_length = proj_in_length; |
| 436 } | 437 } |
| 437 return steps; | 438 return steps; |
| 438 } | 439 } |
| 439 | 440 |
| 440 static void resize_multistep(const uint8_t *const input, | 441 static void resize_multistep(const uint8_t *const input, |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 uint8_t *ou, uint8_t *ov, int ouv_stride, | 916 uint8_t *ou, uint8_t *ov, int ouv_stride, |
| 916 int oheight, int owidth, int bd) { | 917 int oheight, int owidth, int bd) { |
| 917 vp9_highbd_resize_plane(y, height, width, y_stride, | 918 vp9_highbd_resize_plane(y, height, width, y_stride, |
| 918 oy, oheight, owidth, oy_stride, bd); | 919 oy, oheight, owidth, oy_stride, bd); |
| 919 vp9_highbd_resize_plane(u, height, width, uv_stride, | 920 vp9_highbd_resize_plane(u, height, width, uv_stride, |
| 920 ou, oheight, owidth, ouv_stride, bd); | 921 ou, oheight, owidth, ouv_stride, bd); |
| 921 vp9_highbd_resize_plane(v, height, width, uv_stride, | 922 vp9_highbd_resize_plane(v, height, width, uv_stride, |
| 922 ov, oheight, owidth, ouv_stride, bd); | 923 ov, oheight, owidth, ouv_stride, bd); |
| 923 } | 924 } |
| 924 #endif // CONFIG_VP9_HIGHBITDEPTH | 925 #endif // CONFIG_VP9_HIGHBITDEPTH |
| OLD | NEW |