Revision baaf3f46

View differences:

ffmpeg.c
121 121
static int use_umv = 0;
122 122
static int use_alt_scan = 0;
123 123
static int use_trell = 0;
124
static int use_scan_offset = 0;
124 125
static int do_deinterlace = 0;
125 126
static int do_interlace_dct = 0;
126 127
static int do_interlace_me = 0;
......
2399 2400
           	if (use_trell) {
2400 2401
                    video_enc->flags |= CODEC_FLAG_TRELLIS_QUANT;
2401 2402
                }
2403
           	if (use_scan_offset) {
2404
                    video_enc->flags |= CODEC_FLAG_SVCD_SCAN_OFFSET;
2405
                }
2402 2406
                if (b_frames) {
2403 2407
                    video_enc->max_b_frames = b_frames;
2404 2408
                    video_enc->b_frame_strategy = 0;
......
2906 2910
        video_rc_max_rate = 2516000;
2907 2911
        video_rc_min_rate = 0; //1145000;
2908 2912
        video_rc_buffer_size = 224*1024*8;
2913
        use_scan_offset = 1;
2909 2914

  
2910 2915
        audio_bit_rate = 224000;
2911 2916
        audio_sample_rate = 44100;
......
3034 3039
    { "umv", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_umv}, "enable Unlimited Motion Vector (h263+)" },
3035 3040
    { "alt", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_alt_scan}, "enable alternate scantable (mpeg2)" },
3036 3041
    { "trell", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_trell}, "enable trellis quantization" },
3042
    { "scan_offset", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&use_scan_offset}, "enable SVCD Scan Offset placeholder" },
3037 3043
    { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" },
3038 3044
    { "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" },
3039 3045
    { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" },
libavcodec/avcodec.h
267 267
#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
268 268
#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
269 269
#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
270
#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< will reserve space for SVCD scan offset user data
270 271
/* Unsupported options :
271 272
 * 		Syntax Arithmetic coding (SAC)
272 273
 * 		Reference Picture Selection
libavcodec/mpeg12.c
473 473
        put_bits(&s->pb, 1, s->progressive_frame);
474 474
        put_bits(&s->pb, 1, 0); //composite_display_flag
475 475
    }
476
    if(s->flags & CODEC_FLAG_SVCD_SCAN_OFFSET){
477
        int i;
478

  
479
        put_header(s, USER_START_CODE);
480
        for(i=0; i<sizeof(svcd_scan_offset_placeholder); i++){
481
            put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]);
482
        }
483
    }
476 484
    
477 485
    s->mb_y=0;
478 486
    ff_mpeg1_encode_slice_header(s);
......
1809 1817
static void mpeg_decode_sequence_extension(MpegEncContext *s)
1810 1818
{
1811 1819
    int horiz_size_ext, vert_size_ext;
1812
    int bit_rate_ext, vbv_buf_ext;
1820
    int bit_rate_ext;
1813 1821
    int frame_rate_ext_n, frame_rate_ext_d;
1814 1822
    int level, profile;
1815 1823

  
libavcodec/mpeg12data.h
433 433
    {0,1},
434 434
};
435 435

  
436
static const uint8_t svcd_scan_offset_placeholder[14]={
437
    0x10, 0x0E,
438
    0x00, 0x80, 0x81,
439
    0x00, 0x80, 0x81,
440
    0xff, 0xff, 0xff,
441
    0xff, 0xff, 0xff,
442
};

Also available in: Unified diff