Changeset 5c0e385a484c1f28ebf9e2a4b33ecbdf07959a8f
- Timestamp:
- 05/04/07 14:09:00
(2 years ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1175774940 +0000
- git-parent:
[f4e4859fd74264e27f3e1c29fef6a46abc603610]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1175774940 +0000
- Message:
Various compile fixes for modules/codec/xvmc
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3f8b630 |
r5c0e385 |
|
| 39 | 39 | extern "C" { |
|---|
| 40 | 40 | #endif |
|---|
| 41 | | |
|---|
| 42 | 41 | |
|---|
| 43 | 42 | typedef struct vlc_macroblock_s |
|---|
| rd3fe7f2 |
r5c0e385 |
|
| 22 | 22 | */ |
|---|
| 23 | 23 | |
|---|
| | 24 | #include <vlc/vlc.h> |
|---|
| | 25 | #include <vlc_vout.h> |
|---|
| | 26 | |
|---|
| 24 | 27 | #include "xxmc-config.h" |
|---|
| 25 | 28 | |
|---|
| … | … | |
| 31 | 34 | #include "attributes.h" |
|---|
| 32 | 35 | #include "mpeg2_internal.h" |
|---|
| | 36 | #include "xvmc_vld.h" |
|---|
| 33 | 37 | |
|---|
| 34 | 38 | static int mpeg2_accels = 0; |
|---|
| … | … | |
| 174 | 178 | while(1) |
|---|
| 175 | 179 | { |
|---|
| 176 | | while( (unsignedint) (mpeg2dec->code - mpeg2dec->first_decode_slice) |
|---|
| | 180 | while( (unsigned int) (mpeg2dec->code - mpeg2dec->first_decode_slice) |
|---|
| 177 | 181 | < mpeg2dec->nb_decode_slices ) |
|---|
| 178 | 182 | { |
|---|
| … | … | |
| 204 | 208 | } |
|---|
| 205 | 209 | mpeg2dec->bytes_since_tag += copied; |
|---|
| 206 | | mpeg2_xxmc_slice( &(mpeg2dec->decoder), NULL, |
|---|
| | 210 | mpeg2_xxmc_slice( mpeg2dec, NULL, |
|---|
| 207 | 211 | mpeg2dec->code,mpeg2dec->chunk_start, |
|---|
| 208 | 212 | mpeg2dec->chunk_size); |
|---|
| rd3fe7f2 |
r5c0e385 |
|
| 23 | 23 | */ |
|---|
| 24 | 24 | |
|---|
| | 25 | #include <vlc/vlc.h> |
|---|
| | 26 | |
|---|
| | 27 | #include <inttypes.h> |
|---|
| | 28 | #include <stdlib.h> /* defines NULL */ |
|---|
| | 29 | #include <string.h> /* memcmp */ |
|---|
| | 30 | |
|---|
| 25 | 31 | #include "xxmc-config.h" |
|---|
| 26 | | |
|---|
| 27 | | #include <inttypes.h> |
|---|
| 28 | | #include <stdlib.h> /* defines NULL */ |
|---|
| 29 | | #include <string.h> /* memcmp */ |
|---|
| 30 | 32 | |
|---|
| 31 | 33 | #include "mpeg2.h" |
|---|
| … | … | |
| 661 | 663 | picture->display_offset[i].x = mpeg2dec->display_offset_x = x >> 1; |
|---|
| 662 | 664 | picture->display_offset[i].y = mpeg2dec->display_offset_y = y >> 1; |
|---|
| 663 | | } |
|---|
| 664 | 665 | } |
|---|
| 665 | 666 | for( ; i < 3; i++ ) |
|---|
| rd3fe7f2 |
r5c0e385 |
|
| 59 | 59 | uint8_t transfer_characteristics; |
|---|
| 60 | 60 | uint8_t matrix_coefficients; |
|---|
| 61 | | int aspect_ratio_information; |
|---|
| | 61 | int aspect_ratio_information; |
|---|
| 62 | 62 | } mpeg2_sequence_t; |
|---|
| 63 | 63 | |
|---|
| rea82a40 |
r5c0e385 |
|
| 17 | 17 | * |
|---|
| 18 | 18 | */ |
|---|
| 19 | | |
|---|
| | 19 | |
|---|
| 20 | 20 | #include <vlc/vlc.h> |
|---|
| 21 | 21 | #include <vlc_vout.h> |
|---|
| … | … | |
| 48 | 48 | }; |
|---|
| 49 | 49 | |
|---|
| 50 | | |
|---|
| 51 | | |
|---|
| 52 | | |
|---|
| 53 | | void mpeg2_xxmc_choose_coding(decoder_t *p_dec, mpeg2_decoder_t * const decoder, picture_t *picture, |
|---|
| 54 | | double aspect_ratio, int flags) |
|---|
| | 50 | void mpeg2_xxmc_choose_coding(decoder_t *p_dec, |
|---|
| | 51 | mpeg2_decoder_t * const decoder, picture_t *picture, |
|---|
| | 52 | double aspect_ratio, int flags) |
|---|
| 55 | 53 | { |
|---|
| 56 | 54 | if (picture) |
|---|
| … | … | |
| 58 | 56 | //vlc_fourcc_t decoder_format = picture->format.i_chroma; |
|---|
| 59 | 57 | //if (decoder_format == VLC_FOURCC('X','x','M','C')) { |
|---|
| 60 | | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; |
|---|
| | 58 | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; |
|---|
| 61 | 59 | |
|---|
| 62 | 60 | /* |
|---|
| … | … | |
| 89 | 87 | } |
|---|
| 90 | 88 | |
|---|
| 91 | | void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code, |
|---|
| 92 | | uint8_t *buffer, int size) |
|---|
| | 89 | void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, |
|---|
| | 90 | int code, uint8_t *buffer, int size) |
|---|
| 93 | 91 | { |
|---|
| 94 | 92 | mpeg2_decoder_t * const decoder = &(mpeg2dec->decoder); |
|---|
| 95 | 93 | picture = (picture_t *)mpeg2dec->fbuf[0]->id; |
|---|
| 96 | | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; |
|---|
| | 94 | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; |
|---|
| 97 | 95 | vlc_vld_frame_t *vft = &xxmc->vld_frame; |
|---|
| 98 | 96 | unsigned mb_frame_height; |
|---|
| … | … | |
| 188 | 186 | int i=0; |
|---|
| 189 | 187 | if ( vft->forward_reference_picture != NULL && ((vlc_xxmc_t *) |
|---|
| 190 | | vft->forward_reference_picture->p_accel_data)->slice_data_size > 10) |
|---|
| | 188 | vft->forward_reference_picture->p_data)->slice_data_size > 10) |
|---|
| 191 | 189 | { |
|---|
| 192 | 190 | printf("\nFORWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *) |
|---|
| 193 | | vft->forward_reference_picture->p_accel_data)->slice_data_size); |
|---|
| | 191 | vft->forward_reference_picture->p_data)->slice_data_size); |
|---|
| 194 | 192 | for (i=0;i<10;i++) |
|---|
| 195 | 193 | { |
|---|
| 196 | | printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_accel_data)->slice_data+i)); |
|---|
| | 194 | printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_data)->slice_data+i)); |
|---|
| 197 | 195 | } |
|---|
| 198 | 196 | printf("\nFORWARD SLICE DATA END!!!!\n"); |
|---|
| 199 | 197 | } |
|---|
| 200 | 198 | if ( vft->backward_reference_picture != NULL && ((vlc_xxmc_t *) |
|---|
| 201 | | vft->backward_reference_picture->p_accel_data)->slice_data_size > 10) |
|---|
| | 199 | vft->backward_reference_picture->p_data)->slice_data_size > 10) |
|---|
| 202 | 200 | { |
|---|
| 203 | 201 | printf("\nBACKWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *) |
|---|
| 204 | | vft->backward_reference_picture->p_accel_data)->slice_data_size); |
|---|
| | 202 | vft->backward_reference_picture->p_data)->slice_data_size); |
|---|
| 205 | 203 | for (i=0;i<10;i++) |
|---|
| 206 | 204 | { |
|---|
| 207 | | printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_accel_data)->slice_data+i)); |
|---|
| | 205 | printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_data)->slice_data+i)); |
|---|
| 208 | 206 | } |
|---|
| 209 | 207 | printf("\nBACKWARD SLICE DATA END!!!!\n"); |
|---|
| … | … | |
| 281 | 279 | void mpeg2_xxmc_vld_frame_complete(mpeg2dec_t *mpeg2dec, picture_t *picture, int code) |
|---|
| 282 | 280 | { |
|---|
| 283 | | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_accel_data; |
|---|
| | 281 | vlc_xxmc_t *xxmc = (vlc_xxmc_t *) picture->p_data; |
|---|
| 284 | 282 | vlc_vld_frame_t *vft = &xxmc->vld_frame; |
|---|
| 285 | 283 | |
|---|
| rea82a40 |
r5c0e385 |
|
| 29 | 29 | #include <vlc_vout.h> |
|---|
| 30 | 30 | #include <vlc_codec.h> |
|---|
| 31 | | |
|---|
| | 31 | #include <vlc_vout_synchro.h> |
|---|
| | 32 | |
|---|
| | 33 | #include <stdio.h> |
|---|
| | 34 | #include <unistd.h> |
|---|
| 32 | 35 | #include <mcheck.h> |
|---|
| 33 | 36 | |
|---|
| … | … | |
| 36 | 39 | #include "mpeg2_internal.h" |
|---|
| 37 | 40 | #include "xvmc_vld.h" |
|---|
| 38 | | |
|---|
| 39 | | #include "vout_synchro.h" |
|---|
| 40 | 41 | |
|---|
| 41 | 42 | /* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */ |
|---|
| … | … | |
| 45 | 46 | #define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */ |
|---|
| 46 | 47 | |
|---|
| 47 | | #include <unistd.h> |
|---|
| 48 | 48 | /***************************************************************************** |
|---|
| 49 | 49 | * decoder_sys_t : libmpeg2 decoder descriptor |
|---|
| … | … | |
| 61 | 61 | * Input properties |
|---|
| 62 | 62 | */ |
|---|
| 63 | | pes_packet_t *p_pes; /* current PES we are decoding */ |
|---|
| 64 | 63 | mtime_t i_pts; |
|---|
| 65 | 64 | mtime_t i_previous_pts; |
|---|
| 66 | 65 | mtime_t i_current_pts; |
|---|
| 67 | 66 | mtime_t i_previous_dts; |
|---|
| 68 | | mtime_t i_current_dts; |
|---|
| | 67 | mtime_t i_current_dts; |
|---|
| 69 | 68 | int i_current_rate; |
|---|
| 70 | 69 | picture_t * p_picture_to_destroy; |
|---|
| … | … | |
| 78 | 77 | */ |
|---|
| 79 | 78 | vout_synchro_t *p_synchro; |
|---|
| 80 | | int i_aspect; |
|---|
| 81 | | mtime_t i_last_frame_pts; |
|---|
| | 79 | int i_aspect; |
|---|
| | 80 | mtime_t i_last_frame_pts; |
|---|
| 82 | 81 | |
|---|
| 83 | 82 | }; |
|---|
| … | … | |
| 111 | 110 | |
|---|
| 112 | 111 | decoder_t *p_dec = (decoder_t*)p_this; |
|---|
| 113 | | decoder_sys_t *p_sys; |
|---|
| | 112 | decoder_sys_t *p_sys = NULL; |
|---|
| 114 | 113 | uint32_t i_accel = 0; |
|---|
| 115 | 114 | FILE *f_wd_dec; |
|---|
| … | … | |
| 131 | 130 | |
|---|
| 132 | 131 | /* Allocate the memory needed to store the decoder's structure */ |
|---|
| 133 | | if( ( p_dec->p_sys = p_sys = |
|---|
| 134 | | (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL ) |
|---|
| | 132 | p_dec->p_sys = p_sys = (decoder_sys_t *)malloc(sizeof(decoder_sys_t)); |
|---|
| | 133 | if( !p_sys ) |
|---|
| 135 | 134 | { |
|---|
| 136 | 135 | msg_Err( p_dec, "out of memory" ); |
|---|
| … | … | |
| 140 | 139 | /* Initialize the thread properties */ |
|---|
| 141 | 140 | memset( p_sys, 0, sizeof(decoder_sys_t) ); |
|---|
| 142 | | p_sys->p_pes = NULL; |
|---|
| 143 | 141 | p_sys->p_mpeg2dec = NULL; |
|---|
| 144 | 142 | p_sys->p_synchro = NULL; |
|---|
| … | … | |
| 155 | 153 | |
|---|
| 156 | 154 | #if defined( __i386__ ) |
|---|
| 157 | | if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMX ) |
|---|
| | 155 | if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_MMX ) |
|---|
| 158 | 156 | { |
|---|
| 159 | 157 | i_accel |= MPEG2_ACCEL_X86_MMX; |
|---|
| 160 | 158 | } |
|---|
| 161 | 159 | |
|---|
| 162 | | if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_3DNOW ) |
|---|
| | 160 | if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_3DNOW ) |
|---|
| 163 | 161 | { |
|---|
| 164 | 162 | i_accel |= MPEG2_ACCEL_X86_3DNOW; |
|---|
| 165 | 163 | } |
|---|
| 166 | 164 | |
|---|
| 167 | | if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_MMXEXT ) |
|---|
| | 165 | if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_MMXEXT ) |
|---|
| 168 | 166 | { |
|---|
| 169 | 167 | i_accel |= MPEG2_ACCEL_X86_MMXEXT; |
|---|
| … | … | |
| 171 | 169 | |
|---|
| 172 | 170 | #elif defined( __powerpc__ ) || defined( SYS_DARWIN ) |
|---|
| 173 | | if( p_dec->p_libvlc->i_cpu & CPU_CAPABILITY_ALTIVEC ) |
|---|
| | 171 | if( p_dec->p_libvlc_global->i_cpu & CPU_CAPABILITY_ALTIVEC ) |
|---|
| 174 | 172 | { |
|---|
| 175 | 173 | i_accel |= MPEG2_ACCEL_PPC_ALTIVEC; |
|---|
| … | … | |
| 275 | 273 | { |
|---|
| 276 | 274 | vout_SynchroNewPicture( p_sys->p_synchro, |
|---|
| 277 | | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); |
|---|
| | 275 | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, |
|---|
| | 276 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); |
|---|
| 278 | 277 | vout_SynchroDecode( p_sys->p_synchro ); |
|---|
| 279 | 278 | vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); |
|---|
| … | … | |
| 393 | 392 | p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, |
|---|
| 394 | 393 | p_sys->p_info->current_picture->nb_fields, |
|---|
| 395 | | 0, 0, p_sys->i_current_rate ); |
|---|
| | 394 | 0, 0, p_sys->i_current_rate, |
|---|
| | 395 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); |
|---|
| 396 | 396 | |
|---|
| 397 | 397 | if( p_sys->b_skip ) |
|---|
| … | … | |
| 418 | 418 | msg_Dbg( p_dec, "intra-slice refresh stream" ); |
|---|
| 419 | 419 | vout_SynchroNewPicture( p_sys->p_synchro, |
|---|
| 420 | | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); |
|---|
| | 420 | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, |
|---|
| | 421 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); |
|---|
| 421 | 422 | vout_SynchroDecode( p_sys->p_synchro ); |
|---|
| 422 | 423 | vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); |
|---|
| … | … | |
| 452 | 453 | p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE, |
|---|
| 453 | 454 | p_sys->p_info->current_picture->nb_fields, i_pts, |
|---|
| 454 | | 0, p_sys->i_current_rate ); |
|---|
| | 455 | 0, p_sys->i_current_rate, |
|---|
| | 456 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); |
|---|
| 455 | 457 | |
|---|
| 456 | 458 | if ( !(p_sys->b_slice_i |
|---|
| … | … | |
| 460 | 462 | p_sys->p_info->current_picture->flags |
|---|
| 461 | 463 | & PIC_MASK_CODING_TYPE, |
|---|
| 462 | | /*FindVout(p_dec)->render_time*/ 0 /*FIXME*/ ) ) |
|---|
| | 464 | /*FindVout(p_dec)->render_time*/ 0 /*FIXME*/, |
|---|
| | 465 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ) ) |
|---|
| 463 | 466 | { |
|---|
| 464 | 467 | mpeg2_skip( p_sys->p_mpeg2dec, 1 ); |
|---|
| … | … | |
| 588 | 591 | { |
|---|
| 589 | 592 | vout_SynchroNewPicture( p_sys->p_synchro, |
|---|
| 590 | | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate ); |
|---|
| | 593 | I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate, |
|---|
| | 594 | p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY ); |
|---|
| 591 | 595 | vout_SynchroDecode( p_sys->p_synchro ); |
|---|
| 592 | 596 | vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 ); |
|---|
| … | … | |
| 669 | 673 | decoder_sys_t *p_sys = p_dec->p_sys; |
|---|
| 670 | 674 | picture_t *p_pic; |
|---|
| 671 | | static int nbpic = 0; |
|---|
| 672 | 675 | |
|---|
| 673 | 676 | p_dec->fmt_out.video.i_width = p_sys->p_info->sequence->width; |
|---|