GNOME Bugzilla – Bug 750685
h263parse: Wrong mask use in the find_psc function.
Last modified: 2015-06-11 06:32:37 UTC
When we played a video clip encoded by h263, playbin received EOS after showing us just one frame. We checked the log h263parse, it found wrong position of psc. For this reason, h263parse calculated wrong size of frame. In the h263 spec, PSC is a word of 22 bits. Its value is 0000 0000 0000 0000 1 00000. It seemed that the value of the mask to operate 22bits was wrong.
Do you want to provide a patch?
Indeed, it looks as though the mask is wrong It should be (using 24 bit matching): * startcode : 0000 0000 0000 0000 1000 00xx * mask (bin) : 1111 1111 1111 1111 1111 1100 * mask (hex) : f f f f f c * match : 0 0 0 0 8 0
Created attachment 304924 [details] [review] h264parse: Fix PSC matching We were off by one byte in the matching It should be (using 24 bit matching): * startcode : 0000 0000 0000 0000 1000 00xx * mask (bin) : 1111 1111 1111 1111 1111 1100 * mask (hex) : f f f f f c * match : 0 0 0 0 8 0
Created attachment 304925 [details] [review] h263parse: Fix PSC matching We were off by one byte in the matching It should be (using 24 bit matching): * startcode : 0000 0000 0000 0000 1000 00xx * mask (bin) : 1111 1111 1111 1111 1111 1100 * mask (hex) : f f f f f c * match : 0 0 0 0 8 0
(In reply to Edward Hervey from comment #4) > Created attachment 304925 [details] [review] [review] > h263parse: Fix PSC matching > > We were off by one byte in the matching > > It should be (using 24 bit matching): > * startcode : 0000 0000 0000 0000 1000 00xx > * mask (bin) : 1111 1111 1111 1111 1111 1100 > * mask (hex) : f f f f f c > * match : 0 0 0 0 8 0 This is same with what I prepared. :)
commit 898b43621982175baba86fd02eadccf3af6c1091 Author: Edward Hervey <edward@centricular.com> Date: Wed Jun 10 10:36:21 2015 +0200 h263parse: Fix PSC matching We were off by one byte in the matching It should be (using 24 bit matching): * startcode : 0000 0000 0000 0000 1000 00xx * mask (bin) : 1111 1111 1111 1111 1111 1100 * mask (hex) : f f f f f c * match : 0 0 0 0 8 0 https://bugzilla.gnome.org/show_bug.cgi?id=750685