Commit db186eca authored by michael's avatar michael

Cosmetic (restructure RGB ljpeg check to be more readable)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20793 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8761c07d
...@@ -531,17 +531,17 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) ...@@ -531,17 +531,17 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
case CODEC_ID_MJPEG: case CODEC_ID_MJPEG:
s->out_format = FMT_MJPEG; s->out_format = FMT_MJPEG;
s->intra_only = 1; /* force intra only for jpeg */ s->intra_only = 1; /* force intra only for jpeg */
if(avctx->codec->id == CODEC_ID_MJPEG || avctx->pix_fmt != PIX_FMT_BGRA){ if(avctx->codec->id == CODEC_ID_LJPEG && 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{
s->mjpeg_vsample[0] = s->mjpeg_hsample[0] = s->mjpeg_vsample[0] = s->mjpeg_hsample[0] =
s->mjpeg_vsample[1] = s->mjpeg_hsample[1] = s->mjpeg_vsample[1] = s->mjpeg_hsample[1] =
s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 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) if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER)
|| ff_mjpeg_encode_init(s) < 0) || ff_mjpeg_encode_init(s) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment