Revision cde9e780

View differences:

configure
133 133
  echo "  --disable-debug          disable debugging symbols"
134 134
  echo "  --disable-mpegaudio-hp   faster (but less accurate)"
135 135
  echo "                           MPEG audio decoding [default=no]"
136
  echo "  --enable-gray            enable full grayscale support (slower color)"
136 137
  echo "  --disable-ffmpeg         disable ffmpeg build"
137 138
  echo "  --disable-ffserver       disable ffserver build"
138 139
  echo "  --disable-ffplay         disable ffplay build"
......
615 616
    v4l2
616 617
    x11grab
617 618
    zlib
619
    gray
618 620
'
619 621

  
620 622
THREADS_LIST='
......
860 862
optimize="yes"
861 863
protocols="yes"
862 864
vhook="default"
865
gray="no"
863 866

  
864 867
# build settings
865 868
SHFLAGS='-shared -Wl,-soname,$@'
libavcodec/mpegvideo.c
1554 1554
            ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
1555 1555
                             src_x, src_y<<field_based, h_edge_pos, v_edge_pos);
1556 1556
            ptr_y = s->edge_emu_buffer;
1557
            if(!(s->flags&CODEC_FLAG_GRAY)){
1557
            if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
1558 1558
                uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
1559 1559
                ff_emulated_edge_mc(uvbuf  , ptr_cb, s->uvlinesize, 9, 9+field_based,
1560 1560
                                 uvsrc_x, uvsrc_y<<field_based, h_edge_pos>>1, v_edge_pos>>1);
......
1581 1581
    sy <<= 2 - lowres;
1582 1582
    pix_op[lowres-1](dest_y, ptr_y, linesize, h, sx, sy);
1583 1583

  
1584
    if(!(s->flags&CODEC_FLAG_GRAY)){
1584
    if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
1585 1585
        uvsx <<= 2 - lowres;
1586 1586
        uvsy <<= 2 - lowres;
1587 1587
        pix_op[lowres](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
......
1687 1687
                my += s->mv[dir][i][1];
1688 1688
            }
1689 1689

  
1690
        if(!(s->flags&CODEC_FLAG_GRAY))
1690
        if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY))
1691 1691
            chroma_4mv_motion_lowres(s, dest_cb, dest_cr, ref_picture, pix_op, mx, my);
1692 1692
        break;
1693 1693
    case MV_TYPE_FIELD:
......
1974 1974
                add_dequant_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);
1975 1975
                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
1976 1976

  
1977
                if(!(s->flags&CODEC_FLAG_GRAY)){
1977
                if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
1978 1978
                    if (s->chroma_y_shift){
1979 1979
                        add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
1980 1980
                        add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
......
1993 1993
                add_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize);
1994 1994
                add_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize);
1995 1995

  
1996
                if(!(s->flags&CODEC_FLAG_GRAY)){
1996
                if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
1997 1997
                    if(s->chroma_y_shift){//Chroma420
1998 1998
                        add_dct(s, block[4], 4, dest_cb, uvlinesize);
1999 1999
                        add_dct(s, block[5], 5, dest_cr, uvlinesize);
......
2026 2026
                put_dct(s, block[2], 2, dest_y + dct_offset             , dct_linesize, s->qscale);
2027 2027
                put_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
2028 2028

  
2029
                if(!(s->flags&CODEC_FLAG_GRAY)){
2029
                if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
2030 2030
                    if(s->chroma_y_shift){
2031 2031
                        put_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
2032 2032
                        put_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
......
2045 2045
                s->dsp.idct_put(dest_y + dct_offset             , dct_linesize, block[2]);
2046 2046
                s->dsp.idct_put(dest_y + dct_offset + block_size, dct_linesize, block[3]);
2047 2047

  
2048
                if(!(s->flags&CODEC_FLAG_GRAY)){
2048
                if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
2049 2049
                    if(s->chroma_y_shift){
2050 2050
                        s->dsp.idct_put(dest_cb, uvlinesize, block[4]);
2051 2051
                        s->dsp.idct_put(dest_cr, uvlinesize, block[5]);
libavcodec/mpegvideo_common.h
104 104
        }
105 105
    }
106 106

  
107
    if(s->flags&CODEC_FLAG_GRAY) return;
107
    if(ENABLE_GRAY && s->flags&CODEC_FLAG_GRAY) return;
108 108

  
109 109
    motion_x= s->sprite_offset[1][0];
110 110
    motion_y= s->sprite_offset[1][1];
......
173 173
           a+1, (1<<(2*a+1)) - s->no_rounding,
174 174
           s->h_edge_pos, s->v_edge_pos);
175 175

  
176
    if(s->flags&CODEC_FLAG_GRAY) return;
176
    if(ENABLE_GRAY && s->flags&CODEC_FLAG_GRAY) return;
177 177

  
178 178
    ox= s->sprite_offset[1][0] + s->sprite_delta[0][0]*s->mb_x*8 + s->sprite_delta[0][1]*s->mb_y*8;
179 179
    oy= s->sprite_offset[1][1] + s->sprite_delta[1][0]*s->mb_x*8 + s->sprite_delta[1][1]*s->mb_y*8;
......
318 318
            ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
319 319
                             src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
320 320
            ptr_y = s->edge_emu_buffer;
321
            if(!(s->flags&CODEC_FLAG_GRAY)){
321
            if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
322 322
                uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
323 323
                ff_emulated_edge_mc(uvbuf  , ptr_cb, s->uvlinesize, 9, 9+field_based,
324 324
                                 uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
......
343 343

  
344 344
    pix_op[0][dxy](dest_y, ptr_y, linesize, h);
345 345

  
346
    if(!(s->flags&CODEC_FLAG_GRAY)){
346
    if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
347 347
        pix_op[s->chroma_x_shift][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
348 348
        pix_op[s->chroma_x_shift][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
349 349
    }
......
485 485
        ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
486 486
                         src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);
487 487
        ptr_y= s->edge_emu_buffer;
488
        if(!(s->flags&CODEC_FLAG_GRAY)){
488
        if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
489 489
            uint8_t *uvbuf= s->edge_emu_buffer + 18*s->linesize;
490 490
            ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize, 9, 9 + field_based,
491 491
                             uvsrc_x, uvsrc_y<<field_based, s->h_edge_pos>>1, s->v_edge_pos>>1);
......
515 515
        qpix_op[1][dxy](dest_y  , ptr_y  , linesize);
516 516
        qpix_op[1][dxy](dest_y+8, ptr_y+8, linesize);
517 517
    }
518
    if(!(s->flags&CODEC_FLAG_GRAY)){
518
    if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
519 519
        pix_op[1][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> 1);
520 520
        pix_op[1][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> 1);
521 521
    }
......
663 663
            mx += mv[0][0];
664 664
            my += mv[0][1];
665 665
        }
666
        if(!(s->flags&CODEC_FLAG_GRAY))
666
        if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY))
667 667
            chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
668 668

  
669 669
        return;
......
745 745
            }
746 746
        }
747 747

  
748
        if(!(s->flags&CODEC_FLAG_GRAY))
748
        if(!ENABLE_GRAY || !(s->flags&CODEC_FLAG_GRAY))
749 749
            chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
750 750
        break;
751 751
    case MV_TYPE_FIELD:

Also available in: Unified diff