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_dsp_common.h" | 16 #include "vpx_dsp/vpx_dsp_common.h" |
17 #include "vpx_dsp/vpx_filter.h" | 17 #include "vpx_dsp/vpx_filter.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_vert_4_dspr2(const uint8_t *src, | 21 static void convolve_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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 src += src_stride; | 326 src += src_stride; |
327 dst += dst_stride; | 327 dst += dst_stride; |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 void vpx_convolve8_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, | 331 void vpx_convolve8_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride, |
332 uint8_t *dst, ptrdiff_t dst_stride, | 332 uint8_t *dst, ptrdiff_t dst_stride, |
333 const int16_t *filter_x, int x_step_q4, | 333 const int16_t *filter_x, int x_step_q4, |
334 const int16_t *filter_y, int y_step_q4, | 334 const int16_t *filter_y, int y_step_q4, |
335 int w, int h) { | 335 int w, int h) { |
336 if (((const int32_t *)filter_y)[1] == 0x800000) { | 336 assert(y_step_q4 == 16); |
337 vpx_convolve_copy(src, src_stride, | 337 assert(((const int32_t *)filter_y)[1] != 0x800000); |
338 dst, dst_stride, | 338 |
339 filter_x, x_step_q4, | 339 if (((const int32_t *)filter_y)[0] == 0) { |
340 filter_y, y_step_q4, | |
341 w, h); | |
342 } else if (((const int32_t *)filter_y)[0] == 0) { | |
343 vpx_convolve2_vert_dspr2(src, src_stride, | 340 vpx_convolve2_vert_dspr2(src, src_stride, |
344 dst, dst_stride, | 341 dst, dst_stride, |
345 filter_x, x_step_q4, | 342 filter_x, x_step_q4, |
346 filter_y, y_step_q4, | 343 filter_y, y_step_q4, |
347 w, h); | 344 w, h); |
348 } else { | 345 } else { |
349 if (16 == y_step_q4) { | 346 uint32_t pos = 38; |
350 uint32_t pos = 38; | |
351 | 347 |
352 /* bit positon for extract from acc */ | 348 /* bit positon for extract from acc */ |
353 __asm__ __volatile__ ( | 349 __asm__ __volatile__ ( |
354 "wrdsp %[pos], 1 \n\t" | 350 "wrdsp %[pos], 1 \n\t" |
355 : | 351 : |
356 : [pos] "r" (pos) | 352 : [pos] "r" (pos) |
357 ); | 353 ); |
358 | 354 |
359 prefetch_store(dst); | 355 prefetch_store(dst); |
360 | 356 |
361 switch (w) { | 357 switch (w) { |
362 case 4 : | 358 case 4 : |
363 case 8 : | 359 case 8 : |
364 case 16 : | 360 case 16 : |
365 case 32 : | 361 case 32 : |
366 convolve_vert_4_dspr2(src, src_stride, | 362 convolve_vert_4_dspr2(src, src_stride, |
367 dst, dst_stride, | 363 dst, dst_stride, |
368 filter_y, w, h); | 364 filter_y, w, h); |
369 break; | 365 break; |
370 case 64 : | 366 case 64 : |
371 prefetch_store(dst + 32); | 367 prefetch_store(dst + 32); |
372 convolve_vert_64_dspr2(src, src_stride, | 368 convolve_vert_64_dspr2(src, src_stride, |
373 dst, dst_stride, | |
374 filter_y, h); | |
375 break; | |
376 default: | |
377 vpx_convolve8_vert_c(src, src_stride, | |
378 dst, dst_stride, | 369 dst, dst_stride, |
379 filter_x, x_step_q4, | 370 filter_y, h); |
380 filter_y, y_step_q4, | 371 break; |
381 w, h); | 372 default: |
382 break; | 373 vpx_convolve8_vert_c(src, src_stride, |
383 } | 374 dst, dst_stride, |
384 } else { | 375 filter_x, x_step_q4, |
385 vpx_convolve8_vert_c(src, src_stride, | 376 filter_y, y_step_q4, |
386 dst, dst_stride, | 377 w, h); |
387 filter_x, x_step_q4, | 378 break; |
388 filter_y, y_step_q4, | |
389 w, h); | |
390 } | 379 } |
391 } | 380 } |
392 } | 381 } |
393 | 382 |
394 #endif | 383 #endif |
OLD | NEW |