From b4987f72197e0c62cf2633bf835a9c32d2a445ae Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 18 Feb 2014 11:30:55 +0100 Subject: idct: Convert IDCT permutation #defines to an enum Also rename the enum values to be consistent with other DCT permutations. --- libavcodec/x86/cavsdsp.c | 2 +- libavcodec/x86/idctdsp_init.c | 12 ++++++------ libavcodec/x86/mpegvideoenc_template.c | 2 +- libavcodec/x86/proresdsp_init.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libavcodec/x86') diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index f0e8cfcd17..b85912b084 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -493,7 +493,7 @@ static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c, c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmx; c->cavs_idct8_add = cavs_idct8_add_mmx; - c->idct_perm = FF_TRANSPOSE_IDCT_PERM; + c->idct_perm = FF_IDCT_PERM_TRANSPOSE; } #endif /* HAVE_MMX_INLINE */ diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index 9b68497502..5bd293fb6b 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -41,16 +41,16 @@ static const uint8_t simple_mmx_permutation[64] = { 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) + enum idct_permutation_type perm_type) { int i; - switch (idct_permutation_type) { - case FF_SIMPLE_IDCT_PERM: + switch (perm_type) { + case FF_IDCT_PERM_SIMPLE: for (i = 0; i < 64; i++) idct_permutation[i] = simple_mmx_permutation[i]; return 1; - case FF_SSE2_IDCT_PERM: + case FF_IDCT_PERM_SSE2: for (i = 0; i < 64; i++) idct_permutation[i] = (i & 0x38) | idct_sse2_row_perm[i & 7]; return 1; @@ -76,7 +76,7 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->idct_put = ff_simple_idct_put_mmx; c->idct_add = ff_simple_idct_add_mmx; c->idct = ff_simple_idct_mmx; - c->idct_permutation_type = FF_SIMPLE_IDCT_PERM; + c->perm_type = FF_IDCT_PERM_SIMPLE; break; case FF_IDCT_XVIDMMX: c->idct_put = ff_idct_xvid_mmx_put; @@ -100,7 +100,7 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->idct_put = ff_idct_xvid_sse2_put; c->idct_add = ff_idct_xvid_sse2_add; c->idct = ff_idct_xvid_sse2; - c->idct_permutation_type = FF_SSE2_IDCT_PERM; + c->perm_type = FF_IDCT_PERM_SSE2; } } } diff --git a/libavcodec/x86/mpegvideoenc_template.c b/libavcodec/x86/mpegvideoenc_template.c index 4a17ff3da7..87965fe114 100644 --- a/libavcodec/x86/mpegvideoenc_template.c +++ b/libavcodec/x86/mpegvideoenc_template.c @@ -229,7 +229,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, if(s->mb_intra) block[0]= level; else block[0]= temp_block[0]; - if (s->idsp.idct_permutation_type == FF_SIMPLE_IDCT_PERM) { + if (s->idsp.perm_type == FF_IDCT_PERM_SIMPLE) { if(last_non_zero_p1 <= 1) goto end; block[0x08] = temp_block[0x01]; block[0x10] = temp_block[0x08]; block[0x20] = temp_block[0x10]; diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c index a66fc70982..e82dac0448 100644 --- a/libavcodec/x86/proresdsp_init.c +++ b/libavcodec/x86/proresdsp_init.c @@ -38,17 +38,17 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp) int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { - dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; + dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_sse2; } if (EXTERNAL_SSE4(cpu_flags)) { - dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; + dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_sse4; } if (EXTERNAL_AVX(cpu_flags)) { - dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; + dsp->idct_permutation_type = FF_IDCT_PERM_TRANSPOSE; dsp->idct_put = ff_prores_idct_put_10_avx; } #endif /* ARCH_X86_64 */ -- cgit v1.2.3