From: Jean-Paul Saman Date: Thu, 5 Apr 2007 12:09:00 +0000 (+0000) Subject: Various compile fixes for modules/codec/xvmc X-Git-Tag: 0.9.0-test0~7831 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5c0e385a484c1f28ebf9e2a4b33ecbdf07959a8f;p=vlc Various compile fixes for modules/codec/xvmc --- diff --git a/modules/codec/xvmc/accel_xvmc.h b/modules/codec/xvmc/accel_xvmc.h index 47245f0e32..ecf7dbf304 100644 --- a/modules/codec/xvmc/accel_xvmc.h +++ b/modules/codec/xvmc/accel_xvmc.h @@ -39,7 +39,6 @@ extern "C" { #endif - typedef struct vlc_macroblock_s { short *blockptr; /* pointer to current dct block */ diff --git a/modules/codec/xvmc/decode.c b/modules/codec/xvmc/decode.c index a180a3e821..8abca8e30e 100644 --- a/modules/codec/xvmc/decode.c +++ b/modules/codec/xvmc/decode.c @@ -21,6 +21,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "xxmc-config.h" #include /* memcmp/memset, try to remove */ @@ -30,6 +33,7 @@ #include "mpeg2.h" #include "attributes.h" #include "mpeg2_internal.h" +#include "xvmc_vld.h" static int mpeg2_accels = 0; @@ -173,7 +177,7 @@ mpeg2_state_t mpeg2_parse( mpeg2dec_t * mpeg2dec ) while(1) { - while( (unsignedint) (mpeg2dec->code - mpeg2dec->first_decode_slice) + while( (unsigned int) (mpeg2dec->code - mpeg2dec->first_decode_slice) < mpeg2dec->nb_decode_slices ) { size_buffer = mpeg2dec->buf_end - mpeg2dec->buf_start; @@ -203,7 +207,7 @@ mpeg2_state_t mpeg2_parse( mpeg2dec_t * mpeg2dec ) } } mpeg2dec->bytes_since_tag += copied; - mpeg2_xxmc_slice( &(mpeg2dec->decoder), NULL, + mpeg2_xxmc_slice( mpeg2dec, NULL, mpeg2dec->code,mpeg2dec->chunk_start, mpeg2dec->chunk_size); mpeg2dec->prev_code = mpeg2dec->code; diff --git a/modules/codec/xvmc/header.c b/modules/codec/xvmc/header.c index cf726f050a..b10cb6212f 100644 --- a/modules/codec/xvmc/header.c +++ b/modules/codec/xvmc/header.c @@ -22,11 +22,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "xxmc-config.h" +#include #include -#include /* defines NULL */ -#include /* memcmp */ +#include /* defines NULL */ +#include /* memcmp */ + +#include "xxmc-config.h" #include "mpeg2.h" #include "attributes.h" @@ -660,7 +662,6 @@ static int picture_display_ext( mpeg2dec_t * mpeg2dec ) return 1; picture->display_offset[i].x = mpeg2dec->display_offset_x = x >> 1; picture->display_offset[i].y = mpeg2dec->display_offset_y = y >> 1; - } } for( ; i < 3; i++ ) { diff --git a/modules/codec/xvmc/mpeg2.h b/modules/codec/xvmc/mpeg2.h index b478c8d98b..37470a93d3 100644 --- a/modules/codec/xvmc/mpeg2.h +++ b/modules/codec/xvmc/mpeg2.h @@ -58,7 +58,7 @@ typedef struct mpeg2_sequence_s uint8_t colour_primaries; uint8_t transfer_characteristics; uint8_t matrix_coefficients; - int aspect_ratio_information; + int aspect_ratio_information; } mpeg2_sequence_t; #define GOP_FLAG_DROP_FRAME 1 diff --git a/modules/codec/xvmc/slice_xvmc_vld.c b/modules/codec/xvmc/slice_xvmc_vld.c index 12cc6d9e76..b9a0d13654 100644 --- a/modules/codec/xvmc/slice_xvmc_vld.c +++ b/modules/codec/xvmc/slice_xvmc_vld.c @@ -16,7 +16,7 @@ * * */ - + #include #include #include @@ -47,17 +47,15 @@ static uint8_t alternate_scan [64] ATTR_ALIGN(16) = 53,61,22,30,7,15,23,31,38,46,54,62,39,47,55,63 }; - - - -void mpeg2_xxmc_choose_coding(decoder_t *p_dec, mpeg2_decoder_t * const decoder, picture_t *picture, - double aspect_ratio, int flags) +void mpeg2_xxmc_choose_coding(decoder_t *p_dec, + mpeg2_decoder_t * const decoder, picture_t *picture, + double aspect_ratio, int flags) { if (picture) { //vlc_fourcc_t decoder_format = picture->format.i_chroma; //if (decoder_format == VLC_FOURCC('X','x','M','C')) { - vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; + vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; /* * Make a request for acceleration type and mpeg coding from @@ -88,12 +86,12 @@ void mpeg2_xxmc_choose_coding(decoder_t *p_dec, mpeg2_decoder_t * const decoder, } } -void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code, - uint8_t *buffer, int size) +void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, + int code, uint8_t *buffer, int size) { mpeg2_decoder_t * const decoder = &(mpeg2dec->decoder); picture = (picture_t *)mpeg2dec->fbuf[0]->id; - vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; + vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; vlc_vld_frame_t *vft = &xxmc->vld_frame; unsigned mb_frame_height; int i; @@ -187,24 +185,24 @@ void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code, printf("\nSLICE DATA !!!! size=%d", size-4); int i=0; if ( vft->forward_reference_picture != NULL && ((vlc_xxmc_t *) - vft->forward_reference_picture->p_accel_data)->slice_data_size > 10) + vft->forward_reference_picture->p_data)->slice_data_size > 10) { printf("\nFORWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *) - vft->forward_reference_picture->p_accel_data)->slice_data_size); + vft->forward_reference_picture->p_data)->slice_data_size); for (i=0;i<10;i++) { - printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_accel_data)->slice_data+i)); + printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_data)->slice_data+i)); } printf("\nFORWARD SLICE DATA END!!!!\n"); } if ( vft->backward_reference_picture != NULL && ((vlc_xxmc_t *) - vft->backward_reference_picture->p_accel_data)->slice_data_size > 10) + vft->backward_reference_picture->p_data)->slice_data_size > 10) { printf("\nBACKWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *) - vft->backward_reference_picture->p_accel_data)->slice_data_size); + vft->backward_reference_picture->p_data)->slice_data_size); for (i=0;i<10;i++) { - printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_accel_data)->slice_data+i)); + printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_data)->slice_data+i)); } printf("\nBACKWARD SLICE DATA END!!!!\n"); } @@ -280,7 +278,7 @@ void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code, void mpeg2_xxmc_vld_frame_complete(mpeg2dec_t *mpeg2dec, picture_t *picture, int code) { - vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; + vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; vlc_vld_frame_t *vft = &xxmc->vld_frame; if (xxmc->decoded) diff --git a/modules/codec/xvmc/xxmc.c b/modules/codec/xvmc/xxmc.c index 1fece216e8..62081fd170 100644 --- a/modules/codec/xvmc/xxmc.c +++ b/modules/codec/xvmc/xxmc.c @@ -28,7 +28,10 @@ #include #include #include +#include +#include +#include #include #include "mpeg2.h" @@ -36,15 +39,12 @@ #include "mpeg2_internal.h" #include "xvmc_vld.h" -#include "vout_synchro.h" - /* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ #define AR_SQUARE_PICTURE 1 /* square pixels */ #define AR_3_4_PICTURE 2 /* 3:4 picture (TV) */ #define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */ #define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */ -#include /***************************************************************************** * decoder_sys_t : libmpeg2 decoder descriptor *****************************************************************************/ @@ -60,12 +60,11 @@ struct decoder_sys_t /* * Input properties */ - pes_packet_t *p_pes; /* current PES we are decoding */ mtime_t i_pts; mtime_t i_previous_pts; mtime_t i_current_pts; mtime_t i_previous_dts; - mtime_t i_current_dts; + mtime_t i_current_dts; int i_current_rate; picture_t * p_picture_to_destroy; vlc_bool_t b_garbage_pic; @@ -77,8 +76,8 @@ struct decoder_sys_t * Output properties */ vout_synchro_t *p_synchro; - int i_aspect; - mtime_t i_last_frame_pts; + int i_aspect; + mtime_t i_last_frame_pts; }; @@ -110,7 +109,7 @@ static int OpenDecoder( vlc_object_t *p_this ) { decoder_t *p_dec = (decoder_t*)p_this; - decoder_sys_t *p_sys; + decoder_sys_t *p_sys = NULL; uint32_t i_accel = 0; FILE *f_wd_dec; @@ -130,8 +129,8 @@ static int OpenDecoder( vlc_object_t *p_this ) } /* Allocate the memory needed to store the decoder's structure */ - if( ( p_dec->p_sys = p_sys = - (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) + p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t)); + if( !p_sys ) { msg_Err( p_dec, "out of memory" ); return VLC_EGENERIC; @@ -139,7 +138,6 @@ static int OpenDecoder( vlc_object_t *p_this ) /* Initialize the thread properties */ memset( p_sys, 0, sizeof(decoder_sys_t) ); - p_sys->p_pes = NULL; p_sys->p_mpeg2dec = NULL; p_sys->p_synchro = NULL; p_sys->p_info = NULL; @@ -154,23 +152,23 @@ static int OpenDecoder( vlc_object_t *p_this ) p_sys->b_skip = 0; #if defined( __i386__ ) - if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMX ) + if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_MMX ) { i_accel |= MPEG2_ACCEL_X86_MMX; } - if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_3DNOW ) + if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_3DNOW ) { i_accel |= MPEG2_ACCEL_X86_3DNOW; } - if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMXEXT ) + if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_MMXEXT ) { i_accel |= MPEG2_ACCEL_X86_MMXEXT; } #elif defined( __powerpc__ ) || defined( SYS_DARWIN ) - if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_ALTIVEC ) + if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_ALTIVEC ) { i_accel |= MPEG2_ACCEL_PPC_ALTIVEC; } @@ -274,7 +272,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) if ( p_sys->b_slice_i ) { vout_SynchroNewPicture( p_sys->p_synchro, - I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); + I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); vout_SynchroDecode( p_sys->p_synchro ); vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); } @@ -392,7 +391,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) vout_SynchroNewPicture( p_sys->p_synchro, p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, p_sys->p_info->current_picture->nb_fields, - 0, 0, p_sys->i_current_rate ); + 0, 0, p_sys->i_current_rate, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); if( p_sys->b_skip ) { @@ -417,7 +417,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) /* Intra-slice refresh. Simulate a blank I picture. */ msg_Dbg( p_dec, "intra-slice refresh stream" ); vout_SynchroNewPicture( p_sys->p_synchro, - I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); + I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); vout_SynchroDecode( p_sys->p_synchro ); vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); p_sys->b_slice_i = 1; @@ -451,7 +452,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) vout_SynchroNewPicture( p_sys->p_synchro, p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, p_sys->p_info->current_picture->nb_fields, i_pts, - 0, p_sys->i_current_rate ); + 0, p_sys->i_current_rate, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); if ( !(p_sys->b_slice_i && ((p_sys->p_info->current_picture->flags @@ -459,7 +461,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) && !vout_SynchroChoose( p_sys->p_synchro, p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, - /*FindVout(p_dec)->render_time*/ 0 /*FIXME*/ ) ) + /*FindVout(p_dec)->render_time*/ 0 /*FIXME*/, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ) ) { mpeg2_skip( p_sys->p_mpeg2dec, 1 ); p_sys->b_skip = 1; @@ -587,7 +590,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) if( p_sys->b_slice_i ) { vout_SynchroNewPicture( p_sys->p_synchro, - I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); + I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, + p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); vout_SynchroDecode( p_sys->p_synchro ); vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); } @@ -668,7 +672,6 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf ) //msg_Dbg(p_dec, "GetNewPicture Entering"); decoder_sys_t *p_sys = p_dec->p_sys; picture_t *p_pic; - static int nbpic = 0; p_dec->fmt_out.video.i_width = p_sys->p_info->sequence->width; p_dec->fmt_out.video.i_height = p_sys->p_info->sequence->height;