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_avg_vert_4_dspr2(const uint8_t *src, | 21 static void convolve_bi_avg_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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 src += src_stride; | 226 src += src_stride; |
227 dst += dst_stride; | 227 dst += dst_stride; |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 void vpx_convolve2_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, | 231 void vpx_convolve2_avg_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, |
232 uint8_t *dst, ptrdiff_t dst_stride, | 232 uint8_t *dst, ptrdiff_t dst_stride, |
233 const int16_t *filter_x, int x_step_q4, | 233 const int16_t *filter_x, int x_step_q4, |
234 const int16_t *filter_y, int y_step_q4, | 234 const int16_t *filter_y, int y_step_q4, |
235 int w, int h) { | 235 int w, int h) { |
236 if (16 == y_step_q4) { | 236 uint32_t pos = 38; |
237 uint32_t pos = 38; | |
238 | 237 |
239 /* bit positon for extract from acc */ | 238 assert(y_step_q4 == 16); |
240 __asm__ __volatile__ ( | |
241 "wrdsp %[pos], 1 \n\t" | |
242 : | |
243 : [pos] "r" (pos) | |
244 ); | |
245 | 239 |
246 prefetch_store(dst); | 240 /* bit positon for extract from acc */ |
| 241 __asm__ __volatile__ ( |
| 242 "wrdsp %[pos], 1 \n\t" |
| 243 : |
| 244 : [pos] "r" (pos) |
| 245 ); |
247 | 246 |
248 switch (w) { | 247 prefetch_store(dst); |
249 case 4: | 248 |
250 case 8: | 249 switch (w) { |
251 case 16: | 250 case 4: |
252 case 32: | 251 case 8: |
253 convolve_bi_avg_vert_4_dspr2(src, src_stride, | 252 case 16: |
254 dst, dst_stride, | 253 case 32: |
255 filter_y, w, h); | 254 convolve_bi_avg_vert_4_dspr2(src, src_stride, |
256 break; | 255 dst, dst_stride, |
257 case 64: | 256 filter_y, w, h); |
258 prefetch_store(dst + 32); | 257 break; |
259 convolve_bi_avg_vert_64_dspr2(src, src_stride, | 258 case 64: |
260 dst, dst_stride, | 259 prefetch_store(dst + 32); |
261 filter_y, h); | 260 convolve_bi_avg_vert_64_dspr2(src, src_stride, |
262 break; | 261 dst, dst_stride, |
263 default: | 262 filter_y, h); |
264 vpx_convolve8_avg_vert_c(src, src_stride, | 263 break; |
265 dst, dst_stride, | 264 default: |
266 filter_x, x_step_q4, | 265 vpx_convolve8_avg_vert_c(src, src_stride, |
267 filter_y, y_step_q4, | 266 dst, dst_stride, |
268 w, h); | 267 filter_x, x_step_q4, |
269 break; | 268 filter_y, y_step_q4, |
270 } | 269 w, h); |
271 } else { | 270 break; |
272 vpx_convolve8_avg_vert_c(src, src_stride, | |
273 dst, dst_stride, | |
274 filter_x, x_step_q4, | |
275 filter_y, y_step_q4, | |
276 w, h); | |
277 } | 271 } |
278 } | 272 } |
279 #endif | 273 #endif |
OLD | NEW |