~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/x86/cabac.h

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "config.h"
28
28
 
29
29
#if HAVE_FAST_CMOV
30
 
#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
 
30
#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
31
31
        "mov    "tmp"       , %%ecx     \n\t"\
32
32
        "shl    $17         , "tmp"     \n\t"\
33
33
        "cmp    "low"       , "tmp"     \n\t"\
34
34
        "cmova  %%ecx       , "range"   \n\t"\
35
35
        "sbb    %%ecx       , %%ecx     \n\t"\
36
36
        "and    %%ecx       , "tmp"     \n\t"\
37
 
        "sub    "tmp"       , "low"     \n\t"\
38
 
        "xor    %%ecx       , "ret"     \n\t"
 
37
        "xor    %%ecx       , "ret"     \n\t"\
 
38
        "sub    "tmp"       , "low"     \n\t"
39
39
#else /* HAVE_FAST_CMOV */
40
 
#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
 
40
#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
41
41
        "mov    "tmp"       , %%ecx     \n\t"\
42
42
        "shl    $17         , "tmp"     \n\t"\
43
43
        "sub    "low"       , "tmp"     \n\t"\
51
51
        "xor    "tmp"       , "ret"     \n\t"
52
52
#endif /* HAVE_FAST_CMOV */
53
53
 
54
 
#define BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte, byte) \
 
54
#define BRANCHLESS_GET_CABAC(ret, statep, low, lowword, range, tmp, tmpbyte, byte) \
55
55
        "movzbl "statep"    , "ret"                                     \n\t"\
56
56
        "mov    "range"     , "tmp"                                     \n\t"\
57
57
        "and    $0xC0       , "range"                                   \n\t"\
58
58
        "movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\
59
59
        "sub    "range"     , "tmp"                                     \n\t"\
60
 
        BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword,        \
61
 
                                    range, tmp)                              \
 
60
        BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)   \
62
61
        "movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx          \n\t"\
63
62
        "shl    %%cl        , "range"                                   \n\t"\
64
63
        "movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp"          \n\t"\
 
64
        "shl    %%cl        , "low"                                     \n\t"\
65
65
        "mov    "tmpbyte"   , "statep"                                  \n\t"\
66
 
        "shl    %%cl        , "low"                                     \n\t"\
67
66
        "test   "lowword"   , "lowword"                                 \n\t"\
68
67
        " jnz   1f                                                      \n\t"\
69
 
        "mov "byte"("cabac"), %%"REG_c"                                 \n\t"\
 
68
        "mov    "byte"      , %%"REG_c"                                 \n\t"\
 
69
        "add"OPSIZE" $2     , "byte"                                    \n\t"\
70
70
        "movzwl (%%"REG_c")     , "tmp"                                 \n\t"\
71
 
        "bswap  "tmp"                                                   \n\t"\
72
 
        "shr    $15         , "tmp"                                     \n\t"\
73
 
        "sub    $0xFFFF     , "tmp"                                     \n\t"\
74
 
        "add    $2          , %%"REG_c"                                 \n\t"\
75
 
        "mov    %%"REG_c"   , "byte    "("cabac")                       \n\t"\
76
71
        "lea    -1("low")   , %%ecx                                     \n\t"\
77
72
        "xor    "low"       , %%ecx                                     \n\t"\
78
73
        "shr    $15         , %%ecx                                     \n\t"\
 
74
        "bswap  "tmp"                                                   \n\t"\
 
75
        "shr    $15         , "tmp"                                     \n\t"\
79
76
        "movzbl " MANGLE(ff_h264_norm_shift) "(%%ecx), %%ecx            \n\t"\
 
77
        "sub    $0xFFFF     , "tmp"                                     \n\t"\
80
78
        "neg    %%ecx                                                   \n\t"\
81
79
        "add    $7          , %%ecx                                     \n\t"\
82
80
        "shl    %%cl        , "tmp"                                     \n\t"\
83
81
        "add    "tmp"       , "low"                                     \n\t"\
84
82
        "1:                                                             \n\t"
85
83
 
86
 
#if ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
 
84
#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
87
85
#define get_cabac_inline get_cabac_inline_x86
88
86
static av_always_inline int get_cabac_inline_x86(CABACContext *c,
89
87
                                                 uint8_t *const state)
90
88
{
91
 
    int bit, low, range, tmp;
 
89
    int bit, tmp;
92
90
 
93
91
    __asm__ volatile(
94
 
        "movl %a6(%5), %2               \n\t"
95
 
        "movl %a7(%5), %1               \n\t"
96
 
        BRANCHLESS_GET_CABAC("%0", "%5", "(%4)", "%1", "%w1", "%2",
97
 
                             "%3", "%b3", "%a8")
98
 
        "movl %2, %a6(%5)               \n\t"
99
 
        "movl %1, %a7(%5)               \n\t"
100
 
 
101
 
        :"=&r"(bit), "=&r"(low), "=&r"(range), "=&q"(tmp)
102
 
        :"r"(state), "r"(c),
103
 
         "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
104
 
         "i"(offsetof(CABACContext, bytestream))
 
92
        BRANCHLESS_GET_CABAC("%0", "(%5)", "%1", "%w1", "%2",
 
93
                             "%3", "%b3", "%4")
 
94
        :"=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp),
 
95
         "+m"(c->bytestream)
 
96
        :"r"(state)
105
97
        : "%"REG_c, "memory"
106
98
    );
107
99
    return bit & 1;
108
100
}
109
 
#endif /* ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
 
101
#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
110
102
 
111
103
#define get_cabac_bypass_sign get_cabac_bypass_sign_x86
112
104
static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
113
105
{
114
106
    x86_reg tmp;
115
107
    __asm__ volatile(
116
 
        "movl %a3(%2), %k1                      \n\t"
117
 
        "movl %a4(%2), %%eax                    \n\t"
 
108
        "movl %4, %k1                           \n\t"
 
109
        "movl %2, %%eax                         \n\t"
118
110
        "shl $17, %k1                           \n\t"
119
111
        "add %%eax, %%eax                       \n\t"
120
112
        "sub %k1, %%eax                         \n\t"
125
117
        "sub %%edx, %%ecx                       \n\t"
126
118
        "test %%ax, %%ax                        \n\t"
127
119
        " jnz 1f                                \n\t"
128
 
        "mov  %a5(%2), %1                       \n\t"
 
120
        "mov  %3, %1                            \n\t"
129
121
        "subl $0xFFFF, %%eax                    \n\t"
130
122
        "movzwl (%1), %%edx                     \n\t"
131
123
        "bswap %%edx                            \n\t"
132
124
        "shrl $15, %%edx                        \n\t"
133
125
        "add  $2, %1                            \n\t"
134
126
        "addl %%edx, %%eax                      \n\t"
135
 
        "mov  %1, %a5(%2)                       \n\t"
 
127
        "mov  %1, %3                            \n\t"
136
128
        "1:                                     \n\t"
137
 
        "movl %%eax, %a4(%2)                    \n\t"
 
129
        "movl %%eax, %2                         \n\t"
138
130
 
139
 
        :"+c"(val), "=&r"(tmp)
140
 
        :"r"(c),
141
 
         "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
142
 
         "i"(offsetof(CABACContext, bytestream))
143
 
        : "%eax", "%edx", "memory"
 
131
        :"+c"(val), "=&r"(tmp), "+m"(c->low), "+m"(c->bytestream)
 
132
        :"m"(c->range)
 
133
        : "%eax", "%edx"
144
134
    );
145
135
    return val;
146
136
}