aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-12-10 20:05:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-12-10 20:05:04 +0000
commita1a63143f182729c40037b4fb8d8f9d84039e7ab (patch)
tree4bcf8bf1f6ddeee37f406bc80160138a3cefdc01
parent401e0a74bdbd40b02508f593120228c4da886cd2 (diff)
downloadffmpeg-a1a63143f182729c40037b4fb8d8f9d84039e7ab.tar.gz
Cosmetic (restructure RGB ljpeg check to be more readable)
Originally committed as revision 20793 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpegvideo_enc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 224ccffd5a..a0f155845e 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -531,17 +531,17 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
case CODEC_ID_MJPEG:
s->out_format = FMT_MJPEG;
s->intra_only = 1; /* force intra only for jpeg */
- if(avctx->codec->id == CODEC_ID_MJPEG || avctx->pix_fmt != PIX_FMT_BGRA){
- 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;
- }else{
+ if(avctx->codec->id == CODEC_ID_LJPEG && avctx->pix_fmt == PIX_FMT_BGRA){
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{
+ 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)
|| ff_mjpeg_encode_init(s) < 0)