Commit f22f4ef5 authored by Sam Hocevar's avatar Sam Hocevar

* fixed several format string inconsistencies and deprecated C constructions.

parent f9e12228
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ftp.c: * ftp.c:
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ftp.c,v 1.2 2002/12/16 15:17:12 fenrir Exp $ * $Id: ftp.c,v 1.3 2002/12/18 14:17:09 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -350,7 +350,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -350,7 +350,7 @@ static int Open( vlc_object_t *p_this )
} }
#endif #endif
msg_Dbg( p_input, "file size:%d", p_access->i_filesize ); msg_Dbg( p_input, "file size: "I64Fd, p_access->i_filesize );
FREE( psz_arg ); FREE( psz_arg );
if( ftp_StartStream( p_input, 0 ) < 0 ) if( ftp_StartStream( p_input, 0 ) < 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in * mms.c: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.c,v 1.13 2002/12/12 15:10:58 gbazin Exp $ * $Id: mms.c,v 1.14 2002/12/18 14:17:09 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1559,11 +1559,15 @@ static int mms_ParseCommand( input_thread_t *p_input, ...@@ -1559,11 +1559,15 @@ static int mms_ParseCommand( input_thread_t *p_input,
GET32( 0 ), GET32( 0 ),
GET32( 4 ), GET32( 4 ),
GET32( 8 ), GET32( 8 ),
/* 12: protocol type "MMS " */
GET32( 16 ), GET32( 16 ),
GET32( 20 ), GET32( 20 ),
/* 24: unknown (0) */
/* 28: unknown (0) */
GET32( 32 ), GET32( 32 ),
GET32( 36 ), GET32( 36 )
GET32( 40 ) ); /* 40: switches */
/* 44: extra */ );
p_access->i_command = GET32( 36 ) & 0xffff; p_access->i_command = GET32( 36 ) & 0xffff;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc * oss.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.38 2002/12/10 18:22:01 gbazin Exp $ * $Id: oss.c,v 1.39 2002/12/18 14:17:09 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -376,7 +376,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -376,7 +376,7 @@ static int Open( vlc_object_t *p_this )
if( ioctl( p_sys->i_fd, SNDCTL_DSP_CHANNELS, &i_nb_channels ) < 0 || if( ioctl( p_sys->i_fd, SNDCTL_DSP_CHANNELS, &i_nb_channels ) < 0 ||
i_nb_channels != aout_FormatNbChannels( &p_aout->output.output ) ) i_nb_channels != aout_FormatNbChannels( &p_aout->output.output ) )
{ {
msg_Err( p_aout, "cannot set number of audio channels (%x)", msg_Err( p_aout, "cannot set number of audio channels (%s)",
aout_FormatPrintChannels( &p_aout->output.output) ); aout_FormatPrintChannels( &p_aout->output.output) );
close( p_sys->i_fd ); close( p_sys->i_fd );
free( p_sys ); free( p_sys );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* adpcm.c : adpcm variant audio decoder * adpcm.c : adpcm variant audio decoder
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: adpcm.c,v 1.1 2002/12/03 17:00:16 fenrir Exp $ * $Id: adpcm.c,v 1.2 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -378,6 +378,7 @@ static void DecodeThread( adec_thread_t *p_adec ) ...@@ -378,6 +378,7 @@ static void DecodeThread( adec_thread_t *p_adec )
DecodeAdpcmMs( p_adec, p_aout_buffer ); DecodeAdpcmMs( p_adec, p_aout_buffer );
break; break;
default: default:
break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library * audio.c: audio decoder using ffmpeg library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: audio.c,v 1.7 2002/12/06 14:22:55 fenrir Exp $ * $Id: audio.c,v 1.8 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -238,7 +238,7 @@ void E_( DecodeThread_Audio )( adec_thread_t *p_adec ) ...@@ -238,7 +238,7 @@ void E_( DecodeThread_Audio )( adec_thread_t *p_adec )
p_adec->p_context->channels > 5 ) p_adec->p_context->channels > 5 )
{ {
msg_Warn( p_adec->p_fifo, msg_Warn( p_adec->p_fifo,
"invalid channels count", "invalid channels count %d",
p_adec->p_context->channels ); p_adec->p_context->channels );
} }
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* postprocessing_mmx.c: Post Processing library in MMX * postprocessing_mmx.c: Post Processing library in MMX
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: postprocessing_mmx.c,v 1.2 2002/12/06 16:34:05 sam Exp $ * $Id: postprocessing_mmx.c,v 1.3 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#include <vlc/vlc.h> /* only use u8, u32 .... */ #include <vlc/vlc.h> /* only use uint8_t, uint32_t .... */
#include "postprocessing.h" #include "postprocessing.h"
#include "postprocessing_common.h" #include "postprocessing_common.h"
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
/* Use same things as in idct but how it work ? */ /* Use same things as in idct but how it work ? */
#define UNUSED_LONGLONG( foo ) \ #define UNUSED_LONGLONG( foo ) \
static const unsigned long long foo __asm__ (#foo) __attribute__((unused)) static const unsigned long long foo __asm__ (#foo) __attribute__((unused))
/* to calculate isDC_mode for mmx */ /* to calculate isDC_mode for mmx */
UNUSED_LONGLONG( mmx_127_thr1 ) = ( ( 127ULL - PP_THR1 ) << 56 )| UNUSED_LONGLONG( mmx_127_thr1 ) = ( ( 127ULL - PP_THR1 ) << 56 )|
( ( 127ULL - PP_THR1 ) << 48 )| ( ( 127ULL - PP_THR1 ) << 48 )|
( ( 127ULL - PP_THR1 ) << 40 )| ( ( 127ULL - PP_THR1 ) << 40 )|
...@@ -67,38 +67,38 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL; ...@@ -67,38 +67,38 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
#if 0 #if 0
/* find min bytes from r ans set it in r, t is destroyed */ /* find min bytes from r ans set it in r, t is destroyed */
#define MMXEXT_GET_PMIN( r, t ) \ #define MMXEXT_GET_PMIN( r, t ) \
"movq " #r ", " #t " \n\ "movq " #r ", " #t " \n" \
psrlq $8, " #t " \n\ "psrlq $8, " #t " \n" \
pminub " #t ", " #r " \n\ "pminub " #t ", " #r " \n" \
pshufw $0xf5, " #r ", " #t " #instead of shift with tmp reg \n\ "pshufw $0xf5, " #r ", " #t " #instead of shift with tmp reg \n" \
pminub " #t ", " #r " \n\ "pminub " #t ", " #r " \n" \
pshufw $0xfe, " #r ", " #t " \n\ "pshufw $0xfe, " #r ", " #t " \n" \
pminub " #t ", " #r " \n" "pminub " #t ", " #r " \n"
/* find mzx bytes from r ans set it in r, t is destroyed */ /* find mzx bytes from r ans set it in r, t is destroyed */
#define MMXEXT_GET_PMAX( r, t ) \ #define MMXEXT_GET_PMAX( r, t ) \
"movq " #r ", " #t " \n\ "movq " #r ", " #t " \n" \
psrlq $8, " #t " \n\ "psrlq $8, " #t " \n" \
pmaxub " #t ", " #r " \n\ "pmaxub " #t ", " #r " \n" \
pshufw $0xf5, " #r ", " #t " \n\ "pshufw $0xf5, " #r ", " #t " \n" \
pmaxub " #t ", " #r " \n\ "pmaxub " #t ", " #r " \n" \
pshufw $0xfe, " #r ", " #t " \n\ "pshufw $0xfe, " #r ", " #t " \n" \
pmaxub " #t ", " #r " \n" "pmaxub " #t ", " #r " \n"
#define MMXEXT_GET_LMINMAX( s, m, M, t ) \ #define MMXEXT_GET_LMINMAX( s, m, M, t ) \
"movq " #s ", " #t " \n\ "movq " #s ", " #t " \n" \
pminub " #t ", " #m " \n\ "pminub " #t ", " #m " \n" \
pmaxub " #t ", " #M " \n" "pmaxub " #t ", " #M " \n"
/* Some tips for MMX /* Some tips for MMX
* |a-b| : * |a-b| :
d1 = a - b with unsigned saturate d1 = a - b with unsigned saturate
d2 = b - a with ... d2 = b - a with ...
|a-b| = d1 | d2 |a-b| = d1 | d2
*/ */
...@@ -112,45 +112,45 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL; ...@@ -112,45 +112,45 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
* so need to be fast ... * so need to be fast ...
* *
****************************************************************************/ ****************************************************************************/
static inline int pp_deblock_isDC_mode( u8 *p_v ) static inline int pp_deblock_isDC_mode( uint8_t *p_v )
{ {
unsigned int i_eq_cnt; unsigned int i_eq_cnt;
/* algo : /* algo :
x = v[i] - v[i+1] without signed saturation x = v[i] - v[i+1] without signed saturation
( XXX see if there is'nt problem, but can't be with signed ( XXX see if there is'nt problem, but can't be with signed
sat because pixel will be saturate :( sat because pixel will be saturate :(
so x within [-128, 127] and we have to test if it fit in [-M, M] so x within [-128, 127] and we have to test if it fit in [-M, M]
we add 127-M with wrap around -> good value fit in [ 127-2*M, 127] we add 127-M with wrap around -> good value fit in [ 127-2*M, 127]
and if x >= 127 - 2 * M ie x > 127 -2*M - 1 value is good and if x >= 127 - 2 * M ie x > 127 -2*M - 1 value is good
*/ */
__asm__ __volatile__ (" \n\ __asm__ __volatile__ (
#* Do (v0-v1) to (v7-v8) \n\ " #* Do (v0-v1) to (v7-v8) \n"
movq (%1), %%mm1 # load v0->v7 \n\ "movq (%1), %%mm1 # load v0->v7 \n"
movq 1(%1), %%mm2 # load v1->v8 \n\ "movq 1(%1), %%mm2 # load v1->v8 \n"
psubb %%mm2, %%mm1 # v[i]-v[i+1] \n\ "psubb %%mm2, %%mm1 # v[i]-v[i+1] \n"
paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n\ "paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n"
pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n" "pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n"
"movq %%mm1, %%mm0 # \n\ "movq %%mm1, %%mm0 # \n"
psrlw $8, %%mm1 # \n\ "psrlw $8, %%mm1 # \n"
paddb %%mm1, %%mm0 # \n\ "paddb %%mm1, %%mm0 # \n"
# \n\ " # \n"
movq %%mm0, %%mm1 # Now sum to create eq_cnt \n\ "movq %%mm0, %%mm1 # Now sum to create eq_cnt \n"
psrld $16, %%mm0 # \n\ "psrld $16, %%mm0 # \n"
paddb %%mm0, %%mm1 # \n\ "paddb %%mm0, %%mm1 # \n"
# \n\ " # \n"
movq %%mm1, %%mm0 # \n\ "movq %%mm1, %%mm0 # \n"
psrlq $32, %%mm1 # \n\ "psrlq $32, %%mm1 # \n"
paddb %%mm1, %%mm0 \n" "paddb %%mm1, %%mm0 \n"
"movd %%mm0, %0 # \n\ "movd %%mm0, %0 # \n"
negl %0 \n\ "negl %0 \n"
andl $255, %0" "andl $255, %0"
: "=r"(i_eq_cnt) : "r" (p_v) ); : "=r"(i_eq_cnt) : "r" (p_v) );
/* last test, hey, 9 don't fit in MMX */ /* last test, hey, 9 don't fit in MMX */
if(( ( p_v[8] - p_v[9] + PP_THR1 )&0xffff )<= PP_2xTHR1 ) if(( ( p_v[8] - p_v[9] + PP_THR1 )&0xffff )<= PP_2xTHR1 )
{ {
i_eq_cnt++; i_eq_cnt++;
} }
...@@ -160,8 +160,8 @@ static inline int pp_deblock_isDC_mode( u8 *p_v ) ...@@ -160,8 +160,8 @@ static inline int pp_deblock_isDC_mode( u8 *p_v )
for( i =0; i < 9; i++ ) for( i =0; i < 9; i++ )
{ {
if(( ( p_v[i] - p_v[i+1] + PP_THR1 )&0xffff )<= PP_2xTHR1 ) if(( ( p_v[i] - p_v[i+1] + PP_THR1 )&0xffff )<= PP_2xTHR1 )
{ {
i_eq_cnt++; i_eq_cnt++;
} }
} }
...@@ -170,25 +170,25 @@ static inline int pp_deblock_isDC_mode( u8 *p_v ) ...@@ -170,25 +170,25 @@ static inline int pp_deblock_isDC_mode( u8 *p_v )
return( (i_eq_cnt >= PP_THR2 ) ? 1 : 0 ); return( (i_eq_cnt >= PP_THR2 ) ? 1 : 0 );
} }
static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP ) static inline int pp_deblock_isMinMaxOk( uint8_t *p_v, int i_QP )
{ {
int i_range; int i_range;
#if 0 #if 0
__asm__ __volatile__ ( __asm__ __volatile__ (
"movq 1(%1), %%mm0 # 8 bytes \n" "movq 1(%1), %%mm0 # 8 bytes \n"
"movq %%mm0, %%mm1 \n" "movq %%mm0, %%mm1 \n"
MMXEXT_GET_PMIN( %%mm0, %%mm7 ) MMXEXT_GET_PMIN( %%mm0, %%mm7 )
MMXEXT_GET_PMAX( %%mm1, %%mm7 ) MMXEXT_GET_PMAX( %%mm1, %%mm7 )
"psubd %%mm0, %%mm1 # max - min \n\ "psubd %%mm0, %%mm1 # max - min \n"
movd %%mm1, %0 \n\ "movd %%mm1, %0 \n"
andl $255, %0" : "=r"(i_range) : "r"(p_v) ); "andl $255, %0" : "=r"(i_range) : "r"(p_v) );
#endif #endif
int i_max, i_min; int i_max, i_min;
int i; int i;
i_min = i_max = p_v[1]; i_min = i_max = p_v[1];
for( i = 2; i < 9; i++ ) for( i = 2; i < 9; i++ )
{ {
if( i_max < p_v[i] ) i_max = p_v[i]; if( i_max < p_v[i] ) i_max = p_v[i];
...@@ -200,7 +200,7 @@ static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP ) ...@@ -200,7 +200,7 @@ static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP )
} }
static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, static inline void pp_deblock_DefaultMode( uint8_t i_v[10], int i_stride,
int i_QP ) int i_QP )
{ {
int d, i_delta; int d, i_delta;
...@@ -210,16 +210,16 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -210,16 +210,16 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
/* d = CLIP( 5(a3x0' - a3x0)//8, 0, (v4-v5)/2 ).d( abs(a3x0) < QP ) */ /* d = CLIP( 5(a3x0' - a3x0)//8, 0, (v4-v5)/2 ).d( abs(a3x0) < QP ) */
/* First calculate a3x0 */ /* First calculate a3x0 */
__asm__ __volatile__ ( " \n\ __asm__ __volatile__ (
pxor %%mm7, %%mm7 # mm7 = 0 \n\ "pxor %%mm7, %%mm7 # mm7 = 0 \n"
movq mmx_m2_5_m5_2, %%mm6 # mm6 =(2,-5,5,-2) \n\ "movq mmx_m2_5_m5_2, %%mm6 # mm6 =(2,-5,5,-2) \n"
movd 3(%1), %%mm0 \n\ "movd 3(%1), %%mm0 \n"
punpcklbw %%mm7,%%mm0 \n\ "punpcklbw %%mm7,%%mm0 \n"
pmaddwd %%mm6, %%mm0 \n" "pmaddwd %%mm6, %%mm0 \n"
"movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $32, %%mm1 \n" "psrlq $32, %%mm1 \n"
"paddd %%mm1, %%mm0 \n\ "paddd %%mm1, %%mm0 \n"
movd %%mm0, %0" : "=r"(a3x0) :"r"(i_v) ); "movd %%mm0, %0" : "=r"(a3x0) :"r"(i_v) );
#if 0 #if 0
a3x0 = 2 * ( i_v[3] - i_v[6] ) + 5 *( i_v[5] - i_v[4] ); a3x0 = 2 * ( i_v[3] - i_v[6] ) + 5 *( i_v[5] - i_v[4] );
#endif #endif
...@@ -228,7 +228,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -228,7 +228,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
{ {
b_neg = 1; b_neg = 1;
a3x0 = -a3x0; a3x0 = -a3x0;
} }
else else
{ {
b_neg = 0; b_neg = 0;
...@@ -237,24 +237,24 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -237,24 +237,24 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
if( ( a3x0 < 8 * i_QP )&&( a3x0 != 0 ) ) /* |a3x0| < 8*i_QP */ if( ( a3x0 < 8 * i_QP )&&( a3x0 != 0 ) ) /* |a3x0| < 8*i_QP */
{ {
/* calculate a3x1 et a3x2 */ /* calculate a3x1 et a3x2 */
__asm__ __volatile__ ( " \n\ __asm__ __volatile__ (
# mm7 = 0 \n\ " # mm7 = 0 \n"
# mm6 = ( 2, -5, 5, -2 ) \n\ " # mm6 = ( 2, -5, 5, -2 ) \n"
movd 1(%2), %%mm0 \n\ "movd 1(%2), %%mm0 \n"
movd 5(%2), %%mm2 \n\ "movd 5(%2), %%mm2 \n"
punpcklbw %%mm7,%%mm0 \n\ "punpcklbw %%mm7,%%mm0 \n"
punpcklbw %%mm7,%%mm2 \n\ "punpcklbw %%mm7,%%mm2 \n"
pmaddwd %%mm6, %%mm0 \n\ "pmaddwd %%mm6, %%mm0 \n"
pmaddwd %%mm6, %%mm2 \n" "pmaddwd %%mm6, %%mm2 \n"
"movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $32, %%mm1 \n" "psrlq $32, %%mm1 \n"
"paddd %%mm1, %%mm0 # mm0 = a3x1 \n\ "paddd %%mm1, %%mm0 # mm0 = a3x1 \n"
movd %%mm0, %0 \n" "movd %%mm0, %0 \n"
"movq %%mm2, %%mm1 \n\ "movq %%mm2, %%mm1 \n"
psrlq $32, %%mm1 \n" "psrlq $32, %%mm1 \n"
"paddd %%mm1, %%mm2 # mm2 = a3x2 \n\ "paddd %%mm1, %%mm2 # mm2 = a3x2 \n"
movd %%mm2, %1 \n\ "movd %%mm2, %1 \n"
" : "=r"(a3x1), "=r"(a3x2) : "r"(i_v) ); : "=r"(a3x1), "=r"(a3x2) : "r"(i_v) );
#if 0 #if 0
a3x1 = 2 * ( i_v[1] - i_v[4] ) + 5 * ( i_v[3] - i_v[2] ); a3x1 = 2 * ( i_v[1] - i_v[4] ) + 5 * ( i_v[3] - i_v[2] );
a3x2 = 2 * ( i_v[5] - i_v[8] ) + 5 * ( i_v[7] - i_v[6] ); a3x2 = 2 * ( i_v[5] - i_v[8] ) + 5 * ( i_v[7] - i_v[6] );
...@@ -264,7 +264,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -264,7 +264,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
if( a3x2 < 0) a3x2 = -a3x2; /* abs( a3x2 ) */ if( a3x2 < 0) a3x2 = -a3x2; /* abs( a3x2 ) */
a3x0_ = PP_MIN3( a3x0, a3x1, a3x2 ); a3x0_ = PP_MIN3( a3x0, a3x1, a3x2 );
d = 5 *( a3x0 - a3x0_ ) / 8; /* always > 0 */ d = 5 *( a3x0 - a3x0_ ) / 8; /* always > 0 */
i_delta = ( i_v[4] - i_v[5] ) / 2; i_delta = ( i_v[4] - i_v[5] ) / 2;
...@@ -293,7 +293,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -293,7 +293,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ static inline void pp_deblock_DCMode( uint8_t *p_v, /* = int i_v[10] */
int i_QP ) int i_QP )
{ {
int i_p0, i_p9; int i_p0, i_p9;
...@@ -302,20 +302,20 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -302,20 +302,20 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
i_p9 = PP_ABS( p_v[8] - p_v[9] ) < i_QP ? p_v[9] : p_v[8]; i_p9 = PP_ABS( p_v[8] - p_v[9] ) < i_QP ? p_v[9] : p_v[8];
/* mm0 = 8 pix unmodified /* mm0 = 8 pix unmodified
-We will process first 4 pixel -We will process first 4 pixel
mm0 = 8 pix unmodified mm0 = 8 pix unmodified
mm1 = for the first part of the 4 first pix mm1 = for the first part of the 4 first pix
(v1) -> (p0) -> ... ( word ) (v1) -> (p0) -> ... ( word )
(v2) (v1) (v2) (v1)
(v3) (v2) (v3) (v2)
(v4) (v3) (v4) (v3)
= for the commoin part between first and last pix = for the commoin part between first and last pix
(v2) -> (v3) -> ... ( word ) (v2) -> (v3) -> ... ( word )
(v3) (v4) (v3) (v4)
(v4) (v5) (v4) (v5)
(v5) (v6) (v5) (v6)
= for the last part of the 4 last pix = for the last part of the 4 last pix
(v5) -> (v6) -> ... ( word ) (v5) -> (v6) -> ... ( word )
(v6) (v7) (v6) (v7)
...@@ -323,110 +323,110 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -323,110 +323,110 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
(v8) (p9) (v8) (p9)
mm2 = acu for first new pix mm2 = acu for first new pix
mm3 = acu for last pix mm3 = acu for last pix
mm4 = unused mm4 = unused
mm5 = p0 mm5 = p0
mm6 = p9 << 48 mm6 = p9 << 48
mm7 = 0 */ mm7 = 0 */
__asm__ __volatile__ ( __asm__ __volatile__ (
"pxor %%mm7, %%mm7 \n\ "pxor %%mm7, %%mm7 \n"
movq 1(%0), %%mm0 # get 8 pix \n\ "movq 1(%0), %%mm0 # get 8 pix \n"
# unpack into mm1 \n\ " # unpack into mm1 \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
punpcklbw %%mm7, %%mm1 \n\ "punpcklbw %%mm7, %%mm1 \n"
# get p_0 and i_p9 \n\ " # get p_0 and i_p9 \n"
movd %1, %%mm5 \n\ "movd %1, %%mm5 \n"
movd %2, %%mm6 \n\ "movd %2, %%mm6 \n"
psllq $48, %%mm6 \n "psllq $48, %%mm6 \n"
\n\ " \n"
movq %%mm1, %%mm3 # p_v[5-8] = v[1-4] !! \n\ "movq %%mm1, %%mm3 # p_v[5-8] = v[1-4] !! \n"
movq %%mm1, %%mm2 \n\ "movq %%mm1, %%mm2 \n"
psllw $2, %%mm2 # p_v[1-4] = 4*v[1-4] \n\ "psllw $2, %%mm2 # p_v[1-4] = 4*v[1-4] \n"
\n\ " \n"
psllq $16, %%mm1 \n\ "psllq $16, %%mm1 \n"
por %%mm5, %%mm1 # mm1 =( p0, v1, v2 ,v3)\n\ "por %%mm5, %%mm1 # mm1 =( p0, v1, v2 ,v3)\n"
\n\ " \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
psllq $16, %%mm1 \n\ "psllq $16, %%mm1 \n"
por %%mm5, %%mm1 # mm1 =( p0, p0, v1, v2)\n\ "por %%mm5, %%mm1 # mm1 =( p0, p0, v1, v2)\n"
\n\ " \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
psllq $16, %%mm1 \n\ "psllq $16, %%mm1 \n"
por %%mm5, %%mm1 # mm1 =( p0, p0, p0, v1)\n\ "por %%mm5, %%mm1 # mm1 =( p0, p0, p0, v1)\n"
\n\ " \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
psllq $16, %%mm1 \n\ "psllq $16, %%mm1 \n"
por %%mm5, %%mm1 # mm1 =( p0, p0, p0, p0)\n\ "por %%mm5, %%mm1 # mm1 =( p0, p0, p0, p0)\n"
\n\ " \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
# Now last part a little borring\n\ " # Now last part a little borring\n"
# last part for mm2, beginig for mm3 " # last part for mm2, beginig for mm3\n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $8, %%mm1 \n\ "psrlq $8, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v2, v3, v4, v5 )\n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v2, v3, v4, v5 )\n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v3, v4, v5, v6 )\n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v3, v4, v5, v6 )\n"
psllw $1, %%mm1 \n\ "psllw $1, %%mm1 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $24, %%mm1 \n\ "psrlq $24, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v4, v5, v6, v7) \n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v4, v5, v6, v7) \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $32, %%mm1 \n\ "psrlq $32, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v5, v6, v7, v8) \n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v5, v6, v7, v8) \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
psllw $2, %%mm1 "psllw $2, %%mm1 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
# Now last part for last 4 pix \n\ " # Now last part for last 4 pix \n"
# \n\ " # \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
punpckhbw %%mm7, %%mm1 # mm1 = ( v5, v6, v7, v8) \n\ "punpckhbw %%mm7, %%mm1 # mm1 = ( v5, v6, v7, v8) \n"
\n\ " \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
por %%mm6, %%mm1 # mm1 =( v6, v7, v8, p9 )\n\ "por %%mm6, %%mm1 # mm1 =( v6, v7, v8, p9 )\n"
\n\ " \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
por %%mm6, %%mm1 # mm1 =( v7, v8, p9, p9)\n\ "por %%mm6, %%mm1 # mm1 =( v7, v8, p9, p9)\n"
\n\ " \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
por %%mm6, %%mm1 # mm1 =( v8, p9, p9, p9 )\n\ "por %%mm6, %%mm1 # mm1 =( v8, p9, p9, p9 )\n"
\n\ " \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
por %%mm6, %%mm1 # mm1 =( p9, p9, p9, p9 )\n\ "por %%mm6, %%mm1 # mm1 =( p9, p9, p9, p9 )\n"
\n\ " \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
psrlw $4, %%mm2 \n\ "psrlw $4, %%mm2 \n"
psrlw $4, %%mm3 \n\ "psrlw $4, %%mm3 \n"
packuswb %%mm3, %%mm2 \n\ "packuswb %%mm3, %%mm2 \n"
movq %%mm2, 1(%0) \n\ "movq %%mm2, 1(%0) \n"
": : "r"(p_v), "r"(i_p0), "r"(i_p9) : "memory" ); : : "r"(p_v), "r"(i_p0), "r"(i_p9) : "memory" );
#if 0 #if 0
for( i = 1; i < 9; i++ ) for( i = 1; i < 9; i++ )
...@@ -434,28 +434,28 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -434,28 +434,28 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
v[i] = p_v[i]; /* save 8 pix that will be modified */ v[i] = p_v[i]; /* save 8 pix that will be modified */
} }
p_v[1] = ( 6 * i_p0 + 4 * v[1] p_v[1] = ( 6 * i_p0 + 4 * v[1]
+ 2 *( v[2] + v[3]) + v[4] + v[5]) >> 4; + 2 *( v[2] + v[3]) + v[4] + v[5]) >> 4;
p_v[2] = ( 4 * i_p0 + 2 * v[1] + 4 * v[2] p_v[2] = ( 4 * i_p0 + 2 * v[1] + 4 * v[2]
+ 2 *( v[3] + v[4]) + v[5] + v[6]) >> 4; + 2 *( v[3] + v[4]) + v[5] + v[6]) >> 4;
p_v[3] = ( 2 * i_p0 + 2 * (v[1] + v[2]) + 4 * v[3] p_v[3] = ( 2 * i_p0 + 2 * (v[1] + v[2]) + 4 * v[3]
+ 2 *( v[4] + v[5]) + v[6] + v[7]) >> 4; + 2 *( v[4] + v[5]) + v[6] + v[7]) >> 4;
p_v[4] = ( i_p0 + v[1] + 2 * (v[2] + v[3]) + 4 * v[4] p_v[4] = ( i_p0 + v[1] + 2 * (v[2] + v[3]) + 4 * v[4]
+ 2 *( v[5] + v[6]) + v[7] + v[8]) >> 4; + 2 *( v[5] + v[6]) + v[7] + v[8]) >> 4;
p_v[5] = ( v[1] + v[2] + 2 * (v[3] + v[4]) + 4 * v[5] p_v[5] = ( v[1] + v[2] + 2 * (v[3] + v[4]) + 4 * v[5]
+ 2 *( v[6] + v[7]) + v[8] + i_p9) >> 4; + 2 *( v[6] + v[7]) + v[8] + i_p9) >> 4;
p_v[6] = ( v[2] + v[3] + 2 * (v[4] + v[5]) + 4 * v[6] p_v[6] = ( v[2] + v[3] + 2 * (v[4] + v[5]) + 4 * v[6]
+ 2 *( v[7] + v[8]) + 2 * i_p9) >> 4; + 2 *( v[7] + v[8]) + 2 * i_p9) >> 4;
p_v[7] = ( v[3] + v[4] + 2 * (v[5] + v[6]) + 4 * v[7] p_v[7] = ( v[3] + v[4] + 2 * (v[5] + v[6]) + 4 * v[7]
+ 2 * v[8] + 4 * i_p9) >> 4; + 2 * v[8] + 4 * i_p9) >> 4;
p_v[8] = ( v[4] + v[5] + 2 * (v[6] + v[7]) + 4 * v[8] p_v[8] = ( v[4] + v[5] + 2 * (v[6] + v[7]) + 4 * v[8]
+ 6 * i_p9) >> 4; + 6 * i_p9) >> 4;
#endif #endif
...@@ -471,21 +471,21 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -471,21 +471,21 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_deblock_V )( u8 *p_plane, void E_( pp_deblock_V )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride, QT_STORE_T *p_QP_store, int i_QP_stride,
int b_chroma ) int b_chroma )
{ {
int x, y, i; int x, y, i;
u8 *p_v; uint8_t *p_v;
int i_QP_scale; /* use to do ( ? >> i_QP_scale ) */ int i_QP_scale; /* use to do ( ? >> i_QP_scale ) */
int i_QP; int i_QP;
u8 i_v[10]; uint8_t i_v[10];
i_QP_scale = b_chroma ? 5 : 4 ; i_QP_scale = b_chroma ? 5 : 4 ;
for( y = 8; y < i_height - 4; y += 8 ) for( y = 8; y < i_height - 4; y += 8 )
{ {
p_v = p_plane + ( y - 5 )* i_stride; p_v = p_plane + ( y - 5 )* i_stride;
for( x = 0; x < i_width; x++ ) for( x = 0; x < i_width; x++ )
...@@ -530,22 +530,22 @@ void E_( pp_deblock_V )( u8 *p_plane, ...@@ -530,22 +530,22 @@ void E_( pp_deblock_V )( u8 *p_plane,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_deblock_H )( u8 *p_plane, void E_( pp_deblock_H )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride, QT_STORE_T *p_QP_store, int i_QP_stride,
int b_chroma ) int b_chroma )
{ {
int x, y; int x, y;
u8 *p_v; uint8_t *p_v;
int i_QP_scale; int i_QP_scale;
int i_QP; int i_QP;
i_QP_scale = b_chroma ? 5 : 4 ; i_QP_scale = b_chroma ? 5 : 4 ;
for( y = 0; y < i_height; y++ ) for( y = 0; y < i_height; y++ )
{ {
p_v = p_plane + y * i_stride - 5; p_v = p_plane + y * i_stride - 5;
for( x = 8; x < i_width - 4; x += 8 ) for( x = 8; x < i_width - 4; x += 8 )
{ {
/* p_v point 5 pix before a block boundary */ /* p_v point 5 pix before a block boundary */
/* XXX QP is for v5 */ /* XXX QP is for v5 */
...@@ -564,7 +564,7 @@ void E_( pp_deblock_H )( u8 *p_plane, ...@@ -564,7 +564,7 @@ void E_( pp_deblock_H )( u8 *p_plane,
} }
} }
} }
return; return;
} }
...@@ -575,7 +575,7 @@ void E_( pp_deblock_H )( u8 *p_plane, ...@@ -575,7 +575,7 @@ void E_( pp_deblock_H )( u8 *p_plane,
* *
*****************************************************************************/ *****************************************************************************/
static inline void pp_dering_MinMax( u8 *p_block, int i_stride, static inline void pp_dering_MinMax( uint8_t *p_block, int i_stride,
int *pi_min, int *pi_max ) int *pi_min, int *pi_max )
{ {
int x, y; int x, y;
...@@ -583,13 +583,13 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride, ...@@ -583,13 +583,13 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride,
#if 0 #if 0
/* First we will extract min/max for each pix on vertical line /* First we will extract min/max for each pix on vertical line
and next extract global min/max */ and next extract global min/max */
__asm__ __volatile__( __asm__ __volatile__(
"leal (%2,%3), %%eax \n\ "leal (%2,%3), %%eax \n"
movq (%2), %%mm0 #load line \n\ "movq (%2), %%mm0 #load line \n"
movq %%mm0, %%mm1 \n" "movq %%mm0, %%mm1 \n"
MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 )
...@@ -600,20 +600,20 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride, ...@@ -600,20 +600,20 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride,
MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3,2), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3,2), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_PMIN( %%mm0, %%mm7 ) MMXEXT_GET_PMIN( %%mm0, %%mm7 )
MMXEXT_GET_PMAX( %%mm1, %%mm7 ) MMXEXT_GET_PMAX( %%mm1, %%mm7 )
"movd %%mm0, %%eax \n\ "movd %%mm0, %%eax \n"
andl $255, %%eax \n\ "andl $255, %%eax \n"
movl %%eax, (%0) \n\ "movl %%eax, (%0) \n"
movd %%mm1, %%eax \n\ "movd %%mm1, %%eax \n"
andl $255, %%eax \n\ "andl $255, %%eax \n"
movl %%eax, (%1) \n" "movl %%eax, (%1) \n"
: : "r"(pi_min), "r"(pi_max), "r"(p_block), "r"(i_stride) : "%eax", "memory" ); : : "r"(pi_min), "r"(pi_max), "r"(p_block), "r"(i_stride) : "%eax", "memory" );
#endif #endif
i_min = 255; i_max = 0; i_min = 255; i_max = 0;
for( y = 0; y < 8; y++ ) for( y = 0; y < 8; y++ )
{ {
for( x = 0; x < 8; x++ ) for( x = 0; x < 8; x++ )
...@@ -623,17 +623,17 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride, ...@@ -623,17 +623,17 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride,
} }
p_block += i_stride; p_block += i_stride;
} }
*pi_min = i_min; *pi_min = i_min;
*pi_max = i_max; *pi_max = i_max;
} }
static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr, static inline void pp_dering_BinIndex( uint8_t *p_block, int i_stride,
u32 *p_bin ) int i_thr, uint32_t *p_bin )
{ {
int x, y; int x, y;
u32 i_bin; uint32_t i_bin;
for( y = 0; y < 10; y++ ) for( y = 0; y < 10; y++ )
{ {
...@@ -653,27 +653,27 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr, ...@@ -653,27 +653,27 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr,
} }
} }
static inline void pp_dering_Filter( u8 *p_block, int i_stride, static inline void pp_dering_Filter( uint8_t *p_block, int i_stride,
u32 *p_bin, uint32_t *p_bin,
int i_QP ) int i_QP )
{ {
int x, y; int x, y;
u32 i_bin; uint32_t i_bin;
int i_flt[8][8]; int i_flt[8][8];
int i_f; int i_f;
u8 *p_sav; uint8_t *p_sav;
int i_QP_2; int i_QP_2;
p_sav = p_block; p_sav = p_block;
i_QP_2 = i_QP >> 1; i_QP_2 = i_QP >> 1;
for( y = 0; y < 8; y++ ) for( y = 0; y < 8; y++ )
{ {
i_bin = p_bin[y] & p_bin[y+1] & p_bin[y+2]; /* To be optimised */ i_bin = p_bin[y] & p_bin[y+1] & p_bin[y+2]; /* To be optimised */
i_bin |= i_bin >> 16; /* detect 0 or 1 */ i_bin |= i_bin >> 16; /* detect 0 or 1 */
for( x = 0; x < 8; x++ ) for( x = 0; x < 8; x++ )
{ {
if( i_bin&0x02 ) /* 0x02 since 10 index but want 1-9 */ if( i_bin&0x02 ) /* 0x02 since 10 index but want 1-9 */
{ {
/* apply dering */ /* apply dering */
...@@ -683,11 +683,11 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -683,11 +683,11 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
i_f = p_block[x - i_stride - 1] + i_f = p_block[x - i_stride - 1] +
( p_block[x - i_stride ] << 1)+ ( p_block[x - i_stride ] << 1)+
p_block[x - i_stride + 1] + p_block[x - i_stride + 1] +
( p_block[x - 1] << 1 )+ ( p_block[x - 1] << 1 )+
( p_block[x ] << 2 )+ ( p_block[x ] << 2 )+
( p_block[x + 1] << 1 )+ ( p_block[x + 1] << 1 )+
p_block[x + i_stride - 1] + p_block[x + i_stride - 1] +
( p_block[x + i_stride ] << 1 ) + ( p_block[x + i_stride ] << 1 ) +
p_block[x + i_stride + 1]; p_block[x + i_stride + 1];
...@@ -707,7 +707,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -707,7 +707,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
} }
else else
{ {
i_flt[y][x] = i_f ; i_flt[y][x] = i_f ;
} }
} }
else else
...@@ -715,7 +715,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -715,7 +715,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
i_flt[y][x] = p_block[x]; i_flt[y][x] = p_block[x];
} }
i_bin >>= 1; i_bin >>= 1;
} }
p_block += i_stride; p_block += i_stride;
} }
...@@ -738,7 +738,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -738,7 +738,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_dering_Y )( u8 *p_plane, void E_( pp_dering_Y )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride ) QT_STORE_T *p_QP_store, int i_QP_stride )
{ {
...@@ -746,10 +746,10 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -746,10 +746,10 @@ void E_( pp_dering_Y )( u8 *p_plane,
int i_max[4], i_min[4], i_range[4]; int i_max[4], i_min[4], i_range[4];
int i_thr[4]; int i_thr[4];
int i_max_range, i_kmax; int i_max_range, i_kmax;
u32 i_bin[4][10]; uint32_t i_bin[4][10];
u8 *p_block[4]; uint8_t *p_block[4];
QT_STORE_T *p_QP; QT_STORE_T *p_QP;
/* We process 4 blocks/loop*/ /* We process 4 blocks/loop*/
for( y = 8; y < i_height-8; y += 16 ) for( y = 8; y < i_height-8; y += 16 )
{ {
...@@ -819,8 +819,8 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -819,8 +819,8 @@ void E_( pp_dering_Y )( u8 *p_plane,
i_thr[2], i_bin[2] ); i_thr[2], i_bin[2] );
pp_dering_BinIndex( p_block[3] - i_stride - 1, i_stride, pp_dering_BinIndex( p_block[3] - i_stride - 1, i_stride,
i_thr[3], i_bin[3] ); i_thr[3], i_bin[3] );
/* 3: adaptive smoothing */ /* 3: adaptive smoothing */
/* since we begin at (8,8) QP can be different for each block */ /* since we begin at (8,8) QP can be different for each block */
p_QP = &( p_QP_store[( y >> 4) * i_QP_stride + (x >> 4)] ); p_QP = &( p_QP_store[( y >> 4) * i_QP_stride + (x >> 4)] );
...@@ -836,27 +836,27 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -836,27 +836,27 @@ void E_( pp_dering_Y )( u8 *p_plane,
pp_dering_Filter( p_block[3], i_stride, pp_dering_Filter( p_block[3], i_stride,
i_bin[3], p_QP[i_QP_stride+1] ); i_bin[3], p_QP[i_QP_stride+1] );
p_block[0] += 8; p_block[0] += 8;
p_block[1] += 8; p_block[1] += 8;
p_block[2] += 8; p_block[2] += 8;
p_block[3] += 8; p_block[3] += 8;
} }
} }
} }
void E_( pp_dering_C )( u8 *p_plane, void E_( pp_dering_C )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride ) QT_STORE_T *p_QP_store, int i_QP_stride )
{ {
int x, y; int x, y;
int i_max, i_min; int i_max, i_min;
int i_thr; int i_thr;
u32 i_bin[10]; uint32_t i_bin[10];
u8 *p_block; uint8_t *p_block;
for( y = 8; y < i_height-8; y += 8 ) for( y = 8; y < i_height-8; y += 8 )
{ {
...@@ -877,13 +877,13 @@ void E_( pp_dering_C )( u8 *p_plane, ...@@ -877,13 +877,13 @@ void E_( pp_dering_C )( u8 *p_plane,
pp_dering_BinIndex( p_block - i_stride -1, i_stride, pp_dering_BinIndex( p_block - i_stride -1, i_stride,
i_thr, i_thr,
i_bin ); i_bin );
/* 3: adaptive smoothing */ /* 3: adaptive smoothing */
pp_dering_Filter( p_block, i_stride, pp_dering_Filter( p_block, i_stride,
i_bin, i_bin,
p_QP_store[(y>>5)*i_QP_stride+ (x>>5)]); p_QP_store[(y>>5)*i_QP_stride+ (x>>5)]);
p_block += 8; p_block += 8;
} }
} }
} }
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
* postprocessing_mmxext.c: Post Processing plugin MMXEXT * postprocessing_mmxext.c: Post Processing plugin MMXEXT
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: postprocessing_mmxext.c,v 1.4 2002/12/06 16:34:05 sam Exp $ * $Id: postprocessing_mmxext.c,v 1.5 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#include <vlc/vlc.h> /* only use u8, u32 .... */ #include <vlc/vlc.h> /* only use uint8_t, uint32_t .... */
#include "postprocessing.h" #include "postprocessing.h"
#include "postprocessing_common.h" #include "postprocessing_common.h"
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
/* Use same things as in idct but how it work ? */ /* Use same things as in idct but how it work ? */
#define UNUSED_LONGLONG( foo ) \ #define UNUSED_LONGLONG( foo ) \
static const unsigned long long foo __asm__ (#foo) __attribute__((unused)) static const unsigned long long foo __asm__ (#foo) __attribute__((unused))
/* to calculate isDC_mode for mmx */ /* to calculate isDC_mode for mmx */
UNUSED_LONGLONG( mmx_thr1 ) = ( PP_THR1 << 56 )| UNUSED_LONGLONG( mmx_thr1 ) = ( PP_THR1 << 56 )|
( PP_THR1 << 48 )| ( PP_THR1 << 48 )|
( PP_THR1 << 40 )| ( PP_THR1 << 40 )|
...@@ -76,37 +76,37 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL; ...@@ -76,37 +76,37 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
/* find min bytes from r ans set it in r, t is destroyed */ /* find min bytes from r ans set it in r, t is destroyed */
#define MMXEXT_GET_PMIN( r, t ) \ #define MMXEXT_GET_PMIN( r, t ) \
"movq " #r ", " #t " \n\ "movq " #r ", " #t " \n" \
psrlq $8, " #t " \n\ "psrlq $8, " #t " \n" \
pminub " #t ", " #r " \n\ "pminub " #t ", " #r " \n" \
pshufw $0xf5, " #r ", " #t " #instead of shift with tmp reg \n\ "pshufw $0xf5, " #r ", " #t " #instead of shift with tmp reg \n" \
pminub " #t ", " #r " \n\ "pminub " #t ", " #r " \n" \
pshufw $0xfe, " #r ", " #t " \n\ "pshufw $0xfe, " #r ", " #t " \n" \
pminub " #t ", " #r " \n" "pminub " #t ", " #r " \n"
/* find mzx bytes from r ans set it in r, t is destroyed */ /* find mzx bytes from r ans set it in r, t is destroyed */
#define MMXEXT_GET_PMAX( r, t ) \ #define MMXEXT_GET_PMAX( r, t ) \
"movq " #r ", " #t " \n\ "movq " #r ", " #t " \n" \
psrlq $8, " #t " \n\ "psrlq $8, " #t " \n" \
pmaxub " #t ", " #r " \n\ "pmaxub " #t ", " #r " \n" \
pshufw $0xf5, " #r ", " #t " \n\ "pshufw $0xf5, " #r ", " #t " \n" \
pmaxub " #t ", " #r " \n\ "pmaxub " #t ", " #r " \n" \
pshufw $0xfe, " #r ", " #t " \n\ "pshufw $0xfe, " #r ", " #t " \n" \
pmaxub " #t ", " #r " \n" "pmaxub " #t ", " #r " \n"
#define MMXEXT_GET_LMINMAX( s, m, M, t ) \ #define MMXEXT_GET_LMINMAX( s, m, M, t ) \
"movq " #s ", " #t " \n\ "movq " #s ", " #t " \n" \
pminub " #t ", " #m " \n\ "pminub " #t ", " #m " \n" \
pmaxub " #t ", " #M " \n" "pmaxub " #t ", " #M " \n"
/* Some tips for MMX /* Some tips for MMX
* |a-b| : * |a-b| :
d1 = a - b with unsigned saturate d1 = a - b with unsigned saturate
d2 = b - a with ... d2 = b - a with ...
|a-b| = d1 | d2 |a-b| = d1 | d2
*/ */
...@@ -120,52 +120,52 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL; ...@@ -120,52 +120,52 @@ UNUSED_LONGLONG( mmx_m2_5_m5_2 ) = 0xfffe0005fffb0002ULL;
* so need to be fast ... * so need to be fast ...
* *
****************************************************************************/ ****************************************************************************/
static inline int pp_deblock_isDC_mode( u8 *p_v ) static inline int pp_deblock_isDC_mode( uint8_t *p_v )
{ {
unsigned int i_eq_cnt; unsigned int i_eq_cnt;
/* algo : /* algo :
x = v[i] - v[i+1] without signed saturation x = v[i] - v[i+1] without signed saturation
( XXX see if there is'nt problem, but can't be with signed ( XXX see if there is'nt problem, but can't be with signed
sat because pixel will be saturate :( sat because pixel will be saturate :(
so x within [-128, 127] and we have to test if it fit in [-M, M] so x within [-128, 127] and we have to test if it fit in [-M, M]
we add 127-M with wrap around -> good value fit in [ 127-2*M, 127] we add 127-M with wrap around -> good value fit in [ 127-2*M, 127]
and if x >= 127 - 2 * M ie x > 127 -2*M - 1 value is good and if x >= 127 - 2 * M ie x > 127 -2*M - 1 value is good
*/ */
#if 0 #if 0
__asm__ __volatile__ (" \n\ __asm__ __volatile__ (
#* Do (v0-v1) to (v7-v8) \n\ " #* Do (v0-v1) to (v7-v8) \n"
movq (%1), %%mm1 # load v0->v7 \n\ "movq (%1), %%mm1 # load v0->v7 \n"
movq 1(%1), %%mm2 # load v1->v8 \n\ "movq 1(%1), %%mm2 # load v1->v8 \n"
psubb %%mm2, %%mm1 # v[i]-v[i+1] \n\ "psubb %%mm2, %%mm1 # v[i]-v[i+1] \n"
paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n\ "paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n"
pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n\ "pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n"
pxor %%mm0, %%mm0 # mm0 = 0 \n\ "pxor %%mm0, %%mm0 # mm0 = 0 \n"
psadbw %%mm1, %%mm0 \n\ "psadbw %%mm1, %%mm0 \n"
movd %%mm0, %0 # \n\ "movd %%mm0, %0 # \n"
negl %0 \n\ "negl %0 \n"
andl $255, %0" "andl $255, %0"
: "=r"(i_eq_cnt) : "r" (p_v) ); : "=r"(i_eq_cnt) : "r" (p_v) );
#endif #endif
__asm__ __volatile__ (" \n\ __asm__ __volatile__ (
#* Do (v0-v1) to (v7-v8) \n\ " #* Do (v0-v1) to (v7-v8) \n"
movq (%1), %%mm1 # load v0->v7 \n\ "movq (%1), %%mm1 # load v0->v7 \n"
pxor %%mm0, %%mm0 # mm0 = 0 \n\ "pxor %%mm0, %%mm0 # mm0 = 0 \n"
movq 1(%1), %%mm2 # load v1->v8 \n\ "movq 1(%1), %%mm2 # load v1->v8 \n"
psubb %%mm2, %%mm1 # v[i]-v[i+1] \n\ "psubb %%mm2, %%mm1 # v[i]-v[i+1] \n"
paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n\ "paddb mmx_127_thr1, %%mm1 # + 127-THR1 with wrap \n"
pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n\ "pcmpgtb mmx_127_2xthr1_1, %%mm1 # > 127 -2*thr1 - 1 \n"
psadbw %%mm1, %%mm0 \n\ "psadbw %%mm1, %%mm0 \n"
movd %%mm0, %0 # \n\ "movd %%mm0, %0 # \n"
negl %0" "negl %0"
: "=r"(i_eq_cnt) : "r" (p_v) ); : "=r"(i_eq_cnt) : "r" (p_v) );
/* last test, hey, 9 don't fit in MMX */ /* last test, hey, 9 don't fit in MMX */
if(( ( p_v[8] - p_v[9] + PP_THR1 )&0xffff )<= PP_2xTHR1 ) if(( ( p_v[8] - p_v[9] + PP_THR1 )&0xffff )<= PP_2xTHR1 )
{ {
i_eq_cnt++; i_eq_cnt++;
} }
...@@ -175,8 +175,8 @@ static inline int pp_deblock_isDC_mode( u8 *p_v ) ...@@ -175,8 +175,8 @@ static inline int pp_deblock_isDC_mode( u8 *p_v )
for( i =0; i < 9; i++ ) for( i =0; i < 9; i++ )
{ {
if(( ( p_v[i] - p_v[i+1] + PP_THR1 )&0xffff )<= PP_2xTHR1 ) if(( ( p_v[i] - p_v[i+1] + PP_THR1 )&0xffff )<= PP_2xTHR1 )
{ {
i_eq_cnt++; i_eq_cnt++;
} }
} }
...@@ -185,24 +185,24 @@ static inline int pp_deblock_isDC_mode( u8 *p_v ) ...@@ -185,24 +185,24 @@ static inline int pp_deblock_isDC_mode( u8 *p_v )
return( (i_eq_cnt >= PP_THR2 ) ? 1 : 0 ); return( (i_eq_cnt >= PP_THR2 ) ? 1 : 0 );
} }
static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP ) static inline int pp_deblock_isMinMaxOk( uint8_t *p_v, int i_QP )
{ {
int i_range; int i_range;
__asm__ __volatile__ ( __asm__ __volatile__ (
"movq 1(%1), %%mm0 # 8 bytes \n" "movq 1(%1), %%mm0 # 8 bytes \n"
"movq %%mm0, %%mm1 \n" "movq %%mm0, %%mm1 \n"
MMXEXT_GET_PMIN( %%mm0, %%mm7 ) MMXEXT_GET_PMIN( %%mm0, %%mm7 )
MMXEXT_GET_PMAX( %%mm1, %%mm7 ) MMXEXT_GET_PMAX( %%mm1, %%mm7 )
"psubd %%mm0, %%mm1 # max - min \n\ "psubd %%mm0, %%mm1 # max - min \n"
movd %%mm1, %0 \n\ "movd %%mm1, %0 \n"
andl $255, %0" : "=r"(i_range) : "r"(p_v) ); "andl $255, %0" : "=r"(i_range) : "r"(p_v) );
#if 0 #if 0
int i_max, i_min; int i_max, i_min;
int i; int i;
i_min = i_max = p_v[1]; i_min = i_max = p_v[1];
for( i = 2; i < 9; i++ ) for( i = 2; i < 9; i++ )
{ {
if( i_max < p_v[i] ) i_max = p_v[i]; if( i_max < p_v[i] ) i_max = p_v[i];
...@@ -215,7 +215,7 @@ static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP ) ...@@ -215,7 +215,7 @@ static inline int pp_deblock_isMinMaxOk( u8 *p_v, int i_QP )
} }
static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, static inline void pp_deblock_DefaultMode( uint8_t i_v[10], int i_stride,
int i_QP ) int i_QP )
{ {
int d, i_delta; int d, i_delta;
...@@ -225,15 +225,15 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -225,15 +225,15 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
/* d = CLIP( 5(a3x0' - a3x0)//8, 0, (v4-v5)/2 ).d( abs(a3x0) < QP ) */ /* d = CLIP( 5(a3x0' - a3x0)//8, 0, (v4-v5)/2 ).d( abs(a3x0) < QP ) */
/* First calculate a3x0 */ /* First calculate a3x0 */
__asm__ __volatile__ ( " \n\ __asm__ __volatile__ (
pxor %%mm7, %%mm7 # mm7 = 0 \n\ "pxor %%mm7, %%mm7 # mm7 = 0 \n"
movq mmx_m2_5_m5_2, %%mm6 # mm6 =(2,-5,5,-2) \n\ "movq mmx_m2_5_m5_2, %%mm6 # mm6 =(2,-5,5,-2) \n"
movd 3(%1), %%mm0 \n\ "movd 3(%1), %%mm0 \n"
punpcklbw %%mm7,%%mm0 \n\ "punpcklbw %%mm7,%%mm0 \n"
pmaddwd %%mm6, %%mm0 \n" "pmaddwd %%mm6, %%mm0 \n"
"pshufw $0xfe, %%mm0, %%mm1 \n" "pshufw $0xfe, %%mm0, %%mm1 \n"
"paddd %%mm1, %%mm0 \n\ "paddd %%mm1, %%mm0 \n"
movd %%mm0, %0" : "=r"(a3x0) :"r"(i_v) ); "movd %%mm0, %0" : "=r"(a3x0) :"r"(i_v) );
#if 0 #if 0
a3x0 = 2 * ( i_v[3] - i_v[6] ) + 5 *( i_v[5] - i_v[4] ); a3x0 = 2 * ( i_v[3] - i_v[6] ) + 5 *( i_v[5] - i_v[4] );
#endif #endif
...@@ -242,7 +242,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -242,7 +242,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
{ {
b_neg = 1; b_neg = 1;
a3x0 = -a3x0; a3x0 = -a3x0;
} }
else else
{ {
b_neg = 0; b_neg = 0;
...@@ -251,22 +251,22 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -251,22 +251,22 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
if( ( a3x0 < 8 * i_QP )&&( a3x0 != 0 ) ) /* |a3x0| < 8*i_QP */ if( ( a3x0 < 8 * i_QP )&&( a3x0 != 0 ) ) /* |a3x0| < 8*i_QP */
{ {
/* calculate a3x1 et a3x2 */ /* calculate a3x1 et a3x2 */
__asm__ __volatile__ ( " \n\ __asm__ __volatile__ (
# mm7 = 0 \n\ " # mm7 = 0 \n"
# mm6 = ( 2, -5, 5, -2 ) \n\ " # mm6 = ( 2, -5, 5, -2 ) \n"
movd 1(%2), %%mm0 \n\ "movd 1(%2), %%mm0 \n"
movd 5(%2), %%mm2 \n\ "movd 5(%2), %%mm2 \n"
punpcklbw %%mm7,%%mm0 \n\ "punpcklbw %%mm7,%%mm0 \n"
punpcklbw %%mm7,%%mm2 \n\ "punpcklbw %%mm7,%%mm2 \n"
pmaddwd %%mm6, %%mm0 \n\ "pmaddwd %%mm6, %%mm0 \n"
pmaddwd %%mm6, %%mm2 \n\ "pmaddwd %%mm6, %%mm2 \n"
pshufw $0xfe, %%mm0, %%mm1 \n\ "pshufw $0xfe, %%mm0, %%mm1 \n"
paddd %%mm1, %%mm0 # mm0 = a3x1 \n\ "paddd %%mm1, %%mm0 # mm0 = a3x1 \n"
movd %%mm0, %0 \n\ "movd %%mm0, %0 \n"
pshufw $0xfe, %%mm2, %%mm1 \n\ "pshufw $0xfe, %%mm2, %%mm1 \n"
paddd %%mm1, %%mm2 # mm2 = a3x2 \n\ "paddd %%mm1, %%mm2 # mm2 = a3x2 \n"
movd %%mm2, %1 \n\ "movd %%mm2, %1 \n"
" : "=r"(a3x1), "=r"(a3x2) : "r"(i_v) ); : "=r"(a3x1), "=r"(a3x2) : "r"(i_v) );
#if 0 #if 0
a3x1 = 2 * ( i_v[1] - i_v[4] ) + 5 * ( i_v[3] - i_v[2] ); a3x1 = 2 * ( i_v[1] - i_v[4] ) + 5 * ( i_v[3] - i_v[2] );
a3x2 = 2 * ( i_v[5] - i_v[8] ) + 5 * ( i_v[7] - i_v[6] ); a3x2 = 2 * ( i_v[5] - i_v[8] ) + 5 * ( i_v[7] - i_v[6] );
...@@ -276,7 +276,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -276,7 +276,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
if( a3x2 < 0) a3x2 = -a3x2; /* abs( a3x2 ) */ if( a3x2 < 0) a3x2 = -a3x2; /* abs( a3x2 ) */
a3x0_ = PP_MIN3( a3x0, a3x1, a3x2 ); a3x0_ = PP_MIN3( a3x0, a3x1, a3x2 );
d = 5 *( a3x0 - a3x0_ ) / 8; /* always > 0 */ d = 5 *( a3x0 - a3x0_ ) / 8; /* always > 0 */
i_delta = ( i_v[4] - i_v[5] ) / 2; i_delta = ( i_v[4] - i_v[5] ) / 2;
...@@ -305,7 +305,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride, ...@@ -305,7 +305,7 @@ static inline void pp_deblock_DefaultMode( u8 i_v[10], int i_stride,
static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ static inline void pp_deblock_DCMode( uint8_t *p_v, /* = int i_v[10] */
int i_QP ) int i_QP )
{ {
int i_p0, i_p9; int i_p0, i_p9;
...@@ -313,20 +313,20 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -313,20 +313,20 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
i_p9 = PP_ABS( p_v[8] - p_v[9] ) < i_QP ? p_v[9] : p_v[8]; i_p9 = PP_ABS( p_v[8] - p_v[9] ) < i_QP ? p_v[9] : p_v[8];
/* mm0 = 8 pix unmodified /* mm0 = 8 pix unmodified
-We will process first 4 pixel -We will process first 4 pixel
mm0 = 8 pix unmodified mm0 = 8 pix unmodified
mm1 = for the first part of the 4 first pix mm1 = for the first part of the 4 first pix
(v1) -> (p0) -> ... ( word ) (v1) -> (p0) -> ... ( word )
(v2) (v1) (v2) (v1)
(v3) (v2) (v3) (v2)
(v4) (v3) (v4) (v3)
= for the commoin part between first and last pix = for the commoin part between first and last pix
(v2) -> (v3) -> ... ( word ) (v2) -> (v3) -> ... ( word )
(v3) (v4) (v3) (v4)
(v4) (v5) (v4) (v5)
(v5) (v6) (v5) (v6)
= for the last part of the 4 last pix = for the last part of the 4 last pix
(v5) -> (v6) -> ... ( word ) (v5) -> (v6) -> ... ( word )
(v6) (v7) (v6) (v7)
...@@ -334,98 +334,98 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -334,98 +334,98 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
(v8) (p9) (v8) (p9)
mm2 = acu for first new pix mm2 = acu for first new pix
mm3 = acu for last pix mm3 = acu for last pix
mm4 = unused mm4 = unused
mm5 = p0 mm5 = p0
mm6 = p9 << 48 mm6 = p9 << 48
mm7 = 0 */ mm7 = 0 */
__asm__ __volatile__ ( __asm__ __volatile__ (
"pxor %%mm7, %%mm7 \n\ "pxor %%mm7, %%mm7 \n"
movq 1(%0), %%mm0 # get 8 pix \n\ "movq 1(%0), %%mm0 # get 8 pix \n"
# unpack into mm1 \n\ " # unpack into mm1 \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
punpcklbw %%mm7, %%mm1 \n\ "punpcklbw %%mm7, %%mm1 \n"
# get p_0 and i_p9 \n\ " # get p_0 and i_p9 \n"
movd %1, %%mm5 \n\ "movd %1, %%mm5 \n"
movd %2, %%mm6 \n\ "movd %2, %%mm6 \n"
psllq $48, %%mm6 \n "psllq $48, %%mm6 \n"
\n\ " \n"
movq %%mm1, %%mm3 # p_v[5-8] = v[1-4] !! \n\ "movq %%mm1, %%mm3 # p_v[5-8] = v[1-4] !! \n"
movq %%mm1, %%mm2 \n\ "movq %%mm1, %%mm2 \n"
psllw $2, %%mm2 # p_v[1-4] = 4*v[1-4] \n\ "psllw $2, %%mm2 # p_v[1-4] = 4*v[1-4] \n"
\n\ " \n"
psllq $16, %%mm1 \n\ "psllq $16, %%mm1 \n"
por %%mm5, %%mm1 # mm1 =( p0, v1, v2 ,v3)\n\ "por %%mm5, %%mm1 # mm1 =( p0, v1, v2 ,v3)\n"
\n\ " \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, v1, v2)\n\ "pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, v1, v2)\n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, p0, v2)\n\ "pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, p0, v2)\n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
\n\ " \n"
pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, p0, p0)\n\ "pshufw $0x90,%%mm1,%%mm1 # mm1 =( p0, p0, p0, p0)\n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
# Now last part a little borring\n\ " # Now last part a little borring\n"
# last part for mm2, beginig for mm3 " # last part for mm2, beginig for mm3\n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $8, %%mm1 \n\ "psrlq $8, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v2, v3, v4, v5 )\n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v2, v3, v4, v5 )\n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v3, v4, v5, v6 )\n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v3, v4, v5, v6 )\n"
psllw $1, %%mm1 \n\ "psllw $1, %%mm1 \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $24, %%mm1 \n\ "psrlq $24, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v4, v5, v6, v7) \n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v4, v5, v6, v7) \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
psrlq $32, %%mm1 \n\ "psrlq $32, %%mm1 \n"
punpcklbw %%mm7, %%mm1 # mm1 =( v5, v6, v7, v8) \n\ "punpcklbw %%mm7, %%mm1 # mm1 =( v5, v6, v7, v8) \n"
paddw %%mm1, %%mm2 \n\ "paddw %%mm1, %%mm2 \n"
psllw $2, %%mm1 "psllw $2, %%mm1 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
# Now last part for last 4 pix \n\ " # Now last part for last 4 pix \n"
# \n\ " # \n"
movq %%mm0, %%mm1 \n\ "movq %%mm0, %%mm1 \n"
punpckhbw %%mm7, %%mm1 # mm1 = ( v5, v6, v7, v8) \n\ "punpckhbw %%mm7, %%mm1 # mm1 = ( v5, v6, v7, v8) \n"
\n\ " \n"
psrlq $16, %%mm1 \n\ "psrlq $16, %%mm1 \n"
por %%mm6, %%mm1 # mm1 =( v6, v7, v8, p9 )\n\ "por %%mm6, %%mm1 # mm1 =( v6, v7, v8, p9 )\n"
\n\ " \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
pshufw $0xf9,%%mm1,%%mm1 # mm1 =( v7, v8, p9, p9)\n\ "pshufw $0xf9,%%mm1,%%mm1 # mm1 =( v7, v8, p9, p9)\n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
pshufw $0xf9,%%mm1,%%mm1 # mm1 =( v8, p9, p9, p9)\n\ "pshufw $0xf9,%%mm1,%%mm1 # mm1 =( v8, p9, p9, p9)\n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
\n\ " \n"
pshufw $0xf9,%%mm1,%%mm1 # mm1 =( p9, p9, p9, p9)\n\ "pshufw $0xf9,%%mm1,%%mm1 # mm1 =( p9, p9, p9, p9)\n"
paddw %%mm1, %%mm3 \n\ "paddw %%mm1, %%mm3 \n"
psrlw $4, %%mm2 \n\ "psrlw $4, %%mm2 \n"
psrlw $4, %%mm3 \n\ "psrlw $4, %%mm3 \n"
packuswb %%mm3, %%mm2 \n\ "packuswb %%mm3, %%mm2 \n"
movq %%mm2, 1(%0) \n\ "movq %%mm2, 1(%0) \n"
": : "r"(p_v), "r"(i_p0), "r"(i_p9) : "memory" ); : : "r"(p_v), "r"(i_p0), "r"(i_p9) : "memory" );
#if 0 #if 0
for( i = 1; i < 9; i++ ) for( i = 1; i < 9; i++ )
...@@ -433,28 +433,28 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -433,28 +433,28 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
v[i] = p_v[i]; /* save 8 pix that will be modified */ v[i] = p_v[i]; /* save 8 pix that will be modified */
} }
p_v[1] = ( 6 * i_p0 + 4 * v[1] p_v[1] = ( 6 * i_p0 + 4 * v[1]
+ 2 *( v[2] + v[3]) + v[4] + v[5]) >> 4; + 2 *( v[2] + v[3]) + v[4] + v[5]) >> 4;
p_v[2] = ( 4 * i_p0 + 2 * v[1] + 4 * v[2] p_v[2] = ( 4 * i_p0 + 2 * v[1] + 4 * v[2]
+ 2 *( v[3] + v[4]) + v[5] + v[6]) >> 4; + 2 *( v[3] + v[4]) + v[5] + v[6]) >> 4;
p_v[3] = ( 2 * i_p0 + 2 * (v[1] + v[2]) + 4 * v[3] p_v[3] = ( 2 * i_p0 + 2 * (v[1] + v[2]) + 4 * v[3]
+ 2 *( v[4] + v[5]) + v[6] + v[7]) >> 4; + 2 *( v[4] + v[5]) + v[6] + v[7]) >> 4;
p_v[4] = ( i_p0 + v[1] + 2 * (v[2] + v[3]) + 4 * v[4] p_v[4] = ( i_p0 + v[1] + 2 * (v[2] + v[3]) + 4 * v[4]
+ 2 *( v[5] + v[6]) + v[7] + v[8]) >> 4; + 2 *( v[5] + v[6]) + v[7] + v[8]) >> 4;
p_v[5] = ( v[1] + v[2] + 2 * (v[3] + v[4]) + 4 * v[5] p_v[5] = ( v[1] + v[2] + 2 * (v[3] + v[4]) + 4 * v[5]
+ 2 *( v[6] + v[7]) + v[8] + i_p9) >> 4; + 2 *( v[6] + v[7]) + v[8] + i_p9) >> 4;
p_v[6] = ( v[2] + v[3] + 2 * (v[4] + v[5]) + 4 * v[6] p_v[6] = ( v[2] + v[3] + 2 * (v[4] + v[5]) + 4 * v[6]
+ 2 *( v[7] + v[8]) + 2 * i_p9) >> 4; + 2 *( v[7] + v[8]) + 2 * i_p9) >> 4;
p_v[7] = ( v[3] + v[4] + 2 * (v[5] + v[6]) + 4 * v[7] p_v[7] = ( v[3] + v[4] + 2 * (v[5] + v[6]) + 4 * v[7]
+ 2 * v[8] + 4 * i_p9) >> 4; + 2 * v[8] + 4 * i_p9) >> 4;
p_v[8] = ( v[4] + v[5] + 2 * (v[6] + v[7]) + 4 * v[8] p_v[8] = ( v[4] + v[5] + 2 * (v[6] + v[7]) + 4 * v[8]
+ 6 * i_p9) >> 4; + 6 * i_p9) >> 4;
#endif #endif
...@@ -470,21 +470,21 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */ ...@@ -470,21 +470,21 @@ static inline void pp_deblock_DCMode( u8 *p_v, /* = int i_v[10] */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_deblock_V )( u8 *p_plane, void E_( pp_deblock_V )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride, QT_STORE_T *p_QP_store, int i_QP_stride,
int b_chroma ) int b_chroma )
{ {
int x, y, i; int x, y, i;
u8 *p_v; uint8_t *p_v;
int i_QP_scale; /* use to do ( ? >> i_QP_scale ) */ int i_QP_scale; /* use to do ( ? >> i_QP_scale ) */
int i_QP; int i_QP;
u8 i_v[10]; uint8_t i_v[10];
i_QP_scale = b_chroma ? 5 : 4 ; i_QP_scale = b_chroma ? 5 : 4 ;
for( y = 8; y < i_height - 4; y += 8 ) for( y = 8; y < i_height - 4; y += 8 )
{ {
p_v = p_plane + ( y - 5 )* i_stride; p_v = p_plane + ( y - 5 )* i_stride;
for( x = 0; x < i_width; x++ ) for( x = 0; x < i_width; x++ )
...@@ -529,22 +529,22 @@ void E_( pp_deblock_V )( u8 *p_plane, ...@@ -529,22 +529,22 @@ void E_( pp_deblock_V )( u8 *p_plane,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_deblock_H )( u8 *p_plane, void E_( pp_deblock_H )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride, QT_STORE_T *p_QP_store, int i_QP_stride,
int b_chroma ) int b_chroma )
{ {
int x, y; int x, y;
u8 *p_v; uint8_t *p_v;
int i_QP_scale; int i_QP_scale;
int i_QP; int i_QP;
i_QP_scale = b_chroma ? 5 : 4 ; i_QP_scale = b_chroma ? 5 : 4 ;
for( y = 0; y < i_height; y++ ) for( y = 0; y < i_height; y++ )
{ {
p_v = p_plane + y * i_stride - 5; p_v = p_plane + y * i_stride - 5;
for( x = 8; x < i_width - 4; x += 8 ) for( x = 8; x < i_width - 4; x += 8 )
{ {
/* p_v point 5 pix before a block boundary */ /* p_v point 5 pix before a block boundary */
/* XXX QP is for v5 */ /* XXX QP is for v5 */
...@@ -563,7 +563,7 @@ void E_( pp_deblock_H )( u8 *p_plane, ...@@ -563,7 +563,7 @@ void E_( pp_deblock_H )( u8 *p_plane,
} }
} }
} }
return; return;
} }
...@@ -574,17 +574,17 @@ void E_( pp_deblock_H )( u8 *p_plane, ...@@ -574,17 +574,17 @@ void E_( pp_deblock_H )( u8 *p_plane,
* *
*****************************************************************************/ *****************************************************************************/
static inline void pp_dering_MinMax( u8 *p_block, int i_stride, static inline void pp_dering_MinMax( uint8_t *p_block, int i_stride,
int *pi_min, int *pi_max ) int *pi_min, int *pi_max )
{ {
/* First we will extract min/max for each pix on vertical line /* First we will extract min/max for each pix on vertical line
and next extract global min/max */ and next extract global min/max */
__asm__ __volatile__( __asm__ __volatile__(
"leal (%2,%3), %%eax \n\ "leal (%2,%3), %%eax \n"
movq (%2), %%mm0 #load line \n\ "movq (%2), %%mm0 #load line \n"
movq %%mm0, %%mm1 \n" "movq %%mm0, %%mm1 \n"
MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 )
...@@ -595,20 +595,20 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride, ...@@ -595,20 +595,20 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride,
MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_LMINMAX( (%%eax, %3,2), %%mm0, %%mm1, %%mm7 ) MMXEXT_GET_LMINMAX( (%%eax, %3,2), %%mm0, %%mm1, %%mm7 )
MMXEXT_GET_PMIN( %%mm0, %%mm7 ) MMXEXT_GET_PMIN( %%mm0, %%mm7 )
MMXEXT_GET_PMAX( %%mm1, %%mm7 ) MMXEXT_GET_PMAX( %%mm1, %%mm7 )
"movd %%mm0, %%eax \n\ "movd %%mm0, %%eax \n"
andl $255, %%eax \n\ "andl $255, %%eax \n"
movl %%eax, (%0) \n\ "movl %%eax, (%0) \n"
movd %%mm1, %%eax \n\ "movd %%mm1, %%eax \n"
andl $255, %%eax \n\ "andl $255, %%eax \n"
movl %%eax, (%1) \n" "movl %%eax, (%1) \n"
: : "r"(pi_min), "r"(pi_max), "r"(p_block), "r"(i_stride) : "%eax", "memory" ); : : "r"(pi_min), "r"(pi_max), "r"(p_block), "r"(i_stride) : "%eax", "memory" );
#if 0 #if 0
i_min = 255; i_max = 0; i_min = 255; i_max = 0;
for( y = 0; y < 8; y++ ) for( y = 0; y < 8; y++ )
{ {
for( x = 0; x < 8; x++ ) for( x = 0; x < 8; x++ )
...@@ -618,18 +618,18 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride, ...@@ -618,18 +618,18 @@ static inline void pp_dering_MinMax( u8 *p_block, int i_stride,
} }
p_block += i_stride; p_block += i_stride;
} }
*pi_min = i_min; *pi_min = i_min;
*pi_max = i_max; *pi_max = i_max;
#endif #endif
} }
static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr, static inline void pp_dering_BinIndex( uint8_t *p_block, int i_stride,
u32 *p_bin ) int i_thr, uint32_t *p_bin )
{ {
int y; int y;
u32 i_bin; uint32_t i_bin;
/* first create mm7 with all bytes set to thr and mm6 = 0 */ /* first create mm7 with all bytes set to thr and mm6 = 0 */
__asm__ __volatile__( __asm__ __volatile__(
...@@ -642,7 +642,7 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr, ...@@ -642,7 +642,7 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr,
for( y = 0; y < 10; y++ ) for( y = 0; y < 10; y++ )
{ {
__asm__ __volatile__( __asm__ __volatile__(
"movq (%1), %%mm0 \n" "movq (%1), %%mm0 \n"
"psubusb %%mm7, %%mm0 \n" /* sat makes that x <= thr --> 0 */ "psubusb %%mm7, %%mm0 \n" /* sat makes that x <= thr --> 0 */
"pcmpeqb %%mm6, %%mm0 \n" /* p_block <= i_thr ? -1 : 0 */ "pcmpeqb %%mm6, %%mm0 \n" /* p_block <= i_thr ? -1 : 0 */
...@@ -681,27 +681,27 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr, ...@@ -681,27 +681,27 @@ static inline void pp_dering_BinIndex( u8 *p_block, int i_stride, int i_thr,
} }
static inline void pp_dering_Filter( u8 *p_block, int i_stride, static inline void pp_dering_Filter( uint8_t *p_block, int i_stride,
u32 *p_bin, uint32_t *p_bin,
int i_QP ) int i_QP )
{ {
int x, y; int x, y;
u32 i_bin; uint32_t i_bin;
u8 i_flt[8][8]; uint8_t i_flt[8][8];
int i_f; int i_f;
u8 *p_sav; uint8_t *p_sav;
int i_QP_2; int i_QP_2;
p_sav = p_block; p_sav = p_block;
i_QP_2 = i_QP >> 1; i_QP_2 = i_QP >> 1;
for( y = 0; y < 8; y++ ) for( y = 0; y < 8; y++ )
{ {
i_bin = p_bin[y] & p_bin[y+1] & p_bin[y+2]; /* To be optimised */ i_bin = p_bin[y] & p_bin[y+1] & p_bin[y+2]; /* To be optimised */
i_bin |= i_bin >> 16; /* detect 0 or 1 */ i_bin |= i_bin >> 16; /* detect 0 or 1 */
for( x = 0; x < 8; x++ ) for( x = 0; x < 8; x++ )
{ {
if( i_bin&0x02 ) /* 0x02 since 10 index but want 1-9 */ if( i_bin&0x02 ) /* 0x02 since 10 index but want 1-9 */
{ {
/* apply dering */ /* apply dering */
...@@ -711,11 +711,11 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -711,11 +711,11 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
i_f = p_block[x - i_stride - 1] + i_f = p_block[x - i_stride - 1] +
( p_block[x - i_stride ] << 1)+ ( p_block[x - i_stride ] << 1)+
p_block[x - i_stride + 1] + p_block[x - i_stride + 1] +
( p_block[x - 1] << 1 )+ ( p_block[x - 1] << 1 )+
( p_block[x ] << 2 )+ ( p_block[x ] << 2 )+
( p_block[x + 1] << 1 )+ ( p_block[x + 1] << 1 )+
p_block[x + i_stride - 1] + p_block[x + i_stride - 1] +
( p_block[x + i_stride ] << 1 ) + ( p_block[x + i_stride ] << 1 ) +
p_block[x + i_stride + 1]; p_block[x + i_stride + 1];
...@@ -728,7 +728,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -728,7 +728,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
} }
i_bin >>= 1; i_bin >>= 1;
} }
p_block += i_stride; p_block += i_stride;
} }
...@@ -745,7 +745,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -745,7 +745,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
for( y = 0; y < 8; y++ ) for( y = 0; y < 8; y++ )
{ {
/* clamp those values and copy them */ /* clamp those values and copy them */
__asm__ __volatile__( __asm__ __volatile__(
"movq (%0), %%mm0 \n" /* mm0 = i_ftl[y][0] ... i_ftl[y][7] */ "movq (%0), %%mm0 \n" /* mm0 = i_ftl[y][0] ... i_ftl[y][7] */
"movq (%1), %%mm1 \n" /* mm1 = p_sav[0] ... p_sav[7] */ "movq (%1), %%mm1 \n" /* mm1 = p_sav[0] ... p_sav[7] */
"movq %%mm1, %%mm2 \n" "movq %%mm1, %%mm2 \n"
...@@ -769,7 +769,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride, ...@@ -769,7 +769,7 @@ static inline void pp_dering_Filter( u8 *p_block, int i_stride,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/*****************************************************************************/ /*****************************************************************************/
void E_( pp_dering_Y )( u8 *p_plane, void E_( pp_dering_Y )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride ) QT_STORE_T *p_QP_store, int i_QP_stride )
{ {
...@@ -777,10 +777,10 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -777,10 +777,10 @@ void E_( pp_dering_Y )( u8 *p_plane,
int i_max[4], i_min[4], i_range[4]; int i_max[4], i_min[4], i_range[4];
int i_thr[4]; int i_thr[4];
int i_max_range, i_kmax; int i_max_range, i_kmax;
u32 i_bin[4][10]; uint32_t i_bin[4][10];
u8 *p_block[4]; uint8_t *p_block[4];
QT_STORE_T *p_QP; QT_STORE_T *p_QP;
/* We process 4 blocks/loop*/ /* We process 4 blocks/loop*/
for( y = 8; y < i_height-8; y += 16 ) for( y = 8; y < i_height-8; y += 16 )
{ {
...@@ -850,8 +850,8 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -850,8 +850,8 @@ void E_( pp_dering_Y )( u8 *p_plane,
i_thr[2], i_bin[2] ); i_thr[2], i_bin[2] );
pp_dering_BinIndex( p_block[3] - i_stride - 1, i_stride, pp_dering_BinIndex( p_block[3] - i_stride - 1, i_stride,
i_thr[3], i_bin[3] ); i_thr[3], i_bin[3] );
/* 3: adaptive smoothing */ /* 3: adaptive smoothing */
/* since we begin at (8,8) QP can be different for each block */ /* since we begin at (8,8) QP can be different for each block */
p_QP = &( p_QP_store[( y >> 4) * i_QP_stride + (x >> 4)] ); p_QP = &( p_QP_store[( y >> 4) * i_QP_stride + (x >> 4)] );
...@@ -867,27 +867,25 @@ void E_( pp_dering_Y )( u8 *p_plane, ...@@ -867,27 +867,25 @@ void E_( pp_dering_Y )( u8 *p_plane,
pp_dering_Filter( p_block[3], i_stride, pp_dering_Filter( p_block[3], i_stride,
i_bin[3], p_QP[i_QP_stride+1] ); i_bin[3], p_QP[i_QP_stride+1] );
p_block[0] += 8; p_block[0] += 8;
p_block[1] += 8; p_block[1] += 8;
p_block[2] += 8; p_block[2] += 8;
p_block[3] += 8; p_block[3] += 8;
} }
} }
} }
void E_( pp_dering_C )( u8 *p_plane, void E_( pp_dering_C )( uint8_t *p_plane,
int i_width, int i_height, int i_stride, int i_width, int i_height, int i_stride,
QT_STORE_T *p_QP_store, int i_QP_stride ) QT_STORE_T *p_QP_store, int i_QP_stride )
{ {
int x, y; int x, y;
int i_max, i_min; int i_max, i_min;
int i_thr; int i_thr;
u32 i_bin[10]; uint32_t i_bin[10];
u8 *p_block; uint8_t *p_block;
for( y = 8; y < i_height-8; y += 8 ) for( y = 8; y < i_height-8; y += 8 )
{ {
...@@ -908,13 +906,12 @@ void E_( pp_dering_C )( u8 *p_plane, ...@@ -908,13 +906,12 @@ void E_( pp_dering_C )( u8 *p_plane,
pp_dering_BinIndex( p_block - i_stride -1, i_stride, pp_dering_BinIndex( p_block - i_stride -1, i_stride,
i_thr, i_thr,
i_bin ); i_bin );
/* 3: adaptive smoothing */ /* 3: adaptive smoothing */
pp_dering_Filter( p_block, i_stride, pp_dering_Filter( p_block, i_stride,
i_bin, i_bin,
p_QP_store[(y>>5)*i_QP_stride+ (x>>5)]); p_QP_store[(y>>5)*i_QP_stride+ (x>>5)]);
p_block += 8; p_block += 8;
} }
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.c : video parser thread * video_parser.c : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: parser.c,v 1.8 2002/11/28 17:35:00 sam Exp $ * $Id: parser.c,v 1.9 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr> * Samuel Hocevar <sam@via.ecp.fr>
...@@ -317,22 +317,22 @@ static void EndThread( vpar_thread_t *p_vpar ) ...@@ -317,22 +317,22 @@ static void EndThread( vpar_thread_t *p_vpar )
vout_Request( p_vpar->p_fifo, p_vpar->p_vout, 0, 0, 0, 0 ); vout_Request( p_vpar->p_fifo, p_vpar->p_vout, 0, 0, 0, 0 );
msg_Dbg( p_vpar->p_fifo, "%d loops among %d sequence(s)", msg_Dbg( p_vpar->p_fifo, "%ld loops among %ld sequence(s)",
p_vpar->c_loops, p_vpar->c_sequences ); p_vpar->c_loops, p_vpar->c_sequences );
#ifdef HAVE_SYS_TIMES_H #ifdef HAVE_SYS_TIMES_H
msg_Dbg( p_vpar->p_fifo, "cpu usage (user: %d, system: %d)", msg_Dbg( p_vpar->p_fifo, "cpu usage (user: %ld, system: %ld)",
cpu_usage.tms_utime, cpu_usage.tms_stime ); cpu_usage.tms_utime, cpu_usage.tms_stime );
#endif #endif
msg_Dbg( p_vpar->p_fifo, "read %d frames/fields (I %d/P %d/B %d)", msg_Dbg( p_vpar->p_fifo, "read %ld frames/fields (I %ld/P %ld/B %ld)",
p_vpar->pc_pictures[I_CODING_TYPE] p_vpar->pc_pictures[I_CODING_TYPE]
+ p_vpar->pc_pictures[P_CODING_TYPE] + p_vpar->pc_pictures[P_CODING_TYPE]
+ p_vpar->pc_pictures[B_CODING_TYPE], + p_vpar->pc_pictures[B_CODING_TYPE],
p_vpar->pc_pictures[I_CODING_TYPE], p_vpar->pc_pictures[I_CODING_TYPE],
p_vpar->pc_pictures[P_CODING_TYPE], p_vpar->pc_pictures[P_CODING_TYPE],
p_vpar->pc_pictures[B_CODING_TYPE] ); p_vpar->pc_pictures[B_CODING_TYPE] );
msg_Dbg( p_vpar->p_fifo, "decoded %d frames/fields (I %d/P %d/B %d)", msg_Dbg( p_vpar->p_fifo, "decoded %ld frames/fields (I %ld/P %ld/B %ld)",
p_vpar->pc_decoded_pictures[I_CODING_TYPE] p_vpar->pc_decoded_pictures[I_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[P_CODING_TYPE] + p_vpar->pc_decoded_pictures[P_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[B_CODING_TYPE], + p_vpar->pc_decoded_pictures[B_CODING_TYPE],
...@@ -340,7 +340,7 @@ static void EndThread( vpar_thread_t *p_vpar ) ...@@ -340,7 +340,7 @@ static void EndThread( vpar_thread_t *p_vpar )
p_vpar->pc_decoded_pictures[P_CODING_TYPE], p_vpar->pc_decoded_pictures[P_CODING_TYPE],
p_vpar->pc_decoded_pictures[B_CODING_TYPE] ); p_vpar->pc_decoded_pictures[B_CODING_TYPE] );
msg_Dbg( p_vpar->p_fifo, msg_Dbg( p_vpar->p_fifo,
"read %d malformed frames/fields (I %d/P %d/B %d)", "read %ld malformed frames/fields (I %ld/P %ld/B %ld)",
p_vpar->pc_malformed_pictures[I_CODING_TYPE] p_vpar->pc_malformed_pictures[I_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[P_CODING_TYPE] + p_vpar->pc_malformed_pictures[P_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[B_CODING_TYPE], + p_vpar->pc_malformed_pictures[B_CODING_TYPE],
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libasf.c : * libasf.c :
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.8 2002/12/06 16:34:06 sam Exp $ * $Id: libasf.c,v 1.9 2002/12/18 14:17:10 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -353,10 +353,11 @@ int ASF_ReadObject_Index( input_thread_t *p_input, ...@@ -353,10 +353,11 @@ int ASF_ReadObject_Index( input_thread_t *p_input,
msg_Dbg( p_input, msg_Dbg( p_input,
"Read \"Index Object\" file_id:" GUID_FMT "Read \"Index Object\" file_id:" GUID_FMT
" index_entry_time_interval:"I64Fd" max_packet_count:%d " " index_entry_time_interval:"I64Fd" max_packet_count:%d "
"index_entry_count:%d", "index_entry_count:%ld",
GUID_PRINT( p_index->i_file_id ), GUID_PRINT( p_index->i_file_id ),
p_index->i_index_entry_time_interval,
p_index->i_max_packet_count, p_index->i_max_packet_count,
p_index->i_index_entry_count ); (long int)p_index->i_index_entry_count );
#endif #endif
return( 1 ); return( 1 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* demuxdump.c : Pseudo demux module for vlc (dump raw stream) * demuxdump.c : Pseudo demux module for vlc (dump raw stream)
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: demuxdump.c,v 1.1 2002/11/13 20:23:21 fenrir Exp $ * $Id: demuxdump.c,v 1.2 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -157,7 +157,7 @@ static void Desactivate ( vlc_object_t *p_this ) ...@@ -157,7 +157,7 @@ static void Desactivate ( vlc_object_t *p_this )
demux_sys_t *p_demux = (demux_sys_t*)p_input->p_demux_data; demux_sys_t *p_demux = (demux_sys_t*)p_input->p_demux_data;
msg_Info( p_input, msg_Info( p_input,
"closing %s (%d Kbytes dumped)", "closing %s ("I64Fd" Kbytes dumped)",
p_demux->psz_name, p_demux->psz_name,
p_demux->i_write / 1024 ); p_demux->i_write / 1024 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc * libmp4.c : LibMP4 library for mp4 module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.10 2002/12/06 16:34:06 sam Exp $ * $Id: libmp4.c,v 1.11 2002/12/18 14:17:10 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -1557,7 +1557,7 @@ int MP4_ReadBox_stdp( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1557,7 +1557,7 @@ int MP4_ReadBox_stdp( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
#endif #endif
...@@ -1602,7 +1602,7 @@ int MP4_ReadBox_padb( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1602,7 +1602,7 @@ int MP4_ReadBox_padb( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"stdp\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
#endif #endif
...@@ -1661,7 +1661,7 @@ int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1661,7 +1661,7 @@ int MP4_ReadBox_elst( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Read Box: \"elst\" entry-count %d", msg_Dbg( p_stream->p_input, "Read Box: \"elst\" entry-count "I64Fd,
i_read / 2 ); i_read / 2 );
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ogg.c : ogg stream input module for vlc * ogg.c : ogg stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ogg.c,v 1.14 2002/12/16 18:30:12 gbazin Exp $ * $Id: ogg.c,v 1.15 2002/12/18 14:17:10 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -457,7 +457,7 @@ static void Ogg_DecodePacket( input_thread_t *p_input, ...@@ -457,7 +457,7 @@ static void Ogg_DecodePacket( input_thread_t *p_input,
if( p_stream->i_fourcc == VLC_FOURCC( 't','a','r','k' ) ) if( p_stream->i_fourcc == VLC_FOURCC( 't','a','r','k' ) )
{ {
/* FIXME: the biggest hack I've ever done */ /* FIXME: the biggest hack I've ever done */
msg_Warn( p_input, "tark pts: %lli, granule: %i", msg_Warn( p_input, "tark pts: "I64Fd", granule: "I64Fd,
p_pes->i_pts, p_pes->i_dts ); p_pes->i_pts, p_pes->i_dts );
msleep(10000); msleep(10000);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc * wav.c : wav file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: wav.c,v 1.7 2002/12/10 23:34:19 gbazin Exp $ * $Id: wav.c,v 1.8 2002/12/18 14:17:10 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -210,7 +210,7 @@ static int FindTag( input_thread_t *p_input, u32 i_tag ) ...@@ -210,7 +210,7 @@ static int FindTag( input_thread_t *p_input, u32 i_tag )
i_id = GetDWLE( p_peek ); i_id = GetDWLE( p_peek );
i_size = GetDWLE( p_peek + 4 ); i_size = GetDWLE( p_peek + 4 );
msg_Dbg( p_input, "FindTag: tag:%4.4s size:%d", &i_id, i_size ); msg_Dbg( p_input, "FindTag: tag:%4.4s size:%d", (char*)&i_id, i_size );
if( i_id == i_tag ) if( i_id == i_tag )
{ {
/* Yes, we have found the good tag */ /* Yes, we have found the good tag */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* display.c: Gtk+ tools for main interface * display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: display.c,v 1.5 2002/12/13 01:56:29 gbazin Exp $ * $Id: display.c,v 1.6 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -288,7 +288,7 @@ void GtkHideToolbarText( vlc_object_t *p_this ) ...@@ -288,7 +288,7 @@ void GtkHideToolbarText( vlc_object_t *p_this )
for( i_index = 0; i_index < list.i_count; i_index++ ) for( i_index = 0; i_index < list.i_count; i_index++ )
{ {
p_intf = (module_t *)list.p_values[i_index].p_object ; p_intf = (intf_thread_t *)list.p_values[i_index].p_object ;
if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) ) if( strcmp( MODULE_STRING, p_intf->p_module->psz_object_name ) )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ps.c * ps.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ps.c,v 1.2 2002/12/15 23:39:41 fenrir Exp $ * $Id: ps.c,v 1.3 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org> * Eric Petit <titer@videolan.org>
...@@ -160,7 +160,7 @@ static int AddStream( sout_instance_t *p_sout, sout_input_t *p_input ) ...@@ -160,7 +160,7 @@ static int AddStream( sout_instance_t *p_sout, sout_input_t *p_input )
sout_mux_t *p_mux = (sout_mux_t*)p_sout->p_mux_data; sout_mux_t *p_mux = (sout_mux_t*)p_sout->p_mux_data;
ps_stream_t *p_stream; ps_stream_t *p_stream;
msg_Dbg( p_sout, "adding input", p_sout ); msg_Dbg( p_sout, "adding input" );
p_input->p_mux_data = (void*)p_stream = malloc( sizeof( ps_stream_t ) ); p_input->p_mux_data = (void*)p_stream = malloc( sizeof( ps_stream_t ) );
p_stream->i_ok = 0; p_stream->i_ok = 0;
switch( p_input->input_format.i_cat ) switch( p_input->input_format.i_cat )
...@@ -188,7 +188,7 @@ static int AddStream( sout_instance_t *p_sout, sout_input_t *p_input ) ...@@ -188,7 +188,7 @@ static int AddStream( sout_instance_t *p_sout, sout_input_t *p_input )
} }
p_stream->i_ok = 1; p_stream->i_ok = 1;
msg_Dbg( p_sout, "adding input stream_id:0x%x [OK]", p_stream->i_stream_id, p_sout ); msg_Dbg( p_sout, "adding input stream_id:0x%x [OK]", p_stream->i_stream_id );
return( 0 ); return( 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mixer.c : audio output mixing operations * mixer.c : audio output mixing operations
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: mixer.c,v 1.21 2002/12/06 10:10:39 sam Exp $ * $Id: mixer.c,v 1.22 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -229,7 +229,7 @@ static int MixBuffer( aout_instance_t * p_aout ) ...@@ -229,7 +229,7 @@ static int MixBuffer( aout_instance_t * p_aout )
+ mixer_nb_bytes)) ) + mixer_nb_bytes)) )
{ {
msg_Warn( p_aout, msg_Warn( p_aout,
"mixer start isn't output start (%d)", "mixer start isn't output start ("I64Fd,
i_nb_bytes - mixer_nb_bytes ); i_nb_bytes - mixer_nb_bytes );
/* Round to the nearest multiple */ /* Round to the nearest multiple */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.219 2002/12/12 15:23:43 gbazin Exp $ * $Id: input.c,v 1.220 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -541,10 +541,10 @@ static void EndThread( input_thread_t * p_input ) ...@@ -541,10 +541,10 @@ static void EndThread( input_thread_t * p_input )
struct tms cpu_usage; struct tms cpu_usage;
times( &cpu_usage ); times( &cpu_usage );
msg_Dbg( p_input, "%d loops consuming user: %d, system: %d", msg_Dbg( p_input, "%ld loops consuming user: %ld, system: %ld",
p_input->c_loops, cpu_usage.tms_utime, cpu_usage.tms_stime ); p_input->c_loops, cpu_usage.tms_utime, cpu_usage.tms_stime );
#else #else
msg_Dbg( p_input, "%d loops", p_input->c_loops ); msg_Dbg( p_input, "%ld loops", p_input->c_loops );
#endif #endif
/* Free info structures */ /* Free info structures */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface * input_ext-intf.c: services to the interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.44 2002/12/06 16:34:08 sam Exp $ * $Id: input_ext-intf.c,v 1.45 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -277,7 +277,7 @@ void input_DumpStream( input_thread_t * p_input ) ...@@ -277,7 +277,7 @@ void input_DumpStream( input_thread_t * p_input )
unsigned int i, j; unsigned int i, j;
#define S p_input->stream #define S p_input->stream
msg_Dbg( p_input, "dumping stream ID 0x%x [OK:%d/D:%d]", S.i_stream_id, msg_Dbg( p_input, "dumping stream ID 0x%x [OK:%ld/D:%ld]", S.i_stream_id,
S.c_packets_read, S.c_packets_trashed ); S.c_packets_read, S.c_packets_trashed );
if( S.b_seekable ) if( S.b_seekable )
msg_Dbg( p_input, "seekable stream, position: "I64Fd"/"I64Fd" (%s/%s)", msg_Dbg( p_input, "seekable stream, position: "I64Fd"/"I64Fd" (%s/%s)",
...@@ -299,8 +299,8 @@ void input_DumpStream( input_thread_t * p_input ) ...@@ -299,8 +299,8 @@ void input_DumpStream( input_thread_t * p_input )
for( j = 0; j < p_input->stream.pp_programs[i]->i_es_number; j++ ) for( j = 0; j < p_input->stream.pp_programs[i]->i_es_number; j++ )
{ {
#define ES p_input->stream.pp_programs[i]->pp_es[j] #define ES p_input->stream.pp_programs[i]->pp_es[j]
msg_Dbg( p_input, msg_Dbg( p_input, "ES 0x%x, "
"ES 0x%x, stream 0x%x, fourcc `%4.4s', %s [OK:%d/ERR:%d]", "stream 0x%x, fourcc `%4.4s', %s [OK:%ld/ERR:%ld]",
ES->i_id, ES->i_stream_id, (char*)&ES->i_fourcc, ES->i_id, ES->i_stream_id, (char*)&ES->i_fourcc,
ES->p_decoder_fifo != NULL ? "selected" : "not selected", ES->p_decoder_fifo != NULL ? "selected" : "not selected",
ES->c_packets, ES->c_invalid_packets ); ES->c_packets, ES->c_invalid_packets );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* threads.c : threads implementation for the VideoLAN client * threads.c : threads implementation for the VideoLAN client
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: threads.c,v 1.29 2002/12/14 19:19:08 gbazin Exp $ * $Id: threads.c,v 1.30 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -651,7 +651,7 @@ int __vlc_thread_create( vlc_object_t *p_this, char * psz_file, int i_line, ...@@ -651,7 +651,7 @@ int __vlc_thread_create( vlc_object_t *p_this, char * psz_file, int i_line,
p_this->b_thread = 1; p_this->b_thread = 1;
msg_Dbg( p_this, "thread %d (%s) created at priority %d (%s:%d)", msg_Dbg( p_this, "thread %d (%s) created at priority %d (%s:%d)",
p_this->thread_id, psz_name, i_priority, (int)p_this->thread_id, psz_name, i_priority,
psz_file, i_line ); psz_file, i_line );
vlc_mutex_unlock( &p_this->object_lock ); vlc_mutex_unlock( &p_this->object_lock );
...@@ -752,16 +752,17 @@ void __vlc_thread_join( vlc_object_t *p_this, char * psz_file, int i_line ) ...@@ -752,16 +752,17 @@ void __vlc_thread_join( vlc_object_t *p_this, char * psz_file, int i_line )
{ {
#ifdef HAVE_STRERROR #ifdef HAVE_STRERROR
msg_Err( p_this, "thread_join(%d) failed at %s:%d (%s)", msg_Err( p_this, "thread_join(%d) failed at %s:%d (%s)",
p_this->thread_id, psz_file, i_line, strerror(i_ret) ); (int)p_this->thread_id, psz_file, i_line,
strerror(i_ret) );
#else #else
msg_Err( p_this, "thread_join(%d) failed at %s:%d", msg_Err( p_this, "thread_join(%d) failed at %s:%d",
p_this->thread_id, psz_file, i_line ); (int)p_this->thread_id, psz_file, i_line );
#endif #endif
} }
else else
{ {
msg_Dbg( p_this, "thread %d joined (%s:%d)", msg_Dbg( p_this, "thread %d joined (%s:%d)",
p_this->thread_id, psz_file, i_line ); (int)p_this->thread_id, psz_file, i_line );
} }
p_this->b_thread = 0; p_this->b_thread = 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* variables.c: routines for object variables handling * variables.c: routines for object variables handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: variables.c,v 1.18 2002/12/14 19:34:06 gbazin Exp $ * $Id: variables.c,v 1.19 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -497,7 +497,7 @@ int __var_Set( vlc_object_t *p_this, const char *psz_name, vlc_value_t val ) ...@@ -497,7 +497,7 @@ int __var_Set( vlc_object_t *p_this, const char *psz_name, vlc_value_t val )
i_var = Lookup( p_this->p_vars, p_this->i_vars, psz_name ); i_var = Lookup( p_this->p_vars, p_this->i_vars, psz_name );
if( i_var < 0 ) if( i_var < 0 )
{ {
msg_Err( p_this, "variable %s has disappeared" ); msg_Err( p_this, "variable %s has disappeared", psz_name );
vlc_mutex_unlock( &p_this->var_lock ); vlc_mutex_unlock( &p_this->var_lock );
return VLC_ENOVAR; return VLC_ENOVAR;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.204 2002/12/18 08:08:29 gbazin Exp $ * $Id: video_output.c,v 1.205 2002/12/18 14:17:11 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -477,7 +477,8 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -477,7 +477,8 @@ static int InitThread( vout_thread_t *p_vout )
if( p_vout->chroma.p_module == NULL ) if( p_vout->chroma.p_module == NULL )
{ {
msg_Err( p_vout, "no chroma module for %4.4s to %4.4s", msg_Err( p_vout, "no chroma module for %4.4s to %4.4s",
&p_vout->render.i_chroma, &p_vout->output.i_chroma ); (char*)&p_vout->render.i_chroma,
(char*)&p_vout->output.i_chroma );
p_vout->pf_end( p_vout ); p_vout->pf_end( p_vout );
vlc_mutex_unlock( &p_vout->change_lock ); vlc_mutex_unlock( &p_vout->change_lock );
return VLC_EGENERIC; return VLC_EGENERIC;
......
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