invtrans.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. #ifndef VPX_VP8_COMMON_INVTRANS_H_
  11. #define VPX_VP8_COMMON_INVTRANS_H_
  12. #include "./vpx_config.h"
  13. #include "vp8_rtcd.h"
  14. #include "blockd.h"
  15. #include "onyxc_int.h"
  16. #if CONFIG_MULTITHREAD
  17. #include "vpx_mem/vpx_mem.h"
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. static void eob_adjust(char *eobs, short *diff) {
  23. /* eob adjust.... the idct can only skip if both the dc and eob are zero */
  24. int js;
  25. for (js = 0; js < 16; ++js) {
  26. if ((eobs[js] == 0) && (diff[0] != 0)) eobs[js]++;
  27. diff += 16;
  28. }
  29. }
  30. static INLINE void vp8_inverse_transform_mby(MACROBLOCKD *xd) {
  31. short *DQC = xd->dequant_y1;
  32. if (xd->mode_info_context->mbmi.mode != SPLITMV) {
  33. /* do 2nd order transform on the dc block */
  34. if (xd->eobs[24] > 1) {
  35. vp8_short_inv_walsh4x4(&xd->block[24].dqcoeff[0], xd->qcoeff);
  36. } else {
  37. vp8_short_inv_walsh4x4_1(&xd->block[24].dqcoeff[0], xd->qcoeff);
  38. }
  39. eob_adjust(xd->eobs, xd->qcoeff);
  40. DQC = xd->dequant_y1_dc;
  41. }
  42. vp8_dequant_idct_add_y_block(xd->qcoeff, DQC, xd->dst.y_buffer,
  43. xd->dst.y_stride, xd->eobs);
  44. }
  45. #ifdef __cplusplus
  46. } // extern "C"
  47. #endif
  48. #endif // VPX_VP8_COMMON_INVTRANS_H_