From c0673f2cf4e2aab240af4ed3d94a8dac27114fef Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 29 Sep 2010 14:02:32 +0000 Subject: [PATCH] Remove d_idx as a variable, and instead load it as a constant in the asm. This has no measurable speed effect because the surrounding code doesn't take advantage of this yet. Originally committed as revision 25254 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/x86/h264dsp_mmx.c | 70 +++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/libavcodec/x86/h264dsp_mmx.c b/libavcodec/x86/h264dsp_mmx.c index ed0dbc6b0d..8743456bc7 100644 --- a/libavcodec/x86/h264dsp_mmx.c +++ b/libavcodec/x86/h264dsp_mmx.c @@ -66,9 +66,8 @@ void ff_h264_idct_add8_sse2 (uint8_t **dest, const int *block_offset, DCTEL static av_always_inline void h264_loop_filter_strength_iteration_mmx2(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2], int bidir, int edges, int step, - int mask_mv, int dir) + int mask_mv, int dir, const int d_idx) { - const x86_reg d_idx = dir ? -8 : -1; DECLARE_ALIGNED(8, const uint64_t, mask_dir) = dir ? 0 : 0xffffffffffffffffULL; int b_idx, edge; for( b_idx=12, edge=0; edge= limit "packsswb %%mm1, %%mm1 \n" "por %%mm1, %%mm0 \n" - ::"r"(d_idx), + ::"i"(d_idx), "r"(ref[0]+b_idx), - "r"(mv[0]+b_idx) + "r"(mv[0]+b_idx), + "i"(d_idx*4), + "i"(d_idx*4+8) ); } } __asm__ volatile( - "movd %0, %%mm1 \n" - "por %1, %%mm1 \n" // nnz[b] || nnz[bn] - ::"m"(nnz[b_idx]), - "m"(nnz[b_idx+d_idx]) + "movd (%0), %%mm1 \n" + "por %a1(%0), %%mm1 \n" // nnz[b] || nnz[bn] + ::"r"(nnz+b_idx), + "i"(d_idx) ); __asm__ volatile( "pminub %%mm7, %%mm1 \n" @@ -187,8 +193,8 @@ static void h264_loop_filter_strength_mmx2( int16_t bS[2][4][4], uint8_t nnz[40] // could do a special case for dir==0 && edges==1, but it only reduces the // average filter time by 1.2% - h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, edges, step, mask_mv1, 1); - h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, 4, 1, mask_mv0, 0); + h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, edges, step, mask_mv1, 1, -8); + h264_loop_filter_strength_iteration_mmx2(bS, nnz, ref, mv, bidir, 4, 1, mask_mv0, 0, -1); __asm__ volatile( "movq (%0), %%mm0 \n\t"