diff h263.c @ 2167:76334bbb5038 libavcodec

user overrideable level & profile
author michael
date Fri, 13 Aug 2004 13:59:28 +0000
parents 82816cad0e29
children f140ada1f755
line wrap: on
line diff
--- a/h263.c	Thu Aug 12 23:36:48 2004 +0000
+++ b/h263.c	Fri Aug 13 13:59:28 2004 +0000
@@ -2154,13 +2154,26 @@
     int profile_and_level_indication;
     int vo_ver_id;
     
-    if(s->max_b_frames || s->quarter_sample){
-        profile_and_level_indication= 0xF1; // adv simple level 1
+    if(s->avctx->profile != FF_PROFILE_UNKNOWN){
+        profile_and_level_indication = s->avctx->profile << 4;
+    }else if(s->max_b_frames || s->quarter_sample){
+        profile_and_level_indication= 0xF0; // adv simple
+    }else{
+        profile_and_level_indication= 0x00; // simple
+    }
+
+    if(s->avctx->level != FF_LEVEL_UNKNOWN){
+        profile_and_level_indication |= s->avctx->level;
+    }else{
+        profile_and_level_indication |= 1; //level 1
+    }
+
+    if(profile_and_level_indication>>4 == 0xF){
         vo_ver_id= 5;
     }else{
-        profile_and_level_indication= 0x01; // simple level 1
         vo_ver_id= 1;
     }
+
     //FIXME levels
 
     put_bits(&s->pb, 16, 0);