~ubuntu-branches/ubuntu/oneiric/libav/oneiric

« back to all changes in this revision

Viewing changes to libavcodec/ppc/h264_altivec.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-04-30 14:27:42 UTC
  • mfrom: (1.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110430142742-quvblxk1tj6adlh5
Tags: 4:0.7~b1-1ubuntu1
* Merge from debian. Remaining changes:
  - don't build against libfaad, libdirac, librtmp and libopenjpeg
    (all in universe)
  - explicitly --enable-pic on powerpc, cf. LP #654666
  - different arm configure bits that should probably better be
    merged into debian
* Cherry-picked from git: 
  - install doc/APIChanges and refer to them in NEWS.Debian (Closes: #623682)
  - don't try to install non-existing documentation, fixes FTBFS on powerpc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org>
3
3
 *
4
 
 * This file is part of FFmpeg.
 
4
 * This file is part of Libav.
5
5
 *
6
 
 * FFmpeg is free software; you can redistribute it and/or
 
6
 * Libav is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU Lesser General Public
8
8
 * License as published by the Free Software Foundation; either
9
9
 * version 2.1 of the License, or (at your option) any later version.
10
10
 *
11
 
 * FFmpeg is distributed in the hope that it will be useful,
 
11
 * Libav is distributed in the hope that it will be useful,
12
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
14
 * Lesser General Public License for more details.
15
15
 *
16
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
 
17
 * License along with Libav; if not, write to the Free Software
18
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 */
20
20
 
 
21
#include "libavutil/cpu.h"
21
22
#include "libavcodec/dsputil.h"
22
23
#include "libavcodec/h264data.h"
23
24
#include "libavcodec/h264dsp.h"
24
25
 
25
 
#include "dsputil_ppc.h"
26
26
#include "dsputil_altivec.h"
27
27
#include "util_altivec.h"
28
28
#include "types_altivec.h"
32
32
 
33
33
#define OP_U8_ALTIVEC                          PUT_OP_U8_ALTIVEC
34
34
#define PREFIX_h264_chroma_mc8_altivec         put_h264_chroma_mc8_altivec
35
 
#define PREFIX_no_rnd_vc1_chroma_mc8_altivec   put_no_rnd_vc1_chroma_mc8_altivec
36
35
#define PREFIX_h264_chroma_mc8_num             altivec_put_h264_chroma_mc8_num
37
36
#define PREFIX_h264_qpel16_h_lowpass_altivec   put_h264_qpel16_h_lowpass_altivec
38
37
#define PREFIX_h264_qpel16_h_lowpass_num       altivec_put_h264_qpel16_h_lowpass_num
43
42
#include "h264_template_altivec.c"
44
43
#undef OP_U8_ALTIVEC
45
44
#undef PREFIX_h264_chroma_mc8_altivec
46
 
#undef PREFIX_no_rnd_vc1_chroma_mc8_altivec
47
45
#undef PREFIX_h264_chroma_mc8_num
48
46
#undef PREFIX_h264_qpel16_h_lowpass_altivec
49
47
#undef PREFIX_h264_qpel16_h_lowpass_num
54
52
 
55
53
#define OP_U8_ALTIVEC                          AVG_OP_U8_ALTIVEC
56
54
#define PREFIX_h264_chroma_mc8_altivec         avg_h264_chroma_mc8_altivec
57
 
#define PREFIX_no_rnd_vc1_chroma_mc8_altivec   avg_no_rnd_vc1_chroma_mc8_altivec
58
55
#define PREFIX_h264_chroma_mc8_num             altivec_avg_h264_chroma_mc8_num
59
56
#define PREFIX_h264_qpel16_h_lowpass_altivec   avg_h264_qpel16_h_lowpass_altivec
60
57
#define PREFIX_h264_qpel16_h_lowpass_num       altivec_avg_h264_qpel16_h_lowpass_num
65
62
#include "h264_template_altivec.c"
66
63
#undef OP_U8_ALTIVEC
67
64
#undef PREFIX_h264_chroma_mc8_altivec
68
 
#undef PREFIX_no_rnd_vc1_chroma_mc8_altivec
69
65
#undef PREFIX_h264_chroma_mc8_num
70
66
#undef PREFIX_h264_qpel16_h_lowpass_altivec
71
67
#undef PREFIX_h264_qpel16_h_lowpass_num
970
966
 
971
967
void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
972
968
 
973
 
    if (has_altivec()) {
 
969
    if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) {
974
970
        c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
975
971
        c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec;
976
 
        c->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec;
977
 
        c->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec;
978
972
 
979
973
#define dspfunc(PFX, IDX, NUM) \
980
974
        c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
1002
996
 
1003
997
void ff_h264dsp_init_ppc(H264DSPContext *c)
1004
998
{
1005
 
    if (has_altivec()) {
 
999
    if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) {
1006
1000
        c->h264_idct_add = ff_h264_idct_add_altivec;
1007
1001
        c->h264_idct_add8 = ff_h264_idct_add8_altivec;
1008
1002
        c->h264_idct_add16 = ff_h264_idct_add16_altivec;