1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

ffv1: PIX_FMT_YUV444P9 & PIX_FMT_YUV422P9 support

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Paul B Mahol 2012-03-06 23:16:39 +00:00 committed by Michael Niedermayer
parent eff2399f24
commit 65491fa3d5

View File

@ -877,6 +877,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->plane_count=3;
switch(avctx->pix_fmt){
case PIX_FMT_YUV444P9:
case PIX_FMT_YUV422P9:
case PIX_FMT_YUV420P9:
if (!avctx->bits_per_raw_sample)
s->bits_per_raw_sample = 9;
@ -1637,10 +1639,11 @@ static int read_header(FFV1Context *f){
return -1;
}
}else if(f->avctx->bits_per_raw_sample==9) {
f->packed_at_lsb=1;
switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break;
case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break;
case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P9 ; f->packed_at_lsb=1; break;
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P9; break;
case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P9; break;
case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P9; break;
default:
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1;
@ -1858,7 +1861,7 @@ AVCodec ff_ffv1_encoder = {
.encode2 = encode_frame,
.close = common_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUVA420P, PIX_FMT_YUV444P, PIX_FMT_YUVA444P, PIX_FMT_YUV440P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_0RGB32, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_YUV420P9, PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_GRAY16, PIX_FMT_GRAY8, PIX_FMT_NONE},
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUVA420P, PIX_FMT_YUV444P, PIX_FMT_YUVA444P, PIX_FMT_YUV440P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_0RGB32, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_YUV444P9, PIX_FMT_YUV422P9, PIX_FMT_YUV420P9, PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_GRAY16, PIX_FMT_GRAY8, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
};
#endif