vp9parser: Rename symbols to prevent symbol conflicts
authorSebastian Dröge <sebastian@centricular.com>
Wed, 30 Dec 2015 09:36:45 +0000 (11:36 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 30 Dec 2015 09:37:59 +0000 (11:37 +0200)
Also make clamp() a static function for the same reason and use CLAMP (as
defined by GLib) in the GStreamer code.

gst-libs/gst/codecparsers/Makefile.am
gst-libs/gst/codecparsers/gstvp9parser.c
gst-libs/gst/codecparsers/vp9utils.c
gst-libs/gst/codecparsers/vp9utils.h

index 00c78e2..98140f1 100644 (file)
@@ -11,14 +11,14 @@ libgstcodecparsers_@GST_API_VERSION@_la_SOURCES = \
 libgstcodecparsers_@GST_API_VERSION@includedir = \
        $(includedir)/gstreamer-@GST_API_VERSION@/gst/codecparsers
 
-noinst_HEADERS = parserutils.h nalutils.h dboolhuff.h vp8utils.h
+noinst_HEADERS = parserutils.h nalutils.h dboolhuff.h vp8utils.h vp9utils.h
 
 libgstcodecparsers_@GST_API_VERSION@include_HEADERS = \
        gstmpegvideoparser.h gsth264parser.h gstvc1parser.h gstmpeg4parser.h \
        gsth265parser.h gstvp8parser.h gstvp8rangedecoder.h \
        gstjpegparser.h \
        gstmpegvideometa.h \
-       gstvp9parser.h vp9utils.h
+       gstvp9parser.h
 
 libgstcodecparsers_@GST_API_VERSION@_la_CFLAGS = \
        $(GST_PLUGINS_BAD_CFLAGS) \
index 598e8cd..385515b 100644 (file)
@@ -415,7 +415,7 @@ seg_get_base_qindex (const GstVp9Parser * parser,
     else
       seg_base += seg->alternate_quantizer;
   }
-  return clamp (seg_base, 0, MAXQ);
+  return CLAMP (seg_base, 0, MAXQ);
 }
 
 static guint8
@@ -432,7 +432,7 @@ seg_get_filter_level (const GstVp9Parser * parser,
     else
       seg_filter += seg->alternate_loop_filter;
   }
-  return clamp (seg_filter, 0, GST_VP9_MAX_LOOP_FILTER);
+  return CLAMP (seg_filter, 0, GST_VP9_MAX_LOOP_FILTER);
 }
 
 /*save segmentation info from frame header to parser*/
@@ -481,12 +481,12 @@ segmentation_update (GstVp9Parser * parser, const GstVp9FrameHdr * frame_hdr)
     const GstVp9SegmentationInfoData *info = priv->segmentation + i;
 
     seg->luma_dc_quant_scale =
-        vp9_dc_quant (q, quant_indices->y_dc_delta, frame_hdr->bit_depth);
-    seg->luma_ac_quant_scale = vp9_ac_quant (q, 0, frame_hdr->bit_depth);
+        gst_vp9_dc_quant (q, quant_indices->y_dc_delta, frame_hdr->bit_depth);
+    seg->luma_ac_quant_scale = gst_vp9_ac_quant (q, 0, frame_hdr->bit_depth);
     seg->chroma_dc_quant_scale =
-        vp9_dc_quant (q, quant_indices->uv_dc_delta, frame_hdr->bit_depth);
+        gst_vp9_dc_quant (q, quant_indices->uv_dc_delta, frame_hdr->bit_depth);
     seg->chroma_ac_quant_scale =
-        vp9_ac_quant (q, quant_indices->uv_ac_delta, frame_hdr->bit_depth);
+        gst_vp9_ac_quant (q, quant_indices->uv_ac_delta, frame_hdr->bit_depth);
 
     if (lf->filter_level) {
       guint8 filter = seg_get_filter_level (parser, frame_hdr, i);
@@ -498,13 +498,13 @@ segmentation_update (GstVp9Parser * parser, const GstVp9FrameHdr * frame_hdr)
         const int intra_filter =
             filter + priv->ref_deltas[GST_VP9_REF_FRAME_INTRA] * scale;
         seg->filter_level[GST_VP9_REF_FRAME_INTRA][0] =
-            clamp (intra_filter, 0, GST_VP9_MAX_LOOP_FILTER);
+            CLAMP (intra_filter, 0, GST_VP9_MAX_LOOP_FILTER);
         for (ref = GST_VP9_REF_FRAME_LAST; ref < GST_VP9_REF_FRAME_MAX; ++ref) {
           for (mode = 0; mode < GST_VP9_MAX_MODE_LF_DELTAS; ++mode) {
             const int inter_filter = filter + priv->ref_deltas[ref] * scale
                 + priv->mode_deltas[mode] * scale;
             seg->filter_level[ref][mode] =
-                clamp (inter_filter, 0, GST_VP9_MAX_LOOP_FILTER);
+                CLAMP (inter_filter, 0, GST_VP9_MAX_LOOP_FILTER);
           }
         }
       }
index 71c5a4e..c42a139 100644 (file)
@@ -223,12 +223,12 @@ static const int16_t ac_qlookup_12[QINDEX_RANGE] = {
   25551, 26047, 26559, 27071, 27599, 28143, 28687, 29247,
 };
 
-int clamp(int value, int low, int high)
+static int clamp(int value, int low, int high)
 {
   return value < low ? low : (value > high ? high : value);
 }
 
-int16_t vp9_dc_quant(int qindex, int delta, int bit_depth)
+int16_t gst_vp9_dc_quant(int qindex, int delta, int bit_depth)
 {
   const uint8_t q_table_idx = clamp(qindex + delta, 0, MAXQ);
 
@@ -245,7 +245,7 @@ int16_t vp9_dc_quant(int qindex, int delta, int bit_depth)
   return -1;
 }
 
-int16_t vp9_ac_quant(int qindex, int delta, int bit_depth)
+int16_t gst_vp9_ac_quant(int qindex, int delta, int bit_depth)
 {
   const uint8_t q_table_idx = clamp(qindex + delta, 0, MAXQ);
 
index 0a6feb1..20ef6bb 100644 (file)
 #define QINDEX_RANGE 256
 #define QINDEX_BITS 8
 
-int clamp(int value, int low, int high);
+int16_t gst_vp9_dc_quant(int qindex, int delta, int bit_depth);
 
-int16_t vp9_dc_quant(int qindex, int delta, int bit_depth);
-
-int16_t vp9_ac_quant(int qindex, int delta, int bit_depth);
+int16_t gst_vp9_ac_quant(int qindex, int delta, int bit_depth);
 
 
 #endif //__VP9_QUANT_H__