Commit 0b2dd2e7 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Tim-Philipp Müller

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: default avatarGwenole Beauchesne <gwenole.beauchesne@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=683858
parent 2c3eaf52
......@@ -837,10 +837,13 @@ parse_sequence_header_advanced (GstVC1SeqHdr * seqhdr, GstBitReader * br)
READ_UINT8 (br, advanced->aspect_ratio, 4);
if (advanced->aspect_ratio == 15) {
/* Aspect Width (6.1.14.3.2) and Aspect Height (6.1.14.3.3)
* syntax elements hold a binary encoding of sizes ranging
* from 1 to 256 */
READ_UINT8 (br, advanced->aspect_horiz_size, 8);
READ_UINT8 (br, advanced->aspect_vert_size, 8);
advanced->par_n = advanced->aspect_horiz_size;
advanced->par_d = advanced->aspect_vert_size;
advanced->par_n = 1 + advanced->aspect_horiz_size;
advanced->par_d = 1 + advanced->aspect_vert_size;
} else {
advanced->par_n = aspect_ratios[advanced->aspect_ratio].par_n;
advanced->par_d = aspect_ratios[advanced->aspect_ratio].par_d;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment