--- libavcodec/dct-test.c | 16 ++-------------- libavcodec/x86/idct_permutation.h | 38 ++++++++++++++++++++++++++++++++++++++ libavcodec/x86/idctdsp_init.c | 15 +-------------- 3 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 libavcodec/x86/idct_permutation.h
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 74a4206..87faeae 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -44,6 +44,7 @@ #include "aandcttab.h" #include "faandct.h" #include "faanidct.h" +#include "x86/idct_permutation.h" #include "x86/idct_xvid.h" #include "dctref.h" @@ -144,19 +145,6 @@ static const struct algo idct_tab[] = { static short idct_mmx_perm[64]; -static short idct_simple_mmx_perm[64] = { - 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D, - 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D, - 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D, - 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F, - 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F, - 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D, - 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F, - 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, -}; - -static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 }; - static void idct_mmx_init(void) { int i; @@ -207,7 +195,7 @@ static void permute(int16_t dst[64], const int16_t src[64], int perm) dst[idct_mmx_perm[i]] = src[i]; } else if (perm == MMX_SIMPLE_PERM) { for (i = 0; i < 64; i++) - dst[idct_simple_mmx_perm[i]] = src[i]; + dst[simple_mmx_permutation[i]] = src[i]; } else if (perm == SSE2_PERM) { for (i = 0; i < 64; i++) dst[(i & 0x38) | idct_sse2_row_perm[i & 7]] = src[i]; diff --git a/libavcodec/x86/idct_permutation.h b/libavcodec/x86/idct_permutation.h new file mode 100644 index 0000000..8180f21 --- /dev/null +++ b/libavcodec/x86/idct_permutation.h @@ -0,0 +1,38 @@ +/* + * This file is part of Libav. + * + * Libav is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * Libav is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Libav; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_X86_IDCT_PERMUTATION_H +#define AVCODEC_X86_IDCT_PERMUTATION_H + +#include <stdint.h> + +/* Input permutation for the simple_idct_mmx */ +static const uint8_t simple_mmx_permutation[64] = { + 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D, + 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D, + 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D, + 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F, + 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F, + 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D, + 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F, + 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, +}; + +static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 }; + +#endif /* AVCODEC_X86_IDCT_PERMUTATION_H */ diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index 9b68497..21bf2c3 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -23,23 +23,10 @@ #include "libavcodec/avcodec.h" #include "libavcodec/idctdsp.h" #include "libavcodec/simple_idct.h" +#include "idct_permutation.h" #include "idct_xvid.h" #include "idctdsp.h" -/* Input permutation for the simple_idct_mmx */ -static const uint8_t simple_mmx_permutation[64] = { - 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D, - 0x10, 0x18, 0x14, 0x19, 0x11, 0x1C, 0x15, 0x1D, - 0x20, 0x28, 0x24, 0x29, 0x21, 0x2C, 0x25, 0x2D, - 0x12, 0x1A, 0x16, 0x1B, 0x13, 0x1E, 0x17, 0x1F, - 0x02, 0x0A, 0x06, 0x0B, 0x03, 0x0E, 0x07, 0x0F, - 0x30, 0x38, 0x34, 0x39, 0x31, 0x3C, 0x35, 0x3D, - 0x22, 0x2A, 0x26, 0x2B, 0x23, 0x2E, 0x27, 0x2F, - 0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, -}; - -static const uint8_t idct_sse2_row_perm[8] = { 0, 4, 1, 5, 2, 6, 3, 7 }; - av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, int idct_permutation_type) { -- 1.8.3.2 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel