idct_blk_mmi.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2017 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 "./vp8_rtcd.h"
  11. #include "vpx_mem/vpx_mem.h"
  12. void vp8_dequant_idct_add_y_block_mmi(int16_t *q, int16_t *dq, uint8_t *dst,
  13. int stride, char *eobs) {
  14. int i, j;
  15. for (i = 0; i < 4; i++) {
  16. for (j = 0; j < 4; j++) {
  17. if (*eobs++ > 1) {
  18. vp8_dequant_idct_add_mmi(q, dq, dst, stride);
  19. } else {
  20. vp8_dc_only_idct_add_mmi(q[0] * dq[0], dst, stride, dst, stride);
  21. memset(q, 0, 2 * sizeof(q[0]));
  22. }
  23. q += 16;
  24. dst += 4;
  25. }
  26. dst += 4 * stride - 16;
  27. }
  28. }
  29. void vp8_dequant_idct_add_uv_block_mmi(int16_t *q, int16_t *dq, uint8_t *dst_u,
  30. uint8_t *dst_v, int stride, char *eobs) {
  31. int i, j;
  32. for (i = 0; i < 2; i++) {
  33. for (j = 0; j < 2; j++) {
  34. if (*eobs++ > 1) {
  35. vp8_dequant_idct_add_mmi(q, dq, dst_u, stride);
  36. } else {
  37. vp8_dc_only_idct_add_mmi(q[0] * dq[0], dst_u, stride, dst_u, stride);
  38. memset(q, 0, 2 * sizeof(q[0]));
  39. }
  40. q += 16;
  41. dst_u += 4;
  42. }
  43. dst_u += 4 * stride - 8;
  44. }
  45. for (i = 0; i < 2; i++) {
  46. for (j = 0; j < 2; j++) {
  47. if (*eobs++ > 1) {
  48. vp8_dequant_idct_add_mmi(q, dq, dst_v, stride);
  49. } else {
  50. vp8_dc_only_idct_add_mmi(q[0] * dq[0], dst_v, stride, dst_v, stride);
  51. memset(q, 0, 2 * sizeof(q[0]));
  52. }
  53. q += 16;
  54. dst_v += 4;
  55. }
  56. dst_v += 4 * stride - 8;
  57. }
  58. }