MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / map_chroma_format

Function map_chroma_format

libavcodec/nvdec.c:87–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static 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
106static int nvdec_test_capabilities(NVDECDecoder *decoder,
107 CUVIDDECODECREATEINFO *params, void *logctx)

Callers 2

ff_nvdec_decode_initFunction · 0.85
ff_nvdec_frame_paramsFunction · 0.85

Calls 2

av_pix_fmt_count_planesFunction · 0.85

Tested by

no test coverage detected