Commit 5c0e385a authored by Jean-Paul Saman's avatar Jean-Paul Saman

Various compile fixes for modules/codec/xvmc

parent f4e4859f
......@@ -39,7 +39,6 @@
extern "C" {
#endif
typedef struct vlc_macroblock_s
{
short *blockptr; /* pointer to current dct block */
......
......@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include "xxmc-config.h"
#include <string.h> /* 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;
......
......@@ -22,12 +22,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "xxmc-config.h"
#include <vlc/vlc.h>
#include <inttypes.h>
#include <stdlib.h> /* defines NULL */
#include <string.h> /* memcmp */
#include "xxmc-config.h"
#include "mpeg2.h"
#include "attributes.h"
#include "mpeg2_internal.h"
......@@ -661,7 +663,6 @@ static int picture_display_ext( mpeg2dec_t * mpeg2dec )
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++ )
{
picture->display_offset[i].x = mpeg2dec->display_offset_x;
......
......@@ -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,
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)
......
......@@ -28,7 +28,10 @@
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_vout_synchro.h>
#include <stdio.h>
#include <unistd.h>
#include <mcheck.h>
#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 <unistd.h>
/*****************************************************************************
* decoder_sys_t : libmpeg2 decoder descriptor
*****************************************************************************/
......@@ -60,7 +60,6 @@ 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;
......@@ -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;
......
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