Revision baced9f5

View differences:

ffmpeg.c
182 182
static int coder = 0;
183 183
static int context = 0;
184 184
static int predictor = 0;
185
static int video_profile = FF_PROFILE_UNKNOWN;
186
static int video_level = FF_LEVEL_UNKNOWN;
185 187
extern int loop_input; /* currently a hack */
186 188

  
187 189
static int gop_size = 12;
......
3150 3152
                video_enc->coder_type= coder;
3151 3153
                video_enc->context_model= context;
3152 3154
                video_enc->prediction_method= predictor;
3155
                video_enc->profile= video_profile;
3156
                video_enc->level= video_level;
3153 3157

  
3154 3158
                if(packet_size){
3155 3159
                    video_enc->rtp_mode= 1;
......
3839 3843
    { "coder", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&coder}, "coder type", "" },
3840 3844
    { "context", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&context}, "context model", "" },
3841 3845
    { "pred", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&predictor}, "prediction method", "" },
3846
    { "vprofile", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_profile}, "profile", "" },
3847
    { "vlevel", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_level}, "level", "" },
3842 3848

  
3843 3849
    /* audio options */
3844 3850
    { "ab", HAS_ARG | OPT_AUDIO, {(void*)opt_audio_bitrate}, "set audio bitrate (in kbit/s)", "bitrate", },
libavcodec/avcodec.h
17 17

  
18 18
#define FFMPEG_VERSION_INT     0x000409
19 19
#define FFMPEG_VERSION         "0.4.9-pre1"
20
#define LIBAVCODEC_BUILD       4719
20
#define LIBAVCODEC_BUILD       4720
21 21

  
22 22
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
23 23
#define LIBAVCODEC_VERSION     FFMPEG_VERSION
......
1624 1624
     * - decoding: set by user
1625 1625
     */
1626 1626
     int skip_bottom;
1627

  
1628
    /**
1629
     * profile
1630
     * - encoding: set by user
1631
     * - decoding: set by lavc
1632
     */
1633
     int profile;
1634
#define FF_PROFILE_UNKNOWN -99
1635

  
1636
    /**
1637
     * level
1638
     * - encoding: set by user
1639
     * - decoding: set by lavc
1640
     */
1641
     int level;
1642
#define FF_LEVEL_UNKNOWN -99
1627 1643
} AVCodecContext;
1628 1644

  
1629 1645

  
libavcodec/h263.c
2154 2154
    int profile_and_level_indication;
2155 2155
    int vo_ver_id;
2156 2156
    
2157
    if(s->max_b_frames || s->quarter_sample){
2158
        profile_and_level_indication= 0xF1; // adv simple level 1
2157
    if(s->avctx->profile != FF_PROFILE_UNKNOWN){
2158
        profile_and_level_indication = s->avctx->profile << 4;
2159
    }else if(s->max_b_frames || s->quarter_sample){
2160
        profile_and_level_indication= 0xF0; // adv simple
2161
    }else{
2162
        profile_and_level_indication= 0x00; // simple
2163
    }
2164

  
2165
    if(s->avctx->level != FF_LEVEL_UNKNOWN){
2166
        profile_and_level_indication |= s->avctx->level;
2167
    }else{
2168
        profile_and_level_indication |= 1; //level 1
2169
    }
2170

  
2171
    if(profile_and_level_indication>>4 == 0xF){
2159 2172
        vo_ver_id= 5;
2160 2173
    }else{
2161
        profile_and_level_indication= 0x01; // simple level 1
2162 2174
        vo_ver_id= 1;
2163 2175
    }
2176

  
2164 2177
    //FIXME levels
2165 2178

  
2166 2179
    put_bits(&s->pb, 16, 0);
libavcodec/mpeg12.c
314 314
                put_header(s, EXT_START_CODE);
315 315
                put_bits(&s->pb, 4, 1); //seq ext
316 316
                put_bits(&s->pb, 1, 0); //esc
317
                put_bits(&s->pb, 3, 4); //profile
318
                put_bits(&s->pb, 4, 8); //level
317
                
318
                if(s->avctx->profile == FF_PROFILE_UNKNOWN){
319
                    put_bits(&s->pb, 3, 4); //profile
320
                }else{
321
                    put_bits(&s->pb, 3, s->avctx->profile); //profile
322
                }
323

  
324
                if(s->avctx->level == FF_LEVEL_UNKNOWN){
325
                    put_bits(&s->pb, 4, 8); //level
326
                }else{
327
                    put_bits(&s->pb, 4, s->avctx->level); //level
328
                }
329

  
319 330
                put_bits(&s->pb, 1, s->progressive_sequence);
320 331
                put_bits(&s->pb, 2, 1); //chroma format 4:2:0
321 332
                put_bits(&s->pb, 2, 0); //horizontal size ext
......
1971 1982
{
1972 1983
    int horiz_size_ext, vert_size_ext;
1973 1984
    int bit_rate_ext;
1974
    int level, profile;
1975 1985

  
1976 1986
    skip_bits(&s->gb, 1); /* profil and level esc*/
1977
    profile= get_bits(&s->gb, 3);
1978
    level= get_bits(&s->gb, 4);
1987
    s->avctx->profile= get_bits(&s->gb, 3);
1988
    s->avctx->level= get_bits(&s->gb, 4);
1979 1989
    s->progressive_sequence = get_bits1(&s->gb); /* progressive_sequence */
1980 1990
    s->chroma_format = get_bits(&s->gb, 2); /* chroma_format 1=420, 2=422, 3=444 */
1981 1991
    horiz_size_ext = get_bits(&s->gb, 2);
......
1999 2009

  
2000 2010
    if(s->avctx->debug & FF_DEBUG_PICT_INFO)
2001 2011
        av_log(s->avctx, AV_LOG_DEBUG, "profile: %d, level: %d vbv buffer: %d, bitrate:%d\n", 
2002
               profile, level, s->avctx->rc_buffer_size, s->bit_rate);
2012
               s->avctx->profile, s->avctx->level, s->avctx->rc_buffer_size, s->bit_rate);
2003 2013

  
2004 2014
}
2005 2015

  
libavcodec/utils.c
396 396
    s->lmax= FF_QP2LAMBDA * s->qmax;
397 397
    s->sample_aspect_ratio= (AVRational){0,1};
398 398
    s->ildct_cmp= FF_CMP_VSAD;
399
    s->profile= FF_PROFILE_UNKNOWN;
400
    s->level= FF_LEVEL_UNKNOWN;
399 401
    
400 402
    s->intra_quant_bias= FF_DEFAULT_QUANT_BIAS;
401 403
    s->inter_quant_bias= FF_DEFAULT_QUANT_BIAS;

Also available in: Unified diff