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

Function mpeg_get_pixelformat

libavcodec/mpeg12dec.c:839–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837};
838
839static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
840{
841 Mpeg1Context *s1 = avctx->priv_data;
842 MPVContext *const s = &s1->slice.c;
843 const enum AVPixelFormat *pix_fmts;
844
845 if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY))
846 return AV_PIX_FMT_GRAY8;
847
848 if (s->chroma_format < CHROMA_422)
849 pix_fmts = avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
850 mpeg1_hwaccel_pixfmt_list_420 :
851 mpeg2_hwaccel_pixfmt_list_420;
852 else if (s->chroma_format == CHROMA_422)
853 pix_fmts = mpeg12_pixfmt_list_422;
854 else
855 pix_fmts = mpeg12_pixfmt_list_444;
856
857 return ff_get_format(avctx, pix_fmts);
858}
859
860/* Call this function when we know all parameters.
861 * It may be called in different places for MPEG-1 and MPEG-2. */

Callers 2

mpeg_decode_postinitFunction · 0.85
vcr2_init_sequenceFunction · 0.85

Calls 1

ff_get_formatFunction · 0.85

Tested by

no test coverage detected