Mercurial > libavcodec.hg
comparison mpegvideo.c @ 1397:2e43c9bdc982 libavcodec
check input pix_fmt
author | michaelni |
---|---|
date | Tue, 05 Aug 2003 14:08:28 +0000 |
parents | e380ac39024a |
children | f662e9c86cf2 |
comparison
equal
deleted
inserted
replaced
1396:e380ac39024a | 1397:2e43c9bdc982 |
---|---|
1362 && pic->data[1] == pic_arg->data[1] | 1362 && pic->data[1] == pic_arg->data[1] |
1363 && pic->data[2] == pic_arg->data[2]){ | 1363 && pic->data[2] == pic_arg->data[2]){ |
1364 // empty | 1364 // empty |
1365 }else{ | 1365 }else{ |
1366 int h_chroma_shift, v_chroma_shift; | 1366 int h_chroma_shift, v_chroma_shift; |
1367 | |
1368 avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift); | 1367 avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift); |
1369 | 1368 |
1370 for(i=0; i<3; i++){ | 1369 for(i=0; i<3; i++){ |
1371 int src_stride= pic_arg->linesize[i]; | 1370 int src_stride= pic_arg->linesize[i]; |
1372 int dst_stride= i ? s->uvlinesize : s->linesize; | 1371 int dst_stride= i ? s->uvlinesize : s->linesize; |
1546 { | 1545 { |
1547 MpegEncContext *s = avctx->priv_data; | 1546 MpegEncContext *s = avctx->priv_data; |
1548 AVFrame *pic_arg = data; | 1547 AVFrame *pic_arg = data; |
1549 int i; | 1548 int i; |
1550 | 1549 |
1550 if(avctx->pix_fmt != PIX_FMT_YUV420P){ | |
1551 fprintf(stderr, "this codec supports only YUV420P\n"); | |
1552 return -1; | |
1553 } | |
1554 | |
1551 init_put_bits(&s->pb, buf, buf_size, NULL, NULL); | 1555 init_put_bits(&s->pb, buf, buf_size, NULL, NULL); |
1552 | 1556 |
1553 s->picture_in_gop_number++; | 1557 s->picture_in_gop_number++; |
1554 | 1558 |
1555 load_input_picture(s, pic_arg); | 1559 load_input_picture(s, pic_arg); |