Revision 182f56cb

View differences:

libavcodec/i386/cavsdsp_mmx.c
23 23
 */
24 24

  
25 25
#include "dsputil.h"
26
#include "dsputil_mmx.h"
26 27
#include "common.h"
27 28

  
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;
34

  
35 29
/*****************************************************************************
36 30
 *
37 31
 * inverse transform
libavcodec/i386/dsputil_mmx.c
23 23
 */
24 24

  
25 25
#include "dsputil.h"
26
#include "dsputil_mmx.h"
26 27
#include "simple_idct.h"
27 28
#include "mpegvideo.h"
28 29
#include "x86_cpu.h"
......
40 41
int mm_flags; /* multimedia extension flags */
41 42

  
42 43
/* pixel operations */
43
static const uint64_t mm_bone attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL;
44
static const uint64_t mm_wone attribute_used __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
45
static const uint64_t mm_wtwo attribute_used __attribute__ ((aligned(8))) = 0x0002000200020002ULL;
44
DECLARE_ALIGNED_8 (const uint64_t, mm_bone) = 0x0101010101010101ULL;
45
DECLARE_ALIGNED_8 (const uint64_t, mm_wone) = 0x0001000100010001ULL;
46
DECLARE_ALIGNED_8 (const uint64_t, mm_wtwo) = 0x0002000200020002ULL;
47
DECLARE_ALIGNED_8 (const uint64_t, mm_wabs) = 0xFFFFFFFFFFFFFFFFULL;
46 48

  
47
static const uint64_t ff_pdw_80000000[2] attribute_used __attribute__ ((aligned(16))) =
49
DECLARE_ALIGNED_16(const uint64_t, ff_pdw_80000000[2]) =
48 50
{0x8000000080000000ULL, 0x8000000080000000ULL};
49 51

  
50
static const uint64_t ff_pw_20 attribute_used __attribute__ ((aligned(8))) = 0x0014001400140014ULL;
51
static const uint64_t ff_pw_3  attribute_used __attribute__ ((aligned(8))) = 0x0003000300030003ULL;
52
static const uint64_t ff_pw_4  attribute_used __attribute__ ((aligned(8))) = 0x0004000400040004ULL;
53
static const uint64_t ff_pw_5  attribute_used __attribute__ ((aligned(8))) = 0x0005000500050005ULL;
54
static const uint64_t ff_pw_8  attribute_used __attribute__ ((aligned(8))) = 0x0008000800080008ULL;
55
static const uint64_t ff_pw_16 attribute_used __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
56
static const uint64_t ff_pw_32 attribute_used __attribute__ ((aligned(8))) = 0x0020002000200020ULL;
57
static const uint64_t ff_pw_64 attribute_used __attribute__ ((aligned(8))) = 0x0040004000400040ULL;
58
static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;
59

  
60
static const uint64_t ff_pb_1  attribute_used __attribute__ ((aligned(8))) = 0x0101010101010101ULL;
61
static const uint64_t ff_pb_3  attribute_used __attribute__ ((aligned(8))) = 0x0303030303030303ULL;
62
static const uint64_t ff_pb_7  attribute_used __attribute__ ((aligned(8))) = 0x0707070707070707ULL;
63
static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
64
static const uint64_t ff_pb_A1 attribute_used __attribute__ ((aligned(8))) = 0xA1A1A1A1A1A1A1A1ULL;
65
static const uint64_t ff_pb_5F attribute_used __attribute__ ((aligned(8))) = 0x5F5F5F5F5F5F5F5FULL;
66
static const uint64_t ff_pb_FC attribute_used __attribute__ ((aligned(8))) = 0xFCFCFCFCFCFCFCFCULL;
67

  
68
static const double ff_pd_1[2] attribute_used __attribute__ ((aligned(16))) = { 1.0, 1.0 };
69
static const double ff_pd_2[2] attribute_used __attribute__ ((aligned(16))) = { 2.0, 2.0 };
52
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_3  ) = 0x0003000300030003ULL;
53
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_4  ) = 0x0004000400040004ULL;
54
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_5  ) = 0x0005000500050005ULL;
55
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_8  ) = 0x0008000800080008ULL;
56
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_15 ) = 0x000F000F000F000FULL;
57
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_16 ) = 0x0010001000100010ULL;
58
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_20 ) = 0x0014001400140014ULL;
59
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_32 ) = 0x0020002000200020ULL;
60
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_42 ) = 0x002A002A002A002AULL;
61
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_64 ) = 0x0040004000400040ULL;
62
DECLARE_ALIGNED_8 (const uint64_t, ff_pw_96 ) = 0x0060006000600060ULL;
63
DECLARE_ALIGNED_16(const uint64_t, ff_pw_128) = 0x0080008000800080ULL;
64

  
65
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_1  ) = 0x0101010101010101ULL;
66
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3  ) = 0x0303030303030303ULL;
67
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_7  ) = 0x0707070707070707ULL;
68
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3F ) = 0x3F3F3F3F3F3F3F3FULL;
69
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_5F ) = 0x5F5F5F5F5F5F5F5FULL;
70
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_A1 ) = 0xA1A1A1A1A1A1A1A1ULL;
71
DECLARE_ALIGNED_8 (const uint64_t, ff_pb_FC ) = 0xFCFCFCFCFCFCFCFCULL;
72

  
73
DECLARE_ALIGNED_16(const double, ff_pd_1[2]) = { 1.0, 1.0 };
74
DECLARE_ALIGNED_16(const double, ff_pd_2[2]) = { 2.0, 2.0 };
70 75

  
71 76
#define JUMPALIGN() __asm __volatile (ASMALIGN(3)::)
72 77
#define MOVQ_ZERO(regd)  __asm __volatile ("pxor %%" #regd ", %%" #regd ::)
libavcodec/i386/dsputil_mmx.h
1
/*
2
 * MMX optimized DSP utils
3
 * Copyright (c) 2007  Aurelien Jacobs <aurel@gnuage.org>
4
 *
5
 * This file is part of FFmpeg.
6
 *
7
 * FFmpeg is free software; you can redistribute it and/or
8
 * modify it under the terms of the GNU Lesser General Public
9
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * FFmpeg is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 * Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with FFmpeg; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 */
21

  
22
#ifndef FFMPEG_DSPUTIL_MMX_H
23
#define FFMPEG_DSPUTIL_MMX_H
24

  
25
extern const uint64_t mm_bone;
26
extern const uint64_t mm_wone;
27
extern const uint64_t mm_wtwo;
28
extern const uint64_t mm_wabs;
29

  
30
extern const uint64_t ff_pdw_80000000[2];
31

  
32
extern const uint64_t ff_pw_3;
33
extern const uint64_t ff_pw_4;
34
extern const uint64_t ff_pw_5;
35
extern const uint64_t ff_pw_8;
36
extern const uint64_t ff_pw_15;
37
extern const uint64_t ff_pw_16;
38
extern const uint64_t ff_pw_20;
39
extern const uint64_t ff_pw_32;
40
extern const uint64_t ff_pw_42;
41
extern const uint64_t ff_pw_64;
42
extern const uint64_t ff_pw_96;
43
extern const uint64_t ff_pw_128;
44

  
45
extern const uint64_t ff_pb_1;
46
extern const uint64_t ff_pb_3;
47
extern const uint64_t ff_pb_7;
48
extern const uint64_t ff_pb_3F;
49
extern const uint64_t ff_pb_5F;
50
extern const uint64_t ff_pb_A1;
51
extern const uint64_t ff_pb_FC;
52

  
53
extern const double ff_pd_1[2];
54
extern const double ff_pd_2[2];
55

  
56
#endif /* FFMPEG_DSPUTIL_MMX_H */
libavcodec/i386/h264dsp_mmx.c
18 18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
 */
20 20

  
21
#include "dsputil_mmx.h"
21 22

  
22 23
/***********************************/
23 24
/* IDCT */
libavcodec/i386/mpegvideo_mmx.c
23 23
 */
24 24

  
25 25
#include "dsputil.h"
26
#include "dsputil_mmx.h"
26 27
#include "mpegvideo.h"
27 28
#include "avcodec.h"
28 29
#include "x86_cpu.h"
29 30

  
30 31
extern uint16_t inv_zigzag_direct16[64];
31 32

  
32
static const unsigned long long int mm_wabs __attribute__ ((aligned(8))) = 0xffffffffffffffffULL;
33
static const unsigned long long int mm_wone __attribute__ ((aligned(8))) = 0x0001000100010001ULL;
34

  
35 33

  
36 34
static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
37 35
                                  DCTELEM *block, int n, int qscale)
libavcodec/i386/vc1dsp_mmx.c
25 25
 */
26 26

  
27 27
#include "dsputil.h"
28
#include "dsputil_mmx.h"
28 29
#include "x86_cpu.h"
29 30

  
30 31
/** Add rounder from mm7 to mm3 and pack result at destination */
......
103 104
    );
104 105
}
105 106

  
106
/** To remove bias allowing use of MMX 16bits arithmetic */
107
DECLARE_ALIGNED_16(static const uint64_t, ff_pw_128) = 0x0080008000800080ULL;
108

  
109 107
/**
110 108
 * Data is already unpacked, so some operations can directly be made from
111 109
 * memory.

Also available in: Unified diff