diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-15 23:31:33 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:29 +0100 |
commit | 375935d9c419b90d6b82686c5ddd9be7b5637382 (patch) | |
tree | b7a9107381a59d018487ae5b1bb411ddc2628e1b /sys/vdpau | |
parent | ee591b9f3d01865389a7a5dc4b8381466d0096e0 (diff) | |
download | gst-plugins-bad-375935d9c419b90d6b82686c5ddd9be7b5637382.tar.gz gst-plugins-bad-375935d9c419b90d6b82686c5ddd9be7b5637382.tar.bz2 gst-plugins-bad-375935d9c419b90d6b82686c5ddd9be7b5637382.zip |
vdpaumpegdec: fixup quantmatrix extension parsing
Diffstat (limited to 'sys/vdpau')
-rw-r--r-- | sys/vdpau/gstvdpmpegdecoder.c | 10 | ||||
-rw-r--r-- | sys/vdpau/mpegutil.c | 15 |
2 files changed, 12 insertions, 13 deletions
diff --git a/sys/vdpau/gstvdpmpegdecoder.c b/sys/vdpau/gstvdpmpegdecoder.c index 7aefe73c..be432281 100644 --- a/sys/vdpau/gstvdpmpegdecoder.c +++ b/sys/vdpau/gstvdpmpegdecoder.c @@ -355,15 +355,15 @@ gst_vdp_mpeg_decoder_chain (GstPad * pad, GstBuffer * buffer) gst_vdp_mpeg_decoder_parse_picture_coding (mpeg_dec, packet_start, packet_end); break; + case MPEG_PACKET_EXT_QUANT_MATRIX: + GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXT_QUANT_MATRIX"); + gst_vdp_mpeg_decoder_parse_quant_matrix (mpeg_dec, packet_start, + packet_end); + break; default: break; } break; - case MPEG_PACKET_EXT_QUANT_MATRIX: - GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_EXT_QUANT_MATRIX"); - gst_vdp_mpeg_decoder_parse_quant_matrix (mpeg_dec, packet_start, - packet_end); - break; case MPEG_PACKET_GOP: GST_DEBUG_OBJECT (mpeg_dec, "MPEG_PACKET_GOP"); gst_vdp_mpeg_decoder_parse_gop (mpeg_dec, packet_start, packet_end); diff --git a/sys/vdpau/mpegutil.c b/sys/vdpau/mpegutil.c index 3a4a63de..7ef46fb2 100644 --- a/sys/vdpau/mpegutil.c +++ b/sys/vdpau/mpegutil.c @@ -385,31 +385,30 @@ mpeg_util_parse_quant_matrix (MPEGQuantMatrix * qm, guint8 * data, guint8 * end) code = GST_READ_UINT32_BE (data); - if (G_UNLIKELY (G_UNLIKELY (code != (0x00000100 | MPEG_PACKET_GOP)))) + if (G_UNLIKELY (G_UNLIKELY (code != (0x00000100 | MPEG_PACKET_EXTENSION)))) return FALSE; /* Skip the sync word */ data += 4; - load_intra_flag = read_bits (data, 0, 1); + load_intra_flag = read_bits (data, 4, 1); if (load_intra_flag) { if (G_UNLIKELY ((end - data) < 64)) return FALSE; - for (i = 0; i < 64; i++) { - qm->intra_quantizer_matrix[mpeg2_scan[i]] = read_bits (data + i, 1, 8); - } - data += 64; + for (i = 0; i < 64; i++) + qm->intra_quantizer_matrix[mpeg2_scan[i]] = read_bits (data + i, 5, 8); + data += 64; } else memcpy (qm->intra_quantizer_matrix, default_intra_quantizer_matrix, 64); - load_non_intra_flag = read_bits (data, 1 + load_intra_flag, 1); + load_non_intra_flag = read_bits (data, 5 + load_intra_flag, 1); if (load_non_intra_flag) { if (G_UNLIKELY ((end - data) < 64)) return FALSE; for (i = 0; i < 64; i++) qm->non_intra_quantizer_matrix[mpeg2_scan[i]] = - read_bits (data + i, 2 + load_intra_flag, 8); + read_bits (data + i, 6 + load_intra_flag, 8); } else memset (qm->non_intra_quantizer_matrix, 16, 64); |