[FFmpeg-cvslog] r20793 - trunk/libavcodec/mpegvideo_enc.c

michael subversion
Thu Dec 10 21:05:04 CET 2009


Author: michael
Date: Thu Dec 10 21:05:04 2009
New Revision: 20793

Log:
Cosmetic (restructure RGB ljpeg check to be more readable)

Modified:
   trunk/libavcodec/mpegvideo_enc.c

Modified: trunk/libavcodec/mpegvideo_enc.c
==============================================================================
--- trunk/libavcodec/mpegvideo_enc.c	Thu Dec 10 20:41:47 2009	(r20792)
+++ trunk/libavcodec/mpegvideo_enc.c	Thu Dec 10 21:05:04 2009	(r20793)
@@ -531,17 +531,17 @@ av_cold int MPV_encode_init(AVCodecConte
     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)



More information about the ffmpeg-cvslog mailing list