diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 15:21:31 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 16:30:23 +0400 |
commit | 93947d88f2abdf17d374a2d83cdb051ef9bafb2c (patch) | |
tree | 4e1f967ed1e56ae70d3df7eaa7de32c20f905db6 /libavcodec/mpegvideo_enc.c | |
parent | d756b2b530ca742ac930ca6e9d1ba86ec8af86c9 (diff) | |
parent | 24abd806ea0cfb0d988d2f0044eac79cff12918c (diff) |
Merge commit '24abd806ea0cfb0d988d2f0044eac79cff12918c'
* commit '24abd806ea0cfb0d988d2f0044eac79cff12918c':
ljpegenc: deMpegEncContextize
Conflicts:
libavcodec/ljpegenc.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
tests/ref/vsynth/vsynth1-ljpeg
tests/ref/vsynth/vsynth2-ljpeg
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index dcbdc036da..533e9e1357 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -243,7 +243,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; int i, ret; - int chroma_h_shift, chroma_v_shift; MPV_encode_defaults(s); @@ -256,21 +255,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) return -1; } break; - case AV_CODEC_ID_LJPEG: - if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P && - avctx->pix_fmt != AV_PIX_FMT_YUVJ422P && - avctx->pix_fmt != AV_PIX_FMT_YUVJ444P && - avctx->pix_fmt != AV_PIX_FMT_BGR0 && - avctx->pix_fmt != AV_PIX_FMT_BGRA && - avctx->pix_fmt != AV_PIX_FMT_BGR24 && - ((avctx->pix_fmt != AV_PIX_FMT_YUV420P && - avctx->pix_fmt != AV_PIX_FMT_YUV422P && - avctx->pix_fmt != AV_PIX_FMT_YUV444P) || - avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) { - av_log(avctx, AV_LOG_ERROR, "colorspace not supported in LJPEG\n"); - return -1; - } - break; case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_AMV: if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P && @@ -657,8 +641,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias); - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, &chroma_v_shift); - if (avctx->codec_id == AV_CODEC_ID_MPEG4 && s->avctx->time_base.den > (1 << 16) - 1) { av_log(avctx, AV_LOG_ERROR, @@ -682,30 +664,11 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) avctx->delay = s->low_delay ? 0 : (s->max_b_frames + 1); s->rtp_mode = 1; break; - case AV_CODEC_ID_LJPEG: case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_AMV: s->out_format = FMT_MJPEG; s->intra_only = 1; /* force intra only for jpeg */ - if (avctx->codec->id == AV_CODEC_ID_LJPEG && - (avctx->pix_fmt == AV_PIX_FMT_BGR0 - || s->avctx->pix_fmt == AV_PIX_FMT_BGRA - || s->avctx->pix_fmt == AV_PIX_FMT_BGR24)) { - s->mjpeg_vsample[0] = s->mjpeg_hsample[0] = - s->mjpeg_vsample[1] = s->mjpeg_hsample[1] = - s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1; - } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P) { - s->mjpeg_vsample[0] = s->mjpeg_vsample[1] = s->mjpeg_vsample[2] = 2; - s->mjpeg_hsample[0] = s->mjpeg_hsample[1] = s->mjpeg_hsample[2] = 1; - } else { - s->mjpeg_vsample[0] = 2; - s->mjpeg_vsample[1] = 2 >> chroma_v_shift; - s->mjpeg_vsample[2] = 2 >> chroma_v_shift; - s->mjpeg_hsample[0] = 2; - s->mjpeg_hsample[1] = 2 >> chroma_h_shift; - s->mjpeg_hsample[2] = 2 >> chroma_h_shift; - } - if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) || + if (!CONFIG_MJPEG_ENCODER || ff_mjpeg_encode_init(s) < 0) return -1; avctx->delay = 0; @@ -954,7 +917,7 @@ av_cold int ff_MPV_encode_end(AVCodecContext *avctx) ff_rate_control_uninit(s); ff_MPV_common_end(s); - if ((CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) && + if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG) ff_mjpeg_encode_close(s); |