aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-12-10 18:07:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-12-10 18:07:35 +0000
commite0b176adffbd336c061ca55e40e4baf813cb79a0 (patch)
treef8e4a542cd296442a77736c76b8e38f9081145d9 /libavcodec
parent65214b621fe900e9d120d069ad81b187e7111f95 (diff)
downloadffmpeg-e0b176adffbd336c061ca55e40e4baf813cb79a0.tar.gz
Fix RGB LJPEG encoding.
Originally committed as revision 20788 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegvideo_enc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index df4044f463..e6220c3c61 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -531,12 +531,18 @@ 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){
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{
+ 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;
+ }
if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER)
|| ff_mjpeg_encode_init(s) < 0)
return -1;