| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org> | 2 * Copyright (c) 2004 Romain Dolbeau <romain@dolbeau.org> |
| 3 * | 3 * |
| 4 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
| 5 * | 5 * |
| 6 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2.1 of the License, or (at your option) any later version. | 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 * FFmpeg is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Lesser General Public License for more details. | 14 * Lesser General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Lesser General Public | 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 FFmpeg; if not, write to the Free Software |
| 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 #include "libavutil/cpu.h" |
| 21 #include "libavcodec/dsputil.h" | 22 #include "libavcodec/dsputil.h" |
| 22 #include "libavcodec/h264data.h" | 23 #include "libavcodec/h264data.h" |
| 23 #include "libavcodec/h264dsp.h" | 24 #include "libavcodec/h264dsp.h" |
| 24 | 25 |
| 25 #include "dsputil_altivec.h" | 26 #include "dsputil_altivec.h" |
| 26 #include "util_altivec.h" | 27 #include "util_altivec.h" |
| 27 #include "types_altivec.h" | 28 #include "types_altivec.h" |
| 28 | 29 |
| 29 #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s | 30 #define PUT_OP_U8_ALTIVEC(d, s, dst) d = s |
| 30 #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s) | 31 #define AVG_OP_U8_ALTIVEC(d, s, dst) d = vec_avg(dst, s) |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 } | 963 } |
| 963 | 964 |
| 964 H264_WEIGHT(16,16) | 965 H264_WEIGHT(16,16) |
| 965 H264_WEIGHT(16, 8) | 966 H264_WEIGHT(16, 8) |
| 966 H264_WEIGHT( 8,16) | 967 H264_WEIGHT( 8,16) |
| 967 H264_WEIGHT( 8, 8) | 968 H264_WEIGHT( 8, 8) |
| 968 H264_WEIGHT( 8, 4) | 969 H264_WEIGHT( 8, 4) |
| 969 | 970 |
| 970 void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) { | 971 void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) { |
| 971 | 972 |
| 972 if (has_altivec()) { | 973 if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) { |
| 973 c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec; | 974 c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec; |
| 974 c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec; | 975 c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_altivec; |
| 975 c->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altiv
ec; | 976 c->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altiv
ec; |
| 976 c->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altiv
ec; | 977 c->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altiv
ec; |
| 977 | 978 |
| 978 #define dspfunc(PFX, IDX, NUM) \ | 979 #define dspfunc(PFX, IDX, NUM) \ |
| 979 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \ | 980 c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \ |
| 980 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \ | 981 c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \ |
| 981 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \ | 982 c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \ |
| 982 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \ | 983 c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 994 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec | 995 c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec |
| 995 | 996 |
| 996 dspfunc(put_h264_qpel, 0, 16); | 997 dspfunc(put_h264_qpel, 0, 16); |
| 997 dspfunc(avg_h264_qpel, 0, 16); | 998 dspfunc(avg_h264_qpel, 0, 16); |
| 998 #undef dspfunc | 999 #undef dspfunc |
| 999 } | 1000 } |
| 1000 } | 1001 } |
| 1001 | 1002 |
| 1002 void ff_h264dsp_init_ppc(H264DSPContext *c) | 1003 void ff_h264dsp_init_ppc(H264DSPContext *c) |
| 1003 { | 1004 { |
| 1004 if (has_altivec()) { | 1005 if (av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) { |
| 1005 c->h264_idct_add = ff_h264_idct_add_altivec; | 1006 c->h264_idct_add = ff_h264_idct_add_altivec; |
| 1006 c->h264_idct_add8 = ff_h264_idct_add8_altivec; | 1007 c->h264_idct_add8 = ff_h264_idct_add8_altivec; |
| 1007 c->h264_idct_add16 = ff_h264_idct_add16_altivec; | 1008 c->h264_idct_add16 = ff_h264_idct_add16_altivec; |
| 1008 c->h264_idct_add16intra = ff_h264_idct_add16intra_altivec; | 1009 c->h264_idct_add16intra = ff_h264_idct_add16intra_altivec; |
| 1009 c->h264_idct_dc_add= h264_idct_dc_add_altivec; | 1010 c->h264_idct_dc_add= h264_idct_dc_add_altivec; |
| 1010 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_altivec; | 1011 c->h264_idct8_dc_add = ff_h264_idct8_dc_add_altivec; |
| 1011 c->h264_idct8_add = ff_h264_idct8_add_altivec; | 1012 c->h264_idct8_add = ff_h264_idct8_add_altivec; |
| 1012 c->h264_idct8_add4 = ff_h264_idct8_add4_altivec; | 1013 c->h264_idct8_add4 = ff_h264_idct8_add4_altivec; |
| 1013 c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_altivec; | 1014 c->h264_v_loop_filter_luma= h264_v_loop_filter_luma_altivec; |
| 1014 c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_altivec; | 1015 c->h264_h_loop_filter_luma= h264_h_loop_filter_luma_altivec; |
| 1015 | 1016 |
| 1016 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels16x16_altivec; | 1017 c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels16x16_altivec; |
| 1017 c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels16x8_altivec; | 1018 c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels16x8_altivec; |
| 1018 c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels8x16_altivec; | 1019 c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels8x16_altivec; |
| 1019 c->weight_h264_pixels_tab[3] = ff_weight_h264_pixels8x8_altivec; | 1020 c->weight_h264_pixels_tab[3] = ff_weight_h264_pixels8x8_altivec; |
| 1020 c->weight_h264_pixels_tab[4] = ff_weight_h264_pixels8x4_altivec; | 1021 c->weight_h264_pixels_tab[4] = ff_weight_h264_pixels8x4_altivec; |
| 1021 c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16x16_altivec; | 1022 c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16x16_altivec; |
| 1022 c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels16x8_altivec; | 1023 c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels16x8_altivec; |
| 1023 c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels8x16_altivec; | 1024 c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels8x16_altivec; |
| 1024 c->biweight_h264_pixels_tab[3] = ff_biweight_h264_pixels8x8_altivec; | 1025 c->biweight_h264_pixels_tab[3] = ff_biweight_h264_pixels8x8_altivec; |
| 1025 c->biweight_h264_pixels_tab[4] = ff_biweight_h264_pixels8x4_altivec; | 1026 c->biweight_h264_pixels_tab[4] = ff_biweight_h264_pixels8x4_altivec; |
| 1026 } | 1027 } |
| 1027 } | 1028 } |
| OLD | NEW |