~medibuntu-maintainers/mplayer/medibuntu.quantal

« back to all changes in this revision

Viewing changes to libavcodec/arm/mpegvideo_iwmmxt.c

  • Committer: Gauvain Pocentek
  • Date: 2011-08-21 07:22:23 UTC
  • mfrom: (66.1.11 oneiric)
  • Revision ID: gauvain@pocentek.net-20110821072223-ummeossdz7okpb3d
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
  - update 23mplayer-debug-printf.patch
  - fixes miscompilation with gcc 4.6, Closes: #623304
  - improved internal mkv demuxer, Closes: #595452
  - Fixed segfault due to missing sanitation on playlist files,
    Closes: #591525
  - Fixed byteorder on 16-bit displays, Closes: #594093
  - tighten build depends on libav
  - --enable-largefile switch has been dropped
  - add build dependency on yasm
* Fix build dependency on libjpeg-dev, Closes: #634277
* rewrite debian/copyright in DEP5 format
* fix clean target
* don't remove snapshot_version file
* enable XVID, MP3 and X264 encoders
* simply architecture specific dependencies, Closes: #634773
* make buildlogs verbose
* unbreak building mplayer-doc package
* don't fail debian package build if not all shlibdeps information could be retrieved
* update configure flags for static libav* libraries
* fix spelling in mplayer-dbg description, Closes: #617826
* enable blueray support, Closes: #577761
* Select oss as default audio output module on kFreeBSD, Closes: #598431
* Update documentation with regard to our modifications to the upstream tarball.
* really no longer build mplayer-gui, Closes: #612473
* simplify/remove instruction to get upstream sources
* normalize debian/{control,copyright,mplayer.install} with wrap-and-sort
* bump standards version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * copyright (c) 2004 AGAWA Koji
3
 
 *
4
 
 * This file is part of FFmpeg.
5
 
 *
6
 
 * FFmpeg is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Lesser General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2.1 of the License, or (at your option) any later version.
10
 
 *
11
 
 * FFmpeg is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Lesser General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with FFmpeg; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 
 */
20
 
 
21
 
#include "libavcodec/avcodec.h"
22
 
#include "libavcodec/dsputil.h"
23
 
#include "libavcodec/mpegvideo.h"
24
 
#include "mpegvideo_arm.h"
25
 
 
26
 
static void dct_unquantize_h263_intra_iwmmxt(MpegEncContext *s,
27
 
                                             DCTELEM *block, int n, int qscale)
28
 
{
29
 
    int level, qmul, qadd;
30
 
    int nCoeffs;
31
 
    DCTELEM *block_orig = block;
32
 
 
33
 
    assert(s->block_last_index[n]>=0);
34
 
 
35
 
    qmul = qscale << 1;
36
 
 
37
 
    if (!s->h263_aic) {
38
 
        if (n < 4)
39
 
            level = block[0] * s->y_dc_scale;
40
 
        else
41
 
            level = block[0] * s->c_dc_scale;
42
 
        qadd = (qscale - 1) | 1;
43
 
    }else{
44
 
        qadd = 0;
45
 
        level = block[0];
46
 
    }
47
 
    if(s->ac_pred)
48
 
        nCoeffs=63;
49
 
    else
50
 
        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
51
 
 
52
 
    __asm__ volatile (
53
 
/*      "movd %1, %%mm6                 \n\t" //qmul */
54
 
/*      "packssdw %%mm6, %%mm6          \n\t" */
55
 
/*      "packssdw %%mm6, %%mm6          \n\t" */
56
 
        "tbcsth wr6, %[qmul]            \n\t"
57
 
/*      "movd %2, %%mm5                 \n\t" //qadd */
58
 
/*      "packssdw %%mm5, %%mm5          \n\t" */
59
 
/*      "packssdw %%mm5, %%mm5          \n\t" */
60
 
        "tbcsth wr5, %[qadd]            \n\t"
61
 
        "wzero wr7                      \n\t" /* "pxor %%mm7, %%mm7             \n\t" */
62
 
        "wzero wr4                      \n\t" /* "pxor %%mm4, %%mm4             \n\t" */
63
 
        "wsubh wr7, wr5, wr7            \n\t" /* "psubw %%mm5, %%mm7            \n\t" */
64
 
        "1:                             \n\t"
65
 
        "wldrd wr2, [%[block]]          \n\t" /* "movq (%0, %3), %%mm0          \n\t" */
66
 
        "wldrd wr3, [%[block], #8]      \n\t" /* "movq 8(%0, %3), %%mm1         \n\t" */
67
 
        "wmulsl wr0, wr6, wr2           \n\t" /* "pmullw %%mm6, %%mm0           \n\t" */
68
 
        "wmulsl wr1, wr6, wr3           \n\t" /* "pmullw %%mm6, %%mm1           \n\t" */
69
 
/*      "movq (%0, %3), %%mm2           \n\t" */
70
 
/*      "movq 8(%0, %3), %%mm3          \n\t" */
71
 
        "wcmpgtsh wr2, wr4, wr2         \n\t" /* "pcmpgtw %%mm4, %%mm2          \n\t" // block[i] < 0 ? -1 : 0 */
72
 
        "wcmpgtsh wr3, wr4, wr2         \n\t" /* "pcmpgtw %%mm4, %%mm3          \n\t" // block[i] < 0 ? -1 : 0 */
73
 
        "wxor wr0, wr2, wr0             \n\t" /* "pxor %%mm2, %%mm0             \n\t" */
74
 
        "wxor wr1, wr3, wr1             \n\t" /* "pxor %%mm3, %%mm1             \n\t" */
75
 
        "waddh wr0, wr7, wr0            \n\t" /* "paddw %%mm7, %%mm0            \n\t" */
76
 
        "waddh wr1, wr7, wr1            \n\t" /* "paddw %%mm7, %%mm1            \n\t" */
77
 
        "wxor wr2, wr0, wr2             \n\t" /* "pxor %%mm0, %%mm2             \n\t" */
78
 
        "wxor wr3, wr1, wr3             \n\t" /* "pxor %%mm1, %%mm3             \n\t" */
79
 
        "wcmpeqh wr0, wr7, wr0          \n\t" /* "pcmpeqw %%mm7, %%mm0          \n\t" // block[i] == 0 ? -1 : 0 */
80
 
        "wcmpeqh wr1, wr7, wr1          \n\t" /* "pcmpeqw %%mm7, %%mm1          \n\t" // block[i] == 0 ? -1 : 0 */
81
 
        "wandn wr0, wr2, wr0            \n\t" /* "pandn %%mm2, %%mm0            \n\t" */
82
 
        "wandn wr1, wr3, wr1            \n\t" /* "pandn %%mm3, %%mm1            \n\t" */
83
 
        "wstrd wr0, [%[block]]          \n\t" /* "movq %%mm0, (%0, %3)          \n\t" */
84
 
        "wstrd wr1, [%[block], #8]      \n\t" /* "movq %%mm1, 8(%0, %3)         \n\t" */
85
 
        "add %[block], %[block], #16    \n\t" /* "addl $16, %3                  \n\t" */
86
 
        "subs %[i], %[i], #1            \n\t"
87
 
        "bne 1b                         \n\t" /* "jng 1b                                \n\t" */
88
 
        :[block]"+r"(block)
89
 
        :[i]"r"((nCoeffs + 8) / 8), [qmul]"r"(qmul), [qadd]"r"(qadd)
90
 
        :"memory");
91
 
 
92
 
    block_orig[0] = level;
93
 
}
94
 
 
95
 
#if 0
96
 
static void dct_unquantize_h263_inter_iwmmxt(MpegEncContext *s,
97
 
                                             DCTELEM *block, int n, int qscale)
98
 
{
99
 
    int nCoeffs;
100
 
 
101
 
    assert(s->block_last_index[n]>=0);
102
 
 
103
 
    if(s->ac_pred)
104
 
        nCoeffs=63;
105
 
    else
106
 
        nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
107
 
 
108
 
    ippiQuantInvInter_Compact_H263_16s_I(block, nCoeffs+1, qscale);
109
 
}
110
 
#endif
111
 
 
112
 
void MPV_common_init_iwmmxt(MpegEncContext *s)
113
 
{
114
 
    if (!(mm_flags & FF_MM_IWMMXT)) return;
115
 
 
116
 
    s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_iwmmxt;
117
 
#if 0
118
 
    s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_iwmmxt;
119
 
#endif
120
 
}