av1_idct16x16_msa.c 2.64 KB
Newer Older
Jingning Han's avatar
Jingning Han committed
1
/*
Yaowu Xu's avatar
Yaowu Xu committed
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Jingning Han's avatar
Jingning Han committed
3
 *
Yaowu Xu's avatar
Yaowu Xu committed
4 5 6 7 8 9
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed with this source code in the LICENSE file, you can
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Jingning Han's avatar
Jingning Han committed
10 11 12 13
 */

#include <assert.h>

14
#include "av1/common/enums.h"
15
#include "av1/common/idct.h"
16
#include "aom_dsp/mips/inv_txfm_msa.h"
Jingning Han's avatar
Jingning Han committed
17

Yaowu Xu's avatar
Yaowu Xu committed
18
void av1_iht16x16_256_add_msa(const int16_t *input, uint8_t *dst,
19
                              int32_t dst_stride, FWD_TXFM_PARAM *param) {
Jingning Han's avatar
Jingning Han committed
20 21 22
  int32_t i;
  DECLARE_ALIGNED(32, int16_t, out[16 * 16]);
  int16_t *out_ptr = &out[0];
23
  int32_t tx_type = param->tx_type;
Jingning Han's avatar
Jingning Han committed
24 25 26 27 28 29

  switch (tx_type) {
    case DCT_DCT:
      /* transform rows */
      for (i = 0; i < 2; ++i) {
        /* process 16 * 8 block */
Yaowu Xu's avatar
Yaowu Xu committed
30
        aom_idct16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
Jingning Han's avatar
Jingning Han committed
31 32 33 34 35
      }

      /* transform columns */
      for (i = 0; i < 2; ++i) {
        /* process 8 * 16 block */
Yaowu Xu's avatar
Yaowu Xu committed
36
        aom_idct16_1d_columns_addblk_msa((out_ptr + (i << 3)), (dst + (i << 3)),
Jingning Han's avatar
Jingning Han committed
37 38 39 40 41 42 43
                                         dst_stride);
      }
      break;
    case ADST_DCT:
      /* transform rows */
      for (i = 0; i < 2; ++i) {
        /* process 16 * 8 block */
Yaowu Xu's avatar
Yaowu Xu committed
44
        aom_idct16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
Jingning Han's avatar
Jingning Han committed
45 46 47 48
      }

      /* transform columns */
      for (i = 0; i < 2; ++i) {
Yaowu Xu's avatar
Yaowu Xu committed
49
        aom_iadst16_1d_columns_addblk_msa((out_ptr + (i << 3)),
Jingning Han's avatar
Jingning Han committed
50 51 52 53 54 55 56
                                          (dst + (i << 3)), dst_stride);
      }
      break;
    case DCT_ADST:
      /* transform rows */
      for (i = 0; i < 2; ++i) {
        /* process 16 * 8 block */
Yaowu Xu's avatar
Yaowu Xu committed
57
        aom_iadst16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
Jingning Han's avatar
Jingning Han committed
58 59 60 61 62
      }

      /* transform columns */
      for (i = 0; i < 2; ++i) {
        /* process 8 * 16 block */
Yaowu Xu's avatar
Yaowu Xu committed
63
        aom_idct16_1d_columns_addblk_msa((out_ptr + (i << 3)), (dst + (i << 3)),
Jingning Han's avatar
Jingning Han committed
64 65 66 67 68 69 70
                                         dst_stride);
      }
      break;
    case ADST_ADST:
      /* transform rows */
      for (i = 0; i < 2; ++i) {
        /* process 16 * 8 block */
Yaowu Xu's avatar
Yaowu Xu committed
71
        aom_iadst16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
Jingning Han's avatar
Jingning Han committed
72 73 74 75
      }

      /* transform columns */
      for (i = 0; i < 2; ++i) {
Yaowu Xu's avatar
Yaowu Xu committed
76
        aom_iadst16_1d_columns_addblk_msa((out_ptr + (i << 3)),
Jingning Han's avatar
Jingning Han committed
77 78 79
                                          (dst + (i << 3)), dst_stride);
      }
      break;
clang-format's avatar
clang-format committed
80
    default: assert(0); break;
Jingning Han's avatar
Jingning Han committed
81 82
  }
}