Ejemplo n.º 1
0
//---------------------------------------------------------------------------
// Packet "B0"
void File_AvsV::video_sequence_start()
{
    Element_Name("video_sequence_start");

    //Parsing
    int32u bit_rate_upper, bit_rate_lower;
    Get_B1 (    profile_id,                                     "profile_id");
    Get_B1 (    level_id,                                       "level_id");
    BS_Begin();
    Get_SB (    progressive_sequence,                           "progressive_sequence");
    Get_S2 (14, horizontal_size,                                "horizontal_size");
    Get_S2 (14, vertical_size,                                  "vertical_size");
    Get_S1 ( 2, chroma_format,                                  "chroma_format");
    Skip_S1( 3,                                                 "sample_precision");
    Get_S1 ( 4, aspect_ratio,                                   "aspect_ratio"); Param_Info(AvsV_aspect_ratio[aspect_ratio]);
    Get_S1 ( 4, frame_rate_code,                                "frame_rate_code"); Param_Info(AvsV_frame_rate[frame_rate_code]);
    Get_S3 (18, bit_rate_lower,                                 "bit_rate_lower");
    Mark_1 ();
    Get_S3 (12, bit_rate_upper,                                 "bit_rate_upper");
    bit_rate=(bit_rate_upper<<18)+bit_rate_lower; Param_Info(bit_rate*8, " bps");
    Get_SB (    low_delay,                                      "low_delay");
    Mark_1 ();
    Skip_S3(18,                                                 "bbv_buffer_size");
    Skip_SB(                                                    "reserved");
    Skip_SB(                                                    "reserved");
    Skip_SB(                                                    "reserved");
    BS_End();

    //Not sure, but the 3 first official files have this
    if (Element_Size-Element_Offset)
    {
        BS_Begin();
        Mark_1();
        BS_End();
    }

    FILLING_BEGIN();
        //NextCode
        NextCode_Clear();
        NextCode_Add(0xB2); //user_data_start
        NextCode_Add(0xB3); //picture_start (I)
        NextCode_Add(0xB5); //extension_start

        //Autorisation of other streams
        Streams[0xB1].Searching_Payload=true, //video_sequence_end
        Streams[0xB2].Searching_Payload=true; //user_data_start
        Streams[0xB3].Searching_Payload=true, //picture_start (I)
        Streams[0xB4].Searching_Payload=true, //reserved
        Streams[0xB5].Searching_Payload=true; //extension_start
        Streams[0xB6].Searching_Payload=true, //picture_start (P or B)
        Streams[0xB7].Searching_Payload=true; //video_edit
        Streams[0xB8].Searching_Payload=true, //reserved

        video_sequence_start_IsParsed=true;
    FILLING_END();
}
//---------------------------------------------------------------------------
// AAC in ES, PS part, 2 bytes
// Format is unknown
void File_Mpeg4_AudioSpecificConfig::PS ()
{
    //Parsing
    Element_Begin("PS");
    int16u syncExtensionType;
    Get_S2 (11, syncExtensionType,                             "syncExtensionType");
    if (syncExtensionType!=0x548)
    {
        Element_End();
        return;
    }
    Get_SB (psPresentFlag,                                     "psPresentFlag");
    Element_End();

    //BSAC stuff
    //if (extensionAudioObjectType==22)
    //    BSAC();
    //if ( extensionAudioObjectType == 22 ) {
    //    sbrPresentFlag;
    //    if (sbrPresentFlag == 1) {
    //        extensionSamplingFrequencyIndex;
    //        if ( extensionSamplingFrequencyIndex == 0xf )
    //            extensionSamplingFrequency;
    //    }
    //    extensionChannelConfiguration
    //}
}
//---------------------------------------------------------------------------
// AAC in ES, SBR part, 3+ bytes
void File_Mpeg4_AudioSpecificConfig::SBR ()
{
    //Parsing
    int16u syncExtensionType;
    int8u  samplingFrequencyIndex;
    Element_Begin("SBR");
    Get_S2 (11, syncExtensionType,                             "syncExtensionType");
    if (syncExtensionType!=0x2B7)
    {
        Element_End();
        return;
    }
    Get_S1 (5, extensionAudioObjectType,                        "extensionAudioObjectType");
    if (extensionAudioObjectType==0x05)
    {
        Get_SB (   sbrPresentFlag,                              "sbrPresentFlag");
        if (sbrPresentFlag)
        {
            Get_S1 (4, samplingFrequencyIndex,                  "extensionSamplingFrequencyIndex"); Param_Info(MP4_SamplingRate[samplingFrequencyIndex]);
            if (samplingFrequencyIndex>=0xF)
            {
                Get_S3 (24, samplingFrequency,                  "extensionSamplingFrequency");
            }
            else
                samplingFrequency=MP4_SamplingRate[samplingFrequencyIndex];
        }
    }
    Element_End();

    //PS stuff
    if (Data_Remain())
        PS();
}
Ejemplo n.º 4
0
//---------------------------------------------------------------------------
void File_Dts::Header_Parse()
{
    //Parsing
    int16u Primary_Frame_Byte_Size_minus_1;
    int8u  EncoderSoftwareRevision;
    bool   crc_present;
    Skip_B4(                                                    "Sync");
    BS_Begin();
    Info_SB(    FrameType,                                      "Frame Type"); Param_Info(DTS_FrameType[FrameType]);
    Skip_S1( 5,                                                 "Deficit Sample Count");
    Get_SB (    crc_present,                                    "CRC Present");
    Skip_S1( 7,                                                 "Number of PCM Sample Blocks");
    Get_S2 (14, Primary_Frame_Byte_Size_minus_1,                "Primary Frame Byte Size minus 1");
    Primary_Frame_Byte_Size_minus_1+=1;
    if (!Word) Primary_Frame_Byte_Size_minus_1=Primary_Frame_Byte_Size_minus_1*8/14*2; Param_Info(Ztring::ToZtring(Primary_Frame_Byte_Size_minus_1)+_T(" bytes")); //Word is on 14 bits!
    Get_S1 ( 6, channel_arrangement,                            "Audio Channel Arrangement"); Param_Info(Ztring::ToZtring(DTS_Channels[channel_arrangement])+_T(" channels"));
    Get_S1 ( 4, sample_frequency,                               "Core Audio Sampling Frequency"); Param_Info(Ztring::ToZtring(DTS_SamplingRate[sample_frequency])+_T(" Hz"));
    Get_S1 ( 5, bit_rate,                                       "Transmission Bit Rate"); Param_Info(Ztring::ToZtring(DTS_BitRate[bit_rate])+_T(" bps"));
    Skip_SB(                                                    "Embedded Down Mix Enabled");
    Skip_SB(                                                    "Embedded Dynamic Range");
    Skip_SB(                                                    "Embedded Time Stamp");
    Skip_SB(                                                    "Auxiliary Data");
    Skip_SB(                                                    "HDCD");
    Get_S1 ( 3, ExtensionAudioDescriptor,                       "Extension Audio Descriptor"); Param_Info(DTS_ExtensionAudioDescriptor[ExtensionAudioDescriptor]);
    Get_SB (    ExtendedCoding,                                 "Extended Coding");
    Skip_SB(                                                    "Audio Sync Word Insertion");
    Get_S1 ( 2, lfe_effects,                                    "Low Frequency Effects");
    Skip_SB(                                                    "Predictor History");
    if (crc_present)
        Skip_S2(16,                                             "Header CRC Check");
    Skip_SB(                                                    "Multirate Interpolator");
    Get_S1 ( 4, EncoderSoftwareRevision,                        "Encoder Software Revision");
    Skip_S1( 2,                                                 "Copy History");
    Get_S1 ( 2, bits_per_sample,                                "Source PCM Resolution"); Param_Info(Ztring::ToZtring(DTS_Resolution[bits_per_sample])+_T(" bits"));
    Skip_SB(                                                    "ES");
    Skip_SB(                                                    "Front Sum/Difference");
    Skip_SB(                                                    "Surrounds Sum/Difference");
    Skip_S1( 4,                                                 "Dialog Normalisation Parameter");
    switch (EncoderSoftwareRevision)
    {
        case 6 :
                Skip_S1( 4,                                     "Dialog Normalisation Parameter");
                break;
        case 7 :
                Skip_S1( 4,                                     "Dialog Normalisation Parameter");
                break;
        default :
                Skip_S1( 4,                                     "Unspecified");
                break;
    }
    BS_End();

    //Filling
    Header_Fill_Size(Primary_Frame_Byte_Size_minus_1+DTS_HD_Unknown_Size); //TODO: change this, for DTS-HD
    Header_Fill_Code(0, "Frame");
}
Ejemplo n.º 5
0
//---------------------------------------------------------------------------
void File_OpenMG::FileHeader_Parse()
{
    //Parsing
    int16u Size, FrameSize=0;
    int8u  Flags, CodecID, SamplingRate_Code=0, Channels_Code=0;
    bool  JointStereo=false;
    Skip_C3(                                                    "Code");
    Get_B1 (Flags,                                              "Flags");
    Get_B2 (Size,                                               "Size");
    Skip_XX(26,                                                 "Unknown");
    Get_B1 (CodecID,                                            "Coded ID"); Param_Info1(OpenMG_CodecID_Format(CodecID));
    if (CodecID<=1) //Atrac3
    {
        BS_Begin();
        Skip_S1(7,                                              "Unknown");
        Get_SB (   JointStereo,                                 "Joint Stereo");
        Get_S1 (3, SamplingRate_Code,                           "Sampling Rate"); Param_Info2(OpenMG_SamplingRate(SamplingRate_Code), " Hz");
        Get_S1 (3, Channels_Code,                               "Channels"); Param_Info2(OpenMG_Channels(Channels_Code), " channel(s)");
        Get_S2 (10, FrameSize,                                  "Frame size");
        BS_End();
    }
    Skip_XX(Size-Element_Offset,                                "Unknown");

    FILLING_BEGIN();
        if (!Status[IsAccepted])
        {
            File__Tags_Helper::Accept();

            Fill(Stream_Audio, 0, Audio_Format, OpenMG_CodecID_Format(CodecID));
            Fill(Stream_Audio, 0, Audio_Encryption, OpenMG_CodecID_Encryption(CodecID));
            int64u StreamSize=(int64u)-1;
            if (File_Size!=(int64u)-1)
            {
                StreamSize=File_Size-(Buffer_Offset+Element_Size);
                Fill(Stream_Audio, 0, Audio_StreamSize, StreamSize);
            }
            if (CodecID<=1) // Atrac3
            {
                Fill(Stream_Audio, 0, Audio_Channel_s_, OpenMG_Channels(Channels_Code));
                Fill(Stream_Audio, 0, Audio_ChannelPositions, OpenMG_ChannelPositions(Channels_Code));
                if (Channels_Code==1 && JointStereo)
                    Fill(Stream_Audio, 0, Audio_Format_Settings_Mode, "Joint Stereo");
                Fill(Stream_Audio, 0, Audio_SamplingRate, OpenMG_SamplingRate(SamplingRate_Code));

                if (CodecID==1) //Protected
                    FrameSize++; //Not sure
                FrameSize<<=3; //8-byte  blocks
                int64u BitRate=OpenMG_SamplingRate(SamplingRate_Code)*FrameSize/256;
                Fill(Stream_Audio, 0, Audio_BitRate, BitRate);
                if (StreamSize!=(int64u)-1 && BitRate)
                    Fill(Stream_Audio, 0, Audio_Duration, StreamSize*8*1000/BitRate);
            }
        }
    FILLING_END();
}
Ejemplo n.º 6
0
//---------------------------------------------------------------------------
void File_Latm::Header_Parse()
{
    int16u audioMuxLengthBytes;
    BS_Begin();
    Skip_S2(11,                                                 "syncword");
    Get_S2 (13, audioMuxLengthBytes,                            "audioMuxLengthBytes");
    BS_End();

    //Filling
    Header_Fill_Size(3+audioMuxLengthBytes);
    Header_Fill_Code(0, "LATM");
}
Ejemplo n.º 7
0
//---------------------------------------------------------------------------
bool File_DolbyE::Descramble_16bit ()
{
    int16u ScrambleMask;
    Get_S2 (16, ScrambleMask, "Scramble mask");
    int16u Size=((BigEndian2int16u(Buffer+Buffer_Offset+(size_t)Element_Size-Data_BS_Remain()/8)^ScrambleMask)>>2)&0x3FF;

    if (Data_BS_Remain()<(size_t)((Size+1)*BitDepth)) //+1 for additional unknown word
        return false; //There is a problem

    int8u* Temp=Descrambled_Buffer+(size_t)Element_Size-Data_BS_Remain()/8;
    for (int16u Pos=0; Pos<Size; Pos++)
        int16u2BigEndian(Temp+Pos*2, BigEndian2int16u(Temp+Pos*2)^ScrambleMask);

    return true;
}
//---------------------------------------------------------------------------
// AAC in ES, SBR part, 3+ bytes
void File_Mpeg4_AudioSpecificConfig::SBR ()
{
    //Parsing
    int16u syncExtensionType;
    int8u  samplingFrequencyIndex;
    Element_Begin("SBR");
    Get_S2 (11, syncExtensionType,                             "syncExtensionType");
    if (syncExtensionType!=0x2B7)
    {
        Element_End();
        return;
    }
    Get_S1 (5, extensionAudioObjectType,                        "extensionAudioObjectType");
    if (extensionAudioObjectType==0x05)
    {
        Get_SB (   sbrPresentFlag,                              "sbrPresentFlag");
        if (sbrPresentFlag)
        {
            Get_S1 (4, samplingFrequencyIndex,                  "extensionSamplingFrequencyIndex"); Param_Info(MP4_SamplingRate[samplingFrequencyIndex]);
            if (samplingFrequencyIndex==0xF)
            {
                Get_S3 (24, samplingFrequency,                  "extensionSamplingFrequency");
            }
            else
                samplingFrequency=MP4_SamplingRate[samplingFrequencyIndex];
        }
    }
    Element_End();

    FILLING_BEGIN();
        //Filling
        if (sbrPresentFlag)
        {
            Fill(Stream_Audio, StreamPos_Last, Audio_Format_Settings, "SBR");
            Fill(Stream_Audio, StreamPos_Last, Audio_Format_Settings_SBR, "Yes", Unlimited, true, true);
            Fill(Stream_Audio, StreamPos_Last, Audio_Format_Settings_PS, "No");
            Ztring Codec=Retrieve(Stream_Audio, StreamPos_Last, Audio_Codec);
            Fill(Stream_Audio, StreamPos_Last, Audio_Codec, Codec+_T("/SBR"), true);
            Fill(Stream_Audio, StreamPos_Last, Audio_SamplingRate, samplingFrequency, 10, true);
        }

        //PS stuff
        if (Data_Remain())
            PS();
    FILLING_END();
}
Ejemplo n.º 9
0
//---------------------------------------------------------------------------
// Packet "B5"
void File_AvsV::extension_start()
{
    Element_Name("Extension");

    //Parsing
    int8u extension_start_code_identifier;
    BS_Begin();
    Get_S1 ( 4, extension_start_code_identifier,                "extension_start_code_identifier"); Param_Info(AvsV_extension_start_code_identifier[extension_start_code_identifier]);
    Element_Info(AvsV_extension_start_code_identifier[extension_start_code_identifier]);

         switch (extension_start_code_identifier)
    {
        case 2  :{ //sequence_display
                    //Parsing
                    Get_S1 ( 3, video_format,                   "video_format"); Param_Info(AvsV_video_format[video_format]);
                    Skip_SB(                                    "sample_range");
                    TEST_SB_SKIP(                               "colour_description");
                        Skip_S1( 8,                             "colour_primaries");
                        Skip_S1( 8,                             "transfer_characteristics");
                        Skip_S1( 8,                             "matrix_coefficients");
                    TEST_SB_END();
                    Get_S2 (14, display_horizontal_size,        "display_horizontal_size");
                    Mark_1 ();
                    Get_S2 (14, display_vertical_size,          "display_vertical_size");
                    Skip_SB(                                    "reserved");
                    Skip_SB(                                    "reserved");
                    BS_End();
                }
                break;
        case 4  :{ //copyright
                    //Parsing
                    Skip_SB(                                    "copyright_flag");
                    Skip_S1( 8,                                 "copyright_id");
                    Skip_SB(                                    "original_or_copy");
                    Skip_S1( 7,                                 "reserved");
                    Mark_1 ();
                    Info_S3(20, copyright_number_1,             "copyright_number_1");
                    Mark_1 ();
                    Info_S3(22, copyright_number_2,             "copyright_number_2");
                    Mark_1 ();
                    Info_S3(22, copyright_number_3,             "copyright_number_3"); Param_Info(Ztring::ToZtring(((int64u)copyright_number_1<<44)+((int64u)copyright_number_2<<22)+(int64u)copyright_number_3, 16));
                    BS_End();
                }
                break;
        case 11 :{ //camera_parameters
                    //Parsing
                    Skip_SB(                                    "reserved");
                    Skip_S1( 7,                                 "camera_id");
                    Mark_1 ();
                    Skip_S3(22,                                 "height_of_image_device");
                    Mark_1 ();
                    Skip_S3(22,                                 "focal_length");
                    Mark_1 ();
                    Skip_S3(22,                                 "f_number");
                    Mark_1 ();
                    Skip_S3(22,                                 "vertical_angle_of_view");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_x_upper");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_x_lower");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_y_upper");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_y_lower");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_z_upper");
                    Mark_1 ();
                    Skip_S3(16,                                 "camera_position_z_lower");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_direction_x");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_direction_y");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_direction_z");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_plane_vertical_x");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_plane_vertical_y");
                    Mark_1 ();
                    Skip_S3(22,                                 "camera_plane_vertical_z");
                    Mark_1 ();
                    Skip_S4(32,                                 "reserved");
                    BS_End();
                }
                break;
        default:{
                    //Parsing
                    Skip_S1(4,                                  "data");
                    BS_End();
                    Skip_XX(Element_Size-Element_Offset,        "data");
                }

    }
    
    //Not sure, but the 3 first official files have this
    if (Element_Size-Element_Offset)
    {
        BS_Begin();
        Mark_1();
        BS_End();
    }

    FILLING_BEGIN();
        //NextCode
        NextCode_Test();
    FILLING_END();
}
Ejemplo n.º 10
0
//---------------------------------------------------------------------------
void File_Aac::ALSSpecificConfig()
{
    //Not in spec, but something weird in the example I have
    int32u Junk;
    while (Data_BS_Remain())
    {
        Peek_S4(32, Junk);
        if (Junk!=0x414C5300)
        {
            Skip_SB(                                            "Unknown");
        }
        else
            break;
    }
    if (Data_BS_Remain()==0)
        return; //There is a problem

    Element_Begin1("ALSSpecificConfig");
    bool chan_config,chan_sort,crc_enabled,aux_data_enabled;
    int32u samp_freq, samples;
    int16u channels,frame_length;
    int8u ra_flag,random_access, file_type;
    Skip_BS(32,"als_id");
    Get_BS (32, samp_freq,                                      "samp_freq");
    Get_BS (32, samples,                                        "samples");
    Get_S2 (16, channels,                                       "channels"); Param_Info2(channels+1, " channel(s)");
    Get_S1 (3, file_type,                                       "file_type");
    Skip_S1(3,"resolution");
    Skip_SB("floating");
    Skip_SB("msb_first");
    Get_S2 (16,frame_length,"frame_length");
    Get_S1 (8,random_access,"random_access");
    Get_S1 (2,ra_flag,"ra_flag");
    Skip_SB("adapt_order");
    Skip_S1(2,"coef_table");
    Skip_SB("long_term_prediction");
    Skip_S2(10,"max_order");
    Skip_S1(2,"block_switching");
    Skip_SB("bgmc_mode");
    Skip_SB("sb_part");
    Skip_SB("joint_stereo");
    Skip_SB("mc_coding");
    Get_SB (chan_config,"chan_config");
    Get_SB (chan_sort,"chan_sort");
    Get_SB (crc_enabled,"crc_enabled");
    Skip_SB("RLSLMS");
    Skip_BS(5,"(reserved)");
    Get_SB (aux_data_enabled,"aux_data_enabled");
    if (chan_config)
        Skip_S2(16,"chan_config_info");
    if (chan_sort)
    {
        int16u ChBits=(int16u)ceil(log((double)(channels+1))/log((double)2));
        for (int8u c=0; c<=channels; c++)
            Skip_BS(ChBits,                                     "chan_pos[c]");
    }
    if(Data_BS_Remain()%8)
        Skip_S1(Data_BS_Remain()%8,                             "byte_align");
    BS_End();
    int32u header_size,trailer_size;
    Get_B4(header_size,                                         "header_size");
    Get_B4(trailer_size,                                        "trailer_size");
    #ifdef MEDIAINFO_RIFF_YES
    if (file_type==1) //WAVE file
    {
        Element_Begin1("orig_header");
        File_Riff MI;
        Open_Buffer_Init(&MI);
        Open_Buffer_Continue(&MI, Buffer+Buffer_Offset+(size_t)Element_Offset, header_size);
        Element_Offset+=header_size;
        File__Analyze::Finish(&MI); //No merge of data, only for trace information, because this is the data about the decoded stream, not the encoded stream
        Element_End0();
    }
    else
    #endif //MEDIAINFO_RIFF_YES
        Skip_XX(header_size,                                    "orig_header[]");

    Skip_XX(trailer_size,                                       "orig_trailer[]");
    if (crc_enabled)
        Skip_B4(                                                "crc");
    if ((ra_flag == 2) && (random_access > 0))
        for (int32u f=0; f<((samples-1)/(frame_length+1))+1; f++)
            Skip_B4(                                            "ra_unit_size[f]");
    if (aux_data_enabled)
    {
        int32u aux_size;
        Get_B4(aux_size,                                        "aux_size");
        Skip_XX(aux_size,                                       "aux_data[]");
    }
    Element_End0();
    BS_Begin(); //To be in sync with other objectTypes

    FILLING_BEGIN();
        //Filling
        File__Analyze::Stream_Prepare(Stream_Audio);
        Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, channels+1);

        //Forcing default confignuration (something weird in the example I have)
        channelConfiguration=0;
        sampling_frequency_index=(int8u)-1;
        sampling_frequency=samp_freq;
    FILLING_END();
}
Ejemplo n.º 11
0
//---------------------------------------------------------------------------
// Packet "0F"
void File_Vc1::SequenceHeader()
{
    Element_Name("SequenceHeader");

    //Parsing
    BS_Begin();
    Get_S1 ( 2, profile,                                        "profile"); Param_Info(Vc1_Profile[profile]);
    if (profile==0 || profile==1) //Simple or Main
    {
        Skip_S1( 2,                                             "res_sm");
        Skip_S1( 3,                                             "frmrtq_postproc");
        Skip_S1( 5,                                             "bitrtq_postproc");
        Skip_SB(                                                "loopfilter");
        Skip_SB(                                                "res_x8");
        Skip_SB(                                                "multires");
        Skip_SB(                                                "res_fasttx");
        Skip_SB(                                                "fastuvmc");
        Skip_SB(                                                "extended_mv");
        Skip_S1( 2,                                             "dquant");
        Skip_SB(                                                "vtransform");
        Skip_SB(                                                "res_transtab");
        Skip_SB(                                                "overlap");
        Skip_SB(                                                "syncmarker");
        Skip_SB(                                                "rangered");
        Skip_S1( 2,                                             "maxbframes");
        Skip_S1( 2,                                             "quantizer");
        Skip_SB(                                                "finterpflag");
        Skip_SB(                                                "res_rtm_flag");
    }
    else if (profile==3) //Advanced
    {
        Get_S1 ( 3, level,                                      "level");
        Get_S1 ( 2, colordiff_format,                           "colordiff_format"); Param_Info(Vc1_ColorimetryFormat[colordiff_format]);
        Skip_S1( 3,                                             "frmrtq_postproc");
        Skip_S1( 5,                                             "bitrtq_postproc");
        Skip_SB(                                                "postprocflag");
        Get_S2 (12, coded_width,                                "max_coded_width"); Param_Info((coded_width+1)*2, " pixels");
        Get_S2 (12, coded_height,                               "max_coded_height"); Param_Info((coded_height+1)*2, " pixels");
        Get_SB (    pulldown,                                   "pulldown");
        Get_SB (    interlace,                                  "interlace");
        Get_SB (    tfcntrflag,                                 "tfcntrflag - frame counter");
        Get_SB (    finterpflag,                                "finterpflag");
        Skip_SB(                                                "reserved");
        Get_SB (    psf,                                        "psf - progressive segmented frame");
        TEST_SB_SKIP(                                           "display_ext");
            Info_S2(14, display_x,                              "display_horiz_size"); Param_Info(display_x+1, " pixels");
            Info_S2(14, display_y,                              "display_vert_size"); Param_Info(display_y+1, " pixels");
            TEST_SB_SKIP(                                       "aspectratio_flag");
                Get_S1 ( 4, AspectRatio,                        "aspect_ratio"); Param_Info(Vc1_PixelAspectRatio[AspectRatio]);
                if (AspectRatio==0x0F)
                {
                    Get_S1 ( 8, AspectRatioX,                   "aspect_horiz_size");
                    Get_S1 ( 8, AspectRatioY,                   "aspect_vert_size");
                }
            TEST_SB_END();
            TEST_SB_GET(framerate_present,                      "framerate_flag");
                TESTELSE_SB_GET(framerate_form,                 "framerateind");
                    Get_S2 (16, framerateexp,                   "framerateexp"); Param_Info((float32)((framerateexp+1)/32.0), 3, " fps");
                TESTELSE_SB_ELSE(                               "framerateind");
                    Get_S1 ( 8, frameratecode_enr,              "frameratenr"); Param_Info(Vc1_FrameRate_enr(frameratecode_enr));
                    Get_S1 ( 4, frameratecode_dr,               "frameratedr"); Param_Info(Vc1_FrameRate_dr(frameratecode_dr));
                TESTELSE_SB_END();
            TEST_SB_END();
            TEST_SB_SKIP(                                       "color_format_flag");
                Skip_S1( 8,                                     "color_prim");
                Skip_S1( 8,                                     "transfer_char");
                Skip_S1( 8,                                     "matrix_coef");
            TEST_SB_END();
        TEST_SB_END();
        TEST_SB_GET (hrd_param_flag,                            "hrd_param_flag");
            Get_S1 ( 5, hrd_num_leaky_buckets,                  "hrd_num_leaky_buckets");
            Skip_S1( 4,                                         "bitrate_exponent");
            Skip_S1( 4,                                         "buffer_size_exponent");
            for (int8u Pos=0; Pos<hrd_num_leaky_buckets; Pos++)
            {
                Element_Begin("leaky_bucket");
                Skip_S2(16,                                     "hrd_rate");
                Skip_S2(16,                                     "hrd_buffer");
                Element_End();
            }
        TEST_SB_END();
    }
    else //forbidden
    {
        Element_DoNotTrust("Forbidden value");
    }
    Mark_1();
    BS_End();

    FILLING_BEGIN();
        //NextCode
        NextCode_Clear();
        NextCode_Add(0x0D);
        NextCode_Add(0x0E);

        //Autorisation of other streams
        Streams[0x0D].Searching_Payload=true;
        Streams[0x0E].Searching_Payload=true;

    if (From_WMV3)
        FrameHeader_Fill();
    FILLING_END();
}
Ejemplo n.º 12
0
//---------------------------------------------------------------------------
void File_AfdBarData::bar_data()
{
    //Parsing
    Element_Begin1("bar_data");
    bool   top_bar_flag, bottom_bar_flag, left_bar_flag, right_bar_flag;
    BS_Begin();
    Get_SB (top_bar_flag,                                       "top_bar_flag");
    Get_SB (bottom_bar_flag,                                    "bottom_bar_flag");
    Get_SB (left_bar_flag,                                      "left_bar_flag");
    Get_SB (right_bar_flag,                                     "right_bar_flag");
    if (Format==Format_S2016_3)
    {
        Mark_0_NoTrustError();
        Mark_0_NoTrustError();
        Mark_0_NoTrustError();
        Mark_0_NoTrustError();
    }
    else
    {
        Mark_1_NoTrustError();
        Mark_1_NoTrustError();
        Mark_1_NoTrustError();
        Mark_1_NoTrustError();
    }
    if (top_bar_flag)
    {
        Mark_1();
        Mark_1();
        Get_S2 (14, line_number_end_of_top_bar,                 "line_number_end_of_top_bar");
    }
    if (bottom_bar_flag)
    {
        Mark_1();
        Mark_1();
        Get_S2 (14, line_number_start_of_bottom_bar,            "line_number_start_of_bottom_bar");
    }
    if (left_bar_flag)
    {
        Mark_1();
        Mark_1();
        Get_S2 (14, pixel_number_end_of_left_bar,               "pixel_number_end_of_left_bar");
    }
    if (right_bar_flag)
    {
        Mark_1();
        Mark_1();
        Get_S2 (14, pixel_number_start_of_right_bar,            "pixel_number_start_of_right_bar");
    }
    if (!top_bar_flag && !bottom_bar_flag && !left_bar_flag && !right_bar_flag)
    {
        Mark_1_NoTrustError();
        Mark_1_NoTrustError();
        Skip_S2(14,                                             "reserved");
        Mark_1_NoTrustError();
        Mark_1_NoTrustError();
        Skip_S2(14,                                             "reserved");
    }
    BS_End();
    Element_End0();

    if (Format==Format_A53_4_DTG1)
    {
        BS_Begin();
        Mark_1();
        Mark_1();
        Mark_1();
        Mark_1();
        Mark_1();
        Mark_1();
        Mark_1();
        Mark_1();
        BS_End();

        if (Element_Size-Element_Offset)
            Skip_XX(Element_Size-Element_Offset,                "additional_bar_data");
    }
}