comparison mpegvideo.c @ 3929:a31f865dd68d libavcodec

mjpeg 4:2:2 encoding support
author bcoudurier
date Wed, 04 Oct 2006 12:49:52 +0000
parents 6a40092eb9e6
children 16ace038f452
comparison
equal deleted inserted replaced
3928:987fffdf6ae7 3929:a31f865dd68d
938 return -1; 938 return -1;
939 } 939 }
940 break; 940 break;
941 case CODEC_ID_LJPEG: 941 case CODEC_ID_LJPEG:
942 case CODEC_ID_MJPEG: 942 case CODEC_ID_MJPEG:
943 if(avctx->pix_fmt != PIX_FMT_YUVJ420P && (avctx->pix_fmt != PIX_FMT_YUV420P || avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL)){ 943 if(avctx->pix_fmt != PIX_FMT_YUVJ420P && avctx->pix_fmt != PIX_FMT_YUVJ422P &&
944 ((avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUV422P) || avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL)){
944 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n"); 945 av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n");
945 return -1; 946 return -1;
946 } 947 }
947 break; 948 break;
948 default: 949 default:
1180 case CODEC_ID_MJPEG: 1181 case CODEC_ID_MJPEG:
1181 s->out_format = FMT_MJPEG; 1182 s->out_format = FMT_MJPEG;
1182 s->intra_only = 1; /* force intra only for jpeg */ 1183 s->intra_only = 1; /* force intra only for jpeg */
1183 s->mjpeg_write_tables = avctx->codec->id != CODEC_ID_JPEGLS; 1184 s->mjpeg_write_tables = avctx->codec->id != CODEC_ID_JPEGLS;
1184 s->mjpeg_data_only_frames = 0; /* write all the needed headers */ 1185 s->mjpeg_data_only_frames = 0; /* write all the needed headers */
1185 s->mjpeg_vsample[0] = 1<<chroma_v_shift; 1186 s->mjpeg_vsample[0] = 2;
1186 s->mjpeg_vsample[1] = 1; 1187 s->mjpeg_vsample[1] = 2>>chroma_v_shift;
1187 s->mjpeg_vsample[2] = 1; 1188 s->mjpeg_vsample[2] = 2>>chroma_v_shift;
1188 s->mjpeg_hsample[0] = 1<<chroma_h_shift; 1189 s->mjpeg_hsample[0] = 2;
1189 s->mjpeg_hsample[1] = 1; 1190 s->mjpeg_hsample[1] = 2>>chroma_h_shift;
1190 s->mjpeg_hsample[2] = 1; 1191 s->mjpeg_hsample[2] = 2>>chroma_h_shift;
1191 if (mjpeg_init(s) < 0) 1192 if (mjpeg_init(s) < 0)
1192 return -1; 1193 return -1;
1193 avctx->delay=0; 1194 avctx->delay=0;
1194 s->low_delay=1; 1195 s->low_delay=1;
1195 break; 1196 break;
6840 CODEC_ID_MJPEG, 6841 CODEC_ID_MJPEG,
6841 sizeof(MpegEncContext), 6842 sizeof(MpegEncContext),
6842 MPV_encode_init, 6843 MPV_encode_init,
6843 MPV_encode_picture, 6844 MPV_encode_picture,
6844 MPV_encode_end, 6845 MPV_encode_end,
6845 .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, -1}, 6846 .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, -1},
6846 }; 6847 };
6847 6848
6848 #endif //CONFIG_ENCODERS 6849 #endif //CONFIG_ENCODERS