| 85 | } |
| 86 | |
| 87 | static int map_chroma_format(enum AVPixelFormat pix_fmt) |
| 88 | { |
| 89 | int shift_h = 0, shift_v = 0; |
| 90 | |
| 91 | if (av_pix_fmt_count_planes(pix_fmt) == 1) |
| 92 | return cudaVideoChromaFormat_Monochrome; |
| 93 | |
| 94 | av_pix_fmt_get_chroma_sub_sample(pix_fmt, &shift_h, &shift_v); |
| 95 | |
| 96 | if (shift_h == 1 && shift_v == 1) |
| 97 | return cudaVideoChromaFormat_420; |
| 98 | else if (shift_h == 1 && shift_v == 0) |
| 99 | return cudaVideoChromaFormat_422; |
| 100 | else if (shift_h == 0 && shift_v == 0) |
| 101 | return cudaVideoChromaFormat_444; |
| 102 | |
| 103 | return -1; |
| 104 | } |
| 105 | |
| 106 | static int nvdec_test_capabilities(NVDECDecoder *decoder, |
| 107 | CUVIDDECODECREATEINFO *params, void *logctx) |
no test coverage detected