Commit 91bf1a91 authored by Christophe Massiot's avatar Christophe Massiot

* Borrowed livid's latest libmmx and MMXEXT MC. Not in the Makefile => to

test it, replace vdec_motion_inner_mmx.c by vdec_motion_inner_mmxext.c.

I'm interested in performance feedback.
parent ba59eb04
/*
* attributes.h
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
*
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
*
* mpeg2dec is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* mpeg2dec 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//use gcc attribs to align critical data structures
#ifdef ATTRIBUTE_ALIGNED_MAX
#define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
#else
#define ATTR_ALIGN(align)
#endif
This diff is collapsed.
......@@ -3,7 +3,7 @@
* MMX
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_inner_mmx.c,v 1.7 2001/01/05 18:46:44 massiot Exp $
* $Id: vdec_motion_inner_mmx.c,v 1.8 2001/01/16 17:59:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the
* work done by the livid project <http://www.linuxvideo.org/>
......@@ -52,6 +52,7 @@
#include "video_parser.h"
#include "video_fifo.h"
#include "attributes.h"
#include "mmx.h"
/* OK, I know, this code has been taken from livid's mpeg2dec --Meuuh */
......@@ -76,8 +77,6 @@ static __inline__ void MMXAverage2( u8 *dst, u8 *src1, u8 *src2 )
// *dst = clip_to_u8((*src1 + *src2 + 1)/2);
//
//mmx_zero_reg();
movq_m2r(*src1,mm1); // load 8 src1 bytes
movq_r2r(mm1,mm2); // copy 8 src1 bytes
......@@ -108,8 +107,6 @@ static __inline__ void MMXInterpAverage2( u8 *dst, u8 *src1, u8 *src2 )
// *dst = clip_to_u8((*dst + (*src1 + *src2 + 1)/2 + 1)/2);
//
//mmx_zero_reg();
movq_m2r(*dst,mm1); // load 8 dst bytes
movq_r2r(mm1,mm2); // copy 8 dst bytes
......@@ -152,11 +149,9 @@ static __inline__ void MMXAverage4( u8 *dst, u8 *src1, u8 *src2, u8 *src3,
u8 *src4 )
{
//
// *dst = clip_to_u8((*src1 + *src2 + *src3 + *src4 + 2)/4);
// *dst = (*src1 + *src2 + *src3 + *src4 + 2) / 4;
//
//mmx_zero_reg();
movq_m2r(*src1,mm1); // load 8 src1 bytes
movq_r2r(mm1,mm2); // copy 8 src1 bytes
......@@ -210,8 +205,6 @@ static __inline__ void MMXInterpAverage4( u8 *dst, u8 *src1, u8 *src2,
// *dst = clip_to_u8((*dst + (*src1 + *src2 + *src3 + *src4 + 2)/4 + 1)/2);
//
//mmx_zero_reg();
movq_m2r(*src1,mm1); // load 8 src1 bytes
movq_r2r(mm1,mm2); // copy 8 src1 bytes
......@@ -279,6 +272,9 @@ static __inline__ void MMXInterpAverage4( u8 *dst, u8 *src1, u8 *src2,
* Actual Motion compensation
*/
#define pavg_r2r(src,dest) pavgusb_r2r (src, dest);
#define pavg_m2r(src,dest) pavgusb_m2r (src, dest);
#define __MotionComponent_x_y_copy(width,height) \
void MotionComponent_x_y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
......@@ -290,17 +286,15 @@ void MotionComponent_x_y_copy_##width##_##height(yuv_data_t * p_src, \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
movq_m2r( *p_src, mm1 ); /* load 8 ref bytes */ \
movq_r2m( mm1, *p_dest ); /* store 8 bytes at curr */ \
\
movq_m2r( *p_src, mm0 ); /* load 8 ref bytes */ \
if( width == 16 ) \
{ \
movq_m2r( *(p_src + 8), mm1 ); /* load 8 ref bytes */ \
movq_r2m( mm1, *(p_dest + 8) ); /* store 8 bytes at curr */ \
} \
movq_m2r( *(p_src + 8), mm1 ); \
p_src += i_stride; \
\
movq_r2m( mm0, *p_dest ); /* store 8 bytes at curr */ \
if( width == 16 ) \
movq_r2m( mm1, *(p_dest + 8) ); \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
......@@ -416,7 +410,7 @@ void MotionComponent_X_y_avg_##width##_##height(yuv_data_t * p_src, \
\
if( width == 16 ) \
{ \
MMXInterpAverage2( p_dest + 8, p_dest + 8, p_src + 9 ); \
MMXInterpAverage2( p_dest + 8, p_src + 8, p_src + 9 ); \
} \
\
p_dest += i_stride; \
......@@ -429,21 +423,22 @@ void MotionComponent_x_Y_avg_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
unsigned int i_dummy; \
int i_y; \
yuv_data_t * p_next_src = p_src + i_stride; \
\
MMXZeroReg(); \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
MMXInterpAverage2( p_dest, p_src, p_next_src ); \
\
if( width == 16 ) \
{ \
i_dummy = \
p_dest[i_x] + ((unsigned int)(p_src[i_x] \
+ p_src[i_x + i_stride] \
+ 1) >> 1); \
p_dest[i_x] = (i_dummy + 1) >> 1; \
MMXInterpAverage2( p_dest + 8, p_src + 8, p_next_src + 8 ); \
} \
p_dest += i_stride; \
p_src += i_stride; \
p_next_src += i_stride; \
} \
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.70 2001/01/15 19:54:34 massiot Exp $
* $Id: vpar_headers.c,v 1.71 2001/01/16 17:59:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -723,7 +723,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
memset( p_vpar->picture.pp_mb, 0, MAX_MB*sizeof(macroblock_t *) );
#endif
/* FIXME ! remove asap ?? */
//memset( P_picture->p_data, 0, (p_vpar->sequence.i_mb_size*384));
memset( P_picture->p_data, 0, (p_vpar->sequence.i_mb_size*384));
/* Update the reference pointers. */
ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture );
......
......@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.75 2001/01/16 13:27:14 massiot Exp $
* $Id: vpar_synchro.c,v 1.76 2001/01/16 17:59:23 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -231,9 +231,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
now = mdate();
period = 1000000 * 1001 / p_vpar->sequence.i_frame_rate;
vlc_mutex_lock( &p_vpar->p_vout->change_lock );
tau_yuv = p_vpar->p_vout->render_time;
vlc_mutex_unlock( &p_vpar->p_vout->change_lock );
vlc_mutex_lock( &p_vpar->synchro.fifo_lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment