Revision a1a63143

View differences:

libavcodec/mpegvideo_enc.c
531 531
    case CODEC_ID_MJPEG:
532 532
        s->out_format = FMT_MJPEG;
533 533
        s->intra_only = 1; /* force intra only for jpeg */
534
        if(avctx->codec->id == CODEC_ID_MJPEG || avctx->pix_fmt != PIX_FMT_BGRA){
535
        s->mjpeg_vsample[0] = 2;
536
        s->mjpeg_vsample[1] = 2>>chroma_v_shift;
537
        s->mjpeg_vsample[2] = 2>>chroma_v_shift;
538
        s->mjpeg_hsample[0] = 2;
539
        s->mjpeg_hsample[1] = 2>>chroma_h_shift;
540
        s->mjpeg_hsample[2] = 2>>chroma_h_shift;
541
        }else{
534
        if(avctx->codec->id == CODEC_ID_LJPEG && avctx->pix_fmt == PIX_FMT_BGRA){
542 535
            s->mjpeg_vsample[0] = s->mjpeg_hsample[0] =
543 536
            s->mjpeg_vsample[1] = s->mjpeg_hsample[1] =
544 537
            s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1;
538
        }else{
539
            s->mjpeg_vsample[0] = 2;
540
            s->mjpeg_vsample[1] = 2>>chroma_v_shift;
541
            s->mjpeg_vsample[2] = 2>>chroma_v_shift;
542
            s->mjpeg_hsample[0] = 2;
543
            s->mjpeg_hsample[1] = 2>>chroma_h_shift;
544
            s->mjpeg_hsample[2] = 2>>chroma_h_shift;
545 545
        }
546 546
        if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER)
547 547
            || ff_mjpeg_encode_init(s) < 0)

Also available in: Unified diff