| @@ -1902,6 +1902,33 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 1901 unmodified lines |
| 1902 | 1902 | }, |
| 1903 | 1903 | }; |
| 1904 | 1904 | |
| 1905 | +static const char *color_range_names[AVCOL_RANGE_NB] = { |
| 1906 | + "unknown", "tv", "pc", |
| 1907 | +}; |
| 1908 | + |
| 1909 | +static const char *color_primaries_names[AVCOL_PRI_NB] = { |
| 1910 | + "reserved", "bt709", "unknown", "reserved", "bt470m", |
| 1911 | + "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", |
| 1912 | +}; |
| 1913 | + |
| 1914 | +static const char *color_transfer_names[AVCOL_TRC_NB] = { |
| 1915 | + "reserved", "bt709", "unknown", "reserved", "bt470m", |
| 1916 | + "bt470bg", "smpte170m", "smpte240m", "linear", "log100", |
| 1917 | + "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", |
| 1918 | + "bt2020-10", "bt2020-20", |
| 1919 | +}; |
| 1920 | + |
| 1921 | +static const char *color_space_names[AVCOL_SPC_NB] = { |
| 1922 | + "gbr", "bt709", "unknown", "reserved", "fcc", |
| 1923 | + "bt470bg", "smpte170m", "smpte240m", "ycgco", |
| 1924 | + "bt2020nc", "bt2020c", |
| 1925 | +}; |
| 1926 | + |
| 1927 | +static const char *chroma_location_names[AVCHROMA_LOC_NB] = { |
| 1928 | + "unspecified", "left", "center", "topleft", |
| 1929 | + "top", "bottomleft", "bottom", |
| 1930 | +}; |
| 1931 | + |
| 1905 | 1932 | FF_DISABLE_DEPRECATION_WARNINGS |
| 1906 | 1933 | static enum AVPixelFormat get_pix_fmt_internal(const char *name) |
| 1907 | 1934 | { |
| @@ -2305,6 +2332,36 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en · 397 unmodified lines |
| 2305 | 2332 | return dst_pix_fmt; |
| 2306 | 2333 | } |
| 2307 | 2334 | |
| 2335 | +const char *av_color_range_name(enum AVColorRange range) |
| 2336 | +{ |
| 2337 | + return (unsigned) range < AVCOL_RANGE_NB ? |
| 2338 | + color_range_names[range] : NULL; |
| 2339 | +} |
| 2340 | + |
| 2341 | +const char *av_color_primaries_name(enum AVColorPrimaries primaries) |
| 2342 | +{ |
| 2343 | + return (unsigned) primaries < AVCOL_PRI_NB ? |
| 2344 | + color_primaries_names[primaries] : NULL; |
| 2345 | +} |
| 2346 | + |
| 2347 | +const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer) |
| 2348 | +{ |
| 2349 | + return (unsigned) transfer < AVCOL_TRC_NB ? |
| 2350 | + color_transfer_names[transfer] : NULL; |
| 2351 | +} |
| 2352 | + |
| 2353 | +const char *av_color_space_name(enum AVColorSpace space) |
| 2354 | +{ |
| 2355 | + return (unsigned) space < AVCOL_SPC_NB ? |
| 2356 | + color_space_names[space] : NULL; |
| 2357 | +} |
| 2358 | + |
| 2359 | +const char *av_chroma_location_name(enum AVChromaLocation location) |
| 2360 | +{ |
| 2361 | + return (unsigned) location < AVCHROMA_LOC_NB ? |
| 2362 | + chroma_location_names[location] : NULL; |
| 2363 | +} |
| 2364 | + |
| 2308 | 2365 | #ifdef TEST |
| 2309 | 2366 | |
| 2310 | 2367 | int main(void){ |
| @@ -2332,3 +2389,4 @@ int main(void){ · 21 unmodified lines |
| 2332 | 2389 | } |
| 2333 | 2390 | |
| 2334 | 2391 | #endif |
| 2392 | + |