vdpaumpegdec: rename zigzag matrix

This commit is contained in:
Carl-Anton Ingmarsson 2010-07-14 11:19:05 +02:00
parent c27468f1a1
commit b3ad9d7d04

View file

@ -24,7 +24,7 @@
#include "mpegutil.h" #include "mpegutil.h"
/* default intra quant matrix, in zig-zag order */ /* default intra quant matrix, in zig-zag order */
static const guint8 default_intra_quantizer_matrix[64] = { const guint8 default_intra_quantizer_matrix[64] = {
8, 8,
16, 16, 16, 16,
19, 16, 19, 19, 16, 19,
@ -42,8 +42,7 @@ static const guint8 default_intra_quantizer_matrix[64] = {
83 83
}; };
guint8 mpeg2_scan[64] = { const guint8 mpeg_zigzag_8x8[64] = {
/* Zig-Zag scan pattern */
0, 1, 8, 16, 9, 2, 3, 10, 0, 1, 8, 16, 9, 2, 3, 10,
17, 24, 32, 25, 18, 11, 4, 5, 17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34, 12, 19, 26, 33, 40, 48, 41, 34,
@ -79,7 +78,7 @@ guint8 mpeg2_scan[64] = {
if (!gst_bit_reader_get_bits_uint64 (reader, &val, nbits)) { \ if (!gst_bit_reader_get_bits_uint64 (reader, &val, nbits)) { \
GST_WARNING ("failed to read uint32, nbits: %d", nbits); \ GST_WARNING ("failed to read uint32, nbits: %d", nbits); \
goto error; \ goto error; \
} \ } \
} }
static void static void
@ -214,7 +213,7 @@ mpeg_util_parse_sequence_hdr (MPEGSeqHdr * hdr, GstBuffer * buffer)
if (load_intra_flag) { if (load_intra_flag) {
gint i; gint i;
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
READ_UINT8 (&reader, hdr->intra_quantizer_matrix[mpeg2_scan[i]], 8); READ_UINT8 (&reader, hdr->intra_quantizer_matrix[mpeg_zigzag_8x8[i]], 8);
} else } else
memcpy (hdr->intra_quantizer_matrix, default_intra_quantizer_matrix, 64); memcpy (hdr->intra_quantizer_matrix, default_intra_quantizer_matrix, 64);
@ -223,7 +222,8 @@ mpeg_util_parse_sequence_hdr (MPEGSeqHdr * hdr, GstBuffer * buffer)
if (load_non_intra_flag) { if (load_non_intra_flag) {
gint i; gint i;
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
READ_UINT8 (&reader, hdr->non_intra_quantizer_matrix[mpeg2_scan[i]], 8); READ_UINT8 (&reader, hdr->non_intra_quantizer_matrix[mpeg_zigzag_8x8[i]],
8);
} else } else
memset (hdr->non_intra_quantizer_matrix, 16, 64); memset (hdr->non_intra_quantizer_matrix, 16, 64);
@ -399,7 +399,7 @@ mpeg_util_parse_quant_matrix (MPEGQuantMatrix * qm, GstBuffer * buffer)
if (load_intra_flag) { if (load_intra_flag) {
gint i; gint i;
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
READ_UINT8 (&reader, qm->intra_quantizer_matrix[mpeg2_scan[i]], 8); READ_UINT8 (&reader, qm->intra_quantizer_matrix[mpeg_zigzag_8x8[i]], 8);
} }
} else } else
memcpy (qm->intra_quantizer_matrix, default_intra_quantizer_matrix, 64); memcpy (qm->intra_quantizer_matrix, default_intra_quantizer_matrix, 64);
@ -409,7 +409,8 @@ mpeg_util_parse_quant_matrix (MPEGQuantMatrix * qm, GstBuffer * buffer)
if (load_non_intra_flag) { if (load_non_intra_flag) {
gint i; gint i;
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
READ_UINT8 (&reader, qm->non_intra_quantizer_matrix[mpeg2_scan[i]], 8); READ_UINT8 (&reader, qm->non_intra_quantizer_matrix[mpeg_zigzag_8x8[i]],
8);
} }
} else } else
memset (qm->non_intra_quantizer_matrix, 16, 64); memset (qm->non_intra_quantizer_matrix, 16, 64);