summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/libs/gst-plugins-bad-libs-sections.txt4
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c100
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.h12
3 files changed, 116 insertions, 0 deletions
diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt
index 0d3ee9d1b..0a8069383 100644
--- a/docs/libs/gst-plugins-bad-libs-sections.txt
+++ b/docs/libs/gst-plugins-bad-libs-sections.txt
@@ -40,6 +40,10 @@ gst_h264_nal_parser_new
gst_h264_nal_parser_free
gst_h264_parse_sps
gst_h264_parse_pps
+gst_h264_video_quant_matrix_8x8_get_zigzag_from_raster
+gst_h264_video_quant_matrix_8x8_get_raster_from_zigzag
+gst_h264_video_quant_matrix_4x4_get_zigzag_from_raster
+gst_h264_video_quant_matrix_4x4_get_raster_from_zigzag
<SUBSECTION Standard>
<SUBSECTION Private>
</SECTION>
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index 46785d85d..0020f4015 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -2018,3 +2018,103 @@ error:
GST_WARNING ("error parsing \"Sei message\"");
return GST_H264_PARSER_ERROR;
}
+
+/**
+ * gst_h264_video_quant_matrix_8x8_get_zigzag_from_raster:
+ * @out_quant: (out): The resulting quantization matrix
+ * @quant: The source quantization matrix
+ *
+ * Converts quantization matrix @quant from raster scan order to
+ * zigzag scan order and store the resulting factors into @out_quant.
+ *
+ * Note: it is an error to pass the same table in both @quant and
+ * @out_quant arguments.
+ *
+ * Since: 1.4
+ */
+void
+gst_h264_video_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64],
+ const guint8 quant[64])
+{
+ guint i;
+
+ g_return_if_fail (out_quant != quant);
+
+ for (i = 0; i < 64; i++)
+ out_quant[i] = quant[zigzag_8x8[i]];
+}
+
+/**
+ * gst_h264_quant_matrix_8x8_get_raster_from_zigzag:
+ * @out_quant: (out): The resulting quantization matrix
+ * @quant: The source quantization matrix
+ *
+ * Converts quantization matrix @quant from zigzag scan order to
+ * raster scan order and store the resulting factors into @out_quant.
+ *
+ * Note: it is an error to pass the same table in both @quant and
+ * @out_quant arguments.
+ *
+ * Since: 1.4
+ */
+void
+gst_h264_video_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64],
+ const guint8 quant[64])
+{
+ guint i;
+
+ g_return_if_fail (out_quant != quant);
+
+ for (i = 0; i < 64; i++)
+ out_quant[zigzag_8x8[i]] = quant[i];
+}
+
+/**
+ * gst_h264_video_quant_matrix_4x4_get_zigzag_from_raster:
+ * @out_quant: (out): The resulting quantization matrix
+ * @quant: The source quantization matrix
+ *
+ * Converts quantization matrix @quant from raster scan order to
+ * zigzag scan order and store the resulting factors into @out_quant.
+ *
+ * Note: it is an error to pass the same table in both @quant and
+ * @out_quant arguments.
+ *
+ * Since: 1.4
+ */
+void
+gst_h264_video_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16],
+ const guint8 quant[16])
+{
+ guint i;
+
+ g_return_if_fail (out_quant != quant);
+
+ for (i = 0; i < 16; i++)
+ out_quant[i] = quant[zigzag_4x4[i]];
+}
+
+/**
+ * gst_h264_quant_matrix_4x4_get_raster_from_zigzag:
+ * @out_quant: (out): The resulting quantization matrix
+ * @quant: The source quantization matrix
+ *
+ * Converts quantization matrix @quant from zigzag scan order to
+ * raster scan order and store the resulting factors into @out_quant.
+ *
+ * Note: it is an error to pass the same table in both @quant and
+ * @out_quant arguments.
+ *
+ * Since: 1.4
+ */
+void
+gst_h264_video_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16],
+ const guint8 quant[16])
+{
+ guint i;
+
+ g_return_if_fail (out_quant != quant);
+
+ for (i = 0; i < 16; i++)
+ out_quant[zigzag_4x4[i]] = quant[i];
+}
diff --git a/gst-libs/gst/codecparsers/gsth264parser.h b/gst-libs/gst/codecparsers/gsth264parser.h
index 72b311997..798f33947 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.h
+++ b/gst-libs/gst/codecparsers/gsth264parser.h
@@ -759,5 +759,17 @@ GstH264ParserResult gst_h264_parse_sps (GstH264NalUnit *nalu,
GstH264ParserResult gst_h264_parse_pps (GstH264NalParser *nalparser,
GstH264NalUnit *nalu, GstH264PPS *pps);
+void gst_h264_video_quant_matrix_8x8_get_zigzag_from_raster (guint8 out_quant[64],
+ const guint8 quant[64]);
+
+void gst_h264_video_quant_matrix_8x8_get_raster_from_zigzag (guint8 out_quant[64],
+ const guint8 quant[64]);
+
+void gst_h264_video_quant_matrix_4x4_get_zigzag_from_raster (guint8 out_quant[16],
+ const guint8 quant[16]);
+
+void gst_h264_video_quant_matrix_4x4_get_raster_from_zigzag (guint8 out_quant[16],
+ const guint8 quant[16]);
+
G_END_DECLS
#endif