Urvang Joshi | 1ac47a7 | 2017-12-07 12:12:50 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2017, Alliance for Open Media. All rights reserved |
| 3 | * |
| 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
| 10 | */ |
| 11 | |
| 12 | #include "./aom_dsp_rtcd.h" |
| 13 | #include "av1/common/av1_txfm.h" |
| 14 | |
| 15 | void av1_round_shift_array_c(int32_t *arr, int size, int bit) { |
| 16 | int i; |
| 17 | if (bit == 0) { |
| 18 | return; |
| 19 | } else { |
| 20 | if (bit > 0) { |
| 21 | for (i = 0; i < size; i++) { |
| 22 | arr[i] = round_shift(arr[i], bit); |
| 23 | } |
| 24 | } else { |
| 25 | for (i = 0; i < size; i++) { |
| 26 | arr[i] = arr[i] * (1 << (-bit)); |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | } |