Imported Debian version 2.5.0~trusty1.1
[deb_ffmpeg.git] / ffmpeg / libavutil / pixdesc.c
index 154392af208a856fc8544b1fb7d682f7cafd5da5..648d014daa22f3e0b933d1a23d025c193a397e13 100644 (file)
@@ -1902,6 +1902,33 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
     },
 };
 
+static const char *color_range_names[AVCOL_RANGE_NB] = {
+    "unknown", "tv", "pc",
+};
+
+static const char *color_primaries_names[AVCOL_PRI_NB] = {
+    "reserved", "bt709", "unknown", "reserved", "bt470m",
+    "bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
+};
+
+static const char *color_transfer_names[AVCOL_TRC_NB] = {
+    "reserved", "bt709", "unknown", "reserved", "bt470m",
+    "bt470bg", "smpte170m", "smpte240m", "linear", "log100",
+    "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1",
+    "bt2020-10", "bt2020-20",
+};
+
+static const char *color_space_names[AVCOL_SPC_NB] = {
+    "gbr", "bt709", "unknown", "reserved", "fcc",
+    "bt470bg", "smpte170m", "smpte240m", "ycgco",
+    "bt2020nc", "bt2020c",
+};
+
+static const char *chroma_location_names[AVCHROMA_LOC_NB] = {
+    "unspecified", "left", "center", "topleft",
+    "top", "bottomleft", "bottom",
+};
+
 FF_DISABLE_DEPRECATION_WARNINGS
 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
 {
@@ -2305,6 +2332,36 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en
     return dst_pix_fmt;
 }
 
+const char *av_color_range_name(enum AVColorRange range)
+{
+    return (unsigned) range < AVCOL_RANGE_NB ?
+        color_range_names[range] : NULL;
+}
+
+const char *av_color_primaries_name(enum AVColorPrimaries primaries)
+{
+    return (unsigned) primaries < AVCOL_PRI_NB ?
+        color_primaries_names[primaries] : NULL;
+}
+
+const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
+{
+    return (unsigned) transfer < AVCOL_TRC_NB ?
+        color_transfer_names[transfer] : NULL;
+}
+
+const char *av_color_space_name(enum AVColorSpace space)
+{
+    return (unsigned) space < AVCOL_SPC_NB ?
+        color_space_names[space] : NULL;
+}
+
+const char *av_chroma_location_name(enum AVChromaLocation location)
+{
+    return (unsigned) location < AVCHROMA_LOC_NB ?
+        chroma_location_names[location] : NULL;
+}
+
 #ifdef TEST
 
 int main(void){
@@ -2332,3 +2389,4 @@ int main(void){
 }
 
 #endif
+