We will use the av_csp_itu_eotf() functions to decode these internally, so check this function to see if it succeeds.
Unified · Split
| @@ -41,6 +41,7 @@ · 40 unmodified lines | |||
| 41 | #include "libavutil/attributes.h" | 41 | #include "libavutil/attributes.h" |
| 42 | #include "libavutil/avassert.h" | 42 | #include "libavutil/avassert.h" |
| 43 | #include "libavutil/cpu.h" | 43 | #include "libavutil/cpu.h" |
| 44 | #include "libavutil/csp.h" | ||
| 44 | #include "libavutil/emms.h" | 45 | #include "libavutil/emms.h" |
| 45 | #include "libavutil/imgutils.h" | 46 | #include "libavutil/imgutils.h" |
| 46 | #include "libavutil/intreadwrite.h" | 47 | #include "libavutil/intreadwrite.h" |
| @@ -2738,8 +2739,9 @@ int sws_test_primaries(enum AVColorPrimaries prim, int output) · 2691 unmodified lines | |||
| 2738 | 2739 | ||
| 2739 | int sws_test_transfer(enum AVColorTransferCharacteristic trc, int output) | 2740 | int sws_test_transfer(enum AVColorTransferCharacteristic trc, int output) |
| 2740 | { | 2741 | { |
| 2741 | return trc > AVCOL_TRC_RESERVED0 && trc < AVCOL_TRC_NB && | 2742 | av_csp_eotf_function eotf = output ? av_csp_itu_eotf_inv(trc) |
| 2742 | trc != AVCOL_TRC_RESERVED; | 2743 | : av_csp_itu_eotf(trc); |
| 2744 | return trc == AVCOL_TRC_UNSPECIFIED || eotf != NULL; | ||
| 2743 | } | 2745 | } |
| 2744 | 2746 | ||
| 2745 | static int test_range(enum AVColorRange range) | 2747 | static int test_range(enum AVColorRange range) |