1/* 2 * Copyright © 2009 Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 * 23 * Author: 24 * Zou Nan hai <nanhai.zou@intel.com> 25 * Yan Li <li.l.yan@intel.com> 26 * Liu Xi bin<xibin.liu@intel.com> 27 */ 28/* GRF allocation: 29 g1~g30: constant buffer 30 g1~g2:intra IQ matrix in UB format 31 g3~g4:non intra IQ matrix in UB format 32 g5~g20:IDCT table 33 g32~g55:DCT data before IQ 34 g56~g79:DCT data after IQ 35 g83~g106: IDCT data after idct 36 g82: thread payload backup 37 g125: ip before jump 38*/ 39include(`iq_non_intra.g4i') 40 41define(`ROW_SHIFT', `11UD') //define for idct 42define(`ROW_ADD', `0x400UD') 43define(`COL_SHIFT', `20UD') 44define(`COL_ADD', `0x80000UD') 45 46mov (1) a0.0<1>UD 0x06F006E0UD {align1};//0x06F006E0UD+0x00200020UD=0x07100700UD (g56.0 and g56.16,the start of DCT data) 47 48//Y0 49and.nz (1) null g82.8<1,1,1>UW 0x800UW {align1}; 50(f0) jmpi do_idct_y0; 51 52mov (8) g83.0<1>UW 0UW {align1}; 53mov (8) g84.0<1>UW 0UW {align1}; 54mov (8) g85.0<1>UW 0UW {align1}; 55mov (8) g86.0<1>UW 0UW {align1}; 56mov (8) g87.0<1>UW 0UW {align1}; 57mov (8) g88.0<1>UW 0UW {align1}; 58mov (8) g89.0<1>UW 0UW {align1}; 59mov (8) g90.0<1>UW 0UW {align1}; 60add (1) a0.0<1>UD a0.0<1,1,1>UD 0x00800080UD {align1}; 61jmpi block_y1; 62do_idct_y0: 63mov (1) g125.0<1>UD ip {align1}; 64jmpi IDCT_START; 65mov (8) g83.0<1>W g32.0<16,8,2>W {align1}; 66mov (8) g84.0<1>W g33.0<16,8,2>W {align1}; 67mov (8) g85.0<1>W g34.0<16,8,2>W {align1}; 68mov (8) g86.0<1>W g35.0<16,8,2>W {align1}; 69mov (8) g87.0<1>W g36.0<16,8,2>W {align1}; 70mov (8) g88.0<1>W g37.0<16,8,2>W {align1}; 71mov (8) g89.0<1>W g38.0<16,8,2>W {align1}; 72mov (8) g90.0<1>W g39.0<16,8,2>W {align1}; 73 74//Y1 75block_y1: 76and.nz (1) null g82.8<1,1,1>UW 0x400UW {align1}; 77(f0) jmpi do_idct_y1; 78mov (8) g83.16<1>UW 0UW {align1}; 79mov (8) g84.16<1>UW 0UW {align1}; 80mov (8) g85.16<1>UW 0UW {align1}; 81mov (8) g86.16<1>UW 0UW {align1}; 82mov (8) g87.16<1>UW 0UW {align1}; 83mov (8) g88.16<1>UW 0UW {align1}; 84mov (8) g89.16<1>UW 0UW {align1}; 85mov (8) g90.16<1>UW 0UW {align1}; 86add (1) a0.0<1>UD a0.0<1,1,1>UD 0x00800080UD {align1}; 87jmpi block_y2; 88do_idct_y1: 89mov (1) g125.0<1>UD ip {align1}; 90jmpi IDCT_START; 91mov (8) g83.16<1>W g32.0<16,8,2>W {align1}; 92mov (8) g84.16<1>W g33.0<16,8,2>W {align1}; 93mov (8) g85.16<1>W g34.0<16,8,2>W {align1}; 94mov (8) g86.16<1>W g35.0<16,8,2>W {align1}; 95mov (8) g87.16<1>W g36.0<16,8,2>W {align1}; 96mov (8) g88.16<1>W g37.0<16,8,2>W {align1}; 97mov (8) g89.16<1>W g38.0<16,8,2>W {align1}; 98mov (8) g90.16<1>W g39.0<16,8,2>W {align1}; 99 100//Y2 101block_y2: 102and.nz (1) null g82.8<1,1,1>UW 0x200UW {align1}; 103(f0) jmpi do_idct_y2; 104mov (8) g91.0<1>UW 0UW {align1}; 105mov (8) g92.0<1>UW 0UW {align1}; 106mov (8) g93.0<1>UW 0UW {align1}; 107mov (8) g94.0<1>UW 0UW {align1}; 108mov (8) g95.0<1>UW 0UW {align1}; 109mov (8) g96.0<1>UW 0UW {align1}; 110mov (8) g97.0<1>UW 0UW {align1}; 111mov (8) g98.0<1>UW 0UW {align1}; 112add (1) a0.0<1>UD a0.0<1,1,1>UD 0x00800080UD {align1}; 113jmpi block_y3; 114do_idct_y2: 115mov (1) g125.0<1>UD ip {align1}; 116jmpi IDCT_START; 117mov (8) g91.0<1>W g32.0<16,8,2>W {align1}; 118mov (8) g92.0<1>W g33.0<16,8,2>W {align1}; 119mov (8) g93.0<1>W g34.0<16,8,2>W {align1}; 120mov (8) g94.0<1>W g35.0<16,8,2>W {align1}; 121mov (8) g95.0<1>W g36.0<16,8,2>W {align1}; 122mov (8) g96.0<1>W g37.0<16,8,2>W {align1}; 123mov (8) g97.0<1>W g38.0<16,8,2>W {align1}; 124mov (8) g98.0<1>W g39.0<16,8,2>W {align1}; 125 126//Y3 127block_y3: 128and.nz (1) null g82.8<1,1,1>UW 0x100UW {align1}; 129(f0) jmpi do_idct_y3; 130mov (8) g91.16<1>UW 0UW {align1}; 131mov (8) g92.16<1>UW 0UW {align1}; 132mov (8) g93.16<1>UW 0UW {align1}; 133mov (8) g94.16<1>UW 0UW {align1}; 134mov (8) g95.16<1>UW 0UW {align1}; 135mov (8) g96.16<1>UW 0UW {align1}; 136mov (8) g97.16<1>UW 0UW {align1}; 137mov (8) g98.16<1>UW 0UW {align1}; 138add (1) a0.0<1>UD a0.0<1,1,1>UD 0x00800080UD {align1}; 139jmpi block_u; 140do_idct_y3: 141mov (1) g125.0<1>UD ip {align1}; 142jmpi IDCT_START; 143mov (8) g91.16<1>W g32.0<16,8,2>W {align1}; 144mov (8) g92.16<1>W g33.0<16,8,2>W {align1}; 145mov (8) g93.16<1>W g34.0<16,8,2>W {align1}; 146mov (8) g94.16<1>W g35.0<16,8,2>W {align1}; 147mov (8) g95.16<1>W g36.0<16,8,2>W {align1}; 148mov (8) g96.16<1>W g37.0<16,8,2>W {align1}; 149mov (8) g97.16<1>W g38.0<16,8,2>W {align1}; 150mov (8) g98.16<1>W g39.0<16,8,2>W {align1}; 151 152//U 153block_u: 154and.nz (1) null g82.8<1,1,1>UW 0x80UW {align1}; 155(f0) jmpi do_idct_u; 156mov (16) g99.0<1>UW 0UW {align1}; 157mov (16) g100.0<1>UW 0UW {align1}; 158mov (16) g101.0<1>UW 0UW {align1}; 159mov (16) g102.0<1>UW 0UW {align1}; 160add (1) a0.0<1>UD a0.0<1,1,1>UD 0x00800080UD {align1}; 161jmpi block_v; 162do_idct_u: 163mov (1) g125.0<1>UD ip {align1}; 164jmpi IDCT_START; 165mov (16) g99.0<1>W g32.0<16,8,2>W {align1}; 166mov (16) g100.0<1>W g34.0<16,8,2>W {align1}; 167mov (16) g101.0<1>W g36.0<16,8,2>W {align1}; 168mov (16) g102.0<1>W g38.0<16,8,2>W {align1}; 169 170//V 171block_v: 172and.nz (1) null g82.8<1,1,1>UW 0x40UW {align1}; 173(f0) jmpi do_idct_v; 174mov (16) g103.0<1>UW 0UW {align1}; 175mov (16) g104.0<1>UW 0UW {align1}; 176mov (16) g105.0<1>UW 0UW {align1}; 177mov (16) g106.0<1>UW 0UW {align1}; 178jmpi block_end; 179do_idct_v: 180mov (1) g125.0<1>UD ip {align1}; 181jmpi IDCT_START; 182mov (16) g103.0<1>W g32.0<16,8,2>W {align1}; 183mov (16) g104.0<1>W g34.0<16,8,2>W {align1}; 184mov (16) g105.0<1>W g36.0<16,8,2>W {align1}; 185mov (16) g106.0<1>W g38.0<16,8,2>W {align1}; 186block_end: 187 188add (1) ip g126.8<1,1,1>UD 0x20UD {align1}; //jump back 189include(`do_iq_non_intra.g4i') 190include(`idct.g4i') 191