After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750685 - h263parse: Wrong mask use in the find_psc function.
h263parse: Wrong mask use in the find_psc function.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-10 07:31 UTC by Gilbok Lee
Modified: 2015-06-11 06:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
h264parse: Fix PSC matching (1.56 KB, patch)
2015-06-10 08:37 UTC, Edward Hervey
none Details | Review
h263parse: Fix PSC matching (1.56 KB, patch)
2015-06-10 08:37 UTC, Edward Hervey
committed Details | Review

Description Gilbok Lee 2015-06-10 07:31:55 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.
Comment 1 Sebastian Dröge (slomo) 2015-06-10 08:25:19 UTC
Do you want to provide a patch?
Comment 2 Edward Hervey 2015-06-10 08:35:39 UTC
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
Comment 3 Edward Hervey 2015-06-10 08:37:12 UTC
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
Comment 4 Edward Hervey 2015-06-10 08:37:54 UTC
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
Comment 5 Gilbok Lee 2015-06-11 02:42:38 UTC
(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. :)
Comment 6 Edward Hervey 2015-06-11 06:32:23 UTC
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