OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 <stdio.h> | 12 #include <stdio.h> |
13 | 13 |
14 #include "./vpx_dsp_rtcd.h" | 14 #include "./vpx_dsp_rtcd.h" |
15 #include "vpx_dsp/mips/vpx_common_dspr2.h" | 15 #include "vpx_dsp/mips/convolve_common_dspr2.h" |
16 #include "vpx_dsp/vpx_convolve.h" | 16 #include "vpx_dsp/vpx_convolve.h" |
17 #include "vpx_dsp/vpx_dsp_common.h" | 17 #include "vpx_dsp/vpx_dsp_common.h" |
18 #include "vpx_ports/mem.h" | 18 #include "vpx_ports/mem.h" |
19 | 19 |
20 #if HAVE_DSPR2 | 20 #if HAVE_DSPR2 |
21 static void convolve_bi_vert_4_dspr2(const uint8_t *src, | 21 static void convolve_bi_vert_4_dspr2(const uint8_t *src, |
22 int32_t src_stride, | 22 int32_t src_stride, |
23 uint8_t *dst, | 23 uint8_t *dst, |
24 int32_t dst_stride, | 24 int32_t dst_stride, |
25 const int16_t *filter_y, | 25 const int16_t *filter_y, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 src += src_stride; | 211 src += src_stride; |
212 dst += dst_stride; | 212 dst += dst_stride; |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 void vpx_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, | 216 void vpx_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, |
217 uint8_t *dst, ptrdiff_t dst_stride, | 217 uint8_t *dst, ptrdiff_t dst_stride, |
218 const int16_t *filter_x, int x_step_q4, | 218 const int16_t *filter_x, int x_step_q4, |
219 const int16_t *filter_y, int y_step_q4, | 219 const int16_t *filter_y, int y_step_q4, |
220 int w, int h) { | 220 int w, int h) { |
221 if (16 == y_step_q4) { | 221 uint32_t pos = 38; |
222 uint32_t pos = 38; | |
223 | 222 |
224 /* bit positon for extract from acc */ | 223 assert(y_step_q4 == 16); |
225 __asm__ __volatile__ ( | |
226 "wrdsp %[pos], 1 \n\t" | |
227 : | |
228 : [pos] "r" (pos) | |
229 ); | |
230 | 224 |
231 prefetch_store(dst); | 225 /* bit positon for extract from acc */ |
| 226 __asm__ __volatile__ ( |
| 227 "wrdsp %[pos], 1 \n\t" |
| 228 : |
| 229 : [pos] "r" (pos) |
| 230 ); |
232 | 231 |
233 switch (w) { | 232 prefetch_store(dst); |
234 case 4 : | 233 |
235 case 8 : | 234 switch (w) { |
236 case 16 : | 235 case 4 : |
237 case 32 : | 236 case 8 : |
238 convolve_bi_vert_4_dspr2(src, src_stride, | 237 case 16 : |
239 dst, dst_stride, | 238 case 32 : |
240 filter_y, w, h); | 239 convolve_bi_vert_4_dspr2(src, src_stride, |
241 break; | 240 dst, dst_stride, |
242 case 64 : | 241 filter_y, w, h); |
243 prefetch_store(dst + 32); | 242 break; |
244 convolve_bi_vert_64_dspr2(src, src_stride, | 243 case 64 : |
245 dst, dst_stride, | 244 prefetch_store(dst + 32); |
246 filter_y, h); | 245 convolve_bi_vert_64_dspr2(src, src_stride, |
247 break; | 246 dst, dst_stride, |
248 default: | 247 filter_y, h); |
249 vpx_convolve8_vert_c(src, src_stride, | 248 break; |
250 dst, dst_stride, | 249 default: |
251 filter_x, x_step_q4, | 250 vpx_convolve8_vert_c(src, src_stride, |
252 filter_y, y_step_q4, | 251 dst, dst_stride, |
253 w, h); | 252 filter_x, x_step_q4, |
254 break; | 253 filter_y, y_step_q4, |
255 } | 254 w, h); |
256 } else { | 255 break; |
257 vpx_convolve8_vert_c(src, src_stride, | |
258 dst, dst_stride, | |
259 filter_x, x_step_q4, | |
260 filter_y, y_step_q4, | |
261 w, h); | |
262 } | 256 } |
263 } | 257 } |
264 #endif | 258 #endif |
OLD | NEW |