Bug 39307 - vdpau advertises support for MPEG1, but it's unimplemented
Summary: vdpau advertises support for MPEG1, but it's unimplemented
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-17 10:04 UTC by almos
Modified: 2011-07-25 10:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description almos 2011-07-17 10:04:24 UTC
According to vdpauinfo, MPEG1 profile is supported, but in decode.c:258 the switch doesn't have a branch for PIPE_VIDEO_PROFILE_MPEG1. The result is that the playback starts, but every frame is dropped (without any error message).
Comment 1 Emeric Grange 2011-07-18 15:09:49 UTC
Indeed MPEG1 should be supported, but remains mostly untested.
That patch should do the trick, I'll try to get it commited later if I manage to test it first.
http://cgit.freedesktop.org/~emericg/mesa-vp8/commit/?h=vp8&id=0c1f9a959bc42b51a2064922adca6d422273a79e
Comment 2 Christian König 2011-07-24 17:14:31 UTC
Mhm, Emeric you patch looks quite right to me.

But honestly, I couldn't find an MPEG1 to test it.Emeric you patch looks quite right to me.

But honestly, I couldn't find an MPEG1 to test it.

So could anybody please confirm that it's right so we can push it?
Comment 3 almos 2011-07-25 01:46:15 UTC
(In reply to comment #2)
> Mhm, Emeric you patch looks quite right to me.
> 
> But honestly, I couldn't find an MPEG1 to test it.Emeric you patch looks quite
> right to me.
> 
> But honestly, I couldn't find an MPEG1 to test it.
> 
> So could anybody please confirm that it's right so we can push it?

I have some MPEG1 videos, but I cannot test due to #39308 and #39309.
Comment 4 Andy Furniss 2011-07-25 05:00:05 UTC
(In reply to comment #2)
> Mhm, Emeric you patch looks quite right to me.
> 
> But honestly, I couldn't find an MPEG1 to test it.Emeric you patch looks quite
> right to me.
> 
> But honestly, I couldn't find an MPEG1 to test it.

http://www.linux-video.net/Samples/Mpeg1/

> 
> So could anybody please confirm that it's right so we can push it?

Works OK for me on rv790 (OK meaning rendering with same issues as mpeg2), only tested the space shuttle vid from above.

Had to edit by hand as master seems to have changed somewhat - for reference here's the diff I tested with.

diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index 269c7a4..931d62b 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -161,7 +161,7 @@ vlVdpDecoderGetParameters(VdpDecoder decoder,
 }
 
 static VdpStatus
-vlVdpDecoderRenderMpeg2(struct pipe_video_decoder *decoder,
+vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder,
                         struct pipe_video_decode_buffer *buffer,
                         struct pipe_video_buffer *target,
                         VdpPictureInfoMPEG1Or2 *picture_info,
@@ -256,11 +256,12 @@ vlVdpDecoderRender(VdpDecoder decoder,
 
    // TODO: Right now only mpeg2 is supported.
    switch (vldecoder->decoder->profile)   {
+   case PIPE_VIDEO_PROFILE_MPEG1:
    case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE:
    case PIPE_VIDEO_PROFILE_MPEG2_MAIN:
       ++vldecoder->cur_buffer;
       vldecoder->cur_buffer %= VL_NUM_DECODE_BUFFERS;
-      return vlVdpDecoderRenderMpeg2(vldecoder->decoder,
+      return vlVdpDecoderRenderMpeg12(vldecoder->decoder,
                                      vldecoder->buffer[vldecoder->cur_buffer],
                                      vlsurf->video_buffer,
                                      (VdpPictureInfoMPEG1Or2 *)picture_info,
Comment 5 Christian König 2011-07-25 10:29:58 UTC
I can confirm that with this patch mpeg1 seems to work fine for most of the videos, but on some there are some major mc artefacts.

That doesn't happen with XvMC, so it seems to be a bug inside the bitstream decoder. It's a surprise that this works anyway, I just copied over the code from xine and have never tested it.

I pushed the patch anyway, so I think we can close the bug now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.