FFmpeg
Loading...
Searching...
No Matches
mpegvideoencdsp_mmi.c
Go to the documentation of this file.
1/*
2 * Loongson SIMD optimized mpegvideo
3 *
4 * Copyright (c) 2015 Loongson Technology Corporation Limited
5 * Copyright (c) 2015 Zhou Xiaoyong <zhouxiaoyong@loongson.cn>
6 * Zhang Shuangshuang <zhangshuangshuang@ict.ac.cn>
7 *
8 * This file is part of FFmpeg.
9 *
10 * FFmpeg is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * FFmpeg is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with FFmpeg; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25#include "mpegvideo_mips.h"
27
28void ff_denoise_dct_mmi(int16_t block[64], int sum[64], const uint16_t offset[64])
29{
30 double ftmp[8];
31 mips_reg addr[1];
33
34 __asm__ volatile(
35 "pxor %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
36 "1: \n\t"
37 MMI_LDC1(%[ftmp1], %[block], 0x00)
38 "pxor %[ftmp2], %[ftmp2], %[ftmp2] \n\t"
39 MMI_LDC1(%[ftmp3], %[block], 0x08)
40 "pxor %[ftmp4], %[ftmp4], %[ftmp4] \n\t"
41 "pcmpgth %[ftmp2], %[ftmp2], %[ftmp1] \n\t"
42 "pcmpgth %[ftmp4], %[ftmp4], %[ftmp3] \n\t"
43 "pxor %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
44 "pxor %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
45 "psubh %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
46 "psubh %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
47 MMI_LDC1(%[ftmp6], %[offset], 0x00)
48 "mov.d %[ftmp5], %[ftmp1] \n\t"
49 "psubush %[ftmp1], %[ftmp1], %[ftmp6] \n\t"
50 MMI_LDC1(%[ftmp6], %[offset], 0x08)
51 "mov.d %[ftmp7], %[ftmp3] \n\t"
52 "psubush %[ftmp3], %[ftmp3], %[ftmp6] \n\t"
53 "pxor %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
54 "pxor %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
55 "psubh %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
56 "psubh %[ftmp3], %[ftmp3], %[ftmp4] \n\t"
57 MMI_SDC1(%[ftmp1], %[block], 0x00)
58 MMI_SDC1(%[ftmp3], %[block], 0x08)
59 "mov.d %[ftmp1], %[ftmp5] \n\t"
60 "mov.d %[ftmp3], %[ftmp7] \n\t"
61 "punpcklhw %[ftmp5], %[ftmp5], %[ftmp0] \n\t"
62 "punpckhhw %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
63 "punpcklhw %[ftmp7], %[ftmp7], %[ftmp0] \n\t"
64 "punpckhhw %[ftmp3], %[ftmp3], %[ftmp0] \n\t"
65 MMI_LDC1(%[ftmp2], %[sum], 0x00)
66 "paddw %[ftmp5], %[ftmp5], %[ftmp2] \n\t"
67 MMI_LDC1(%[ftmp2], %[sum], 0x08)
68 "paddw %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
69 MMI_LDC1(%[ftmp2], %[sum], 0x10)
70 "paddw %[ftmp7], %[ftmp7], %[ftmp2] \n\t"
71 MMI_LDC1(%[ftmp2], %[sum], 0x18)
72 "paddw %[ftmp3], %[ftmp3], %[ftmp2] \n\t"
73 MMI_SDC1(%[ftmp5], %[sum], 0x00)
74 MMI_SDC1(%[ftmp1], %[sum], 0x08)
75 MMI_SDC1(%[ftmp7], %[sum], 0x10)
76 MMI_SDC1(%[ftmp3], %[sum], 0x18)
77 PTR_ADDIU "%[block], %[block], 0x10 \n\t"
78 PTR_ADDIU "%[sum], %[sum], 0x20 \n\t"
79 PTR_SUBU "%[addr0], %[block1], %[block] \n\t"
80 PTR_ADDIU "%[offset], %[offset], 0x10 \n\t"
81 "bgtz %[addr0], 1b \n\t"
82 : [ftmp0]"=&f"(ftmp[0]), [ftmp1]"=&f"(ftmp[1]),
83 [ftmp2]"=&f"(ftmp[2]), [ftmp3]"=&f"(ftmp[3]),
84 [ftmp4]"=&f"(ftmp[4]), [ftmp5]"=&f"(ftmp[5]),
85 [ftmp6]"=&f"(ftmp[6]), [ftmp7]"=&f"(ftmp[7]),
87 [addr0]"=&r"(addr[0]),
88 [block]"+&r"(block), [sum]"+&r"(sum),
89 [offset]"+&r"(offset)
90 : [block1]"r"(block+64)
91 : "memory"
92 );
93}
#define PTR_SUBU
Definition asmdefs.h:52
#define PTR_ADDIU
Definition asmdefs.h:50
#define mips_reg
Definition asmdefs.h:46
__asm__(".macro parse_r var r\n\t" "\\var = -1\n\t" _IFC_REG(0) _IFC_REG(1) _IFC_REG(2) _IFC_REG(3) _IFC_REG(4) _IFC_REG(5) _IFC_REG(6) _IFC_REG(7) _IFC_REG(8) _IFC_REG(9) _IFC_REG(10) _IFC_REG(11) _IFC_REG(12) _IFC_REG(13) _IFC_REG(14) _IFC_REG(15) _IFC_REG(16) _IFC_REG(17) _IFC_REG(18) _IFC_REG(19) _IFC_REG(20) _IFC_REG(21) _IFC_REG(22) _IFC_REG(23) _IFC_REG(24) _IFC_REG(25) _IFC_REG(26) _IFC_REG(27) _IFC_REG(28) _IFC_REG(29) _IFC_REG(30) _IFC_REG(31) ".iflt \\var\n\t" ".error \"Unable to parse register name \\r\"\n\t" ".endif\n\t" ".endm")
static int16_t block[64]
Definition dct.c:125
static int16_t block1[64]
Definition dct.c:126
unsigned offset
Definition libaomenc.c:763
#define RESTRICT_ASM_ALL64
Definition mmiutils.h:40
#define DECLARE_VAR_ALL64
Definition mmiutils.h:39
void ff_denoise_dct_mmi(int16_t block[64], int sum[64], const uint16_t offset[64])