| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2002 Dieter Shirley | 2 * Copyright (c) 2002 Dieter Shirley |
| 3 * | 3 * |
| 4 * dct_unquantize_h263_altivec: | 4 * dct_unquantize_h263_altivec: |
| 5 * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> | 5 * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> |
| 6 * | 6 * |
| 7 * This file is part of FFmpeg. | 7 * This file is part of FFmpeg. |
| 8 * | 8 * |
| 9 * FFmpeg is free software; you can redistribute it and/or | 9 * FFmpeg is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Lesser General Public | 10 * modify it under the terms of the GNU Lesser General Public |
| 11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
| 12 * version 2.1 of the License, or (at your option) any later version. | 12 * version 2.1 of the License, or (at your option) any later version. |
| 13 * | 13 * |
| 14 * FFmpeg is distributed in the hope that it will be useful, | 14 * FFmpeg is distributed in the hope that it will be useful, |
| 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 * Lesser General Public License for more details. | 17 * Lesser General Public License for more details. |
| 18 * | 18 * |
| 19 * You should have received a copy of the GNU Lesser General Public | 19 * You should have received a copy of the GNU Lesser General Public |
| 20 * License along with FFmpeg; if not, write to the Free Software | 20 * License along with FFmpeg; if not, write to the Free Software |
| 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #include <stdlib.h> | 24 #include <stdlib.h> |
| 25 #include <stdio.h> | 25 #include <stdio.h> |
| 26 #include "libavutil/cpu.h" |
| 26 #include "libavcodec/dsputil.h" | 27 #include "libavcodec/dsputil.h" |
| 27 #include "libavcodec/mpegvideo.h" | 28 #include "libavcodec/mpegvideo.h" |
| 28 | 29 |
| 29 #include "util_altivec.h" | 30 #include "util_altivec.h" |
| 30 #include "types_altivec.h" | 31 #include "types_altivec.h" |
| 31 #include "dsputil_altivec.h" | 32 #include "dsputil_altivec.h" |
| 32 | 33 |
| 33 // Swaps two variables (used for altivec registers) | 34 // Swaps two variables (used for altivec registers) |
| 34 #define SWAP(a,b) \ | 35 #define SWAP(a,b) \ |
| 35 do { \ | 36 do { \ |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 if (i == 1) { | 564 if (i == 1) { |
| 564 // cheat. this avoid special-casing the first iteration | 565 // cheat. this avoid special-casing the first iteration |
| 565 block[0] = backup_0; | 566 block[0] = backup_0; |
| 566 } | 567 } |
| 567 } | 568 } |
| 568 } | 569 } |
| 569 | 570 |
| 570 | 571 |
| 571 void MPV_common_init_altivec(MpegEncContext *s) | 572 void MPV_common_init_altivec(MpegEncContext *s) |
| 572 { | 573 { |
| 573 if ((mm_flags & FF_MM_ALTIVEC) == 0) return; | 574 if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; |
| 574 | 575 |
| 575 if (s->avctx->lowres==0) { | 576 if (s->avctx->lowres==0) { |
| 576 if ((s->avctx->idct_algo == FF_IDCT_AUTO) || | 577 if ((s->avctx->idct_algo == FF_IDCT_AUTO) || |
| 577 (s->avctx->idct_algo == FF_IDCT_ALTIVEC)) { | 578 (s->avctx->idct_algo == FF_IDCT_ALTIVEC)) { |
| 578 s->dsp.idct_put = idct_put_altivec; | 579 s->dsp.idct_put = idct_put_altivec; |
| 579 s->dsp.idct_add = idct_add_altivec; | 580 s->dsp.idct_add = idct_add_altivec; |
| 580 s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; | 581 s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; |
| 581 } | 582 } |
| 582 } | 583 } |
| 583 | 584 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 598 | 599 |
| 599 if ((s->avctx->dct_algo == FF_DCT_AUTO) || | 600 if ((s->avctx->dct_algo == FF_DCT_AUTO) || |
| 600 (s->avctx->dct_algo == FF_DCT_ALTIVEC)) { | 601 (s->avctx->dct_algo == FF_DCT_ALTIVEC)) { |
| 601 #if 0 /* seems to cause trouble under some circumstances */ | 602 #if 0 /* seems to cause trouble under some circumstances */ |
| 602 s->dct_quantize = dct_quantize_altivec; | 603 s->dct_quantize = dct_quantize_altivec; |
| 603 #endif | 604 #endif |
| 604 s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec; | 605 s->dct_unquantize_h263_intra = dct_unquantize_h263_altivec; |
| 605 s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec; | 606 s->dct_unquantize_h263_inter = dct_unquantize_h263_altivec; |
| 606 } | 607 } |
| 607 } | 608 } |
| OLD | NEW |