comparison ppc/h264_altivec.c @ 12475:9fef0a8ddd63 libavcodec

Move mm_support() from libavcodec to libavutil, make it a public function and rename it to av_get_cpu_flags().
author stefano
date Wed, 08 Sep 2010 15:07:14 +0000
parents 06abedae2906
children
comparison
equal deleted inserted replaced
12474:cf54b8e98e7a 12475:9fef0a8ddd63
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"
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 (mm_support() & AV_CPU_FLAG_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_altivec; 976 c->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec;
976 c->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec; 977 c->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec;
977 978
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 (mm_support() & AV_CPU_FLAG_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;