Revision d0271e8a

View differences:

libavcodec/allcodecs.c
64 64
    register_avcodec(&h263p_encoder);
65 65
    register_avcodec(&flv_encoder);
66 66
    register_avcodec(&rv10_encoder);
67
    register_avcodec(&rv20_encoder);
67 68
    register_avcodec(&mpeg4_encoder);
68 69
    register_avcodec(&msmpeg4v1_encoder);
69 70
    register_avcodec(&msmpeg4v2_encoder);
libavcodec/mpegvideo.c
1120 1120
        avctx->delay=0;
1121 1121
        s->low_delay=1;
1122 1122
        break;
1123
    case CODEC_ID_RV20:
1124
        s->out_format = FMT_H263;
1125
        avctx->delay=0;
1126
        s->low_delay=1;
1127
        s->modified_quant=1;
1128
        s->h263_aic=1;
1129
        s->h263_plus=1;
1130
        s->loop_filter=1;
1131
        s->unrestricted_mv= s->obmc || s->loop_filter || s->umvplus;
1132
        break;
1123 1133
    case CODEC_ID_MPEG4:
1124 1134
        s->out_format = FMT_H263;
1125 1135
        s->h263_pred = 1;
......
4150 4160
    case CODEC_ID_H263P:
4151 4161
    case CODEC_ID_FLV1:
4152 4162
    case CODEC_ID_RV10:
4163
    case CODEC_ID_RV20:
4153 4164
        h263_encode_mb(s, s->block, motion_x, motion_y); break;
4154 4165
#endif
4155 4166
    case CODEC_ID_MJPEG:
......
4175 4186
    }
4176 4187
    s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL;
4177 4188
    
4189
    s->mb_x= s->mb_y= 0;
4190
    
4178 4191
    s->parse_context.state= -1;
4179 4192
    s->parse_context.frame_start_found= 0;
4180 4193
    s->parse_context.overread= 0;
......
5255 5268
            mpeg4_encode_picture_header(s, picture_number);
5256 5269
        else if (s->codec_id == CODEC_ID_RV10) 
5257 5270
            rv10_encode_picture_header(s, picture_number);
5271
        else if (s->codec_id == CODEC_ID_RV20) 
5272
            rv20_encode_picture_header(s, picture_number);
5258 5273
        else if (s->codec_id == CODEC_ID_FLV1)
5259 5274
            ff_flv_encode_picture_header(s, picture_number);
5260 5275
        else
......
6379 6394
    MPV_encode_end,
6380 6395
};
6381 6396

  
6397
AVCodec rv20_encoder = {
6398
    "rv20",
6399
    CODEC_TYPE_VIDEO,
6400
    CODEC_ID_RV20,
6401
    sizeof(MpegEncContext),
6402
    MPV_encode_init,
6403
    MPV_encode_picture,
6404
    MPV_encode_end,
6405
};
6406

  
6382 6407
AVCodec mpeg4_encoder = {
6383 6408
    "mpeg4",
6384 6409
    CODEC_TYPE_VIDEO,
libavcodec/mpegvideo.h
932 932
/* rv10.c */
933 933
void rv10_encode_picture_header(MpegEncContext *s, int picture_number);
934 934
int rv_decode_dc(MpegEncContext *s, int n);
935
void rv20_encode_picture_header(MpegEncContext *s, int picture_number);
935 936

  
936 937

  
937 938
/* msmpeg4.c */
libavcodec/rv10.c
258 258
    put_bits(&s->pb, 3, 0);	/* ignored */
259 259
}
260 260

  
261
void rv20_encode_picture_header(MpegEncContext *s, int picture_number){
262
    put_bits(&s->pb, 2, s->pict_type); //I 0 vs. 1 ?
263
    put_bits(&s->pb, 1, 0);	/* unknown bit */
264
    put_bits(&s->pb, 5, s->qscale);
265
        
266
    put_bits(&s->pb, 8, picture_number&0xFF); //FIXME wrong, but correct is not known
267
    s->mb_x= s->mb_y= 0;
268
    ff_h263_encode_mba(s);
269
    
270
    put_bits(&s->pb, 1, s->no_rounding);
271
    
272
    assert(s->f_code == 1);
273
    assert(s->unrestricted_mv == 1);
274
//    assert(s->h263_aic== (s->pict_type == I_TYPE));
275
    assert(s->alt_inter_vlc == 0);
276
    assert(s->umvplus == 0);
277
    assert(s->modified_quant==1);
278
    assert(s->loop_filter==1);
279

  
280
    s->h263_aic= s->pict_type == I_TYPE;
281
    if(s->h263_aic){
282
        s->y_dc_scale_table= 
283
        s->c_dc_scale_table= ff_aic_dc_scale_table;
284
    }else{
285
        s->y_dc_scale_table=
286
        s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
287
    }
288
}
289

  
261 290
static int get_num(GetBitContext *gb)
262 291
{
263 292
    int n, n1;
libavformat/rm.c
230 230
        } else {
231 231
            /* video codec info */
232 232
            put_be32(s,34); /* size */
233
            put_tag(s,"VIDORV10");
233
            if(stream->enc->codec_id == CODEC_ID_RV10)
234
                put_tag(s,"VIDORV10");
235
            else
236
                put_tag(s,"VIDORV20");
234 237
            put_be16(s, stream->enc->width);
235 238
            put_be16(s, stream->enc->height);
236 239
            put_be16(s, (int) stream->frame_rate); /* frames per seconds ? */
......
241 244
            /* Seems to be the codec version: only use basic H263. The next
242 245
               versions seems to add a diffential DC coding as in
243 246
               MPEG... nothing new under the sun */
244
            put_be32(s,0x10000000); 
247
            if(stream->enc->codec_id == CODEC_ID_RV10)
248
                put_be32(s,0x10000000); 
249
            else
250
                put_be32(s,0x20103001); 
245 251
            //put_be32(s,0x10003000); 
246 252
        }
247 253
    }

Also available in: Unified diff