1 /*
2  *  Copyright (c) 2015 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 
11 #include <assert.h>
12 
13 #include "./vp9_rtcd.h"
14 #include "vp9/common/vp9_enums.h"
15 #include "vpx_dsp/mips/inv_txfm_msa.h"
16 
vp9_iht16x16_256_add_msa(const int16_t * input,uint8_t * dst,int32_t dst_stride,int32_t tx_type)17 void vp9_iht16x16_256_add_msa(const int16_t *input, uint8_t *dst,
18                               int32_t dst_stride, int32_t tx_type) {
19   int32_t i;
20   DECLARE_ALIGNED(32, int16_t, out[16 * 16]);
21   int16_t *out_ptr = &out[0];
22 
23   switch (tx_type) {
24     case DCT_DCT:
25       /* transform rows */
26       for (i = 0; i < 2; ++i) {
27         /* process 16 * 8 block */
28         vpx_idct16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
29       }
30 
31       /* transform columns */
32       for (i = 0; i < 2; ++i) {
33         /* process 8 * 16 block */
34         vpx_idct16_1d_columns_addblk_msa((out_ptr + (i << 3)), (dst + (i << 3)),
35                                          dst_stride);
36       }
37       break;
38     case ADST_DCT:
39       /* transform rows */
40       for (i = 0; i < 2; ++i) {
41         /* process 16 * 8 block */
42         vpx_idct16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
43       }
44 
45       /* transform columns */
46       for (i = 0; i < 2; ++i) {
47         vpx_iadst16_1d_columns_addblk_msa((out_ptr + (i << 3)),
48                                           (dst + (i << 3)), dst_stride);
49       }
50       break;
51     case DCT_ADST:
52       /* transform rows */
53       for (i = 0; i < 2; ++i) {
54         /* process 16 * 8 block */
55         vpx_iadst16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
56       }
57 
58       /* transform columns */
59       for (i = 0; i < 2; ++i) {
60         /* process 8 * 16 block */
61         vpx_idct16_1d_columns_addblk_msa((out_ptr + (i << 3)), (dst + (i << 3)),
62                                          dst_stride);
63       }
64       break;
65     case ADST_ADST:
66       /* transform rows */
67       for (i = 0; i < 2; ++i) {
68         /* process 16 * 8 block */
69         vpx_iadst16_1d_rows_msa((input + (i << 7)), (out_ptr + (i << 7)));
70       }
71 
72       /* transform columns */
73       for (i = 0; i < 2; ++i) {
74         vpx_iadst16_1d_columns_addblk_msa((out_ptr + (i << 3)),
75                                           (dst + (i << 3)), dst_stride);
76       }
77       break;
78     default: assert(0); break;
79   }
80 }
81