Commit 2a8ef11d authored by Sam Hocevar's avatar Sam Hocevar

(previous commit foired)

 . this is a coding style patch which removes all "foo(bar){" constructions
   and most of the tabulations.
 . also, fixed a bug in the default subtitle track.
 . and made a few error messages more explicit, ie. changed "error: %s" to
   "foo error: couldn't initialize bar (%s)"
 . and removed a warning in intf_ctrl.c which isn't used anyway.
parent a132d75c
......@@ -331,7 +331,7 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
SDL_ShowCursor( 1 );
SDL_WM_SetCaption( VOUT_TITLE , VOUT_TITLE );
SDL_EventState(SDL_KEYUP , SDL_IGNORE); /* ignore keys up */
SDL_EventState(SDL_KEYUP , SDL_IGNORE); /* ignore keys up */
if( p_vout->b_need_render )
{
......@@ -382,8 +382,8 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_YUV_CHANGE;
/* Check buffers properties */
p_vout->p_sys->b_must_acquire = 1; /* always acquire */
/* Check buffers properties */
p_vout->p_sys->b_must_acquire = 1; /* always acquire */
return( 0 );
}
......
......@@ -498,8 +498,8 @@ static int SpawnInput( int i_argc, intf_arg_t *p_argv )
p_main->p_intf->p_input = input_CreateThread( i_method, p_source, i_port, i_vlan_id,
p_main->p_intf->p_vout, p_main->p_aout,
NULL );
return( INTF_NO_ERROR );
#endif
return( INTF_NO_ERROR );
}
/*****************************************************************************
......
......@@ -24,9 +24,9 @@
typedef struct lpcmdec_s lpcmdec_t;
typedef struct lpcm_sync_info_s {
int sample_rate; /* sample rate in Hz */
int frame_size; /* frame size in bytes */
int bit_rate; /* nominal bit rate in kbps */
int sample_rate; /* sample rate in Hz */
int frame_size; /* frame size in bytes */
int bit_rate; /* nominal bit rate in kbps */
} lpcm_sync_info_t;
typedef struct lpcm_byte_stream_s {
......@@ -57,7 +57,7 @@ struct lpcmdec_s {
*/
/* The bit stream structure handles the PES stream at the bit level */
lpcm_bit_stream_t bit_stream;
lpcm_bit_stream_t bit_stream;
};
......
......@@ -2,7 +2,7 @@
* lpcm_decoder_thread.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.c,v 1.7 2000/12/27 18:35:45 massiot Exp $
* $Id: lpcm_decoder_thread.c,v 1.8 2001/01/05 14:46:37 sam Exp $
*
* Authors:
*
......@@ -66,11 +66,11 @@ static void EndThread (lpcmdec_thread_t * p_adec);
vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
{
lpcmdec_thread_t * p_lpcmdec;
intf_DbgMsg ( "LPCM Debug: creating lpcm decoder thread" );
intf_DbgMsg ( "lpcm: creating lpcm decoder thread" );
/* Allocate the memory needed to store the thread's structure */
if ((p_lpcmdec = (lpcmdec_thread_t *)malloc (sizeof(lpcmdec_thread_t))) == NULL) {
intf_ErrMsg ( "LPCM Error: not enough memory for lpcmdec_CreateThread() to create the new thread" );
intf_ErrMsg ( "lpcm error: cannot create lpcmdec_thread_t" );
return 0;
}
......@@ -92,7 +92,7 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
/* Spawn the lpcm decoder thread */
if (vlc_thread_create(&p_lpcmdec->thread_id, "lpcm decoder", (vlc_thread_func_t)RunThread, (void *)p_lpcmdec)) {
intf_ErrMsg ( "LPCM Error: can't spawn lpcm decoder thread" );
intf_ErrMsg ( "lpcm error: cannot spawn thread" );
free (p_lpcmdec);
return 0;
}
......@@ -171,38 +171,38 @@ static void RunThread (lpcmdec_thread_t * p_lpcmdec)
while ((!p_lpcmdec->p_fifo->b_die) && (!p_lpcmdec->p_fifo->b_error))
{
s16 * buffer;
lpcm_sync_info_t sync_info;
s16 * buffer;
lpcm_sync_info_t sync_info;
if (!sync)
if (!sync)
{
/* have to find a synchro point */
}
if (DECODER_FIFO_START(*p_lpcmdec->p_fifo)->i_pts)
{
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(*p_lpcmdec->p_fifo)->i_pts;
DECODER_FIFO_START(*p_lpcmdec->p_fifo)->i_pts = 0;
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START(*p_lpcmdec->p_fifo)->i_pts;
DECODER_FIFO_START(*p_lpcmdec->p_fifo)->i_pts = 0;
}
else
{
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->l_end_frame] = LAST_MDATE;
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->l_end_frame] = LAST_MDATE;
}
p_lpcmdec->p_aout_fifo->l_rate = sync_info.sample_rate;
p_lpcmdec->p_aout_fifo->l_rate = sync_info.sample_rate;
buffer = ((s16 *)p_lpcmdec->p_aout_fifo->buffer) + (p_lpcmdec->p_aout_fifo->l_end_frame * LPCMDEC_FRAME_SIZE);
buffer = ((s16 *)p_lpcmdec->p_aout_fifo->buffer) + (p_lpcmdec->p_aout_fifo->l_end_frame * LPCMDEC_FRAME_SIZE);
if (lpcm_decode_frame (&p_lpcmdec->lpcm_decoder, buffer))
if (lpcm_decode_frame (&p_lpcmdec->lpcm_decoder, buffer))
{
sync = 0;
goto bad_frame;
}
vlc_mutex_lock (&p_lpcmdec->p_aout_fifo->data_lock);
p_lpcmdec->p_aout_fifo->l_end_frame = (p_lpcmdec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal (&p_lpcmdec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
sync = 0;
goto bad_frame;
}
vlc_mutex_lock (&p_lpcmdec->p_aout_fifo->data_lock);
p_lpcmdec->p_aout_fifo->l_end_frame = (p_lpcmdec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal (&p_lpcmdec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
intf_DbgMsg( "LPCM Debug: %x", *buffer );
bad_frame:
......
......@@ -2,7 +2,7 @@
* lpcm_decoder_thread.h : lpcm decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.h,v 1.2 2000/12/21 13:25:51 massiot Exp $
* $Id: lpcm_decoder_thread.h,v 1.3 2001/01/05 14:46:37 sam Exp $
*
* Authors:
*
......@@ -37,7 +37,7 @@ typedef struct lpcmdec_thread_s
*/
decoder_fifo_t * p_fifo; /* stores the PES stream data */
data_packet_t * p_data;
int sync_ptr; /* sync ptr from lpcm magic header */
int sync_ptr; /* sync ptr from lpcm magic header */
adec_config_t * p_config;
/*
......
......@@ -94,7 +94,7 @@ mtime_t mdate( void )
void mwait( mtime_t date )
{
#ifdef HAVE_KERNEL_OS_H
mtime_t delay;
delay = date - real_time_clock_usecs();
......
......@@ -94,7 +94,7 @@ int BuildInetAddr( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port )
intf_DbgMsg("debug: resolving internet address %s...", psz_in_addr);
if ( (p_hostent = gethostbyname(psz_in_addr)) == NULL)
{
intf_ErrMsg("error: unknown host %s", psz_in_addr);
intf_ErrMsg( "net error: unknown host %s", psz_in_addr );
return( -1 );
}
......@@ -158,8 +158,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
}
else
{
intf_ErrMsg("Cannot read flags for interface %s: %s", psz_name,
strerror(errno));
intf_ErrMsg( "net error: cannot read flags for interface %s (%s)",
psz_name, strerror(errno) );
return -1;
}
......@@ -182,8 +182,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
}
else
{
intf_ErrMsg("Cannot read hardware address for interface %s: %s",
psz_name, strerror(errno));
intf_ErrMsg( "net error: cannot read hardware address for %s (%s)",
psz_name, strerror(errno) );
return -1;
}
......@@ -197,8 +197,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
}
else
{
intf_ErrMsg("Cannot read network address for interface %s: %s",
psz_name, strerror(errno));
intf_ErrMsg( "net error: cannot read network address for %s (%s)",
psz_name, strerror(errno) );
return -1;
}
......@@ -221,8 +221,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
}
else
{
intf_ErrMsg("Cannot read broadcast address for interface %s: %s",
psz_name, strerror(errno));
intf_ErrMsg( "net error: cannot read broadcast address for %s (%s)",
psz_name, strerror(errno));
return -1;
}
#endif
......@@ -267,8 +267,8 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
i_rc = ioctl(i_sockfd, SIOCGIFCONF, (byte_t*)&ifc_netconf);
if( i_rc )
{
intf_ErrMsg("Cannot read network configuration: %s",
strerror(errno));
intf_ErrMsg( "net error: cannot read network configuration (%s)",
strerror(errno));
break;
}
}
......@@ -298,8 +298,8 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
/* Read the status of this interface */
if( ioctl(i_sockfd, SIOCGIFFLAGS, (byte_t *)p_ifr_current_if) < 0 )
{
intf_ErrMsg("Cannot access interface %s: %s",
p_ifr_current_if->ifr_name, strerror(errno));
intf_ErrMsg( "net error: cannot access interface %s (%s)",
p_ifr_current_if->ifr_name, strerror(errno) );
i_rc = -1;
break;
}
......
......@@ -54,14 +54,14 @@ playlist_t * playlist_Create ( void )
p_playlist->i_index = 0;
p_playlist->p_list = NULL;
intf_Msg("Playlist initialized");
intf_Msg("Playlist created");
return( p_playlist );
}
void playlist_Init( playlist_t * p_playlist, int i_optind )
{
int i_list_index = 0;
int i_index = 0;
int i_index;
int i_argc = p_main->i_argc;
if( i_optind < i_argc )
......@@ -70,11 +70,17 @@ void playlist_Init( playlist_t * p_playlist, int i_optind )
p_playlist->p_list = malloc( i_list_index * sizeof( int ) );
while( i_argc - i_index > i_optind )
for( i_index = 0 ; i_argc - i_index > i_optind ; i_index++ )
{
p_playlist->p_list[ i_index ] =
p_main->ppsz_argv[ i_argc - i_index - 1];
i_index++;
if( strncmp( p_main->ppsz_argv[ i_argc - i_index - 1], "-", 1 ) )
{
p_playlist->p_list[ i_index ] =
p_main->ppsz_argv[ i_argc - i_index - 1];
}
else
{
p_playlist->p_list[ i_index ] = "/dev/stdin";
}
}
}
else
......
......@@ -115,6 +115,7 @@ void bank_Init( plugin_bank_t * p_bank )
/* Dummy plugin */
SEEK_PLUGIN( "dummy" );
SEEK_PLUGIN( "null" );
#undef SEEK_PLUGIN
}
......@@ -190,7 +191,7 @@ char * TestPlugin ( plugin_id_t *p_plugin_id, char * psz_name )
}
#ifndef SYS_BEOS
intf_WarnMsg( 1, "Plugin %s failed: %s", psz_plugin, dlerror() );
intf_ErrMsg( "plugin error: cannot open %s (%s)", psz_plugin, dlerror() );
#endif
free( psz_plugin );
......
......@@ -263,7 +263,7 @@ static void RunThread( spudec_thread_t *p_spudec )
p_spu->i_height = p_spu->i_y - ( (i_word << 8)
| GetByte( &p_spudec->bit_stream ) ) + 1;
i_index += 6;
i_index += 6;
break;
case SPU_CMD_SET_OFFSETS:
/* 06xxxxyyyy (byte offsets) */
......
......@@ -2,7 +2,7 @@
* vdec_idctmmx.S : MMX IDCT implementation
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_idctmmx.S,v 1.5 2000/12/21 17:19:52 massiot Exp $
* $Id: vdec_idctmmx.S,v 1.6 2001/01/05 14:46:37 sam Exp $
*
* Authors:
*
......@@ -166,173 +166,173 @@ vdec_IDCT:
/* with the dequantization in iHuff module */
pmulhw 8*12(%esi), %mm0 /* V12 */
movq 8*4(%ecx), %mm1
pmulhw 8*4(%esi), %mm1 /* V4 */
pmulhw 8*4(%esi), %mm1 /* V4 */
movq (%ecx), %mm3
psraw $1, %mm0 /* t64=t66 */
pmulhw (%esi), %mm3 /* V0 */
movq 8*8(%ecx), %mm5 /* duplicate V4 */
movq %mm1, %mm2 /* added 11/1/96 */
pmulhw 8*8(%esi),%mm5 /* V8 */
psubsw %mm0, %mm1 /* V16 */
pmulhw x5a825a825a825a82, %mm1 /* 23170 ->V18 */
paddsw %mm0, %mm2 /* V17 */
movq %mm2, %mm0 /* duplicate V17 */
psraw $1, %mm2 /* t75=t82 */
psraw $2, %mm0 /* t72 */
movq %mm3, %mm4 /* duplicate V0 */
paddsw %mm5, %mm3 /* V19 */
psubsw %mm5, %mm4 /* V20 ;mm5 free */
psraw $1, %mm0 /* t64=t66 */
pmulhw (%esi), %mm3 /* V0 */
movq 8*8(%ecx), %mm5 /* duplicate V4 */
movq %mm1, %mm2 /* added 11/1/96 */
pmulhw 8*8(%esi),%mm5 /* V8 */
psubsw %mm0, %mm1 /* V16 */
pmulhw x5a825a825a825a82, %mm1 /* 23170 ->V18 */
paddsw %mm0, %mm2 /* V17 */
movq %mm2, %mm0 /* duplicate V17 */
psraw $1, %mm2 /* t75=t82 */
psraw $2, %mm0 /* t72 */
movq %mm3, %mm4 /* duplicate V0 */
paddsw %mm5, %mm3 /* V19 */
psubsw %mm5, %mm4 /* V20 ;mm5 free */
/* moved from the block below */
movq 8*10(%ecx), %mm7
psraw $1, %mm3 /* t74=t81 */
movq %mm3, %mm6 /* duplicate t74=t81 */
psraw $2, %mm4 /* t77=t79 */
psubsw %mm0, %mm1 /* V21 ; mm0 free */
paddsw %mm2, %mm3 /* V22 */
movq %mm1, %mm5 /* duplicate V21 */
paddsw %mm4, %mm1 /* V23 */
movq %mm3, 8*4(%esi) /* V22 */
psubsw %mm5, %mm4 /* V24; mm5 free */
movq %mm1, 8*12(%esi) /* V23 */
psubsw %mm2, %mm6 /* V25; mm2 free */
movq %mm4, (%esi) /* V24 */
psraw $1, %mm3 /* t74=t81 */
movq %mm3, %mm6 /* duplicate t74=t81 */
psraw $2, %mm4 /* t77=t79 */
psubsw %mm0, %mm1 /* V21 ; mm0 free */
paddsw %mm2, %mm3 /* V22 */
movq %mm1, %mm5 /* duplicate V21 */
paddsw %mm4, %mm1 /* V23 */
movq %mm3, 8*4(%esi) /* V22 */
psubsw %mm5, %mm4 /* V24; mm5 free */
movq %mm1, 8*12(%esi) /* V23 */
psubsw %mm2, %mm6 /* V25; mm2 free */
movq %mm4, (%esi) /* V24 */
/* keep mm6 alive all along the next block */
/* movq %mm6, 8*8(%esi) V25 */
/* movq %mm6, 8*8(%esi) V25 */
/* column 0: odd part
* use V2, V6, V10, V14 to produce V31, V39, V40, V41
*/
/* moved above: movq 8*10(%ecx), %mm7 */
pmulhw 8*10(%esi), %mm7 /* V10 */
pmulhw 8*10(%esi), %mm7 /* V10 */
movq 8*6(%ecx), %mm0
pmulhw 8*6(%esi), %mm0 /* V6 */
pmulhw 8*6(%esi), %mm0 /* V6 */
movq 8*2(%ecx), %mm5
movq %mm7, %mm3 /* duplicate V10 */
pmulhw 8*2(%esi), %mm5 /* V2 */
movq %mm7, %mm3 /* duplicate V10 */
pmulhw 8*2(%esi), %mm5 /* V2 */
movq 8*14(%ecx), %mm4
psubsw %mm0, %mm7 /* V26 */
pmulhw 8*14(%esi), %mm4 /* V14 */
paddsw %mm0, %mm3 /* V29 ; free mm0 */
movq %mm7, %mm1 /* duplicate V26 */
psraw $1, %mm3 /* t91=t94 */
pmulhw x539f539f539f539f,%mm7 /* V33 */
psraw $1, %mm1 /* t96 */
movq %mm5, %mm0 /* duplicate V2 */
psraw $2, %mm4 /* t85=t87 */
paddsw %mm4,%mm5 /* V27 */
psubsw %mm4, %mm0 /* V28 ; free mm4 */
movq %mm0, %mm2 /* duplicate V28 */
psraw $1, %mm5 /* t90=t93 */
pmulhw x4546454645464546,%mm0 /* V35 */
psraw $1, %mm2 /* t97 */
movq %mm5, %mm4 /* duplicate t90=t93 */
psubsw %mm2, %mm1 /* V32 ; free mm2 */
pmulhw x61f861f861f861f8,%mm1 /* V36 */
psllw $1, %mm7 /* t107 */
paddsw %mm3, %mm5 /* V31 */
psubsw %mm3, %mm4 /* V30 ; free mm3 */
pmulhw x5a825a825a825a82,%mm4 /* V34 */
psubsw %mm0, %mm7 /* V26 */
pmulhw 8*14(%esi), %mm4 /* V14 */
paddsw %mm0, %mm3 /* V29 ; free mm0 */
movq %mm7, %mm1 /* duplicate V26 */
psraw $1, %mm3 /* t91=t94 */
pmulhw x539f539f539f539f,%mm7 /* V33 */
psraw $1, %mm1 /* t96 */
movq %mm5, %mm0 /* duplicate V2 */
psraw $2, %mm4 /* t85=t87 */
paddsw %mm4,%mm5 /* V27 */
psubsw %mm4, %mm0 /* V28 ; free mm4 */
movq %mm0, %mm2 /* duplicate V28 */
psraw $1, %mm5 /* t90=t93 */
pmulhw x4546454645464546,%mm0 /* V35 */
psraw $1, %mm2 /* t97 */
movq %mm5, %mm4 /* duplicate t90=t93 */
psubsw %mm2, %mm1 /* V32 ; free mm2 */
pmulhw x61f861f861f861f8,%mm1 /* V36 */
psllw $1, %mm7 /* t107 */
paddsw %mm3, %mm5 /* V31 */
psubsw %mm3, %mm4 /* V30 ; free mm3 */
pmulhw x5a825a825a825a82,%mm4 /* V34 */
nop
psubsw %mm1, %mm0 /* V38 */
psubsw %mm7, %mm1 /* V37 ; free mm7 */
psllw $1, %mm1 /* t114 */
psubsw %mm1, %mm0 /* V38 */
psubsw %mm7, %mm1 /* V37 ; free mm7 */
psllw $1, %mm1 /* t114 */
/* move from the next block */
movq %mm6, %mm3 /* duplicate V25 */
movq %mm6, %mm3 /* duplicate V25 */
/* move from the next block */
movq 8*4(%esi), %mm7 /* V22 */
psllw $1, %mm0 /* t110 */
psubsw %mm5, %mm0 /* V39 (mm5 needed for next block) */
psllw $2, %mm4 /* t112 */
movq 8*4(%esi), %mm7 /* V22 */
psllw $1, %mm0 /* t110 */
psubsw %mm5, %mm0 /* V39 (mm5 needed for next block) */
psllw $2, %mm4 /* t112 */
/* moved from the next block */
movq 8*12(%esi), %mm2 /* V23 */
psubsw %mm0, %mm4 /* V40 */
paddsw %mm4, %mm1 /* V41; free mm0 */
movq 8*12(%esi), %mm2 /* V23 */
psubsw %mm0, %mm4 /* V40 */
paddsw %mm4, %mm1 /* V41; free mm0 */
/* moved from the next block */
psllw $1, %mm2 /* t117=t125 */
psllw $1, %mm2 /* t117=t125 */
/* column 0: output butterfly */
/* moved above:
* movq %mm6, %mm3 duplicate V25
* movq 8*4(%esi), %mm7 V22
* movq 8*12(%esi), %mm2 V23
* psllw $1, %mm2 t117=t125
* movq %mm6, %mm3 duplicate V25
* movq 8*4(%esi), %mm7 V22
* movq 8*12(%esi), %mm2 V23
* psllw $1, %mm2 t117=t125
*/
psubsw %mm1, %mm6 /* tm6 */
paddsw %mm1, %mm3 /* tm8; free mm1 */
movq %mm7, %mm1 /* duplicate V22 */
paddsw %mm5, %mm7 /* tm0 */
movq %mm3, 8*8(%esi) /* tm8; free mm3 */
psubsw %mm5, %mm1 /* tm14; free mm5 */
movq %mm6, 8*6(%esi) /* tm6; free mm6 */
movq %mm2, %mm3 /* duplicate t117=t125 */
movq (%esi), %mm6 /* V24 */
paddsw %mm0, %mm2 /* tm2 */
movq %mm7, (%esi) /* tm0; free mm7 */
psubsw %mm0, %mm3 /* tm12; free mm0 */
movq %mm1, 8*14(%esi) /* tm14; free mm1 */
psllw $1, %mm6 /* t119=t123 */
movq %mm2, 8*2(%esi) /* tm2; free mm2 */
movq %mm6, %mm0 /* duplicate t119=t123 */
movq %mm3, 8*12(%esi) /* tm12; free mm3 */
paddsw %mm4, %mm6 /* tm4 */
psubsw %mm1, %mm6 /* tm6 */
paddsw %mm1, %mm3 /* tm8; free mm1 */
movq %mm7, %mm1 /* duplicate V22 */
paddsw %mm5, %mm7 /* tm0 */
movq %mm3, 8*8(%esi) /* tm8; free mm3 */
psubsw %mm5, %mm1 /* tm14; free mm5 */
movq %mm6, 8*6(%esi) /* tm6; free mm6 */
movq %mm2, %mm3 /* duplicate t117=t125 */
movq (%esi), %mm6 /* V24 */
paddsw %mm0, %mm2 /* tm2 */
movq %mm7, (%esi) /* tm0; free mm7 */
psubsw %mm0, %mm3 /* tm12; free mm0 */
movq %mm1, 8*14(%esi) /* tm14; free mm1 */
psllw $1, %mm6 /* t119=t123 */
movq %mm2, 8*2(%esi) /* tm2; free mm2 */
movq %mm6, %mm0 /* duplicate t119=t123 */
movq %mm3, 8*12(%esi) /* tm12; free mm3 */
paddsw %mm4, %mm6 /* tm4 */
/* moved from next block */
movq 8*5(%ecx), %mm1
psubsw %mm4, %mm0 /* tm10; free mm4 */
psubsw %mm4, %mm0 /* tm10; free mm4 */
/* moved from next block */
pmulhw 8*5(%esi), %mm1 /* V5 */
movq %mm6, 8*4(%esi) /* tm4; free mm6 */
movq %mm0, 8*10(%esi) /* tm10; free mm0 */
pmulhw 8*5(%esi), %mm1 /* V5 */
movq %mm6, 8*4(%esi) /* tm4; free mm6 */
movq %mm0, 8*10(%esi) /* tm10; free mm0 */
/* column 1: even part
* use V5, V13, V1, V9 to produce V56..V59
*/
/* moved to prev block:
* movq 8*5(%ecx), %mm1
* pmulhw 8*5(%esi), %mm1 V5
* movq 8*5(%ecx), %mm1
* pmulhw 8*5(%esi), %mm1 V5
*/
movq 8*13(%ecx), %mm7
psllw $1, %mm1 /* t128=t130 */
pmulhw 8*13(%esi), %mm7 /* V13 */
movq %mm1, %mm2 /* duplicate t128=t130 */
psllw $1, %mm1 /* t128=t130 */
pmulhw 8*13(%esi), %mm7 /* V13 */
movq %mm1, %mm2 /* duplicate t128=t130 */
movq 8(%ecx), %mm3
pmulhw 8(%esi), %mm3 /* V1 */
pmulhw 8(%esi), %mm3 /* V1 */
movq 8*9(%ecx), %mm5
psubsw %mm7, %mm1 /* V50 */
pmulhw 8*9(%esi), %mm5 /* V9 */
paddsw %mm7, %mm2 /* V51 */
pmulhw x5a825a825a825a82, %mm1 /* 23170 ->V52 */
movq %mm2, %mm6 /* duplicate V51 */
psraw $1, %mm2 /* t138=t144 */
movq %mm3, %mm4 /* duplicate V1 */
psraw $2, %mm6 /* t136 */
paddsw %mm5, %mm3 /* V53 */
psubsw %mm5, %mm4 /* V54 ;mm5 free */
movq %mm3, %mm7 /* duplicate V53 */
psubsw %mm7, %mm1 /* V50 */
pmulhw 8*9(%esi), %mm5 /* V9 */
paddsw %mm7, %mm2 /* V51 */
pmulhw x5a825a825a825a82, %mm1 /* 23170 ->V52 */
movq %mm2, %mm6 /* duplicate V51 */
psraw $1, %mm2 /* t138=t144 */
movq %mm3, %mm4 /* duplicate V1 */
psraw $2, %mm6 /* t136 */
paddsw %mm5, %mm3 /* V53 */
psubsw %mm5, %mm4 /* V54 ;mm5 free */
movq %mm3, %mm7 /* duplicate V53 */
/* moved from next block */
movq 8*11(%ecx), %mm0
psraw $1, %mm4 /* t140=t142 */
psubsw %mm6, %mm1 /* V55 ; mm6 free */
paddsw %mm2, %mm3 /* V56 */
movq %mm4, %mm5 /* duplicate t140=t142 */
paddsw %mm1, %mm4 /* V57 */
movq %mm3, 8*5(%esi) /* V56 */
psubsw %mm1, %mm5 /* V58; mm1 free */
movq %mm4, 8*13(%esi) /* V57 */
psubsw %mm2, %mm7 /* V59; mm2 free */
movq %mm5, 8*9(%esi) /* V58 */
psraw $1, %mm4 /* t140=t142 */
psubsw %mm6, %mm1 /* V55 ; mm6 free */
paddsw %mm2, %mm3 /* V56 */
movq %mm4, %mm5 /* duplicate t140=t142 */
paddsw %mm1, %mm4 /* V57 */
movq %mm3, 8*5(%esi) /* V56 */
psubsw %mm1, %mm5 /* V58; mm1 free */
movq %mm4, 8*13(%esi) /* V57 */
psubsw %mm2, %mm7 /* V59; mm2 free */
movq %mm5, 8*9(%esi) /* V58 */
/* keep mm7 alive all along the next block
* movq %mm7, 8(%esi) V59
* movq %mm7, 8(%esi) V59
* moved above
* movq 8*11(%ecx), %mm0
* movq 8*11(%ecx), %mm0
*/
pmulhw 8*11(%esi), %mm0 /* V11 */
pmulhw 8*11(%esi), %mm0 /* V11 */
movq 8*7(%ecx), %mm6
pmulhw 8*7(%esi), %mm6 /* V7 */
pmulhw 8*7(%esi), %mm6 /* V7 */
movq 8*15(%ecx), %mm4
movq %mm0, %mm3 /* duplicate V11 */
pmulhw 8*15(%esi), %mm4 /* V15 */
movq %mm0, %mm3 /* duplicate V11 */
pmulhw 8*15(%esi), %mm4 /* V15 */
movq 8*3(%ecx), %mm5
psllw $1, %mm6 /* t146=t152 */
pmulhw 8*3(%esi), %mm5 /* V3 */
paddsw %mm6, %mm0 /* V63 */
psllw $1, %mm6 /* t146=t152 */
pmulhw 8*3(%esi), %mm5 /* V3 */
paddsw %mm6, %mm0 /* V63 */
/* note that V15 computation has a correction step:
* this is a 'magic' constant that rebiases the results to be closer to the
* expected result. this magic constant can be refined to reduce the error
......@@ -340,43 +340,43 @@ vdec_IDCT:
* is actually multiplied by 16
*/
paddw x0005000200010001, %mm4
psubsw %mm6, %mm3 /* V60 ; free mm6 */
psraw $1, %mm0 /* t154=t156 */
movq %mm3, %mm1 /* duplicate V60 */
pmulhw x539f539f539f539f, %mm1 /* V67 */
movq %mm5, %mm6 /* duplicate V3 */
psraw $2, %mm4 /* t148=t150 */
paddsw %mm4, %mm5 /* V61 */
psubsw %mm4, %mm6 /* V62 ; free mm4 */
movq %mm5, %mm4 /* duplicate V61 */
psllw $1, %mm1 /* t169 */
paddsw %mm0, %mm5 /* V65 -> result */
psubsw %mm0, %mm4 /* V64 ; free mm0 */
pmulhw x5a825a825a825a82, %mm4 /* V68 */
psraw $1, %mm3 /* t158 */
psubsw %mm6, %mm3 /* V66 */
movq %mm5, %mm2 /* duplicate V65 */
pmulhw x61f861f861f861f8, %mm3 /* V70 */
psllw $1, %mm6 /* t165 */
pmulhw x4546454645464546, %mm6 /* V69 */
psraw $1, %mm2 /* t172 */
psubsw %mm6, %mm3 /* V60 ; free mm6 */
psraw $1, %mm0 /* t154=t156 */
movq %mm3, %mm1 /* duplicate V60 */
pmulhw x539f539f539f539f, %mm1 /* V67 */
movq %mm5, %mm6 /* duplicate V3 */
psraw $2, %mm4 /* t148=t150 */
paddsw %mm4, %mm5 /* V61 */
psubsw %mm4, %mm6 /* V62 ; free mm4 */
movq %mm5, %mm4 /* duplicate V61 */
psllw $1, %mm1 /* t169 */
paddsw %mm0, %mm5 /* V65 -> result */
psubsw %mm0, %mm4 /* V64 ; free mm0 */
pmulhw x5a825a825a825a82, %mm4 /* V68 */
psraw $1, %mm3 /* t158 */
psubsw %mm6, %mm3 /* V66 */
movq %mm5, %mm2 /* duplicate V65 */
pmulhw x61f861f861f861f8, %mm3 /* V70 */
psllw $1, %mm6 /* t165 */
pmulhw x4546454645464546, %mm6 /* V69 */
psraw $1, %mm2 /* t172 */
/* moved from next block */
movq 8*5(%esi), %mm0 /* V56 */
psllw $1, %mm4 /* t174 */
movq 8*5(%esi), %mm0 /* V56 */
psllw $1, %mm4 /* t174 */
/* moved from next block */
psraw $1, %mm0 /* t177=t188 */
psraw $1, %mm0 /* t177=t188 */
nop
psubsw %mm3, %mm6 /* V72 */
psubsw %mm1, %mm3 /* V71 ; free mm1 */
psubsw %mm2, %mm6 /* V73 ; free mm2 */
psubsw %mm3, %mm6 /* V72 */
psubsw %mm1, %mm3 /* V71 ; free mm1 */
psubsw %mm2, %mm6 /* V73 ; free mm2 */
/* moved from next block */
psraw $1, %mm5 /* t178=t189 */
psubsw %mm6, %mm4 /* V74 */
psraw $1, %mm5 /* t178=t189 */
psubsw %mm6, %mm4 /* V74 */
/* moved from next block */
movq %mm0, %mm1 /* duplicate t177=t188 */
paddsw %mm4, %mm3 /* V75 */
movq %mm0, %mm1 /* duplicate t177=t188 */
paddsw %mm4, %mm3 /* V75 */
/* moved from next block */
paddsw %mm5, %mm0 /* tm1 */
paddsw %mm5, %mm0 /* tm1 */
/* location
* 5 - V56
* 13 - V57
......@@ -388,38 +388,38 @@ vdec_IDCT:
* X - V75, mm3
* free mm0, mm1 & mm2
* moved above
* movq 8*5(%esi), %mm0 V56
* psllw $1, %mm0 t177=t188 ! new !!
* psllw $1, %mm5 t178=t189 ! new !!
* movq %mm0, %mm1 duplicate t177=t188
* paddsw %mm5, %mm0 tm1
* movq 8*5(%esi), %mm0 V56
* psllw $1, %mm0 t177=t188 ! new !!
* psllw $1, %mm5 t178=t189 ! new !!
* movq %mm0, %mm1 duplicate t177=t188
* paddsw %mm5, %mm0 tm1
*/
movq 8*13(%esi), %mm2 /* V57 */
psubsw %mm5, %mm1 /* tm15; free mm5 */
movq %mm0, 8(%esi) /* tm1; free mm0 */
psraw $1, %mm7 /* t182=t184 ! new !! */
movq 8*13(%esi), %mm2 /* V57 */
psubsw %mm5, %mm1 /* tm15; free mm5 */
movq %mm0, 8(%esi) /* tm1; free mm0 */
psraw $1, %mm7 /* t182=t184 ! new !! */
/* save the store as used directly in the transpose
* movq %mm1, 120(%esi) tm15; free mm1
* movq %mm1, 120(%esi) tm15; free mm1
*/
movq %mm7, %mm5 /* duplicate t182=t184 */
psubsw %mm3, %mm7 /* tm7 */
paddsw %mm3, %mm5 /* tm9; free mm3 */
movq 8*9(%esi), %mm0 /* V58 */
movq %mm2, %mm3 /* duplicate V57 */
movq %mm7, 8*7(%esi) /* tm7; free mm7 */
psubsw %mm6, %mm3 /* tm13 */
paddsw %mm6, %mm2 /* tm3 ; free mm6 */
movq %mm7, %mm5 /* duplicate t182=t184 */
psubsw %mm3, %mm7 /* tm7 */
paddsw %mm3, %mm5 /* tm9; free mm3 */
movq 8*9(%esi), %mm0 /* V58 */
movq %mm2, %mm3 /* duplicate V57 */
movq %mm7, 8*7(%esi) /* tm7; free mm7 */
psubsw %mm6, %mm3 /* tm13 */
paddsw %mm6, %mm2 /* tm3 ; free mm6 */
/* moved up from the transpose */
movq %mm3, %mm7
/* moved up from the transpose */
punpcklwd %mm1, %mm3
movq %mm0, %mm6 /* duplicate V58 */
movq %mm2, 8*3(%esi) /* tm3; free mm2 */
paddsw %mm4, %mm0 /* tm5 */
psubsw %mm4, %mm6 /* tm11; free mm4 */
movq %mm0, %mm6 /* duplicate V58 */
movq %mm2, 8*3(%esi) /* tm3; free mm2 */
paddsw %mm4, %mm0 /* tm5 */
psubsw %mm4, %mm6 /* tm11; free mm4 */
/* moved up from the transpose */
punpckhwd %mm1, %mm7
movq %mm0, 8*5(%esi) /* tm5; free mm0 */
movq %mm0, 8*5(%esi) /* tm5; free mm0 */
/* moved up from the transpose */
movq %mm5, %mm2
/* transpose - M4 part
......@@ -432,14 +432,14 @@ vdec_IDCT:
* scheduled before the transpose is done without stores, or use the faster
* half mmword stores (when possible)
*/
movd %mm3, 8*9+4(%esi) /* MS part of tmt9 */
movd %mm3, 8*9+4(%esi) /* MS part of tmt9 */
punpcklwd %mm6, %mm5
movd %mm7, 8*13+4(%esi) /* MS part of tmt13 */
movd %mm7, 8*13+4(%esi) /* MS part of tmt13 */
punpckhwd %mm6, %mm2
movd %mm5, 8*9(%esi) /* LS part of tmt9 */
punpckhdq %mm3, %mm5 /* free mm3 */
movd %mm2, 8*13(%esi) /* LS part of tmt13 */
punpckhdq %mm7, %mm2 /* free mm7 */
movd %mm5, 8*9(%esi) /* LS part of tmt9 */
punpckhdq %mm3, %mm5 /* free mm3 */
movd %mm2, 8*13(%esi) /* LS part of tmt13 */
punpckhdq %mm7, %mm2 /* free mm7 */
/* moved up from the M3 transpose */
movq 8*8(%esi), %mm0
/* moved up from the M3 transpose */
......@@ -447,19 +447,19 @@ vdec_IDCT:
/* moved up from the M3 transpose */
movq %mm0, %mm3
/* shuffle the rest of the data, and write it with 2 mmword writes */
movq %mm5, 8*11(%esi) /* tmt11 */
movq %mm5, 8*11(%esi) /* tmt11 */
/* moved up from the M3 transpose */
punpcklwd %mm1, %mm0
movq %mm2, 8*15(%esi) /* tmt15 */
movq %mm2, 8*15(%esi) /* tmt15 */
/* moved up from the M3 transpose */
punpckhwd %mm1, %mm3
/* transpose - M3 part
* moved up to previous code section
* movq 8*8(%esi), %mm0
* movq 8*10(%esi), %mm1
* movq %mm0, %mm3
* punpcklwd %mm1, %mm0
* punpckhwd %mm1, %mm3
* movq 8*8(%esi), %mm0
* movq 8*10(%esi), %mm1
* movq %mm0, %mm3
* punpcklwd %mm1, %mm0
* punpckhwd %mm1, %mm3
*/
movq 8*12(%esi), %mm6
movq 8*14(%esi), %mm4
......@@ -469,136 +469,136 @@ vdec_IDCT:
movq %mm0, %mm1
punpckhdq %mm6, %mm1
movq %mm3, %mm7
punpckhwd %mm4, %mm2 /* free mm4 */
punpckldq %mm6, %mm0 /* free mm6 */
punpckhwd %mm4, %mm2 /* free mm4 */
punpckldq %mm6, %mm0 /* free mm6 */
/* moved from next block */
movq 8*13(%esi), %mm4 /* tmt13 */
movq 8*13(%esi), %mm4 /* tmt13 */
punpckldq %mm2, %mm3
punpckhdq %mm2, %mm7 /* free mm2 */
punpckhdq %mm2, %mm7 /* free mm2 */
/* moved from next block */
movq %mm3, %mm5 /* duplicate tmt5 */
movq %mm3, %mm5 /* duplicate tmt5 */
/* column 1: even part (after transpose)
* moved above
* movq %mm3, %mm5 duplicate tmt5
* movq 8*13(%esi), %mm4 tmt13
* movq %mm3, %mm5 duplicate tmt5
* movq 8*13(%esi), %mm4 tmt13
*/
psubsw %mm4, %mm3 /* V134 */
pmulhw x5a825a825a825a82, %mm3 /* 23170 ->V136 */
movq 8*9(%esi), %mm6 /* tmt9 */
paddsw %mm4, %mm5 /* V135 ; mm4 free */
movq %mm0, %mm4 /* duplicate tmt1 */
paddsw %mm6, %mm0 /* V137 */
psubsw %mm6, %mm4 /* V138 ; mm6 free */
psllw $2, %mm3 /* t290 */
psubsw %mm5, %mm3 /* V139 */
movq %mm0, %mm6 /* duplicate V137 */
paddsw %mm5, %mm0 /* V140 */
movq %mm4, %mm2 /* duplicate V138 */
paddsw %mm3, %mm2 /* V141 */
psubsw %mm3, %mm4 /* V142 ; mm3 free */
movq %mm0, 8*9(%esi) /* V140 */
psubsw %mm5, %mm6 /* V143 ; mm5 free */
psubsw %mm4, %mm3 /* V134 */
pmulhw x5a825a825a825a82, %mm3 /* 23170 ->V136 */
movq 8*9(%esi), %mm6 /* tmt9 */
paddsw %mm4, %mm5 /* V135 ; mm4 free */
movq %mm0, %mm4 /* duplicate tmt1 */
paddsw %mm6, %mm0 /* V137 */
psubsw %mm6, %mm4 /* V138 ; mm6 free */
psllw $2, %mm3 /* t290 */
psubsw %mm5, %mm3 /* V139 */
movq %mm0, %mm6 /* duplicate V137 */
paddsw %mm5, %mm0 /* V140 */
movq %mm4, %mm2 /* duplicate V138 */
paddsw %mm3, %mm2 /* V141 */
psubsw %mm3, %mm4 /* V142 ; mm3 free */
movq %mm0, 8*9(%esi) /* V140 */
psubsw %mm5, %mm6 /* V143 ; mm5 free */
/* moved from next block */
movq 8*11(%esi), %mm0 /* tmt11 */
movq %mm2, 8*13(%esi) /* V141 */
movq 8*11(%esi), %mm0 /* tmt11 */
movq %mm2, 8*13(%esi) /* V141 */
/* moved from next block */
movq %mm0, %mm2 /* duplicate tmt11 */
movq %mm0, %mm2 /* duplicate tmt11 */
/* column 1: odd part (after transpose) */
/* moved up to the prev block
* movq 8*11(%esi), %mm0 tmt11
* movq %mm0, %mm2 duplicate tmt11
* movq 8*11(%esi), %mm0 tmt11
* movq %mm0, %mm2 duplicate tmt11
*/
movq 8*15(%esi), %mm5 /* tmt15 */
psubsw %mm7, %mm0 /* V144 */
movq %mm0, %mm3 /* duplicate V144 */
paddsw %mm7, %mm2 /* V147 ; free mm7 */
pmulhw x539f539f539f539f, %mm0 /* 21407-> V151 */
movq %mm1, %mm7 /* duplicate tmt3 */
paddsw %mm5, %mm7 /* V145 */
psubsw %mm5, %mm1 /* V146 ; free mm5 */
psubsw %mm1, %mm3 /* V150 */
movq %mm7, %mm5 /* duplicate V145 */
pmulhw x4546454645464546, %mm1 /* 17734-> V153 */
psubsw %mm2, %mm5 /* V148 */
pmulhw x61f861f861f861f8, %mm3 /* 25080-> V154 */
psllw $2, %mm0 /* t311 */
pmulhw x5a825a825a825a82, %mm5 /* 23170-> V152 */
paddsw %mm2, %mm7 /* V149 ; free mm2 */
psllw $1, %mm1 /* t313 */
nop /* without the nop - freeze here for one clock */
movq %mm3, %mm2 /* duplicate V154 */
psubsw %mm0, %mm3 /* V155 ; free mm0 */
psubsw %mm2, %mm1 /* V156 ; free mm2 */
movq 8*15(%esi), %mm5 /* tmt15 */
psubsw %mm7, %mm0 /* V144 */
movq %mm0, %mm3 /* duplicate V144 */
paddsw %mm7, %mm2 /* V147 ; free mm7 */
pmulhw x539f539f539f539f, %mm0 /* 21407-> V151 */
movq %mm1, %mm7 /* duplicate tmt3 */
paddsw %mm5, %mm7 /* V145 */
psubsw %mm5, %mm1 /* V146 ; free mm5 */
psubsw %mm1, %mm3 /* V150 */
movq %mm7, %mm5 /* duplicate V145 */
pmulhw x4546454645464546, %mm1 /* 17734-> V153 */
psubsw %mm2, %mm5 /* V148 */
pmulhw x61f861f861f861f8, %mm3 /* 25080-> V154 */
psllw $2, %mm0 /* t311 */
pmulhw x5a825a825a825a82, %mm5 /* 23170-> V152 */
paddsw %mm2, %mm7 /* V149 ; free mm2 */
psllw $1, %mm1 /* t313 */
nop /* without the nop - freeze here for one clock */
movq %mm3, %mm2 /* duplicate V154 */
psubsw %mm0, %mm3 /* V155 ; free mm0 */
psubsw %mm2, %mm1 /* V156 ; free mm2 */
/* moved from the next block */
movq %mm6, %mm2 /* duplicate V143 */
movq %mm6, %mm2 /* duplicate V143 */
/* moved from the next block */
movq 8*13(%esi), %mm0 /* V141 */
psllw $1, %mm1 /* t315 */
psubsw %mm7, %mm1 /* V157 (keep V149) */
psllw $2, %mm5 /* t317 */
psubsw %mm1, %mm5 /* V158 */
psllw $1, %mm3 /* t319 */
paddsw %mm5, %mm3 /* V159 */
movq 8*13(%esi), %mm0 /* V141 */
psllw $1, %mm1 /* t315 */
psubsw %mm7, %mm1 /* V157 (keep V149) */
psllw $2, %mm5 /* t317 */
psubsw %mm1, %mm5 /* V158 */
psllw $1, %mm3 /* t319 */
paddsw %mm5, %mm3 /* V159 */
/* column 1: output butterfly (after transform)
* moved to the prev block
* movq %mm6, %mm2 duplicate V143
* movq 8*13(%esi), %mm0 V141
* movq %mm6, %mm2 duplicate V143
* movq 8*13(%esi), %mm0 V141
*/
psubsw %mm3, %mm2 /* V163 */
paddsw %mm3, %mm6 /* V164 ; free mm3 */
movq %mm4, %mm3 /* duplicate V142 */
psubsw %mm5, %mm4 /* V165 ; free mm5 */
movq %mm2, scratch7 /* out7 */
psubsw %mm3, %mm2 /* V163 */
paddsw %mm3, %mm6 /* V164 ; free mm3 */
movq %mm4, %mm3 /* duplicate V142 */
psubsw %mm5, %mm4 /* V165 ; free mm5 */
movq %mm2, scratch7 /* out7 */
psraw $4, %mm6
psraw $4, %mm4
paddsw %mm5, %mm3 /* V162 */
movq 8*9(%esi), %mm2 /* V140 */
movq %mm0, %mm5 /* duplicate V141 */
paddsw %mm5, %mm3 /* V162 */
movq 8*9(%esi), %mm2 /* V140 */
movq %mm0, %mm5 /* duplicate V141 */
/* in order not to perculate this line up,
* we read 72(%esi) very near to this location
*/
movq %mm6, 8*9(%esi) /* out9 */
paddsw %mm1, %mm0 /* V161 */
movq %mm3, scratch5 /* out5 */
psubsw %mm1, %mm5 /* V166 ; free mm1 */
movq %mm4, 8*11(%esi) /* out11 */
movq %mm6, 8*9(%esi) /* out9 */
paddsw %mm1, %mm0 /* V161 */
movq %mm3, scratch5 /* out5 */
psubsw %mm1, %mm5 /* V166 ; free mm1 */
movq %mm4, 8*11(%esi) /* out11 */
psraw $4, %mm5
movq %mm0, scratch3 /* out3 */
movq %mm2, %mm4 /* duplicate V140 */
movq %mm5, 8*13(%esi) /* out13 */
paddsw %mm7, %mm2 /* V160 */
movq %mm0, scratch3 /* out3 */
movq %mm2, %mm4 /* duplicate V140 */
movq %mm5, 8*13(%esi) /* out13 */
paddsw %mm7, %mm2 /* V160 */
/* moved from the next block */
movq 8(%esi), %mm0
psubsw %mm7, %mm4 /* V167 ; free mm7 */
psubsw %mm7, %mm4 /* V167 ; free mm7 */
/* moved from the next block */
movq 8*3(%esi), %mm7
psraw $4, %mm4
movq %mm2, scratch1 /* out1 */
movq %mm2, scratch1 /* out1 */
/* moved from the next block */
movq %mm0, %mm1
movq %mm4, 8*15(%esi) /* out15 */
movq %mm4, 8*15(%esi) /* out15 */
/* moved from the next block */
punpcklwd %mm7, %mm0
/* transpose - M2 parts
* moved up to the prev block
* movq 8(%esi), %mm0
* movq 8*3(%esi), %mm7
* movq %mm0, %mm1
* punpcklwd %mm7, %mm0
* movq 8(%esi), %mm0
* movq 8*3(%esi), %mm7
* movq %mm0, %mm1
* punpcklwd %mm7, %mm0
*/
movq 8*5(%esi), %mm5
punpckhwd %mm7, %mm1
movq 8*7(%esi), %mm4
movq %mm5, %mm3
/* shuffle the data and write the lower parts of the trasposed in 4 dwords */
movd %mm0, 8*8(%esi) /* LS part of tmt8 */
movd %mm0, 8*8(%esi) /* LS part of tmt8 */
punpcklwd %mm4, %mm5
movd %mm1, 8*12(%esi) /* LS part of tmt12 */
movd %mm1, 8*12(%esi) /* LS part of tmt12 */
punpckhwd %mm4, %mm3
movd %mm5, 8*8+4(%esi) /* MS part of tmt8 */
punpckhdq %mm5, %mm0 /* tmt10 */
movd %mm3, 8*12+4(%esi) /* MS part of tmt12 */
punpckhdq %mm3, %mm1 /* tmt14 */
movd %mm5, 8*8+4(%esi) /* MS part of tmt8 */
punpckhdq %mm5, %mm0 /* tmt10 */
movd %mm3, 8*12+4(%esi) /* MS part of tmt12 */
punpckhdq %mm3, %mm1 /* tmt14 */
/* transpose - M1 parts */
movq (%esi), %mm7
movq 8*2(%esi), %mm2
......@@ -606,203 +606,203 @@ vdec_IDCT:
movq 8*4(%esi), %mm5
punpcklwd %mm2, %mm7
movq 8*6(%esi), %mm4
punpckhwd %mm2, %mm6 /* free mm2 */
punpckhwd %mm2, %mm6 /* free mm2 */
movq %mm5, %mm3
punpcklwd %mm4, %mm5
punpckhwd %mm4, %mm3 /* free mm4 */
punpckhwd %mm4, %mm3 /* free mm4 */
movq %mm7, %mm2
movq %mm6, %mm4
punpckldq %mm5, %mm7 /* tmt0 */
punpckhdq %mm5, %mm2 /* tmt2 ; free mm5 */
punpckldq %mm5, %mm7 /* tmt0 */
punpckhdq %mm5, %mm2 /* tmt2 ; free mm5 */
/* shuffle the rest of the data, and write it with 2 mmword writes */
punpckldq %mm3, %mm6 /* tmt4 */
punpckldq %mm3, %mm6 /* tmt4 */
/* moved from next block */
movq %mm2, %mm5 /* duplicate tmt2 */
punpckhdq %mm3, %mm4 /* tmt6 ; free mm3 */
movq %mm2, %mm5 /* duplicate tmt2 */
punpckhdq %mm3, %mm4 /* tmt6 ; free mm3 */
/* moved from next block */
movq %mm0, %mm3 /* duplicate tmt10 */
movq %mm0, %mm3 /* duplicate tmt10 */
/* column 0: odd part (after transpose)
*moved up to prev block
* movq %mm0, %mm3 duplicate tmt10
* movq %mm2, %mm5 duplicate tmt2
* movq %mm0, %mm3 duplicate tmt10
* movq %mm2, %mm5 duplicate tmt2
*/
psubsw %mm4, %mm0 /* V110 */
paddsw %mm4, %mm3 /* V113 ; free mm4 */
movq %mm0, %mm4 /* duplicate V110 */
paddsw %mm1, %mm2 /* V111 */
pmulhw x539f539f539f539f, %mm0 /* 21407-> V117 */
psubsw %mm1, %mm5 /* V112 ; free mm1 */
psubsw %mm5, %mm4 /* V116 */
movq %mm2, %mm1 /* duplicate V111 */
pmulhw x4546454645464546, %mm5 /* 17734-> V119 */
psubsw %mm3, %mm2 /* V114 */
pmulhw x61f861f861f861f8, %mm4 /* 25080-> V120 */
paddsw %mm3, %mm1 /* V115 ; free mm3 */
pmulhw x5a825a825a825a82, %mm2 /* 23170-> V118 */
psllw $2, %mm0 /* t266 */
movq %mm1, (%esi) /* save V115 */
psllw $1, %mm5 /* t268 */
psubsw %mm4, %mm5 /* V122 */
psubsw %mm0, %mm4 /* V121 ; free mm0 */
psllw $1, %mm5 /* t270 */
psubsw %mm1, %mm5 /* V123 ; free mm1 */
psllw $2, %mm2 /* t272 */
psubsw %mm5, %mm2 /* V124 (keep V123) */
psllw $1, %mm4 /* t274 */
movq %mm5, 8*2(%esi) /* save V123 ; free mm5 */
paddsw %mm2, %mm4 /* V125 (keep V124) */
psubsw %mm4, %mm0 /* V110 */
paddsw %mm4, %mm3 /* V113 ; free mm4 */
movq %mm0, %mm4 /* duplicate V110 */
paddsw %mm1, %mm2 /* V111 */
pmulhw x539f539f539f539f, %mm0 /* 21407-> V117 */
psubsw %mm1, %mm5 /* V112 ; free mm1 */
psubsw %mm5, %mm4 /* V116 */
movq %mm2, %mm1 /* duplicate V111 */
pmulhw x4546454645464546, %mm5 /* 17734-> V119 */
psubsw %mm3, %mm2 /* V114 */
pmulhw x61f861f861f861f8, %mm4 /* 25080-> V120 */
paddsw %mm3, %mm1 /* V115 ; free mm3 */
pmulhw x5a825a825a825a82, %mm2 /* 23170-> V118 */
psllw $2, %mm0 /* t266 */
movq %mm1, (%esi) /* save V115 */
psllw $1, %mm5 /* t268 */
psubsw %mm4, %mm5 /* V122 */
psubsw %mm0, %mm4 /* V121 ; free mm0 */
psllw $1, %mm5 /* t270 */
psubsw %mm1, %mm5 /* V123 ; free mm1 */
psllw $2, %mm2 /* t272 */
psubsw %mm5, %mm2 /* V124 (keep V123) */
psllw $1, %mm4 /* t274 */
movq %mm5, 8*2(%esi) /* save V123 ; free mm5 */
paddsw %mm2, %mm4 /* V125 (keep V124) */
/* column 0: even part (after transpose) */
movq 8*12(%esi), %mm0 /* tmt12 */
movq %mm6, %mm3 /* duplicate tmt4 */
psubsw %mm0, %mm6 /* V100 */
paddsw %mm0, %mm3 /* V101 ; free mm0 */
pmulhw x5a825a825a825a82, %mm6 /* 23170 ->V102 */
movq %mm7, %mm5 /* duplicate tmt0 */
movq 8*8(%esi), %mm1 /* tmt8 */
paddsw %mm1, %mm7 /* V103 */
psubsw %mm1, %mm5 /* V104 ; free mm1 */
movq %mm7, %mm0 /* duplicate V103 */
psllw $2, %mm6 /* t245 */
paddsw %mm3, %mm7 /* V106 */
movq %mm5, %mm1 /* duplicate V104 */
psubsw %mm3, %mm6 /* V105 */
psubsw %mm3, %mm0 /* V109; free mm3 */
paddsw %mm6, %mm5 /* V107 */
psubsw %mm6, %mm1 /* V108 ; free mm6 */
movq 8*12(%esi), %mm0 /* tmt12 */
movq %mm6, %mm3 /* duplicate tmt4 */
psubsw %mm0, %mm6 /* V100 */
paddsw %mm0, %mm3 /* V101 ; free mm0 */
pmulhw x5a825a825a825a82, %mm6 /* 23170 ->V102 */
movq %mm7, %mm5 /* duplicate tmt0 */
movq 8*8(%esi), %mm1 /* tmt8 */
paddsw %mm1, %mm7 /* V103 */
psubsw %mm1, %mm5 /* V104 ; free mm1 */
movq %mm7, %mm0 /* duplicate V103 */
psllw $2, %mm6 /* t245 */
paddsw %mm3, %mm7 /* V106 */
movq %mm5, %mm1 /* duplicate V104 */
psubsw %mm3, %mm6 /* V105 */
psubsw %mm3, %mm0 /* V109; free mm3 */
paddsw %mm6, %mm5 /* V107 */
psubsw %mm6, %mm1 /* V108 ; free mm6 */
/* column 0: output butterfly (after transform) */
movq %mm1, %mm3 /* duplicate V108 */
paddsw %mm2, %mm1 /* out4 */
movq %mm1, %mm3 /* duplicate V108 */
paddsw %mm2, %mm1 /* out4 */
psraw $4, %mm1
psubsw %mm2, %mm3 /* out10 ; free mm2 */
psubsw %mm2, %mm3 /* out10 ; free mm2 */
psraw $4, %mm3
movq %mm0, %mm6 /* duplicate V109 */
movq %mm1, 8*4(%esi) /* out4 ; free mm1 */
psubsw %mm4, %mm0 /* out6 */
movq %mm3, 8*10(%esi) /* out10 ; free mm3 */
movq %mm0, %mm6 /* duplicate V109 */
movq %mm1, 8*4(%esi) /* out4 ; free mm1 */
psubsw %mm4, %mm0 /* out6 */
movq %mm3, 8*10(%esi) /* out10 ; free mm3 */
psraw $4, %mm0
paddsw %mm4, %mm6 /* out8 ; free mm4 */
movq %mm7, %mm1 /* duplicate V106 */
movq %mm0, 8*6(%esi) /* out6 ; free mm0 */
paddsw %mm4, %mm6 /* out8 ; free mm4 */
movq %mm7, %mm1 /* duplicate V106 */
movq %mm0, 8*6(%esi) /* out6 ; free mm0 */
psraw $4, %mm6
movq (%esi), %mm4 /* V115 */
movq %mm6, 8*8(%esi) /* out8 ; free mm6 */
movq %mm5, %mm2 /* duplicate V107 */
movq 8*2(%esi), %mm3 /* V123 */
paddsw %mm4, %mm7 /* out0 */
movq (%esi), %mm4 /* V115 */
movq %mm6, 8*8(%esi) /* out8 ; free mm6 */
movq %mm5, %mm2 /* duplicate V107 */
movq 8*2(%esi), %mm3 /* V123 */
paddsw %mm4, %mm7 /* out0 */
/* moved up from next block */
movq scratch3, %mm0
psraw $4, %mm7
/* moved up from next block */
movq scratch5, %mm6
psubsw %mm4, %mm1 /* out14 ; free mm4 */
paddsw %mm3, %mm5 /* out2 */
psubsw %mm4, %mm1 /* out14 ; free mm4 */
paddsw %mm3, %mm5 /* out2 */
psraw $4, %mm1
movq %mm7, (%esi) /* out0 ; free mm7 */
movq %mm7, (%esi) /* out0 ; free mm7 */
psraw $4, %mm5
movq %mm1, 8*14(%esi) /* out14 ; free mm1 */
psubsw %mm3, %mm2 /* out12 ; free mm3 */
movq %mm5, 8*2(%esi) /* out2 ; free mm5 */
movq %mm1, 8*14(%esi) /* out14 ; free mm1 */
psubsw %mm3, %mm2 /* out12 ; free mm3 */
movq %mm5, 8*2(%esi) /* out2 ; free mm5 */
psraw $4, %mm2
/* moved up to the prev block */
movq scratch7, %mm4
/* moved up to the prev block */
psraw $4, %mm0
movq %mm2, 8*12(%esi) /* out12 ; free mm2 */
movq %mm2, 8*12(%esi) /* out12 ; free mm2 */
/* moved up to the prev block */
psraw $4, %mm6
/* move back the data to its correct place
* moved up to the prev block
* movq scratch3, %mm0
* movq scratch5, %mm6
* movq scratch7, %mm4
* psraw $4, %mm0
* psraw $4, %mm6
* movq scratch3, %mm0
* movq scratch5, %mm6
* movq scratch7, %mm4
* psraw $4, %mm0
* psraw $4, %mm6
*/
movq scratch1, %mm1
psraw $4, %mm4
movq %mm0, 8*3(%esi) /* out3 */
movq %mm0, 8*3(%esi) /* out3 */
psraw $4, %mm1
movq %mm6, 8*5(%esi) /* out5 */
movq %mm4, 8*7(%esi) /* out7 */
movq %mm1, 8(%esi) /* out1 */
movq %mm6, 8*5(%esi) /* out5 */
movq %mm4, 8*7(%esi) /* out7 */
movq %mm1, 8(%esi) /* out1 */
/* transpose matrix */
movl $8, %ebx /* ebx is x_size */
movl %esi, %edi /* pointer to the matrix */
movl $8, %ebx /* ebx is x_size */
movl %esi, %edi /* pointer to the matrix */
movl %ebx, %ecx
sal $2, %ecx
movl %ebx, %eax
addl %ebx, %ecx
subl $4, %eax /* eax is inner loop variable */
addl %ebx, %ecx /* ecx is 6*row size */
movl %eax, %edx /* edx is the outer loop variable */
.L1: movq (%esi), %mm0 /* first line */
movq (%esi,%ebx,4), %mm2 /* third line */
movq %mm0, %mm6 /* copy first line */
punpcklwd (%esi,%ebx,2), %mm0 /* interleave fist and second lines */
movq %mm2, %mm7 /* copy third line */
punpcklwd (%esi,%ecx), %mm2 /* interleave third and fourth lines */
movq %mm0, %mm4 /* copy first intermediate result */
movq (%esi,%ebx,2), %mm1 /* second line */
subl $4, %eax /* eax is inner loop variable */
addl %ebx, %ecx /* ecx is 6*row size */
movl %eax, %edx /* edx is the outer loop variable */
.L1: movq (%esi), %mm0 /* first line */
movq (%esi,%ebx,4), %mm2 /* third line */
movq %mm0, %mm6 /* copy first line */
punpcklwd (%esi,%ebx,2), %mm0 /* interleave fist and second lines */
movq %mm2, %mm7 /* copy third line */
punpcklwd (%esi,%ecx), %mm2 /* interleave third and fourth lines */
movq %mm0, %mm4 /* copy first intermediate result */
movq (%esi,%ebx,2), %mm1 /* second line */
/* the next line 'punpcklwd %mm2, %mm0' inverted two pixels. */
/* punpckldq make printing cleaner */
punpckldq %mm2, %mm0 /* interleave to produce result 1 */
movq (%esi,%ecx), %mm3 /* fourth line */
punpckhdq %mm2, %mm4 /* interleave to produce result 2 */
movq %mm0, (%esi) /* write result 1 */
punpckhwd %mm1, %mm6 /* interleave first and second lines */
movq %mm4, (%esi,%ebx,2) /* write result 2 */
punpckhwd %mm3, %mm7 /* interleave 3rd and 4th lines */
movq %mm6, %mm5 /* copy first intermediate result */
punpckldq %mm7, %mm6 /* interleave to produce result 3 */
leal (%edi,%ebx,8), %edi /* point to 4x4 set 4 rows down */
punpckhdq %mm7, %mm5 /* interleave to produce result 4 */
movq %mm6, (%esi,%ebx,4) /* write result 3 */
movq %mm5, (%esi,%ecx) /* write result 4 */
punpckldq %mm2, %mm0 /* interleave to produce result 1 */
movq (%esi,%ecx), %mm3 /* fourth line */
punpckhdq %mm2, %mm4 /* interleave to produce result 2 */
movq %mm0, (%esi) /* write result 1 */
punpckhwd %mm1, %mm6 /* interleave first and second lines */
movq %mm4, (%esi,%ebx,2) /* write result 2 */
punpckhwd %mm3, %mm7 /* interleave 3rd and 4th lines */
movq %mm6, %mm5 /* copy first intermediate result */
punpckldq %mm7, %mm6 /* interleave to produce result 3 */
leal (%edi,%ebx,8), %edi /* point to 4x4 set 4 rows down */
punpckhdq %mm7, %mm5 /* interleave to produce result 4 */
movq %mm6, (%esi,%ebx,4) /* write result 3 */
movq %mm5, (%esi,%ecx) /* write result 4 */
/* check to see if number of rows left is zero */
cmpl $0, %edx
/* last time through you are done and ready to exit */
je .L3
.L2: movq 8(%esi), %mm0 /* first line */
movq 8(%esi,%ebx,4), %mm2 /* third line */
movq %mm0, %mm6 /* copy first line */
punpcklwd 8(%esi,%ebx,2), %mm0 /* interleave first and second lines */
movq %mm2, %mm7 /* copy third line */
punpcklwd 8(%esi,%ecx), %mm2 /* interleave 3rd and 4th lines */
movq %mm0, %mm4 /* copy first intermediate */
movq (%edi), %mm1 /* first line */
punpckldq %mm2, %mm0 /* interleave to produce 1st result */
movq (%edi,%ebx,4), %mm3 /* third line */
punpckhdq %mm2, %mm4 /* interleave to produce 2nd result */
punpckhwd 8(%esi,%ebx,2), %mm6 /* interleave 1st and 2nd lines */
movq %mm1, %mm2 /* copy first line */
punpckhwd 8(%esi,%ecx), %mm7 /* interleave 3rd and 4th lines */
movq %mm6, %mm5 /* copy first intermediate */
movq %mm0, (%edi) /* write result 1 */
punpckhdq %mm7, %mm5 /* produce third result */
punpcklwd (%edi,%ebx,2), %mm1 /* interleave 1st and 2nd lines */
movq %mm3, %mm0 /* copy third line */
punpckhwd (%edi,%ebx,2), %mm2 /* interleave 1st and 2nd lines */
movq %mm4, (%edi,%ebx,2) /* write result 2 */
punpckldq %mm7, %mm6 /* produce fourth result */
punpcklwd (%edi,%ecx), %mm3 /* interleave 3rd and 4th lines */
movq %mm1, %mm4 /* copy first intermediate */
movq %mm6, (%edi,%ebx,4) /* write result 3 */
.L2: movq 8(%esi), %mm0 /* first line */
movq 8(%esi,%ebx,4), %mm2 /* third line */
movq %mm0, %mm6 /* copy first line */
punpcklwd 8(%esi,%ebx,2), %mm0 /* interleave first and second lines */
movq %mm2, %mm7 /* copy third line */
punpcklwd 8(%esi,%ecx), %mm2 /* interleave 3rd and 4th lines */
movq %mm0, %mm4 /* copy first intermediate */
movq (%edi), %mm1 /* first line */
punpckldq %mm2, %mm0 /* interleave to produce 1st result */
movq (%edi,%ebx,4), %mm3 /* third line */
punpckhdq %mm2, %mm4 /* interleave to produce 2nd result */
punpckhwd 8(%esi,%ebx,2), %mm6 /* interleave 1st and 2nd lines */
movq %mm1, %mm2 /* copy first line */
punpckhwd 8(%esi,%ecx), %mm7 /* interleave 3rd and 4th lines */
movq %mm6, %mm5 /* copy first intermediate */
movq %mm0, (%edi) /* write result 1 */
punpckhdq %mm7, %mm5 /* produce third result */
punpcklwd (%edi,%ebx,2), %mm1 /* interleave 1st and 2nd lines */
movq %mm3, %mm0 /* copy third line */
punpckhwd (%edi,%ebx,2), %mm2 /* interleave 1st and 2nd lines */
movq %mm4, (%edi,%ebx,2) /* write result 2 */
punpckldq %mm7, %mm6 /* produce fourth result */
punpcklwd (%edi,%ecx), %mm3 /* interleave 3rd and 4th lines */
movq %mm1, %mm4 /* copy first intermediate */
movq %mm6, (%edi,%ebx,4) /* write result 3 */
punpckldq %mm3, %mm1
punpckhwd (%edi,%ecx), %mm0 /* interleave 3rd and 4th lines */
movq %mm2, %mm6 /* copy second intermediate */
movq %mm5, (%edi,%ecx) /* write result 4 */
punpckhdq %mm3, %mm4 /* produce second result */
movq %mm1, 8(%esi) /* write result 5 */
punpckldq %mm0, %mm2 /* produce third result */
movq %mm4, 8(%esi,%ebx,2) /* write result 6 */
punpckhdq %mm0, %mm6 /* produce fourth result */
movq %mm2, 8(%esi,%ebx,4) /* write result 7 */
movq %mm6, 8(%esi,%ecx) /* write result 8 */
punpckhwd (%edi,%ecx), %mm0 /* interleave 3rd and 4th lines */
movq %mm2, %mm6 /* copy second intermediate */
movq %mm5, (%edi,%ecx) /* write result 4 */
punpckhdq %mm3, %mm4 /* produce second result */
movq %mm1, 8(%esi) /* write result 5 */
punpckldq %mm0, %mm2 /* produce third result */
movq %mm4, 8(%esi,%ebx,2) /* write result 6 */
punpckhdq %mm0, %mm6 /* produce fourth result */
movq %mm2, 8(%esi,%ebx,4) /* write result 7 */
movq %mm6, 8(%esi,%ecx) /* write result 8 */
/* increment %esi to point to next 4x4 block in same row */
addl $8, %esi
/* increment %edi to point to nxt 4x4 block below current */
leal (%edi,%ebx,8), %edi
sub $4, %eax /* decrement inner loop var */
sub $4, %eax /* decrement inner loop var */
jnz .L2
/* %edi points to start of second row in block just finished */
sal $1, %edx
......@@ -810,13 +810,13 @@ vdec_IDCT:
subl %edx, %esi
/* subtract the number of bytes in last row */
/* now we point to spot where row=col */
subl $8, %edx /* sub 4 from row number */
subl $8, %edx /* sub 4 from row number */
sarl $1, %edx
mov %esi, %edi
mov %edx, %eax
/* reset x_size to outer loop variable to start new row */
jmp .L1
.L3: emms
.L3: emms
popl %edi
popl %esi
popl %edx
......
......@@ -2,7 +2,7 @@
* vdec_motion.c : motion compensation routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion.c,v 1.33 2000/12/22 13:04:45 sam Exp $
* $Id: vdec_motion.c,v 1.34 2001/01/05 14:46:37 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -55,71 +55,71 @@
#include "video_parser.h"
#include "video_fifo.h"
#define __MotionComponents(width,height) \
void MotionComponent_x_y_copy_##width##_##height (); \
void MotionComponent_X_y_copy_##width##_##height (); \
void MotionComponent_x_Y_copy_##width##_##height (); \
void MotionComponent_X_Y_copy_##width##_##height (); \
void MotionComponent_x_y_avg_##width##_##height (); \
void MotionComponent_X_y_avg_##width##_##height (); \
void MotionComponent_x_Y_avg_##width##_##height (); \
#define __MotionComponents(width,height) \
void MotionComponent_x_y_copy_##width##_##height (); \
void MotionComponent_X_y_copy_##width##_##height (); \
void MotionComponent_x_Y_copy_##width##_##height (); \
void MotionComponent_X_Y_copy_##width##_##height (); \
void MotionComponent_x_y_avg_##width##_##height (); \
void MotionComponent_X_y_avg_##width##_##height (); \
void MotionComponent_x_Y_avg_##width##_##height (); \
void MotionComponent_X_Y_avg_##width##_##height ();
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (8,8) /* 422, 420 */
__MotionComponents (8,4) /* 420 */
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (8,8) /* 422, 420 */
__MotionComponents (8,4) /* 420 */
#if 0
__MotionComponents (8,16) /* 422 */
__MotionComponents (8,16) /* 422 */
#endif
#define ___callTheRightOne(width,height) \
if ((i_width == width) && (i_height == height)) \
{ \
if (!b_average) \
{ \
switch (i_select) \
{ \
case 0: \
MotionComponent_x_y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 1: \
MotionComponent_X_y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 2: \
MotionComponent_x_Y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 3: \
MotionComponent_X_Y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
} \
} \
else \
{ \
switch (i_select) \
{ \
case 0: \
MotionComponent_x_y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 1: \
MotionComponent_X_y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 2: \
MotionComponent_x_Y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 3: \
MotionComponent_X_Y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
} \
} \
#define ___callTheRightOne(width,height) \
if ((i_width == width) && (i_height == height)) \
{ \
if (!b_average) \
{ \
switch (i_select) \
{ \
case 0: \
MotionComponent_x_y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 1: \
MotionComponent_X_y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 2: \
MotionComponent_x_Y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 3: \
MotionComponent_X_Y_copy_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
} \
} \
else \
{ \
switch (i_select) \
{ \
case 0: \
MotionComponent_x_y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 1: \
MotionComponent_X_y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 2: \
MotionComponent_x_Y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
case 3: \
MotionComponent_X_Y_avg_##width##_##height (p_src, p_dest, \
i_stride); \
break; \
} \
} \
}
/*****************************************************************************
......@@ -136,12 +136,12 @@ static __inline__ void MotionComponent(
boolean_t b_average /* (explicit) averaging of several
* predictions */ )
{
___callTheRightOne (16,16)
___callTheRightOne (16,8)
___callTheRightOne (8,8)
___callTheRightOne (8,4)
___callTheRightOne (16,16)
___callTheRightOne (16,8)
___callTheRightOne (8,8)
___callTheRightOne (8,4)
#if 0
___callTheRightOne (8,16)
___callTheRightOne (8,16)
#endif
}
......@@ -263,7 +263,7 @@ static __inline__ void Motion422(
+ (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset
+ b_source_field)
* p_mb->p_picture->i_width
* p_mb->p_picture->i_width
+ (i_mv_y >> 1) * p_mb->i_l_stride,
/* destination */
p_mb->p_picture->p_y
......@@ -671,7 +671,7 @@ void vdec_MotionFrameField444( macroblock_t * p_mb )
MOTION( p_mb, p_mb->p_forward, 0, 0, \
p_mb->pppi_motion_vectors[0][0][0], \
p_mb->pppi_motion_vectors[0][0][1], \
/* XXX?? XXX?? >> 1 ? */ \
/* XXX?? XXX?? >> 1 ? */ \
p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
\
/* predict and add to top field from bottom field */ \
......@@ -683,7 +683,7 @@ void vdec_MotionFrameField444( macroblock_t * p_mb )
MOTION( p_mb, p_mb->p_forward, 1, 1, \
p_mb->pppi_motion_vectors[0][0][0], \
p_mb->pppi_motion_vectors[0][0][1], \
/* XXX?? XXX?? >> 1 ? */ \
/* XXX?? XXX?? >> 1 ? */ \
p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 0 ); \
\
/* predict and add to bottom field from top field */ \
......
......@@ -2,7 +2,7 @@
* vdec_motion_inner.c : motion compensation inner routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_inner.c,v 1.10 2000/12/21 17:19:52 massiot Exp $
* $Id: vdec_motion_inner.c,v 1.11 2001/01/05 14:46:37 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -55,190 +55,190 @@
#include "video_parser.h"
#include "video_fifo.h"
#define __MotionComponent_x_y_copy(width,height) \
void MotionComponent_x_y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = p_src[i_x]; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_x_y_copy(width,height) \
void MotionComponent_x_y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = p_src[i_x]; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_X_y_copy(width,height) \
void MotionComponent_X_y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_X_y_copy(width,height) \
void MotionComponent_X_y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_x_Y_copy(width,height) \
void MotionComponent_x_Y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + i_stride] \
+ 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_x_Y_copy(width,height) \
void MotionComponent_x_Y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + i_stride] \
+ 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_X_Y_copy(width,height) \
void MotionComponent_X_Y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ p_src[i_x + i_stride] \
+ p_src[i_x + i_stride + 1] \
+ 2) >> 2; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_X_Y_copy(width,height) \
void MotionComponent_X_Y_copy_##width##_##height(yuv_data_t * p_src, \
yuv_data_t * p_dest, \
int i_stride) \
{ \
int i_x, i_y; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
p_dest[i_x] = (unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ p_src[i_x + i_stride] \
+ p_src[i_x + i_stride + 1] \
+ 2) >> 2; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_x_y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = p_dest[i_x] + p_src[i_x]; \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_x_y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = p_dest[i_x] + p_src[i_x]; \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_X_y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = p_dest[i_x] + ((unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ 1) >> 1); \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_X_y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = p_dest[i_x] + ((unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ 1) >> 1); \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_x_Y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
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; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_x_Y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
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; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponent_X_Y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = \
p_dest[i_x] + ((unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ p_src[i_x + i_stride] \
+ p_src[i_x + i_stride + 1] \
+ 2) >> 2); \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
#define __MotionComponent_X_Y_avg(width,height) \
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; \
\
for( i_y = 0; i_y < height; i_y ++ ) \
{ \
for( i_x = 0; i_x < width; i_x++ ) \
{ \
i_dummy = \
p_dest[i_x] + ((unsigned int)(p_src[i_x] \
+ p_src[i_x + 1] \
+ p_src[i_x + i_stride] \
+ p_src[i_x + i_stride + 1] \
+ 2) >> 2); \
p_dest[i_x] = (i_dummy + 1) >> 1; \
} \
p_dest += i_stride; \
p_src += i_stride; \
} \
}
#define __MotionComponents(width,height) \
__MotionComponent_x_y_copy(width,height) \
__MotionComponent_X_y_copy(width,height) \
__MotionComponent_x_Y_copy(width,height) \
__MotionComponent_X_Y_copy(width,height) \
__MotionComponent_x_y_avg(width,height) \
__MotionComponent_X_y_avg(width,height) \
__MotionComponent_x_Y_avg(width,height) \
#define __MotionComponents(width,height) \
__MotionComponent_x_y_copy(width,height) \
__MotionComponent_X_y_copy(width,height) \
__MotionComponent_x_Y_copy(width,height) \
__MotionComponent_X_Y_copy(width,height) \
__MotionComponent_x_y_avg(width,height) \
__MotionComponent_X_y_avg(width,height) \
__MotionComponent_x_Y_avg(width,height) \
__MotionComponent_X_Y_avg(width,height)
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (8,8) /* 422, 420 */
__MotionComponents (8,4) /* 420 */
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (8,8) /* 422, 420 */
__MotionComponents (8,4) /* 420 */
#if 0
__MotionComponents (8,16) /* 422 */
__MotionComponents (8,16) /* 422 */
#endif
......@@ -3,7 +3,7 @@
* MMX
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_motion_inner_mmx.c,v 1.5 2000/12/21 17:19:52 massiot Exp $
* $Id: vdec_motion_inner_mmx.c,v 1.6 2001/01/05 14:46:37 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the
* work done by the livid project <http://www.linuxvideo.org/>
......@@ -487,10 +487,10 @@ __MotionComponent_X_y_avg(width,height) \
__MotionComponent_x_Y_avg(width,height) \
__MotionComponent_X_Y_avg(width,height)
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (16,16) /* 444, 422, 420 */
__MotionComponents (16,8) /* 444, 422, 420 */
__MotionComponents (8,8) /* 422, 420 */
__MotionComponents (8,4) /* 420 */
#if 0
__MotionComponents (8,16) /* 422 */
__MotionComponents (8,16) /* 422 */
#endif
......@@ -104,7 +104,8 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
if( p_vout == NULL )
{
intf_ErrMsg( "vout error: %s", strerror(ENOMEM) );
intf_ErrMsg( "vout error: vout thread creation returned %s",
strerror(ENOMEM) );
return( NULL );
}
......@@ -460,7 +461,8 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
p_free_subpic->i_type = EMPTY_SUBPICTURE;
p_free_subpic->i_status = FREE_SUBPICTURE;
p_free_subpic = NULL;
intf_ErrMsg("spu warning: %s", strerror( ENOMEM ) );
intf_ErrMsg( "vout error: spu allocation returned %s",
strerror( ENOMEM ) );
}
#ifdef DEBUG_VOUT
......@@ -698,7 +700,8 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
p_free_picture->i_type = EMPTY_PICTURE;
p_free_picture->i_status = FREE_PICTURE;
p_free_picture = NULL;
intf_ErrMsg( "vout warning: %s", strerror( ENOMEM ) );
intf_ErrMsg( "vout error: picture allocation returned %s",
strerror( ENOMEM ) );
}
#ifdef DEBUG_VOUT
......@@ -929,7 +932,7 @@ static int InitThread( vout_thread_t *p_vout )
/* Initialize convertion tables and functions */
if( vout_InitYUV( p_vout ) )
{
intf_ErrMsg("error: can't allocate YUV translation tables");
intf_ErrMsg("vout error: can't allocate YUV translation tables");
return( 1 );
}
}
......@@ -1142,7 +1145,6 @@ static void RunThread( vout_thread_t *p_vout)
} else {
/* no splash screen ! */
intf_ErrMsgImm("End of splash screen");
p_vout->init_display_date=0;
}
}
......@@ -2042,7 +2044,7 @@ static int Manage( vout_thread_t *p_vout )
{
if( vout_ResetYUV( p_vout ) )
{
intf_ErrMsg("error: can't rebuild convertion tables");
intf_ErrMsg( "vout error: can't rebuild conversion tables" );
return( 1 );
}
}
......@@ -2058,7 +2060,7 @@ static int Manage( vout_thread_t *p_vout )
{
/* Some changes were not acknowledged by p_vout->p_sys_manage or this
* function, it means they should not be authorized */
intf_ErrMsg( "error: unauthorized changes in the video output thread" );
intf_ErrMsg( "vout error: unauthorized changes in the vout thread" );
return( 1 );
}
......@@ -2127,6 +2129,6 @@ static int Align( vout_thread_t *p_vout, int *pi_x, int *pi_y,
static void SetPalette ( p_vout_thread_t p_vout, u16 *red,
u16 *green, u16 *blue, u16 *transp )
{
intf_ErrMsg( "SetPalette: method does not support palette changing" );
intf_ErrMsg( "vout error: method does not support palette changing" );
}
......@@ -228,7 +228,8 @@ vout_font_t *vout_LoadFont( const char *psz_name )
p_font = malloc( sizeof( vout_font_t ) );
if( p_font == NULL )
{
intf_ErrMsg("vout error: %s", strerror(ENOMEM));
intf_ErrMsg( "vout error: cannot allocate vout_font_t (%s)",
strerror(ENOMEM) );
close( i_file );
return( NULL );
}
......@@ -245,7 +246,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
/* Read font header - two bytes indicate the font properties */
if( read( i_file, pi_buffer, 2 ) != 2)
{
intf_ErrMsg("error: unexpected end of file '%s'", psz_name );
intf_ErrMsg( "vout error: unexpected end of file '%s'", psz_name );
free( p_font );
close( i_file );
return( NULL );
......@@ -265,7 +266,8 @@ vout_font_t *vout_LoadFont( const char *psz_name )
p_font->p_data = malloc( 2 * 256 * pi_buffer[1] );
if( p_font->p_data == NULL )
{
intf_ErrMsg("error: %s", strerror(ENOMEM));
intf_ErrMsg( "vout error: cannot allocate font space (%s)",
strerror(ENOMEM) );
free( p_font );
close( i_file );
return( NULL );
......@@ -274,7 +276,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
/* Copy raw data */
if( read( i_file, p_font->p_data, 256 * pi_buffer[1] ) != 256 * pi_buffer[1] )
{
intf_ErrMsg("error: unexpected end of file '%s'", psz_name );
intf_ErrMsg("vout error: unexpected end of file '%s'", psz_name );
free( p_font->p_data );
free( p_font );
close( i_file );
......@@ -300,7 +302,7 @@ vout_font_t *vout_LoadFont( const char *psz_name )
break;
default:
intf_ErrMsg("error: file '%s' has an unknown format", psz_name );
intf_ErrMsg("vout error: file '%s' has an unknown format", psz_name );
free( p_font );
close( i_file );
return( NULL );
......
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