Revision b50eef3a

View differences:

libavcodec/avcodec.h
5 5

  
6 6
#define LIBAVCODEC_VERSION_INT 0x000406
7 7
#define LIBAVCODEC_VERSION     "0.4.6"
8
#define LIBAVCODEC_BUILD       4613
9
#define LIBAVCODEC_BUILD_STR   "4613"
8
#define LIBAVCODEC_BUILD       4614
9
#define LIBAVCODEC_BUILD_STR   "4614"
10 10

  
11 11
enum CodecID {
12 12
    CODEC_ID_NONE, 
......
23 23
    CODEC_ID_MSMPEG4V2,
24 24
    CODEC_ID_MSMPEG4V3,
25 25
    CODEC_ID_WMV1,
26
    CODEC_ID_WMV2,
26 27
    CODEC_ID_H263P,
27 28
    CODEC_ID_H263I,
28 29

  
......
97 98
#define CODEC_FLAG_PASS1 0x0200  /* use internal 2pass ratecontrol in first  pass mode */
98 99
#define CODEC_FLAG_PASS2 0x0400  /* use internal 2pass ratecontrol in second pass mode */
99 100
#define CODEC_FLAG_EXTERN_HUFF 0x1000 /* use external huffman table (for mjpeg) */
101
#define CODEC_FLAG_GRAY  0x2000 /* only decode/encode grayscale */
100 102

  
101 103
/* codec capabilities */
102 104

  
libavcodec/h263dec.c
124 124
    s->hurry_up= avctx->hurry_up;
125 125
    s->error_resilience= avctx->error_resilience;
126 126
    s->workaround_bugs= avctx->workaround_bugs;
127
    s->flags= avctx->flags;
127 128

  
128 129
    /* no supplementary picture */
129 130
    if (buf_size == 0) {
libavcodec/mpegvideo.c
155 155
        CHECKED_ALLOCZ(pict, c_size)
156 156
        s->last_picture_base[i] = pict;
157 157
        s->last_picture[i] = pict + pict_start;
158
        if(i>0) memset(s->last_picture_base[i], 128, c_size);
158 159
    
159 160
        CHECKED_ALLOCZ(pict, c_size)
160 161
        s->next_picture_base[i] = pict;
161 162
        s->next_picture[i] = pict + pict_start;
163
        if(i>0) memset(s->next_picture_base[i], 128, c_size);
162 164
        
163 165
        if (s->has_b_frames || s->codec_id==CODEC_ID_MPEG4) {
164 166
        /* Note the MPEG4 stuff is here cuz of buggy encoders which dont set the low_delay flag but 
......
166 168
            CHECKED_ALLOCZ(pict, c_size)
167 169
            s->aux_picture_base[i] = pict;
168 170
            s->aux_picture[i] = pict + pict_start;
171
            if(i>0) memset(s->aux_picture_base[i], 128, c_size);
169 172
        }
170 173
    }
171 174
    
......
886 889
    pix_op[dxy](dest_y, ptr, linesize, h);
887 890
    pix_op[dxy](dest_y + 8, ptr + 8, linesize, h);
888 891

  
892
    if(s->flags&CODEC_FLAG_GRAY) return;
893

  
889 894
    if (s->out_format == FMT_H263) {
890 895
        dxy = 0;
891 896
        if ((motion_x & 3) != 0)
......
949 954
    qpix_op[dxy](dest_y + linesize*8    , ptr + linesize*8    , linesize, linesize, motion_x&3, motion_y&3);
950 955
    qpix_op[dxy](dest_y + linesize*8 + 8, ptr + linesize*8 + 8, linesize, linesize, motion_x&3, motion_y&3);
951 956
    
957
    if(s->flags&CODEC_FLAG_GRAY) return;
958

  
952 959
    mx= (motion_x>>1) | (motion_x&1);
953 960
    my= (motion_y>>1) | (motion_y&1);
954 961

  
......
1037 1044
            dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
1038 1045
            pix_op[dxy](dest, ptr, s->linesize, 8);
1039 1046
        }
1047
    
1048
        if(s->flags&CODEC_FLAG_GRAY) break;
1040 1049
        /* In case of 8X8, we construct a single chroma motion vector
1041 1050
           with a special rounding */
1042 1051
        mx = 0;
......
1292 1301
                add_dequant_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);
1293 1302
                add_dequant_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);
1294 1303

  
1295
                add_dequant_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1296
                add_dequant_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1304
                if(!(s->flags&CODEC_FLAG_GRAY)){
1305
                    add_dequant_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1306
                    add_dequant_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1307
                }
1297 1308
            } else {
1298 1309
                add_dct(s, block[0], 0, dest_y, dct_linesize);
1299 1310
                add_dct(s, block[1], 1, dest_y + 8, dct_linesize);
1300 1311
                add_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);
1301 1312
                add_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);
1302 1313

  
1303
                add_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1304
                add_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1314
                if(!(s->flags&CODEC_FLAG_GRAY)){
1315
                    add_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1316
                    add_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1317
                }
1305 1318
            }
1306 1319
        } else {
1307 1320
            /* dct only in intra block */
......
1310 1323
            put_dct(s, block[2], 2, dest_y + dct_offset, dct_linesize);
1311 1324
            put_dct(s, block[3], 3, dest_y + dct_offset + 8, dct_linesize);
1312 1325

  
1313
            put_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1314
            put_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1326
            if(!(s->flags&CODEC_FLAG_GRAY)){
1327
                put_dct(s, block[4], 4, dest_cb, s->linesize >> 1);
1328
                put_dct(s, block[5], 5, dest_cr, s->linesize >> 1);
1329
            }
1315 1330
        }
1316 1331
    }
1317 1332
 the_end:

Also available in: Unified diff