[Libva] [Bug 58176] [gst-vaapi] gi4_video.bits decoding failed (MPEG2)

Li, Xiaowei A xiaowei.a.li at intel.com
Wed Jan 30 21:54:29 PST 2013


found another  issue:  in  gstreamer-codec-parser, not all case we  get the converted scanning order , please review the following code in “gst-libs/gst/codecparsers/gstmpegvideoparser.c”, If no matrix contained in bitstream, default zig-zag matrix will be loaded. In two case , we get different types of order.

gst-libs/gst/codecparsers/gstmpegvideoparser.c
/* default intra quant matrix, in zig-zag order */
static const guint8 default_intra_quantizer_matrix[64] = {
  8,
  16, 16,
  19, 16, 19,
  22, 22, 22, 22,
  22, 22, 26, 24, 26,
  27, 27, 27, 26, 26, 26,
  26, 27, 27, 27, 29, 29, 29,
  34, 34, 34, 29, 29, 29, 27, 27,
  29, 29, 32, 32, 34, 34, 37,
  38, 37, 35, 35, 34, 35,
  38, 38, 40, 40, 40,
  48, 48, 46, 46,
  56, 56, 58,
  69, 69,
  83
};

/* load_intra_quantiser_matrix */
  READ_UINT8 (&br, load_intra_flag, 1);
  if (load_intra_flag) {
    gint i;
    for (i = 0; i < 64; i++)
      READ_UINT8 (&br, seqhdr->intra_quantizer_matrix[mpeg_zigzag_8x8[i]], 8);   //case 1. Here seqhdr->intra_quantizer_matrix is filled with scan order matrix
  } else
    memcpy (seqhdr->intra_quantizer_matrix, default_intra_quantizer_matrix, 64); //case 2. Here seqhdr->intra_quantizer_matrix is filled with zig-zaged order matrix



Thanks,
Xiaowei

From: Li, Jocelyn
Sent: Thursday, January 31, 2013 12:28 PM
To: Yuan, Feng; Beauchesne, Gwenole; Xiang, Haihao; Li, Xiaowei A
Cc: Zhao, Halley; Zhong, CongX; libva at lists.freedesktop.org<mailto:libva at lists.freedesktop.org>
Subject: RE: [Bug 58176] [gst-vaapi] gi4_video.bits decoding failed (MPEG2)

Added Xiaowei.

From: Yuan, Feng
Sent: Thursday, January 31, 2013 11:09 AM
To: Li, Jocelyn; Beauchesne, Gwenole; Xiang, Haihao
Cc: Zhao, Halley; Zhong, CongX; libva at lists.freedesktop.org<mailto:libva at lists.freedesktop.org>
Subject: RE: [Bug 58176] [gst-vaapi] gi4_video.bits decoding failed (MPEG2)

Copy to libva maillist, it’s more about gstreamer-codec-parser/gst-vaapi/libva/driver related issues.

Hi all,
     It’s an issue about how to process the zigzagged quantization table between gstreamer level and driver level.
     Libva defined API of
typedef struct _VAIQMatrixBufferMPEG2
{
    int load_intra_quantiser_matrix;
    int load_non_intra_quantiser_matrix;
    int load_chroma_intra_quantiser_matrix;
    int load_chroma_non_intra_quantiser_matrix;
    unsigned char intra_quantiser_matrix[64];
    unsigned char non_intra_quantiser_matrix[64];
    unsigned char chroma_intra_quantiser_matrix[64];
    unsigned char chroma_non_intra_quantiser_matrix[64];
} VAIQMatrixBufferMPEG2;
      Question is how to fill <xxx_intra_quantiser_matrix>, is it zigzag ordered or scan ordered? Mpeg2 data store the quantization table in zigzag order. Currently gstreamer-codec-parser would parse all zigzagged quantization table from MPEG2 data  and converting into scanning order. Intel-Driver would do the same thing again. The result certainly would be incorrect.
     Ffmpeg would fill the quantiser_matrix by zigzag order, do we need to change gstreamer-codec-parse to read data into zigzag order? Does any other package/lib already using gstreamer-codec-parser(mpeg2)?  Which package should be the right role to do the conversion from zigzag to scanning order?

Thanks,
Wind

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libva/attachments/20130131/6a729403/attachment-0001.html>


More information about the Libva mailing list