2
0

idct_blk_sse2.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. void vp8_idct_dequant_0_2x_sse2(short *q, short *dq, unsigned char *dst,
  13. int dst_stride);
  14. void vp8_idct_dequant_full_2x_sse2(short *q, short *dq, unsigned char *dst,
  15. int dst_stride);
  16. void vp8_dequant_idct_add_y_block_sse2(short *q, short *dq, unsigned char *dst,
  17. int stride, char *eobs) {
  18. int i;
  19. for (i = 0; i < 4; ++i) {
  20. if (((short *)(eobs))[0]) {
  21. if (((short *)(eobs))[0] & 0xfefe) {
  22. vp8_idct_dequant_full_2x_sse2(q, dq, dst, stride);
  23. } else {
  24. vp8_idct_dequant_0_2x_sse2(q, dq, dst, stride);
  25. }
  26. }
  27. if (((short *)(eobs))[1]) {
  28. if (((short *)(eobs))[1] & 0xfefe) {
  29. vp8_idct_dequant_full_2x_sse2(q + 32, dq, dst + 8, stride);
  30. } else {
  31. vp8_idct_dequant_0_2x_sse2(q + 32, dq, dst + 8, stride);
  32. }
  33. }
  34. q += 64;
  35. dst += stride * 4;
  36. eobs += 4;
  37. }
  38. }
  39. void vp8_dequant_idct_add_uv_block_sse2(short *q, short *dq,
  40. unsigned char *dst_u,
  41. unsigned char *dst_v, int stride,
  42. char *eobs) {
  43. if (((short *)(eobs))[0]) {
  44. if (((short *)(eobs))[0] & 0xfefe) {
  45. vp8_idct_dequant_full_2x_sse2(q, dq, dst_u, stride);
  46. } else {
  47. vp8_idct_dequant_0_2x_sse2(q, dq, dst_u, stride);
  48. }
  49. }
  50. q += 32;
  51. dst_u += stride * 4;
  52. if (((short *)(eobs))[1]) {
  53. if (((short *)(eobs))[1] & 0xfefe) {
  54. vp8_idct_dequant_full_2x_sse2(q, dq, dst_u, stride);
  55. } else {
  56. vp8_idct_dequant_0_2x_sse2(q, dq, dst_u, stride);
  57. }
  58. }
  59. q += 32;
  60. if (((short *)(eobs))[2]) {
  61. if (((short *)(eobs))[2] & 0xfefe) {
  62. vp8_idct_dequant_full_2x_sse2(q, dq, dst_v, stride);
  63. } else {
  64. vp8_idct_dequant_0_2x_sse2(q, dq, dst_v, stride);
  65. }
  66. }
  67. q += 32;
  68. dst_v += stride * 4;
  69. if (((short *)(eobs))[3]) {
  70. if (((short *)(eobs))[3] & 0xfefe) {
  71. vp8_idct_dequant_full_2x_sse2(q, dq, dst_v, stride);
  72. } else {
  73. vp8_idct_dequant_0_2x_sse2(q, dq, dst_v, stride);
  74. }
  75. }
  76. }