2
2
* Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
3
3
* Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
5
* MMX optimised DSP functions, based on H.264 optimisations by
5
* MMX-optimized DSP functions, based on H.264 optimizations by
6
6
* Michael Niedermayer and Loren Merritt
8
8
* This file is part of FFmpeg.
20
20
* You should have received a copy of the GNU Lesser General Public
21
21
* License along with FFmpeg; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
#include "../dsputil.h"
26
#include "dsputil_mmx.h"
26
27
#include "common.h"
28
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_4 ) = 0x0004000400040004ULL;
29
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_5 ) = 0x0005000500050005ULL;
30
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_7 ) = 0x0007000700070007ULL;
31
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_42) = 0x002A002A002A002AULL;
32
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_64) = 0x0040004000400040ULL;
33
DECLARE_ALIGNED_8(static const uint64_t,ff_pw_96) = 0x0060006000600060ULL;
35
29
/*****************************************************************************
37
31
* inverse transform
39
33
****************************************************************************/
41
#define SUMSUB_BA( a, b ) \
42
"paddw "#b", "#a" \n\t"\
43
"paddw "#b", "#b" \n\t"\
44
"psubw "#a", "#b" \n\t"
46
#define SBUTTERFLY(a,b,t,n)\
47
"movq " #a ", " #t " \n\t" /* abcd */\
48
"punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
49
"punpckh" #n " " #b ", " #t " \n\t" /* cgdh */
51
#define TRANSPOSE4(a,b,c,d,t)\
52
SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
53
SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
54
SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
55
SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
57
35
static inline void cavs_idct8_1d(int16_t *block, uint64_t bias)