idct_blk_dspr2.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
  3. *
  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
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "vpx_config.h"
  11. #include "vp8_rtcd.h"
  12. #if HAVE_DSPR2
  13. void vp8_dequant_idct_add_y_block_dspr2(short *q, short *dq, unsigned char *dst,
  14. int stride, char *eobs) {
  15. int i, j;
  16. for (i = 0; i < 4; ++i) {
  17. for (j = 0; j < 4; ++j) {
  18. if (*eobs++ > 1)
  19. vp8_dequant_idct_add_dspr2(q, dq, dst, stride);
  20. else {
  21. vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst, stride, dst, stride);
  22. ((int *)q)[0] = 0;
  23. }
  24. q += 16;
  25. dst += 4;
  26. }
  27. dst += 4 * stride - 16;
  28. }
  29. }
  30. void vp8_dequant_idct_add_uv_block_dspr2(short *q, short *dq,
  31. unsigned char *dst_u,
  32. unsigned char *dst_v, int stride,
  33. char *eobs) {
  34. int i, j;
  35. for (i = 0; i < 2; ++i) {
  36. for (j = 0; j < 2; ++j) {
  37. if (*eobs++ > 1)
  38. vp8_dequant_idct_add_dspr2(q, dq, dst_u, stride);
  39. else {
  40. vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst_u, stride, dst_u, stride);
  41. ((int *)q)[0] = 0;
  42. }
  43. q += 16;
  44. dst_u += 4;
  45. }
  46. dst_u += 4 * stride - 8;
  47. }
  48. for (i = 0; i < 2; ++i) {
  49. for (j = 0; j < 2; ++j) {
  50. if (*eobs++ > 1)
  51. vp8_dequant_idct_add_dspr2(q, dq, dst_v, stride);
  52. else {
  53. vp8_dc_only_idct_add_dspr2(q[0] * dq[0], dst_v, stride, dst_v, stride);
  54. ((int *)q)[0] = 0;
  55. }
  56. q += 16;
  57. dst_v += 4;
  58. }
  59. dst_v += 4 * stride - 8;
  60. }
  61. }
  62. #endif