本文整理汇总了C++中Skip_XX函数的典型用法代码示例。如果您正苦于以下问题:C++ Skip_XX函数的具体用法?C++ Skip_XX怎么用?C++ Skip_XX使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Skip_XX函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Element_Name
//---------------------------------------------------------------------------
// Packet "B3" or "B6"
void File_AvsV::picture_start()
{
//Counting
if (File_Offset+Buffer_Offset+Element_Size==File_Size)
Frame_Count_Valid=Frame_Count; //Finalize frames in case of there are less than Frame_Count_Valid frames
Frame_Count++;
//Name
Element_Name("picture_start");
Element_Info1(Ztring::ToZtring(Frame_Count));
Element_Info1C((Element_Code==0xB3), __T("I"));
//Parsing
int8u picture_coding_type=(int8u)-1;
bool time_code_flag, progressive_frame, picture_structure=true, top_field_first, repeat_first_field, skip_mode_flag=false, loop_filter_disable;
Skip_B2( "bbv_delay");
BS_Begin();
if (Element_Code==0xB3) //Only I
{
Get_SB ( time_code_flag, "time_code_flag");
if (time_code_flag)
{
Skip_SB( "time_code_dropframe");
Skip_S1(5, "time_code_hours");
Skip_S1(6, "time_code_minutes");
Skip_S1(6, "time_code_seconds");
Skip_S1(6, "time_code_pictures");
}
}
if (Element_Code==0xB6) //Only P or B
{
Get_S1 ( 2, picture_coding_type, "picture_coding_type"); Element_Info1(AvsV_picture_coding_type[picture_coding_type]);
}
Skip_S1( 8, "picture_distance");
if (low_delay)
Skip_UE( "bbv_check_times");
Get_SB ( progressive_frame, "progressive_frame");
if (!progressive_frame)
{
Get_SB( picture_structure, "picture_structure");
if (Element_Code==0xB6) //Only P or B
{
if (picture_structure)
Skip_SB( "advanced_pred_mode_disable");
}
}
Get_SB ( top_field_first, "top_field_first");
Get_SB ( repeat_first_field, "repeat_first_field");
Skip_SB( "fixed_picture_qp");
Skip_S1( 6, "picture_qp");
if (Element_Code==0xB3) //Only I
{
if (!progressive_frame && !picture_structure)
Get_SB( skip_mode_flag, "skip_mode_flag");
}
if (Element_Code==0xB6) //Only P or B
{
if (picture_coding_type!=2 || !picture_structure)
Skip_SB( "picture_reference_flag");
}
Skip_SB( "reserved");
Skip_SB( "reserved");
Skip_SB( "reserved");
Skip_SB( "reserved");
if (Element_Code==0xB6) //Only P or B
{
Get_SB( skip_mode_flag, "skip_mode_flag");
}
Get_SB ( loop_filter_disable, "loop_filter_disable");
if (!loop_filter_disable)
{
bool loop_filter_parameter_flag;
Get_SB ( loop_filter_parameter_flag, "loop_filter_parameter_flag");
if (loop_filter_parameter_flag)
{
Skip_SE( "alpha_c_offset");
Skip_SE( "beta_offset");
}
}
BS_End();
if (Element_Size-Element_Offset)
Skip_XX(Element_Size-Element_Offset, "Unknown");
FILLING_BEGIN();
if (progressive_frame==false)
{
if (picture_structure==true) //Frame
{
if (top_field_first)
Interlaced_Top++;
else
Interlaced_Bottom++;
}
}
else
progressive_frame_Count++;
//.........这里部分代码省略.........
示例2: Skip_L4
//---------------------------------------------------------------------------
void File_Flic::FileHeader_Parse()
{
//Parsing
int32u DelayBetweenFrames;
int16u Type, Frames, Width, Height, BitsPerPixel, AspectX=0, AspectY=0;
Skip_L4( "Size of FLIC including this header");
Get_L2 (Type, "File type");
Get_L2 (Frames, "Number of frames in first segment");
Get_L2 (Width, "Width");
Get_L2 (Height, "Height");
Get_L2 (BitsPerPixel, "Bits per pixel");
Skip_L2( "Flags");
Get_L4 (DelayBetweenFrames, "Delay between frames");
if (Type!=0xAF11)
{
Skip_L2( "Reserved");
Skip_L4( "Date of Creation)");
Skip_L4( "Serial number or compiler id");
Skip_L4( "Date of FLIC update");
Skip_L4( "Serial number");
Get_L2 (AspectX, "Width of square rectangle");
Get_L2 (AspectY, "Height of square rectangle");
}
else
Skip_XX(22, "Reserved");
Skip_L2( "EGI: flags for specific EGI extensions");
Skip_L2( "EGI: key-image frequency");
Skip_L2( "EGI: total number of frames (segments)");
Skip_L4( "EGI: maximum chunk size (uncompressed)");
Skip_L2( "EGI: max. number of regions in a CHK_REGION chunk");
Skip_L2( "EGI: number of transparent levels");
if (Type!=0xAF11)
{
Skip_XX(24, "Reserved");
Skip_L4( "Offset to frame 1");
Skip_L4( "Offset to frame 2");
Skip_XX(40, "Reserved");
}
else
Skip_XX(72, "Reserved");
//Filling
FILLING_BEGIN();
switch (Type)
{
case 0xAF11 :
case 0xAF12 :
case 0xAF30 :
case 0xAF31 :
case 0xAF44 :
break;
default :
Reject("FLIC");
return;
}
//Filling
Accept("FLIC");
Fill(Stream_General, 0, General_Format, "FLIC");
Stream_Prepare(Stream_Video);
if (Type==0xAF11)
{
Fill(Stream_Video, 0, Video_Format, "FLI");
Fill(Stream_Video, 0, Video_Codec, "FLI");
if (DelayBetweenFrames)
{
Fill(Stream_Video, StreamPos_Last, Video_FrameRate, 1000.0/(DelayBetweenFrames*70)); //multiple of 1/70 per frame
Fill(Stream_Video, 0, Video_Duration, Frames*DelayBetweenFrames*70);
}
}
else
{
Fill(Stream_Video, 0, Video_Format, "FLC");
Fill(Stream_Video, 0, Video_Codec, "FLC");
if (DelayBetweenFrames)
{
Fill(Stream_Video, StreamPos_Last, Video_FrameRate, 1000.0/DelayBetweenFrames); //ms per frame
Fill(Stream_Video, 0, Video_Duration, Frames*DelayBetweenFrames);
}
if (AspectY>0)
Fill(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio, AspectX/AspectY, 3, true);
}
Fill(Stream_Video, 0, Video_FrameCount, Frames);
Fill(Stream_Video, StreamPos_Last, Video_Width, Width);
Fill(Stream_Video, StreamPos_Last, Video_Height, Height);
Fill(Stream_Video, 0, Video_BitDepth, (BitsPerPixel%3)?BitsPerPixel:(BitsPerPixel/3), 10, true); //If not a multiple of 3, the total resolution is filled
//No more need data
Finish("FLIC");
FILLING_END();
}
示例3: Skip_B1
//---------------------------------------------------------------------------
void File_Jpeg::QCD()
{
//Parsing
Skip_B1( "Sqcd - Style");
Skip_XX(Element_Size-Element_Offset, "QCD data");
}
示例4: Element_Name
//---------------------------------------------------------------------------
void File_Dirac::Reserved()
{
Element_Name("Reserved");
Skip_XX(Element_Size, "Unknown");
}
示例5: Element_Name
//---------------------------------------------------------------------------
void File_DvbSubtitle::reserved_for_future_use()
{
Element_Name("reserved for future use");
Skip_XX(Element_Size, "Data");
}
示例6: Get_Local
//---------------------------------------------------------------------------
void File_ScreamTracker3::Read_Buffer_Continue()
{
//Parsing
Ztring SongName;
int16u OrdNum, InsNum, PatNum, Flags, Special;
int8u SoftwareVersionMajor, SoftwareVersionMinor, IS, TS;
Get_Local(28, SongName, "Song name");
Skip_L1( "0x1A");
Skip_L1( "Type");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Get_L2 (OrdNum, "Orders count");
Get_L2 (InsNum, "Instruments count");
Get_L2 (PatNum, "Paterns count");
Get_L2 (Flags, "Flags");
Skip_Flags(Flags, 0, "st2vibrato");
Skip_Flags(Flags, 1, "st2tempo");
Skip_Flags(Flags, 2, "amigaslides");
Skip_Flags(Flags, 3, "0vol optimizations");
Skip_Flags(Flags, 4, "amiga limits");
Skip_Flags(Flags, 5, "enable filter/sfx with sb");
Skip_Flags(Flags, 6, "st3.00 volumeslides");
Skip_Flags(Flags, 7, "pecial custom data in file");
Get_L1 (SoftwareVersionMajor, "Cwt/v (Major)");
Get_L1 (SoftwareVersionMinor, "Cwt/v (Minor)");
Skip_L2( "File format information");
Skip_B4( "Signature");
Skip_L1( "global volume");
Get_L1 (IS, "Initial Speed");
Get_L1 (TS, "Initial Temp");
Skip_L1( "master volume");
Skip_L1( "ultra click removal");
Skip_L1( "Default channel pan positions are present");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Get_L2 (Special, "Special");
Skip_XX(32, "Channel settings");
Skip_XX(OrdNum, "Orders");
Skip_XX(InsNum*2, "Instruments");
Skip_XX(PatNum*2, "Patterns");
FILLING_BEGIN();
Accept("Scream Tracker 3");
Fill(Stream_General, 0, General_Format, "Scream Tracker 3");
Fill(Stream_General, 0, General_Track, SongName);
if ((SoftwareVersionMajor&0xF0)==0x10)
Fill(Stream_General, 0, General_Encoded_Application, Ztring(__T("Scream Tracker ")+Ztring::ToZtring(SoftwareVersionMajor)+__T(".")+Ztring::ToZtring(SoftwareVersionMinor/16)+Ztring::ToZtring(SoftwareVersionMinor%16)));
Fill(Stream_General, 0, "BPM", TS);
Stream_Prepare(Stream_Audio);
Finish("Scream Tracker 3");
FILLING_END();
}
示例7: Skip_C4
//---------------------------------------------------------------------------
void File_Ivf::FileHeader_Parse()
{
//Parsing
int32u frame_rate_num, frame_rate_den, frame_count, fourcc;
int16u version, header_size, width, height;
Skip_C4 ( "Signature");
Get_L2 (version, "Version");
if (version==0)
{
Get_L2 (header_size, "Header Size");
if (header_size>=32)
{
Get_C4 (fourcc, "Fourcc");
Get_L2 (width, "Width");
Get_L2 (height, "Height");
Get_L4 (frame_rate_num, "FrameRate Numerator");
Get_L4 (frame_rate_den, "FrameRate Denominator");
Get_L4 (frame_count, "Frame Count");
Skip_L4( "Unused");
if (header_size-32)
Skip_XX(header_size-32, "Unknown");
}
else
{
fourcc=0x00000000;
width=0;
height=0;
frame_rate_num=0;
frame_rate_den=0;
frame_count=0;
}
}
else
{
header_size=0;
fourcc=0x00000000;
width=0;
height=0;
frame_rate_num=0;
frame_rate_den=0;
frame_count=0;
}
FILLING_BEGIN();
Accept("IVF");
Fill(Stream_General, 0, General_Format, "IVF");
if (version==0 && header_size>=32)
{
Stream_Prepare(Stream_Video);
CodecID_Fill(Ztring().From_CC4(fourcc), Stream_Video, 0, InfoCodecID_Format_Riff);
Fill(Stream_Video, 0, Video_FrameRate, (float)frame_rate_num / frame_rate_den);
Fill(Stream_Video, 0, Video_FrameCount, frame_count);
Fill(Stream_Video, 0, Video_Width, width);
Fill(Stream_Video, 0, Video_Height, height);
Fill(Stream_Video, 0, Video_StreamSize, File_Size-header_size-12*frame_count); //Overhead is 12 byte per frame
}
//No more need data
Finish("IVF");
FILLING_END();
}
示例8: Element_Name
//.........这里部分代码省略.........
if (tfcntrflag)
{
Skip_S1( 8, "tfcntr - frame counter");
}
}
if (interlace && !psf)
{
bool tff=true, rff=false;
if (pulldown)
{
Get_SB (tff, "tff - top field first");
Get_SB (rff, "rff - repeat first field");
if (tff)
Interlaced_Top++;
else
Interlaced_Bottom++;
if (TemporalReference.size()<30)
{
if (ptype!=2 && ptype!=3 //if not B and BI-frame
&& !TemporalReference_Waiting.empty()) //We must have 2 I or P pictures to be sure not having B picture later
{
//We have 2 I or P pictures
for (size_t Pos=1; Pos<TemporalReference_Waiting.size(); Pos++) //All B frames (not the first frame, which is I or P)
{
TemporalReference_Offset++;
TemporalReference[TemporalReference_Offset]=TemporalReference_Waiting[Pos];
}
TemporalReference_Offset++;
TemporalReference[TemporalReference_Offset]=TemporalReference_Waiting[0];
TemporalReference_Waiting.clear();
}
//We must wait for having another I or P picture
temporalreference Temp;
Temp.top_field_first=tff;
Temp.repeat_first_field=rff;
TemporalReference_Waiting.push_back(Temp);
}
}
}
else
{
int8u rptfrm=0;
if (pulldown)
{
Get_S1 ( 2, rptfrm, "rptfrm - repeate frame");
}
}
/*
if (panscan_flag)
{
//TODO
}
if (ptype!=4) //!=Skipping
{
bool rndctrl;
Get_SB( rndctrl, "rndctrl - rounding control");
if (rndctrl && (ptype==0 || ptype==3)) //I or BI type
Trusted_IsNot("Should not be true!");
if (interlace)
Skip_SB( "uvsamp - uv sampling mode");
if (finterpflag && PictureFormat==0) //Progressive frame
Skip_SB( "interrpfrm");
if (PictureFormat!=1) //!=Interlaced frame
{
if (ptype==2 //Type B
|| (ptype==3 && PictureFormat==2)) //Type BI and Interlaced field
Skip_VL(Vc1_bfraction, "bfraction");
}
}
*/
}
BS_End();
if (Element_Size-Element_Offset)
Skip_XX(Element_Size-Element_Offset, "Data");
FILLING_BEGIN();
//NextCode
NextCode_Test();
NextCode_Clear();
NextCode_Add(0x0D);
NextCode_Add(0x0F);
//Filling only if not already done
if (!IsFilled && Frame_Count>=Frame_Count_Valid)
FrameHeader_Fill();
//Autorisation of other streams
Streams[0x0D].Searching_Payload=true;
Streams[0x0F].Searching_Payload=true;
FILLING_END();
}
示例9: Element_Begin1
//---------------------------------------------------------------------------
void File_ProRes::Read_Buffer_Continue()
{
//Parsing
int32u Name, creatorID;
int16u hdrSize, version, frameWidth, frameHeight;
int8u chrominance_factor, frame_type, primaries, transf_func, colorMatrix, alpha_info;
bool IsOk=true, luma, chroma;
Element_Begin1("Header");
Skip_B4( "Size");
Get_C4 (Name, "Name");
Element_End();
Element_Begin1("Frame header");
Get_B2 (hdrSize, "hdrSize");
Get_B2 (version, "version");
Get_C4 (creatorID, "creatorID");
Get_B2 (frameWidth, "frameWidth");
Get_B2 (frameHeight, "frameHeight");
BS_Begin();
Get_S1 (2, chrominance_factor, "chrominance factor"); Param_Info1(ProRes_chrominance_factor(chrominance_factor));
Skip_S1(2, "reserved");
Get_S1 (2, frame_type, "frame type"); Param_Info1(ProRes_frame_type_ScanType(frame_type)); Param_Info1(ProRes_frame_type_ScanOrder(frame_type));
Skip_S1(2, "reserved");
BS_End();
Skip_B1( "reserved");
Get_B1 (primaries, "primaries"); Param_Info1(Mpegv_colour_primaries(primaries));
Get_B1 (transf_func, "transf_func"); Param_Info1(Mpegv_transfer_characteristics(transf_func));
Get_B1 (colorMatrix, "colorMatrix"); Param_Info1(Mpegv_matrix_coefficients(colorMatrix));
BS_Begin();
Skip_S1(4, "src_pix_fmt");
Get_S1 (4, alpha_info, "alpha_info");
BS_End();
Skip_B1( "reserved");
BS_Begin();
Skip_S1(6, "reserved");
Get_SB (luma, "custom luma quant matrix present");
Get_SB (chroma, "custom chroma quant matrix present");
BS_End();
if (luma)
Skip_XX(64, "QMatLuma");
if (chroma)
Skip_XX(64, "QMatChroma");
Element_End();
if (Name==0x69637066 && Element_Offset!=8+(int32u)hdrSize) // Coherency test icpf
IsOk=false;
if (Name==0x69637066) // icpf
{
for (int8u PictureNumber=0; PictureNumber<(frame_type?2:1); PictureNumber++)
{
Element_Begin1("Picture layout");
int16u total_slices;
vector<int16u> slices_size;
Element_Begin1("Picture header");
int64u pic_hdr_End, pic_data_End;
int32u pic_data_size;
int8u pic_hdr_size;
Get_B1 (pic_hdr_size, "pic_hdr_size");
if (pic_hdr_size<64)
{
Trusted_IsNot("pic_hdr_size");
Element_End();
Element_End();
return;
}
pic_hdr_End=Element_Offset+pic_hdr_size/8-((pic_hdr_size%8)?0:1);
Get_B4 (pic_data_size, "pic_data_size");
if (pic_data_size<8)
{
Trusted_IsNot("pic_data_size");
Element_End();
Element_End();
return;
}
pic_data_End=Element_Offset+pic_data_size-5;
Get_B2 (total_slices, "total_slices");
BS_Begin();
Skip_S1(4, "slice_width_factor");
Skip_S1(4, "slice_height_factor");
BS_End();
if (Element_Offset<pic_hdr_End)
Skip_XX(pic_hdr_End-Element_Offset, "Unknown");
Element_End();
Element_Begin1("Slice index table");
for (int16u Pos=0; Pos<total_slices; Pos++)
{
int16u slice_size;
Get_B2 (slice_size, "slice_size");
slices_size.push_back(slice_size);
}
Element_End();
for (int16u Pos=0; Pos<slices_size.size(); Pos++)
{
Skip_XX(slices_size[Pos], "slice data");
}
if (Element_Offset<pic_data_End)
Skip_XX(pic_data_End-Element_Offset, "Unknown");
Element_End();
}
}
bool IsZeroes=true;
//.........这里部分代码省略.........
示例10: Skip_XX
//---------------------------------------------------------------------------
void File_Unknown::Read_Buffer_Continue()
{
Skip_XX(Element_Size, "Unknown");
}
示例11: Skip_B4
//---------------------------------------------------------------------------
void File_ImpulseTracker::Read_Buffer_Continue()
{
//Parsing
Ztring SongName;
int16u OrdNum, InsNum, SmpNum, PatNum, Flags, Special;
int8u VersionMajor, VersionMinor, SoftwareVersionMajor, SoftwareVersionMinor, IS, TS;
bool Stereo;
Skip_B4( "Signature");
Get_Local(26, SongName, "Song name");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Get_L2 (OrdNum, "Orders count");
Get_L2 (InsNum, "Instruments count");
Get_L2 (SmpNum, "Samples count");
Get_L2 (PatNum, "Paterns count");
Get_L1 (SoftwareVersionMinor, "Cwt/v (Minor)");
Get_L1 (SoftwareVersionMajor, "Cwt/v (Major)");
Get_L1 (VersionMinor, "Cwt (Minor)");
Get_L1 (VersionMajor, "Cwt (Major)");
Get_L2 (Flags, "Flags");
Get_Flags (Flags, 0, Stereo, "Stereo");
Skip_Flags(Flags, 1, "Vol0MixOptimizations");
Skip_Flags(Flags, 2, "Use instruments/Samples");
Skip_Flags(Flags, 3, "Linear/Amiga slides");
Skip_Flags(Flags, 4, "Old/IT Effects");
Get_L2 (Special, "Special");
Skip_Flags(Special, 0, "Song Message attached");
Skip_L1( "Global volume");
Skip_L1( "Mix volume");
Get_L1 (IS, "Initial Speed");
Get_L1 (TS, "Initial Temp");
Skip_L1( "Panning separation between channels");
Skip_L1( "0");
Skip_L2( "Message Length");
Skip_L4( "Message Offset");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_L1( "Unknown");
Skip_XX(64, "Chnl Pan");
Skip_XX(64, "Chnl Vol");
Skip_XX(OrdNum, "Orders");
Skip_XX(InsNum*4, "Instruments");
Skip_XX(SmpNum*4, "Samples");
Skip_XX(PatNum*4, "Patterns");
FILLING_BEGIN();
Stream_Prepare(Stream_General);
Fill(Stream_General, 0, General_Format, "Impulse Tracker");
Fill(Stream_General, 0, General_Format_Version, Ztring(_T("Version "))+Ztring::ToZtring(VersionMajor)+_T(".")+Ztring::ToZtring(VersionMinor/16)+Ztring::ToZtring(VersionMinor%16));
Fill(Stream_General, 0, General_Track, SongName);
Fill(Stream_General, 0, General_Encoded_Application, Ztring(_T("Impulse Tracker ")+Ztring::ToZtring(SoftwareVersionMajor)+_T(".")+Ztring::ToZtring(SoftwareVersionMinor/16)+Ztring::ToZtring(SoftwareVersionMinor%16)));
Fill(Stream_General, 0, "BPM", TS);
Stream_Prepare(Stream_Audio);
Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Stereo?2:1);
Accept("Impulse Tracker");
Finish("Impulse Tracker");
FILLING_END();
}
示例12: Reject
//.........这里部分代码省略.........
if (4*Names_Count>Element_Size)
{
Element_End();
Reject();
return;
}
for (int16u Pos=0; Pos<Names_Count; Pos++)
{
Element_Begin1("Name");
Get_L4 (Name_Length, "Name length");
if (Name_Length)
{
Info_UTF8(Name_Length, Name, "Name"); Element_Name(Name);
}
Element_End();
}
Element_End();
Skip_L4( "0x00000000");
Skip_L4( "0x0000002A [1]");
Skip_L4( "Unknown [9]");
Skip_L4( "Unknown [10]");
Skip_L4( "0x00000000");
Skip_L1( "0x00 or 0x01 [2]");
Skip_L1( "0x01");
Skip_L1( "0x00 or 0x01 or 0x02");
Skip_L1( "0x00 [2]");
Skip_L1( "0x01");
Skip_L1( "0x00 (once) or 0x01");
Skip_L1( "0x00 or 0x01 (once)");
Skip_L1( "0x00 or 0x01 (once) or 0x5A");
if (Opaque1_Length<6)
{
if (Opaque1_Length)
Skip_XX(Opaque1_Length, "Opaque1");
}
else
{
Skip_L4( "Opaque1 - Unknown [1]");
Skip_L2( "Opaque1 - Unknown [2]");
if (Opaque1_Length<8)
{
if (Opaque1_Length-6)
Skip_XX(Opaque1_Length-6, "Opaque1 - Unknown [3]");
}
else
{
Skip_L2( "Opaque1 - 0x0000");
if (Opaque1_Length>8)
Skip_XX(Opaque1_Length-8, "Opaque1 - Unknown [3]");
}
}
Skip_L2( "0x2519");
Skip_L2( "0x0001");
Skip_L4( "0x00000000 or B5112287");
Skip_L4( "0x00000000 or 4037F9DC");
Skip_L4( "0x00000001 [1]");
Skip_L2( "0x0003");
Element_End();
Get_L4 (Audio_Count, "Audio count");
if (111*Audio_Count>Element_Size)
{
Reject();
return;
}
Element_Begin1("Audio tracks list 1");
for (int16u Pos=0; Pos<Audio_Count; Pos++)
示例13: Open_Buffer_Continue
//---------------------------------------------------------------------------
void File_ChannelGrouping::Read_Buffer_Continue()
{
//Handling of multiple frames in one block
if (Buffer_Size-Buffer_Offset_AlreadyInCommon==0)
{
if (Common->Parser && Common->Parser->Buffer_Size)
Open_Buffer_Continue(Common->Parser, Common->MergedChannel.Buffer+Common->MergedChannel.Buffer_Offset, 0);
Element_WaitForMoreData();
return;
}
//If basic PCM is already detected
if (Common->IsPcm)
{
if (Buffer_Size==Buffer_Offset_AlreadyInCommon)
{
Element_WaitForMoreData();
return;
}
Buffer_Offset_AlreadyInCommon=0;
#if MEDIAINFO_DEMUX
Demux_Level=2; //Container
Demux_Offset=Buffer_Size;
FrameInfo.PTS=FrameInfo.DTS;
if (IsPcm_Frame_Count)
FrameInfo.DUR*=IsPcm_Frame_Count+1;
Demux_UnpacketizeContainer_Demux();
#endif //MEDIAINFO_DEMUX
Skip_XX(Element_Size, "Data");
if (IsPcm_Frame_Count)
{
Frame_Count+=IsPcm_Frame_Count;
IsPcm_Frame_Count=0;
}
Frame_Count++;
if (!Status[IsFilled])
{
Finish();
}
return;
}
else if (Buffer_Size && Buffer_Size>Buffer_Offset_AlreadyInCommon && !Common->IsAes3)
IsPcm_Frame_Count++;
//Demux
#if MEDIAINFO_DEMUX
if (Demux_UnpacketizeContainer)
{
Common->Parser->Demux_UnpacketizeContainer=true;
Common->Parser->Demux_Level=2; //Container
Demux_Level=4; //Intermediate
}
Demux(Common->MergedChannel.Buffer+Common->MergedChannel.Buffer_Offset, Common->MergedChannel.Buffer_Size-Common->MergedChannel.Buffer_Offset, ContentType_MainStream);
#endif //MEDIAINFO_EVENTS
//Copying to Channel buffer
if (Common->Channels[Channel_Pos]->Buffer_Size+Buffer_Size-Buffer_Offset_AlreadyInCommon>Common->Channels[Channel_Pos]->Buffer_Size_Max)
Common->Channels[Channel_Pos]->resize(Common->Channels[Channel_Pos]->Buffer_Size+Buffer_Size-Buffer_Offset_AlreadyInCommon);
memcpy(Common->Channels[Channel_Pos]->Buffer+Common->Channels[Channel_Pos]->Buffer_Size, Buffer+Buffer_Offset_AlreadyInCommon, Buffer_Size-Buffer_Offset_AlreadyInCommon);
Common->Channels[Channel_Pos]->Buffer_Size+=Buffer_Size-Buffer_Offset_AlreadyInCommon;
if (!Common->IsAes3)
Buffer_Offset_AlreadyInCommon=Buffer_Size;
else
Buffer_Offset_AlreadyInCommon=0;
Common->Channel_Current++;
if (Common->Channel_Current>=Channel_Total)
Common->Channel_Current=0;
//Copying to merged channel
size_t Minimum=(size_t)-1;
for (size_t Pos=0; Pos<Common->Channels.size(); Pos++)
if (Minimum>Common->Channels[Pos]->Buffer_Size-Common->Channels[Pos]->Buffer_Offset)
Minimum=Common->Channels[Pos]->Buffer_Size-Common->Channels[Pos]->Buffer_Offset;
while (Minimum>=ByteDepth)
{
for (size_t Pos=0; Pos<Common->Channels.size(); Pos++)
{
if (Common->MergedChannel.Buffer_Size+Minimum>Common->MergedChannel.Buffer_Size_Max)
Common->MergedChannel.resize(Common->MergedChannel.Buffer_Size+Minimum);
memcpy(Common->MergedChannel.Buffer+Common->MergedChannel.Buffer_Size, Common->Channels[Pos]->Buffer+Common->Channels[Pos]->Buffer_Offset, ByteDepth);
Common->Channels[Pos]->Buffer_Offset+=ByteDepth;
Common->MergedChannel.Buffer_Size+=ByteDepth;
}
Minimum-=ByteDepth;
}
if (Common->MergedChannel.Buffer_Size-Common->MergedChannel.Buffer_Offset)
{
if (FrameInfo_Next.DTS!=(int64u)-1)
Common->Parser->FrameInfo=FrameInfo_Next; //AES3 parse has its own buffer management
else
Common->Parser->FrameInfo=FrameInfo;
Open_Buffer_Continue(Common->Parser, Common->MergedChannel.Buffer+Common->MergedChannel.Buffer_Offset, Common->MergedChannel.Buffer_Size-Common->MergedChannel.Buffer_Offset);
Common->MergedChannel.Buffer_Offset=Common->MergedChannel.Buffer_Size;
//.........这里部分代码省略.........
示例14: Open_Buffer_Init
//---------------------------------------------------------------------------
void File_Ogg::Data_Parse()
{
//Counting
Frame_Count++;
//If first chunk of a stream
stream& Stream_Item=Stream[Element_Code]; //[+] FlylinkDC++ Team
if (Stream_Item.Parser==NULL)
{
if (Parsing_End)
return; //Maybe multitracks concatained, not supported
Stream_Item.Parser=new File_Ogg_SubElement;
Open_Buffer_Init(Stream_Item.Parser);
((File_Ogg_SubElement*)Stream_Item.Parser)->InAnotherContainer=IsSub;
StreamsToDo++;
}
((File_Ogg_SubElement*)Stream_Item.Parser)->MultipleStreams=Stream.size()>1; //has no sens for the first init, must check allways
//Parsing
File_Ogg_SubElement* Parser=(File_Ogg_SubElement*)Stream_Item.Parser;
if (Stream_Item.SearchingPayload)
//For each chunk
for (size_t Chunk_Sizes_Pos=0; Chunk_Sizes_Pos<Chunk_Sizes.size(); Chunk_Sizes_Pos++)
{
//Info
if (!continued)
Peek_L1(packet_type); //Only for information
Element_Info1(Ztring::ToZtring(packet_type, 16));
Element_Info1C((continued), "Continue");
//Parsing
if (continued || Parser->File_Offset!=Parser->File_Size)
Open_Buffer_Continue(Parser, Buffer+Buffer_Offset+(size_t)Element_Offset, Chunk_Sizes[Chunk_Sizes_Pos]);
if (Chunk_Sizes_Pos<Chunk_Sizes.size()-1
|| (Chunk_Sizes_Pos==Chunk_Sizes.size()-1 && Chunk_Sizes_Finished))
{
Open_Buffer_Continue(Parser, Buffer+Buffer_Offset, 0); //Purge old datas
}
Element_Offset+=Chunk_Sizes[Chunk_Sizes_Pos];
continued=false; //If there is another chunk, this can not be a continued chunk
if (Parser->File_GoTo!=(int64u)-1)
Chunk_Sizes_Pos=Chunk_Sizes.size();
if (!Status[IsAccepted] && Parser->Status[IsAccepted])
Accept("OGG");
if (Parser->Status[IsFinished] || (Element_Offset==Element_Size && eos))
{
StreamsToDo--;
Stream_Item.SearchingPayload=false;
break;
}
}
else
Skip_XX(Element_Size, "Data");
//End of stream
if (!Parsing_End &&
(StreamsToDo==0 || File_Offset+Buffer_Offset+Element_Offset>256*1024))
{
if (IsSub)
Finish("OGG");
else
GoToFromEnd(256*1024, "OGG");
std::map<int64u, stream>::iterator Stream_Temp=Stream.begin();
if (File_GoTo!=(int64u)-1)
while (Stream_Temp!=Stream.end())
{
Stream_Temp->second.absolute_granule_position=0;
++Stream_Temp;
}
Parsing_End=true;
}
Element_Show();
}
示例15: CASE_INFO
//---------------------------------------------------------------------------
void File_Jpeg::Data_Parse()
{
#define CASE_INFO(_NAME, _DETAIL) \
case Elements::_NAME : Element_Info1(#_NAME); Element_Info1(_DETAIL); _NAME(); break;
//Parsing
if (SOS_SOD_Parsed)
{
Skip_XX(Element_Size, "Data");
SOS_SOD_Parsed=false;
return;
}
switch (Element_Code)
{
CASE_INFO(TEM , "TEM");
CASE_INFO(SOC , "Start of codestream"); //JPEG 2000
CASE_INFO(SIZ , "Image and tile size"); //JPEG 2000
CASE_INFO(COD , "Coding style default"); //JPEG 2000
CASE_INFO(COC , "Coding style component"); //JPEG 2000
CASE_INFO(TLM , "Tile-part lengths, main header"); //JPEG 2000
CASE_INFO(PLM , "Packet length, main header"); //JPEG 2000
CASE_INFO(PLT , "Packet length, tile-part header"); //JPEG 2000
CASE_INFO(QCD , "Quantization default"); //JPEG 2000
CASE_INFO(QCC , "Quantization component "); //JPEG 2000
CASE_INFO(RGN , "Region-of-interest"); //JPEG 2000
CASE_INFO(PPM , "Packed packet headers, main header"); //JPEG 2000
CASE_INFO(PPT , "Packed packet headers, tile-part header"); //JPEG 2000
CASE_INFO(CME , "Comment and extension"); //JPEG 2000
CASE_INFO(SOT , "Start of tile-part"); //JPEG 2000
CASE_INFO(SOP , "Start of packet"); //JPEG 2000
CASE_INFO(EPH , "End of packet header"); //JPEG 2000
CASE_INFO(SOD , "Start of data"); //JPEG 2000
CASE_INFO(S0F0, "Baseline DCT (Huffman)");
CASE_INFO(S0F1, "Extended sequential DCT (Huffman)");
CASE_INFO(S0F2, "Progressive DCT (Huffman)");
CASE_INFO(S0F3, "Lossless (sequential) (Huffman)");
CASE_INFO(DHT , "Define Huffman Tables");
CASE_INFO(S0F5, "Differential sequential DCT (Huffman)");
CASE_INFO(S0F6, "Differential progressive DCT (Huffman)");
CASE_INFO(S0F7, "Differential lossless (sequential) (Huffman)");
CASE_INFO(JPG , "Reserved for JPEG extensions");
CASE_INFO(S0F9, "Extended sequential DCT (Arithmetic)");
CASE_INFO(S0FA, "Progressive DCT (Arithmetic)");
CASE_INFO(S0FB, "Lossless (sequential) (Arithmetic)");
CASE_INFO(DAC , "Define Arithmetic Coding");
CASE_INFO(S0FD, "Differential sequential DCT (Arithmetic)");
CASE_INFO(S0FE, "Differential progressive DCT (Arithmetic)");
CASE_INFO(S0FF, "Differential lossless (sequential) (Arithmetic)");
CASE_INFO(RST0, "Restart Interval Termination 0");
CASE_INFO(RST1, "Restart Interval Termination 1");
CASE_INFO(RST2, "Restart Interval Termination 2");
CASE_INFO(RST3, "Restart Interval Termination 3");
CASE_INFO(RST4, "Restart Interval Termination 4");
CASE_INFO(RST5, "Restart Interval Termination 5");
CASE_INFO(RST6, "Restart Interval Termination 6");
CASE_INFO(RST7, "Restart Interval Termination 7");
CASE_INFO(SOI , "Start Of Image");
CASE_INFO(EOI , "End Of Image"); //Is EOC (End of codestream) in JPEG 2000
CASE_INFO(SOS , "Start Of Scan");
CASE_INFO(DQT , "Define Quantization Tables");
CASE_INFO(DNL , "Define Number of Lines");
CASE_INFO(DRI , "Define Restart Interval");
CASE_INFO(DHP , "Define Hierarchical Progression");
CASE_INFO(EXP , "Expand Reference Components");
CASE_INFO(APP0, "Application-specific marker 0");
CASE_INFO(APP1, "Application-specific marker 1");
CASE_INFO(APP2, "Application-specific marker 2");
CASE_INFO(APP3, "Application-specific marker 3");
CASE_INFO(APP4, "Application-specific marker 4");
CASE_INFO(APP5, "Application-specific marker 5");
CASE_INFO(APP6, "Application-specific marker 6");
CASE_INFO(APP7, "Application-specific marker 7");
CASE_INFO(APP8, "Application-specific marker 8");
CASE_INFO(APP9, "Application-specific marker 9");
CASE_INFO(APPA, "Application-specific marker 10");
CASE_INFO(APPB, "Application-specific marker 11");
CASE_INFO(APPC, "Application-specific marker 12");
CASE_INFO(APPD, "Application-specific marker 13");
CASE_INFO(APPE, "Application-specific marker 14");
CASE_INFO(APPF, "Application-specific marker 15");
CASE_INFO(JPG0, "JPG");
CASE_INFO(JPG1, "JPG");
CASE_INFO(JPG2, "JPG");
CASE_INFO(JPG3, "JPG");
CASE_INFO(JPG4, "JPG");
CASE_INFO(JPG5, "JPG");
CASE_INFO(JPG6, "JPG");
CASE_INFO(JPG7, "JPG");
CASE_INFO(JPG8, "JPG");
CASE_INFO(JPG9, "JPG");
CASE_INFO(JPGA, "JPG");
CASE_INFO(JPGB, "JPG");
CASE_INFO(JPGC, "JPG");
CASE_INFO(JPGD, "JPG");
CASE_INFO(COM , "Comment");
default : Element_Info1("Reserved");
Skip_XX(Element_Size, "Data");
}
}