diff options
Diffstat (limited to 'src/libmpeg2')
-rw-r--r-- | src/libmpeg2/decode.c | 10 | ||||
-rw-r--r-- | src/libmpeg2/slice_xvmc_vld.c | 26 | ||||
-rw-r--r-- | src/libmpeg2/xxmc.h | 3 |
3 files changed, 31 insertions, 8 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c index 114e8bc11..c4ac7c9ba 100644 --- a/src/libmpeg2/decode.c +++ b/src/libmpeg2/decode.c @@ -285,7 +285,7 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, if (mpeg2dec->frame_format == XINE_IMGFMT_XXMC) { xine_xxmc_t *xxmc = (xine_xxmc_t *) picture->current_frame->accel_data; - switch(xxmc->format) { + switch(picture->current_frame->format) { case XINE_IMGFMT_XXMC: switch(xxmc->acceleration) { case XINE_XVMC_ACCEL_VLD: @@ -533,7 +533,8 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, * Move to libmpeg2_accel.c * int libmpeg2_accel_new_frame(mpeg2dec_t *, picture_t *) */ - mpeg2_xxmc_choose_coding(mpeg2dec->frame_format, picture); + mpeg2_xxmc_choose_coding(mpeg2dec, picture, get_aspect_ratio(mpeg2dec), + flags); /* * End of new frame accel code. */ @@ -549,7 +550,8 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, * Move to libmpeg2_accel.c * int libmpeg2_accel_new_frame(mpeg2dec_t *, picture_t *) */ - mpeg2_xxmc_choose_coding(mpeg2dec->frame_format, picture); + mpeg2_xxmc_choose_coding(mpeg2dec, picture, + get_aspect_ratio(mpeg2dec), flags); /* * End of new frame accel code. */ @@ -632,7 +634,7 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code, { xine_xxmc_t *xxmc = (xine_xxmc_t *) picture->current_frame->accel_data; - switch(xxmc->format) { + switch(picture->current_frame->format) { case XINE_IMGFMT_XXMC: switch(xxmc->acceleration) { case XINE_XVMC_ACCEL_VLD: diff --git a/src/libmpeg2/slice_xvmc_vld.c b/src/libmpeg2/slice_xvmc_vld.c index 950ec1f63..3da94237b 100644 --- a/src/libmpeg2/slice_xvmc_vld.c +++ b/src/libmpeg2/slice_xvmc_vld.c @@ -48,8 +48,12 @@ static uint8_t alternate_scan [64] ATTR_ALIGN(16) = -void mpeg2_xxmc_choose_coding(int decoder_format, picture_t *picture) +void mpeg2_xxmc_choose_coding(mpeg2dec_t *mpeg2dec, picture_t *picture, + double aspect_ratio, int flags) { + int + decoder_format = mpeg2dec->frame_format; + if (picture->current_frame) { if (XINE_IMGFMT_XXMC == decoder_format) { xine_xxmc_t *xxmc = (xine_xxmc_t *) @@ -60,11 +64,27 @@ void mpeg2_xxmc_choose_coding(int decoder_format, picture_t *picture) * the output plugin. */ - xxmc->format = XINE_IMGFMT_XXMC; + xxmc->fallback_format = XINE_IMGFMT_YV12; xxmc->acceleration = XINE_XVMC_ACCEL_VLD| XINE_XVMC_ACCEL_IDCT | XINE_XVMC_ACCEL_MOCOMP ; + + /* + * Standard MOCOMP / IDCT XvMC implementation for interlaced streams + * is buggy. The bug is inherited from the old XvMC driver. Don't use it until + * it has been fixed. (A volunteer ?) + */ + + if ( picture->picture_structure != 3 ) { + xxmc->acceleration &= ~( XINE_XVMC_ACCEL_IDCT | XINE_XVMC_ACCEL_MOCOMP ); + } + xxmc->mpeg = (picture->mpeg1) ? XINE_XVMC_MPEG_1:XINE_XVMC_MPEG_2; - xxmc->proc_xxmc_frame(picture->current_frame); + xxmc->proc_xxmc_update_frame (picture->current_frame->driver, + picture->current_frame, + picture->coded_picture_width, + picture->coded_picture_height, + aspect_ratio, + XINE_IMGFMT_XXMC,flags); } } } diff --git a/src/libmpeg2/xxmc.h b/src/libmpeg2/xxmc.h index c4221200b..222ead11b 100644 --- a/src/libmpeg2/xxmc.h +++ b/src/libmpeg2/xxmc.h @@ -5,7 +5,8 @@ extern void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code, uint8_t *buffer); -extern void mpeg2_xxmc_choose_coding(int decoder_format, picture_t *picture); +extern void mpeg2_xxmc_choose_coding(mpeg2dec_t *mpeg2dec, picture_t *picture, + double aspect_ratio, int flags); extern void mpeg2_xxmc_vld_frame_complete(mpeg2dec_t *mpeg2dec, picture_t *picture, int code); |