idct_blk.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2010 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. #include "vpx_mem/vpx_mem.h"
  13. void vp8_dequant_idct_add_c(short *input, short *dq,
  14. unsigned char *dest, int stride);
  15. void vp8_dc_only_idct_add_c(short input_dc, unsigned char * pred,
  16. int pred_stride, unsigned char *dst_ptr,
  17. int dst_stride);
  18. void vp8_dequant_idct_add_y_block_c
  19. (short *q, short *dq,
  20. unsigned char *dst, int stride, char *eobs)
  21. {
  22. int i, j;
  23. for (i = 0; i < 4; i++)
  24. {
  25. for (j = 0; j < 4; j++)
  26. {
  27. if (*eobs++ > 1)
  28. vp8_dequant_idct_add_c (q, dq, dst, stride);
  29. else
  30. {
  31. vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride);
  32. memset(q, 0, 2 * sizeof(q[0]));
  33. }
  34. q += 16;
  35. dst += 4;
  36. }
  37. dst += 4*stride - 16;
  38. }
  39. }
  40. void vp8_dequant_idct_add_uv_block_c
  41. (short *q, short *dq,
  42. unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
  43. {
  44. int i, j;
  45. for (i = 0; i < 2; i++)
  46. {
  47. for (j = 0; j < 2; j++)
  48. {
  49. if (*eobs++ > 1)
  50. vp8_dequant_idct_add_c (q, dq, dstu, stride);
  51. else
  52. {
  53. vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride);
  54. memset(q, 0, 2 * sizeof(q[0]));
  55. }
  56. q += 16;
  57. dstu += 4;
  58. }
  59. dstu += 4*stride - 8;
  60. }
  61. for (i = 0; i < 2; i++)
  62. {
  63. for (j = 0; j < 2; j++)
  64. {
  65. if (*eobs++ > 1)
  66. vp8_dequant_idct_add_c (q, dq, dstv, stride);
  67. else
  68. {
  69. vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride);
  70. memset(q, 0, 2 * sizeof(q[0]));
  71. }
  72. q += 16;
  73. dstv += 4;
  74. }
  75. dstv += 4*stride - 8;
  76. }
  77. }