summaryrefslogtreecommitdiff
path: root/src/libmpeg2
diff options
context:
space:
mode:
authorThomas Hellström <totte67@users.sourceforge.net>2004-10-12 07:40:07 +0000
committerThomas Hellström <totte67@users.sourceforge.net>2004-10-12 07:40:07 +0000
commit937f0bc598b5b91cc0a8368d6007467d0925d5f6 (patch)
treef695bc88cbbdfc8b0ea98314735b112d28c520fb /src/libmpeg2
parent77b3e88fe2cf735c457756c8fdbe3f1c78d5ef85 (diff)
downloadxine-lib-937f0bc598b5b91cc0a8368d6007467d0925d5f6.tar.gz
xine-lib-937f0bc598b5b91cc0a8368d6007467d0925d5f6.tar.bz2
xxmc driver updates:
Updated software fallback mechanism to be compatible with post plugin deinterlacing. A decoder using the plugin can now request a software fallback format to be used if acceleration fails. Removed the software deinterlacer that was inherited from the xv plugin. Made idct/mocomp fall back to software decoding for interlaced streams, since these are not rendered correctly either with the xvmc or the xxmc plugin. CVS patchset: 7029 CVS date: 2004/10/12 07:40:07
Diffstat (limited to 'src/libmpeg2')
-rw-r--r--src/libmpeg2/decode.c10
-rw-r--r--src/libmpeg2/slice_xvmc_vld.c26
-rw-r--r--src/libmpeg2/xxmc.h3
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);