当前位置: 首页>>代码示例>>C++>>正文


C++ CGolombBuffer::GetSize方法代码示例

本文整理汇总了C++中CGolombBuffer::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CGolombBuffer::GetSize方法的具体用法?C++ CGolombBuffer::GetSize怎么用?C++ CGolombBuffer::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGolombBuffer的用法示例。


在下文中一共展示了CGolombBuffer::GetSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

HRESULT CMpeg2DataParser::ParsePAT()
{
	HRESULT					hr;
	CComPtr<ISectionList>	pSectionList;
	DWORD					dwLength;
	PSECTION				data;
	WORD					wTSID;
	WORD					wSectionLength;

	CheckNoLog (m_pData->GetSection (PID_PAT, SI_PAT, &m_Filter, 5000, &pSectionList));
	CheckNoLog (pSectionList->GetSectionData (0, &dwLength, &data));

	CGolombBuffer	gb ((BYTE*)data, dwLength);

	// program_association_section()
	CheckNoLog (ParseSIHeader (gb, SI_PAT, wSectionLength, wTSID));
	while (gb.GetSize() - gb.GetPos() > 4) {
		WORD program_number = gb.BitRead(16);			// program_number
		gb.BitRead(3);									// reserved
		if (program_number==0) {
			gb.BitRead(13);    // network_PID
		} else {
			WORD program_map_PID = gb.BitRead(13);			// program_map_PID
			if (Channels.Lookup(program_number)) {
				Channels [program_number].SetPMT (program_map_PID);
				ParsePMT (Channels [program_number]);
			}
		}
	}

	return S_OK;
}
开发者ID:Samangan,项目名称:mpc-hc,代码行数:32,代码来源:Mpeg2SectionData.cpp

示例2: descriptor

HRESULT CMpeg2DataParser::ParseSDT(ULONG ulFreq)
{
	HRESULT					hr;
	CComPtr<ISectionList>	pSectionList;
	DWORD					dwLength;
	PSECTION				data;
	WORD					wTSID;
	WORD					wONID;
	WORD					wSectionLength;

	CheckNoLog (m_pData->GetSection (PID_SDT, SI_SDT, &m_Filter, 5000, &pSectionList));
	CheckNoLog (pSectionList->GetSectionData (0, &dwLength, &data));

	CGolombBuffer	gb ((BYTE*)data, dwLength);

	// service_description_section()
	CheckNoLog (ParseSIHeader (gb, SI_SDT, wSectionLength, wTSID));

	wONID = gb.BitRead(16);												// original_network_id
	gb.BitRead(8);														// reserved_future_use

	while (gb.GetSize() - gb.GetPos() > 4) {
		CDVBChannel			Channel;
		Channel.SetFrequency (ulFreq);
		Channel.SetTSID (wTSID);
		Channel.SetONID (wONID);
		Channel.SetSID  (gb.BitRead(16));								// service_id   uimsbf
		gb.BitRead(6);													// reserved_future_use   bslbf
		gb.BitRead(1);													// EIT_schedule_flag   bslbf
		Channel.SetNowNextFlag(!!gb.BitRead(1));						// EIT_present_following_flag   bslbf
		gb.BitRead(3);													// running_status   uimsbf
		Channel.SetEncrypted (!!gb.BitRead(1));							// free_CA_mode   bslbf

		// Descriptors:
		BeginEnumDescriptors(gb, nType, nLength) {
			switch (nType) {
				case DT_SERVICE :
					gb.BitRead(8);											// service_type
					nLength = gb.BitRead(8);								// service_provider_name_length
					gb.ReadBuffer (DescBuffer, nLength);					// service_provider_name

					nLength = gb.BitRead(8);								// service_name_length
					gb.ReadBuffer (DescBuffer, nLength);					// service_name
					DescBuffer[nLength] = 0;
					Channel.SetName (ConvertString (DescBuffer, nLength));
					TRACE ("%15S %d\n", Channel.GetName(), Channel.GetSID());
					break;
				default :
					SkipDescriptor (gb, nType, nLength);					// descriptor()
					break;
			}
		}
		EndEnumDescriptors


		if (!Channels.Lookup(Channel.GetSID())) {
			Channels [Channel.GetSID()] = Channel;
		}
	}

	return S_OK;
}
开发者ID:Samangan,项目名称:mpc-hc,代码行数:62,代码来源:Mpeg2SectionData.cpp

示例3: ParseAVCHeader


//.........这里部分代码省略.........
                h.sar.num = (WORD)gb.BitRead(16);	// sar_width
                h.sar.den = (WORD)gb.BitRead(16);	// sar_height
            } else if (aspect_ratio_idc < 17) {
                h.sar.num = pixel_aspect[aspect_ratio_idc][0];
                h.sar.den = pixel_aspect[aspect_ratio_idc][1];
            } else {
                return false;
            }
        } else {
            h.sar.num = 1;
            h.sar.den = 1;
        }

        if (gb.BitRead(1)) {				// overscan_info_present_flag
            gb.BitRead(1);					// overscan_appropriate_flag
        }

        if (gb.BitRead(1)) {				// video_signal_type_present_flag
            gb.BitRead(3);					// video_format
            gb.BitRead(1);					// video_full_range_flag
            if (gb.BitRead(1)) {			// colour_description_present_flag
                gb.BitRead(8);				// colour_primaries
                gb.BitRead(8);				// transfer_characteristics
                gb.BitRead(8);				// matrix_coefficients
            }
        }
        if (gb.BitRead(1)) {				// chroma_location_info_present_flag
            gb.UExpGolombRead();			// chroma_sample_loc_type_top_field
            gb.UExpGolombRead();			// chroma_sample_loc_type_bottom_field
        }
        if (gb.BitRead(1)) {				// timing_info_present_flag
            __int64 num_units_in_tick	= gb.BitRead(32);
            __int64 time_scale			= gb.BitRead(32);
            /*long fixed_frame_rate_flag	= */gb.BitRead(1);

            // Trick for weird parameters
            if ((num_units_in_tick < 1000) || (num_units_in_tick > 1001)) {
                if ((time_scale % num_units_in_tick != 0) && ((time_scale*1001) % num_units_in_tick == 0)) {
                    time_scale			= (time_scale * 1001) / num_units_in_tick;
                    num_units_in_tick	= 1001;
                } else {
                    time_scale			= (time_scale * 1000) / num_units_in_tick;
                    num_units_in_tick	= 1000;
                }
            }
            time_scale = time_scale / 2;	// VUI consider fields even for progressive stream : divide by 2!

            if (time_scale) {
                h.AvgTimePerFrame = (10000000I64*num_units_in_tick)/time_scale;
            }
        }

        if (fullscan) {
            bool nalflag = !!gb.BitRead(1);		// nal_hrd_parameters_present_flag
            if (nalflag) {
                if (HrdParameters(gb) < 0) {
                    return false;
                }
            }
            bool vlcflag = !!gb.BitRead(1);		// vlc_hrd_parameters_present_flag
            if (vlcflag) {
                if (HrdParameters(gb) < 0) {
                    return false;
                }
            }
            if (nalflag || vlcflag) {
                gb.BitRead(1);					// low_delay_hrd_flag
            }

            gb.BitRead(1);						// pic_struct_present_flag
            if (gb.BitRead(1)) {				// bitstream_restriction_flag
                gb.BitRead(1);					// motion_vectors_over_pic_boundaries_flag
                gb.UExpGolombRead();			// max_bytes_per_pic_denom
                gb.UExpGolombRead();			// max_bits_per_mb_denom
                gb.UExpGolombRead();			// log2_max_mv_length_horizontal
                gb.UExpGolombRead();			// log2_max_mv_length_vertical
                UINT64 num_reorder_frames = gb.UExpGolombRead(); // num_reorder_frames
                gb.UExpGolombRead();			// max_dec_frame_buffering

                if (gb.GetSize() < gb.GetPos()) {
                    num_reorder_frames = 0;
                }
                if (num_reorder_frames > 16U) {
                    return false;
                }
            }
        }
    }

    if (!h.sar.num) h.sar.num = 1;
    if (!h.sar.den) h.sar.den = 1;

    unsigned int mb_Width	= (unsigned int)pic_width_in_mbs_minus1 + 1;
    unsigned int mb_Height	= ((unsigned int)pic_height_in_map_units_minus1 + 1) * (2 - !h.interlaced);
    BYTE CHROMA444			= (chroma_format_idc == 3);

    h.width = 16 * mb_Width - (2u>>CHROMA444) * min(h.crop_right, (8u<<CHROMA444)-1);
    if (!h.interlaced) {
        h.height = 16 * mb_Height - (2u>>CHROMA444) * min(h.crop_bottom, (8u<<CHROMA444)-1);
    } else {
开发者ID:WinnerSoftLab,项目名称:WinnerMediaPlayer,代码行数:101,代码来源:VideoParser.cpp


注:本文中的CGolombBuffer::GetSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。