4 years agocodecparsers: h264: add gst_h264_parse_nalu_header() helper.
Gwenole Beauchesne [Mon, 1 Oct 2012 07:48:06 +0000 (09:48 +0200)]
codecparsers: h264: add gst_h264_parse_nalu_header() helper.

Add helper to parse the NALU header. Move bounds checking to there.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: add gst_h264_parse_sps_data() helper.
Gwenole Beauchesne [Mon, 1 Oct 2012 07:37:21 +0000 (09:37 +0200)]
codecparsers: h264: add gst_h264_parse_sps_data() helper.

Split seq_parameter_set_data() parsing off gst_h264_parse_sps() so
that it could be re-used later on.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: complete set of NAL unit types.
Gwenole Beauchesne [Wed, 26 Sep 2012 16:46:36 +0000 (18:46 +0200)]
codecparsers: h264: complete set of NAL unit types.

Add missing NAL unit types. They are mostly related to alpha blending,
scalable video coding extensions (SVC, Annex.G), and multiview video
coding extensions (MVC, Annex.H).

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: clean-up gst_h264_parser_parse_sei_message().
Gwenole Beauchesne [Mon, 24 Mar 2014 18:27:44 +0000 (19:27 +0100)]
codecparsers: h264: clean-up gst_h264_parser_parse_sei_message().

Fix build when GST_DISABLE_GST_DEBUG is not defined. Use a switch
statement to dispatch to the various SEI payload handlers.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: fix skipping of unsupported SEI messages.
Gwenole Beauchesne [Fri, 21 Mar 2014 16:07:19 +0000 (17:07 +0100)]
codecparsers: h264: fix skipping of unsupported SEI messages.

The payloadSize does not account for emulation prevention bytes. So,
just use nal_reader_skip() for skipping payload_size bits. It should
be possible to further optimize this code since the NAL reader shall
be aligned to byte boundary already.

Kill the now unused nal_reader_skip_to_next_byte() function.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: fix SEI buffering_period() parsing.
Gwenole Beauchesne [Fri, 21 Mar 2014 16:03:36 +0000 (17:03 +0100)]
codecparsers: h264: fix SEI buffering_period() parsing.

Fix parsing of buffering_period() SEI messages. The number of bits
used to express {nal,vcl}_initial_cpb_removal_delay{,_offset} syntax
elements is not 5 but 1 + initial_cpb_removal_delay_length_minus1.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: h264: fix rbsp_more_data() implementation.
Gwenole Beauchesne [Wed, 10 Oct 2012 14:19:49 +0000 (16:19 +0200)]
codecparsers: h264: fix rbsp_more_data() implementation.

Account for trailing zero bits when checking for rbsp_more_data().

In particular, fix an hypothetical stream whereby rbsp_more_data()
is called in the following conditions for PPS header: NalReader
reached position 20, 12 bits are remaining and trailing data at
current byte position is c8 00.

rbsp_more_data() used to return TRUE whereas it should obviously
return FALSE because x8 00 represents a valid rbsp_trailing_bits()

Signed-off-by: Gwenole Beauchesne <>
4 years agoUpdate to git master commit 05cb4bc.
Gwenole Beauchesne [Fri, 21 Mar 2014 13:50:50 +0000 (14:50 +0100)]
Update to git master commit 05cb4bc.

4 years agocodecparsers: Don't use gst_ as prefix for private symbols
Edward Hervey [Wed, 29 Jan 2014 09:50:40 +0000 (10:50 +0100)]
codecparsers: Don't use gst_ as prefix for private symbols

Otherwise they get exposed/accessible in the resulting .so

And make check-exports will complain

4 years agocodecparsers: refactor common nal parsing to nalutils
Thiago Santos [Fri, 24 Jan 2014 04:07:45 +0000 (01:07 -0300)]
codecparsers: refactor common nal parsing to nalutils

Moves common code from h264 and h265 to a separate file

4 years agoh264parse: Fix multiple SEI messages in one SEI RBSP parsing.
Aurélien Zanelli [Fri, 3 Jan 2014 08:44:28 +0000 (09:44 +0100)]
h264parse: Fix multiple SEI messages in one SEI RBSP parsing.

An SEI RBSP could contains more than one SEI message as specified in

This commit change the parser API: the gst_h264_parser_parse_sei()
function now create and fill a GArray containing GstH264SEIMessage.

4 years agoh265parser: remove trailling 0x00 bytes as the spec doesn't allow them
Thiago Santos [Wed, 22 Jan 2014 13:26:32 +0000 (10:26 -0300)]
h265parser: remove trailling 0x00 bytes as the spec doesn't allow them

Just like h264, the spec doesn't allow the last bytes of a NAL to be 0x00.
So remove it as it is probably just padding.

This is related to

4 years agoh264parser: remove trailling 0x00 bytes as the spec doesn't allow them
Thiago Santos [Mon, 20 Jan 2014 20:24:54 +0000 (17:24 -0300)]
h264parser: remove trailling 0x00 bytes as the spec doesn't allow them

The spec states that the last byte of a NAL 'shall not' be 0x00
and it is allowed for byte-stream format to add padding 0x00 for

So our parser should strip any trailling 0x00.

4 years agoh265parser: Initialize pointer correctly that is never assigned but freed in error...
duhui.lee [Tue, 21 Jan 2014 01:58:35 +0000 (10:58 +0900)]
h265parser: Initialize pointer correctly that is never assigned but freed in error cases

Fixes crash on broken streams.

4 years agoh265parser: Fix segfault when parsing HRD parameter
duhui.lee [Mon, 20 Jan 2014 08:03:09 +0000 (17:03 +0900)]
h265parser: Fix segfault when parsing HRD parameter

4 years agoh265parser: Fix segfault when parsing VPS
duhui.lee [Tue, 14 Jan 2014 14:21:25 +0000 (23:21 +0900)]
h265parser: Fix segfault when parsing VPS

4 years agoh265parser: prevent to overrun chroma_weight_l0_flag
Justin Joy [Mon, 13 Jan 2014 12:50:16 +0000 (21:50 +0900)]
h265parser: prevent to overrun chroma_weight_l0_flag

The index of elements cannot exceed or equal to the size of elements.

4 years agoh265parser: Fix debug output
Sebastian Dröge [Mon, 6 Jan 2014 13:47:43 +0000 (14:47 +0100)]
h265parser: Fix debug output

4 years agompegvideoparse: Fix documentation of GstMpegVideoSequenceScalableMode
Luis de Bethencourt [Wed, 18 Dec 2013 21:26:17 +0000 (16:26 -0500)]
mpegvideoparse: Fix documentation of GstMpegVideoSequenceScalableMode

4 years agoh264parser: not all startcodes should have 3-byte 0 prefix
Matej Knopp [Thu, 12 Dec 2013 16:49:24 +0000 (17:49 +0100)]
h264parser: not all startcodes should have 3-byte 0 prefix

The parser assumes that every time there is a 0 before the startcode,
it is part of the startcode. But that's not true.

From the specification

Byte stream NAL unit syntax
zero_byte is a single byte equal to 0x00.
  When any of the following conditions are fulfilled, the zero_byte syntax
  element shall be present.
  – the nal_unit_type within the nal_unit( ) is equal to 7 (sequence parameter
    set) or 8 (picture parameter set)
  – the byte stream NAL unit syntax structure contains the first NAL unit of an
    access unit in decoding order, as specified by subclause

The problem with doing this for all startcodes is that a trailing zero can mess
up timestamps. The trailing zero gets prepended to the startcode, which will
carry the PTS and DTS of previous buffer.

4 years agocodecparsers: h264: fix picture level scaling lists derivation (rule B).
Cong Zhong [Wed, 17 Apr 2013 02:44:48 +0000 (10:44 +0800)]
codecparsers: h264: fix picture level scaling lists derivation (rule B).

Fix picture level scaling lists derivation from fall-back rule set B,
as specified in More precisely, the sequence level scaling
lists need to be used but intra and inter lists arguments were swapped.

This fixes FRExt/freh5.264 from conformance testing.

Signed-off-by: Gwenole Beauchesne <>
4 years agoUpdate to git master commit ffeb719.
Gwenole Beauchesne [Mon, 9 Dec 2013 10:36:50 +0000 (11:36 +0100)]
Update to git master commit ffeb719.

4 years agompegvideoparser: Also initialize debug category in parse_sequence_header
Olivier Crête [Wed, 4 Dec 2013 22:31:27 +0000 (17:31 -0500)]
mpegvideoparser: Also initialize debug category in parse_sequence_header

Also remove the useless initialized flag, this is already done by the macro

4 years agocodecparsers: Add -lm needed by H.265 parser
Reynaldo H. Verdejo Pinochet [Wed, 13 Nov 2013 21:59:48 +0000 (18:59 -0300)]
codecparsers: Add -lm needed by H.265 parser

4 years agocodecparsers: Fix bad condition in h264 parser
Aurélien Zanelli [Thu, 7 Nov 2013 13:39:26 +0000 (14:39 +0100)]
codecparsers: Fix bad condition in h264 parser

4 years agocodecparsers: Remove some unused functions
Sebastian Dröge [Thu, 7 Nov 2013 08:54:40 +0000 (09:54 +0100)]
codecparsers: Remove some unused functions

4 years agocodecparsers: add H.265 HEVC bitstream parser
Sreerenj Balachandran [Tue, 1 Oct 2013 10:39:41 +0000 (13:39 +0300)]
codecparsers: add H.265 HEVC bitstream parser

4 years agocodecparsers: h264: store quantization matrices in zig-zag order
Sreerenj Balachandran [Tue, 20 Aug 2013 14:03:38 +0000 (17:03 +0300)]
codecparsers: h264: store quantization matrices in zig-zag order

Quantizer matrices are encoded in zigzag scan order in the bitstream,
so always parse it as it is.

4 years agocodecparsers: h264: add helpers to convert quantization matrices
Sreerenj Balachandran [Wed, 2 Oct 2013 08:24:58 +0000 (11:24 +0300)]
codecparsers: h264: add helpers to convert quantization matrices

Add utility functions to convert quantization matrices from zig-zag scan
order into raster scan order and vice-versa

4 years agocodecparsers: mpegvideoparse: turn internal consistency check into a g_assert()
Tim-Philipp Müller [Tue, 13 Aug 2013 16:47:14 +0000 (17:47 +0100)]
codecparsers: mpegvideoparse: turn internal consistency check into a g_assert()

We only check input from the API user with g_return_*_if_fail().
Internal sanity checks should use g_assert() instead, which is
disabled by default for releases.

4 years agocodecparsers: mpegvideoparser: minor doc fixes
Tim-Philipp Müller [Tue, 13 Aug 2013 16:45:51 +0000 (17:45 +0100)]
codecparsers: mpegvideoparser: minor doc fixes

4 years agoall: Fix for GST_DISABLE_GST_DEBUG
Edward Hervey [Mon, 29 Jul 2013 07:35:08 +0000 (09:35 +0200)]

Where applicable, remove methods that don't do anything different than
the default implementation.

4 years agocodecparser: Make warnings more meaningful
Edward Hervey [Wed, 24 Jul 2013 15:49:59 +0000 (17:49 +0200)]
codecparser: Make warnings more meaningful

By stating whether we don't have enough data or it's a corrupted

4 years agocodecparsers: h264: fix calculation of the frame cropping rectangle.
Gwenole Beauchesne [Mon, 8 Jul 2013 16:44:24 +0000 (18:44 +0200)]
codecparsers: h264: fix calculation of the frame cropping rectangle.

Fix calculation of the frame cropping rectangle, and more precisely
the actual cropped height. The frame_crop_top_offset subtraction
was not scaled up with SubHeightC.

Also clean-up variables to align more with (7-18) to (7-21).

Signed-off-by: Gwenole Beauchesne <>
4 years agoh264parser: Parse the cropping-rectangle separately.
Sreerenj Balachandran [Fri, 15 Feb 2013 12:18:49 +0000 (14:18 +0200)]
h264parser: Parse the cropping-rectangle separately.

Assign the un-cropped width/height to sps->width/sps->height
during sps header parsing. Added new fields to SPS header structure
to provide the crop-rectangle dimensions.

4 years agoUpdate to git master commit 5ad6f2d.
Gwenole Beauchesne [Fri, 5 Jul 2013 17:01:21 +0000 (19:01 +0200)]
Update to git master commit 5ad6f2d.

4 years agocodecparsers: mpeg2: fix video packet header size checks.
Gwenole Beauchesne [Fri, 5 Jul 2013 16:33:42 +0000 (18:33 +0200)]
codecparsers: mpeg2: fix video packet header size checks.

Fix video packet header size checks for:
- Sequence Header: 64 bits ;
- Sequence Scalable Extension: 10 bits ;
- Slice Header: 6 bits.

Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: mpeg2: update test program with new GstMpegVideoPacket API.
Gwenole Beauchesne [Thu, 31 Jan 2013 10:57:54 +0000 (11:57 +0100)]
codecparsers: mpeg2: update test program with new GstMpegVideoPacket API.

This is the lost hunk from:

Signed-off-by: Gwenole Beauchesne <>
4 years agoUpdate to git master commit 9a2ed78.
Gwenole Beauchesne [Fri, 5 Jul 2013 15:43:56 +0000 (17:43 +0200)]
Update to git master commit 9a2ed78.

4 years agocodecparsers: mpeg2: add slice header parsing API.
Sreerenj Balachandran [Wed, 30 Jan 2013 14:56:15 +0000 (16:56 +0200)]
codecparsers: mpeg2: add slice header parsing API.

Add API to parse the Slice header. This also calculates the macroblock
position as specified in 6.3.16.

Signed-off-by: Sreerenj Balachandran <>
Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: mpeg2: add sequence scalable extension parsing API.
Sreerenj Balachandran [Fri, 25 Jan 2013 13:48:58 +0000 (15:48 +0200)]
codecparsers: mpeg2: add sequence scalable extension parsing API.

Add API to parse the Sequence Scalable Extension header.

Signed-off-by: Sreerenj Balachandran <>
Signed-off-by: Gwenole Beauchesne <>
4 years agocodecparsers: mpeg2: add new API that takes GstMpegVideoPacket arguments.
Gwenole Beauchesne [Thu, 31 Jan 2013 10:57:54 +0000 (11:57 +0100)]
codecparsers: mpeg2: add new API that takes GstMpegVideoPacket arguments.

Add new interface to MPEG-2 video parser that takes GstMpegVideoPacket
arguments instead of data, size, and offset. New functions are called
after gst_mpeg_video_packet_*() and provide the default implementation.

Older API is moved to the deprecated namespace and uses the new functions.

Signed-off-by: Gwenole Beauchesne <>
4 years agoh264parser: Fix the return value type for the SEI palyload parsing methods.
Sreerenj Balachandran [Fri, 8 Mar 2013 23:49:23 +0000 (01:49 +0200)]
h264parser: Fix the return value type for the SEI palyload parsing methods.

The return value type of SEI payload parsing functions
are GstH264ParserResult.

4 years agocodecparsers: Fix gtk-doc
Edward Hervey [Sat, 22 Jun 2013 06:57:12 +0000 (08:57 +0200)]
codecparsers: Fix gtk-doc

Detected by initial pre-run of gi-scanner.

5 years agoDrop GstMpegVideoMeta.
Gwenole Beauchesne [Fri, 14 Jun 2013 08:22:21 +0000 (10:22 +0200)]
Drop GstMpegVideoMeta.

Drop GstMpegVideoMeta as this is out-of-scope for this project, which
is only about using the most recent bitstream parsers.

5 years agoUpdate to git master commit a5402d6.
Gwenole Beauchesne [Fri, 14 Jun 2013 08:21:51 +0000 (10:21 +0200)]
Update to git master commit a5402d6.

5 years agompegvideoparser: Fix the pixel-aspect-ratio calculation
Sreerenj Balachandran [Wed, 5 Jun 2013 13:16:36 +0000 (16:16 +0300)]
mpegvideoparser: Fix the pixel-aspect-ratio calculation

Ignore the display_extension values if they are greater than the width/height
values provided by seqhdr and calculate the PAR based on the seqhdr values.T
his is what DVD players are doing.

Thanks to "David Schleef <>"

5 years agocodecparsers: Actually store mpeg video bitrate value
Edward Hervey [Wed, 1 May 2013 14:37:54 +0000 (16:37 +0200)]
codecparsers: Actually store mpeg video bitrate value

And use the extension also (higher 12 bits)

5 years agocodecparsers: ensure the debug category is properly initialized
Thiago Santos [Fri, 21 Dec 2012 18:37:45 +0000 (15:37 -0300)]
codecparsers: ensure the debug category is properly initialized

The user of the library might not need to create a NalParser, so
the debug category needs to be initialized from other functions
as well if required.

5 years agompegvideometa: Fix typo in comment
Sreerenj Balachandran [Tue, 7 May 2013 11:22:10 +0000 (14:22 +0300)]
mpegvideometa: Fix typo in comment

5 years agodocs: add since markers to new codecparsers video meta API
Tim-Philipp Müller [Tue, 2 Apr 2013 22:33:54 +0000 (23:33 +0100)]
docs: add since markers to new codecparsers video meta API

5 years agocodecparsers: Add Mpeg Video GstMeta
Edward Hervey [Thu, 20 Sep 2012 16:03:59 +0000 (18:03 +0200)]
codecparsers: Add Mpeg Video GstMeta

This can be used by parsers to provide pre-parsed information to
downstream elements that would require it (so they can avoid having
to parse the bitstream again).

5 years agocodecparser: Fix picture packet extension size check
Edward Hervey [Wed, 26 Dec 2012 12:16:27 +0000 (13:16 +0100)]
codecparser: Fix picture packet extension size check

It is at least 34 bit big (5 bytes with byte padding)

5 years agocodecparsers: Use correct type specifiers for format strings to fix compiler warnings
Sebastian Dröge [Sun, 3 Mar 2013 11:29:42 +0000 (12:29 +0100)]
codecparsers: Use correct type specifiers for format strings to fix compiler warnings

5 years agompegvideoparser: increase min size for picture coding ext
David Schleef [Tue, 12 Feb 2013 01:58:31 +0000 (17:58 -0800)]
mpegvideoparser: increase min size for picture coding ext

This could use additional work.  The parsing code overruns the
end of buffers during normal operation, triggering GST_WARNINGs.

5 years agocodecparsers: h264: add profile enums.
Gwenole Beauchesne [Tue, 2 Oct 2012 09:02:32 +0000 (11:02 +0200)]
codecparsers: h264: add profile enums.

Add all useful profiles from AVC, MVC and SVC specifications.

Signed-off-by: Gwenole Beauchesne <>
5 years agoUpdate to git master commit 250555a.
Gwenole Beauchesne [Wed, 6 Feb 2013 14:17:40 +0000 (15:17 +0100)]
Update to git master commit 250555a.

5 years agocodecparsers: mpeg2: add helpers to convert quantization matrices.
Gwenole Beauchesne [Tue, 5 Feb 2013 10:56:46 +0000 (11:56 +0100)]
codecparsers: mpeg2: add helpers to convert quantization matrices.

Add utility functions to convert quantization matrices from zigzag scan
order (as encoded in the bitstream) into raster scan order. Also provide
another function to reverse the operation.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: mpeg2: store quantization matrices in zigzag scan order.
Cong Zhong [Thu, 31 Jan 2013 08:13:22 +0000 (16:13 +0800)]
codecparsers: mpeg2: store quantization matrices in zigzag scan order.

Quantizer matrices are encoded in zigzag scan order in the bitstream,
but they are stored in raster scan order when they are parsed. However,
default matrices were also prepared in zigzag scan order, hence the
mismatch. i.e. the matrices were presented either in raster scan order
if they are explicitly present in the bitstream, or they were presented
in zigzag scan order if the default definitions were to be used instead.

One way to solve this problem is to always expose the quantization
matrices in zigzag scan order, since this is the role of the parser to
not build up stories from the source bitstream and just present what
is in there.

Utility functions will be provided to convert quantization matrices in
either scan order.

Signed-off-by: Cong Zhong <>
Signed-off-by: Gwenole Beauchesne <>
5 years agoUpdate to git master commit 10639eb.
Gwenole Beauchesne [Fri, 25 Jan 2013 09:28:51 +0000 (10:28 +0100)]
Update to git master commit 10639eb.

5 years agocodecparsers: vc1: fix bitplanes decoding (DIFF6 or NORM6 residual bytes).
Gwenole Beauchesne [Thu, 24 Jan 2013 17:14:28 +0000 (18:14 +0100)]
codecparsers: vc1: fix bitplanes decoding (DIFF6 or NORM6 residual bytes).

Fix parsing of residual bytes. This is a two-step process. First,
remaining colums of full vertical resolution (<height>) need to be
processed. Next, remaining bytes in the first row can be processed,
while taking into account the fact that we may have filled in the
first columns already. So, this is not full horizontal resolution.

The following figure helps in understanding the expected order of
operations, for a 8x5 MBs bitplane.

    5 5 6 6 6 6 6 6
    5 5 1 1 1 2 2 2
    5 5 1 1 1 2 2 2
    5 5 3 3 3 4 4 4
    5 5 3 3 3 4 4 4

So, after tiles 1 to 4 are decoded, vertical tile 5 needs to be
processed (2x5 MBs) and then the horizontal tile 6 (6x1 MBs).

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: fix bitplanes decoding (DIFF6 or NORM6).
Gwenole Beauchesne [Thu, 24 Jan 2013 16:28:22 +0000 (17:28 +0100)]
codecparsers: vc1: fix bitplanes decoding (DIFF6 or NORM6).

Fix decoding of DIFF6 or NORM6 bitplanes with an odd number of lines
(3x2 "horizontal" tiles). In this case, we have to skip the first line
of macroblocks but <width> number of bytes was used to do so, instead
of the actual <stride> size.

This fixes decoding for the video sample attached to:

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: add API to parse slice headers.
Gwenole Beauchesne [Wed, 23 Jan 2013 13:47:58 +0000 (14:47 +0100)]
codecparsers: vc1: add API to parse slice headers.

Add gst_vc1_parse_slice_header() function to parse slice headers as
described in 7.1.2. Slice layers are optional and allowed in advanced
profile mode only. Picture header, if available (PIC_HEADER_FLAG),
is parsed but not recorded because it shall be the same as that was
previously parsed with gst_vc1_parse_frame_header().

This fixes SA00049.vc1 conformance test.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: fix bitplanes decoding.
Gwenole Beauchesne [Tue, 22 Jan 2013 17:01:24 +0000 (18:01 +0100)]
codecparsers: vc1: fix bitplanes decoding.

Fix decoding of DIFF2 or NORM2 bitplanes with an odd number of macroblocks.
In particular, account for the first bit that was already parsed so that to
avoid a buffer overflow after all pairs are parsed.

This fixes SA00040.vc1 conformance test.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: simplify GstVC1VopDquant structure.
Gwenole Beauchesne [Tue, 22 Jan 2013 10:42:49 +0000 (11:42 +0100)]
codecparsers: vc1: simplify GstVC1VopDquant structure.

Rename dqsbedge to dqbedge. The intent is that we can only have a single
boundary edge selector, depending on the value of dqprofile. So, dqbedge
represents DQSBEDGE if dqprofile == GST_VC1_DQPROFILE_SINGLE_EDGE, or

The former dqbedge field is marked as unused and can be removed on the
next gst-plugins-bad version that allows ABI changes.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: fix VOPDQUANT parser for DQUANT == 2.
Gwenole Beauchesne [Tue, 22 Jan 2013 09:48:39 +0000 (10:48 +0100)]
codecparsers: vc1: fix VOPDQUANT parser for DQUANT == 2.

Fix parsing of VOPDQUANT when DQUANT == 2. In particular, DQUANTFRM is
not present in the bitstream in this case and it shall be derived to
the default value of zero (

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: fix calculation of ALTPQUANT.
Gwenole Beauchesne [Tue, 22 Jan 2013 09:38:20 +0000 (10:38 +0100)]
codecparsers: vc1: fix calculation of ALTPQUANT.

Fix calculation of ALTPQUANT when DQUANT == 1. PQDIFF alters ALTPQUANT
in any case. See

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: vc1: fix parser for DQPROFILE in VOPDQUANT.
Gwenole Beauchesne [Tue, 22 Jan 2013 09:11:34 +0000 (10:11 +0100)]
codecparsers: vc1: fix parser for DQPROFILE in VOPDQUANT.

Fix parse_vopdquant() to correctly parse DQPROFILE, which is 2 bits
instead of a single bit.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: h264: add inferred value for slice_beta_offset_div2.
Gwenole Beauchesne [Sun, 6 Jan 2013 17:54:52 +0000 (18:54 +0100)]
codecparsers: h264: add inferred value for slice_beta_offset_div2.

The standard specifies that when slice_beta_offset_div2 is not present
in the slice header, then the value of slice_beta_offset_div2 shall be
inferred to be equal to 0.

Signed-off-by: Gwenole Beauchesne <>
5 years agoUpdate to git master commit 49fefbd.
Gwenole Beauchesne [Thu, 17 Jan 2013 14:43:49 +0000 (15:43 +0100)]
Update to git master commit 49fefbd.

5 years agocodecparsers: h264: zero-initialize SPS VUI parameters
Mark Nauwelaerts [Sat, 12 Jan 2013 12:15:02 +0000 (13:15 +0100)]
codecparsers: h264: zero-initialize SPS VUI parameters

... so all 'present' flags indicate no presence of optional parts
in case VUI parameters end up not being parsed.


5 years agoUpdate to git master commit 1e9aaee.
Gwenole Beauchesne [Sun, 6 Jan 2013 17:53:18 +0000 (18:53 +0100)]
Update to git master commit 1e9aaee.

5 years agocodecparsers: vc1: fix PTYPE for interlaced frames.
Gwenole Beauchesne [Mon, 19 Nov 2012 09:32:57 +0000 (10:32 +0100)]
codecparsers: vc1: fix PTYPE for interlaced frames.

Coverity found missing break in parse_frame_header_advanced() when
determining PTYPE from FPTYPE for interlaced streams.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: h264: fix error code for invalid size parsed in SPS.
Gwenole Beauchesne [Fri, 21 Sep 2012 16:23:21 +0000 (18:23 +0200)]
codecparsers: h264: fix error code for invalid size parsed in SPS.

gst_h264_parse_sps() returned FALSE if it parsed invalid (negative)
size components. Now make it gracefully return GST_H264_PARSER_ERROR
instead of GST_H264_PARSER_OK (FALSE).

5 years agoUpdate to git master commit 0b3e0ed.
Gwenole Beauchesne [Tue, 13 Nov 2012 08:54:35 +0000 (09:54 +0100)]
Update to git master commit 0b3e0ed.

5 years agoFix FSF address
Tim-Philipp Müller [Sat, 3 Nov 2012 20:38:00 +0000 (20:38 +0000)]
Fix FSF address

5 years agoUpdate to git master commit 380b23a.
Gwenole Beauchesne [Wed, 10 Oct 2012 16:40:29 +0000 (18:40 +0200)]
Update to git master commit 380b23a.

5 years agocheck: Fix mpegvideoparser PAR expectation
Jan Schmidt [Thu, 13 Sep 2012 20:34:16 +0000 (13:34 -0700)]
check: Fix mpegvideoparser PAR expectation

The parser (correctly) now interprets the test header using
MPEG-1 semantics, so fix the test expectation.

5 years agotests: mpegvideoparser: adjust to modified API
Mark Nauwelaerts [Fri, 8 Jun 2012 09:12:06 +0000 (11:12 +0200)]
tests: mpegvideoparser: adjust to modified API

5 years ago.gitignore: ignore more test binaries and stamp files
Tim-Philipp Müller [Thu, 15 Mar 2012 00:13:40 +0000 (00:13 +0000)]
.gitignore: ignore more test binaries and stamp files

5 years agogsth264parser: fix Coverity found not initialized sps/pps valid member.
Peter Seiderer [Mon, 3 Sep 2012 11:43:03 +0000 (13:43 +0200)]
gsth264parser: fix Coverity found not initialized sps/pps valid member.


5 years agogsth264parser: fix Coverity detected off by one at call to READ_UE_ALLOWED.
Peter Seiderer [Mon, 3 Sep 2012 11:09:29 +0000 (13:09 +0200)]
gsth264parser: fix Coverity detected off by one at call to READ_UE_ALLOWED.


5 years agompeg4parser: parse complexity estimation header in video object layer
Arnaud Vrac [Sun, 2 Sep 2012 18:19:17 +0000 (20:19 +0200)]
mpeg4parser: parse complexity estimation header in video object layer

5 years agompeg4parser: fix some issues related to video object layer parsing
Arnaud Vrac [Sun, 2 Sep 2012 18:18:32 +0000 (20:18 +0200)]
mpeg4parser: fix some issues related to video object layer parsing

5 years agompegvideoparse: Handle Sequence Display Extension
Jan Schmidt [Mon, 3 Sep 2012 16:47:30 +0000 (09:47 -0700)]
mpegvideoparse: Handle Sequence Display Extension

Change the way the pixel-aspect-ratio is computed by
interpreting the sequence header aspect ratio info
as MPEG-1 values until a sequence extension or
sequence display extension is seen, and then updating
the sequence header struct accordingly.

Fixes incorrect anamorphic display on some MPEG-2 (DVD)

5 years agocodecparsers: vc1: fix aspect ratio calculation.
Gwenole Beauchesne [Wed, 12 Sep 2012 09:08:25 +0000 (11:08 +0200)]
codecparsers: vc1: fix aspect ratio calculation.

ASPECT_HORIZ_SIZE and ASPECT_VERT_SIZE are syntax elements that hold
binary encodings of sizes ranging from 1 to 256. Thus, the calculated
pixel-aspect-ratio was off by one.

Signed-off-by: Gwenole Beauchesne <>

5 years agocodecparsers: h264parse: don't use anonymous unions.
Gwenole Beauchesne [Wed, 12 Sep 2012 09:01:34 +0000 (11:01 +0200)]
codecparsers: h264parse: don't use anonymous unions.

Anonymous union is an ISO C (2011) feature that is not exposed in
compilers strictly conforming to the previous standard.

Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: h264: compute pixel aspect ratio.
Gwenole Beauchesne [Wed, 12 Sep 2012 09:21:41 +0000 (11:21 +0200)]
codecparsers: h264: compute pixel aspect ratio.

Signed-off-by: Simon Farnsworth <>
Signed-off-by: Gwenole Beauchesne <>
5 years agocodecparsers: minor header indentation clean-up for mpegvideoparser
Tim-Philipp Müller [Tue, 10 Jul 2012 22:27:23 +0000 (23:27 +0100)]
codecparsers: minor header indentation clean-up for mpegvideoparser

5 years agoh264parser: do not assert on data input, just return
Vincent Penquerc'h [Mon, 11 Jun 2012 09:49:15 +0000 (10:49 +0100)]
h264parser: do not assert on data input, just return

5 years agoh264parser: Remove un-needed checks and inline some functions
Edward Hervey [Tue, 5 Jun 2012 15:57:41 +0000 (17:57 +0200)]
h264parser: Remove un-needed checks and inline some functions

val and nr always exist (&nr, &value)
bits is always called smaller than the width

Makes parsing 30% faster

5 years agocodecparsers: mpeg: relax entry constraint
Mark Nauwelaerts [Fri, 1 Jun 2012 08:59:22 +0000 (10:59 +0200)]
codecparsers: mpeg: relax entry constraint

... since it is acceptable and properly handled further on.

5 years agompegvideoparse: tweak codec parser API and adjust parser element
Mark Nauwelaerts [Tue, 22 May 2012 12:00:36 +0000 (14:00 +0200)]
mpegvideoparse: tweak codec parser API and adjust parser element

... to allow for more efficient parsing and (more) consistent parsing API
among various codec parsers.

Fixes #672701.



5 years agocodecparsers: mpeg4: fixup documentation spelling
Mark Nauwelaerts [Tue, 22 May 2012 10:30:07 +0000 (12:30 +0200)]
codecparsers: mpeg4: fixup documentation spelling

5 years agompegvideoparser: Optimize scanning for start code
Nicolas Dufresne [Tue, 8 May 2012 20:51:11 +0000 (16:51 -0400)]
mpegvideoparser: Optimize scanning for start code

5 years agocodecparsers: mpegvideoparser: fix buffer size check
Mark Nauwelaerts [Mon, 21 May 2012 13:24:25 +0000 (15:24 +0200)]
codecparsers: mpegvideoparser: fix buffer size check

... to mind unsigned integer wrap

Based on patch by Alban Browaeys <>


5 years agocodecparsers: mpeg4: do not expect a marker bit where not specified
Mark Nauwelaerts [Fri, 18 May 2012 14:17:13 +0000 (16:17 +0200)]
codecparsers: mpeg4: do not expect a marker bit where not specified

Fixes #672447.

5 years agocodecparser: mpeg4 type error
Wind Yuan [Fri, 27 Apr 2012 02:49:07 +0000 (22:49 -0400)]
codecparser: mpeg4 type error

5 years agompegvideoparse: Do not ignore start code at the end of buffer
Matej Knopp [Sat, 14 Apr 2012 19:09:25 +0000 (21:09 +0200)]
mpegvideoparse: Do not ignore start code at the end of buffer

5 years agogst: Update versioning
Sebastian Dröge [Wed, 4 Apr 2012 12:41:22 +0000 (14:41 +0200)]
gst: Update versioning