| 903 | } |
| 904 | |
| 905 | static void mpeg4_encode_visual_object_header(MpegEncContext * s){ |
| 906 | int profile_and_level_indication; |
| 907 | int vo_ver_id; |
| 908 | |
| 909 | if(s->avctx->profile != FF_PROFILE_UNKNOWN){ |
| 910 | profile_and_level_indication = s->avctx->profile << 4; |
| 911 | }else if(s->max_b_frames || s->quarter_sample){ |
| 912 | profile_and_level_indication= 0xF0; // adv simple |
| 913 | }else{ |
| 914 | profile_and_level_indication= 0x00; // simple |
| 915 | } |
| 916 | |
| 917 | if(s->avctx->level != FF_LEVEL_UNKNOWN){ |
| 918 | profile_and_level_indication |= s->avctx->level; |
| 919 | }else{ |
| 920 | profile_and_level_indication |= 1; //level 1 |
| 921 | } |
| 922 | |
| 923 | if(profile_and_level_indication>>4 == 0xF){ |
| 924 | vo_ver_id= 5; |
| 925 | }else{ |
| 926 | vo_ver_id= 1; |
| 927 | } |
| 928 | |
| 929 | //FIXME levels |
| 930 | |
| 931 | put_bits(&s->pb, 16, 0); |
| 932 | put_bits(&s->pb, 16, VOS_STARTCODE); |
| 933 | |
| 934 | put_bits(&s->pb, 8, profile_and_level_indication); |
| 935 | |
| 936 | put_bits(&s->pb, 16, 0); |
| 937 | put_bits(&s->pb, 16, VISUAL_OBJ_STARTCODE); |
| 938 | |
| 939 | put_bits(&s->pb, 1, 1); |
| 940 | put_bits(&s->pb, 4, vo_ver_id); |
| 941 | put_bits(&s->pb, 3, 1); //priority |
| 942 | |
| 943 | put_bits(&s->pb, 4, 1); //visual obj type== video obj |
| 944 | |
| 945 | put_bits(&s->pb, 1, 0); //video signal type == no clue //FIXME |
| 946 | |
| 947 | ff_mpeg4_stuffing(&s->pb); |
| 948 | } |
| 949 | |
| 950 | static void mpeg4_encode_vol_header(MpegEncContext * s, int vo_number, int vol_number) |
| 951 | { |
no test coverage detected