| 837 | }; |
| 838 | |
| 839 | static 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. */ |
no test coverage detected