Home | History | Annotate | Download | only in filters

Lines Matching refs:sps

520 H264Parser::Result H264Parser::ParseSPSScalingLists(H264SPS* sps) {
531 res = ParseScalingList(arraysize(sps->scaling_list4x4[i]),
532 sps->scaling_list4x4[i],
538 DefaultScalingList4x4(i, sps->scaling_list4x4);
542 i, kDefault4x4Intra, kDefault4x4Inter, sps->scaling_list4x4);
547 for (int i = 0; i < ((sps->chroma_format_idc != 3) ? 2 : 6); ++i) {
551 res = ParseScalingList(arraysize(sps->scaling_list8x8[i]),
552 sps->scaling_list8x8[i],
558 DefaultScalingList8x8(i, sps->scaling_list8x8);
562 i, kDefault8x8Intra, kDefault8x8Inter, sps->scaling_list8x8);
569 H264Parser::Result H264Parser::ParsePPSScalingLists(const H264SPS& sps,
590 if (sps.seq_scaling_matrix_present_flag) {
597 sps.scaling_list4x4[0],
598 sps.scaling_list4x4[3],
605 for (int i = 0; i < ((sps.chroma_format_idc != 3) ? 2 : 6); ++i) {
619 if (sps.seq_scaling_matrix_present_flag) {
626 sps.scaling_list8x8[0],
627 sps.scaling_list8x8[1],
659 H264Parser::Result H264Parser::ParseVUIParameters(H264SPS* sps) {
666 READ_BITS_OR_RETURN(16, &sps->sar_width);
667 READ_BITS_OR_RETURN(16, &sps->sar_height);
671 sps->sar_width = kTableSarWidth[aspect_ratio_idc];
672 sps->sar_height = kTableSarHeight[aspect_ratio_idc];
722 READ_BOOL_OR_RETURN(&sps->bitstream_restriction_flag);
723 if (sps->bitstream_restriction_flag) {
729 READ_UE_OR_RETURN(&sps->max_num_reorder_frames);
730 READ_UE_OR_RETURN(&sps->max_dec_frame_buffering);
731 TRUE_OR_RETURN(sps->max_dec_frame_buffering >= sps->max_num_ref_frames);
733 sps->max_num_reorder_frames, 0, sps->max_dec_frame_buffering);
739 static void FillDefaultSeqScalingLists(H264SPS* sps) {
742 sps->scaling_list4x4[i][j] = 16;
746 sps->scaling_list8x8[i][j] = 16;
756 scoped_ptr<H264SPS> sps(new H264SPS());
758 READ_BITS_OR_RETURN(8, &sps->profile_idc);
759 READ_BOOL_OR_RETURN(&sps->constraint_set0_flag);
760 READ_BOOL_OR_RETURN(&sps->constraint_set1_flag);
761 READ_BOOL_OR_RETURN(&sps->constraint_set2_flag);
762 READ_BOOL_OR_RETURN(&sps->constraint_set3_flag);
763 READ_BOOL_OR_RETURN(&sps->constraint_set4_flag);
764 READ_BOOL_OR_RETURN(&sps->constraint_set5_flag);
766 READ_BITS_OR_RETURN(8, &sps->level_idc);
767 READ_UE_OR_RETURN(&sps->seq_parameter_set_id);
768 TRUE_OR_RETURN(sps->seq_parameter_set_id < 32);
770 if (sps->profile_idc == 100 || sps->profile_idc == 110 ||
771 sps->profile_idc == 122 || sps->profile_idc == 244 ||
772 sps->profile_idc == 44 || sps->profile_idc == 83 ||
773 sps->profile_idc == 86 || sps->profile_idc == 118 ||
774 sps->profile_idc == 128) {
775 READ_UE_OR_RETURN(&sps->chroma_format_idc);
776 TRUE_OR_RETURN(sps->chroma_format_idc < 4);
778 if (sps->chroma_format_idc == 3)
779 READ_BOOL_OR_RETURN(&sps->separate_colour_plane_flag);
781 READ_UE_OR_RETURN(&sps->bit_depth_luma_minus8);
782 TRUE_OR_RETURN(sps->bit_depth_luma_minus8 < 7);
784 READ_UE_OR_RETURN(&sps->bit_depth_chroma_minus8);
785 TRUE_OR_RETURN(sps->bit_depth_chroma_minus8 < 7);
787 READ_BOOL_OR_RETURN(&sps->qpprime_y_zero_transform_bypass_flag);
788 READ_BOOL_OR_RETURN(&sps->seq_scaling_matrix_present_flag);
790 if (sps->seq_scaling_matrix_present_flag) {
792 res = ParseSPSScalingLists(sps.get());
796 FillDefaultSeqScalingLists(sps.get());
799 sps->chroma_format_idc = 1;
800 FillDefaultSeqScalingLists(sps.get());
803 if (sps->separate_colour_plane_flag)
804 sps->chroma_array_type = 0;
806 sps->chroma_array_type = sps->chroma_format_idc;
808 READ_UE_OR_RETURN(&sps->log2_max_frame_num_minus4);
809 TRUE_OR_RETURN(sps->log2_max_frame_num_minus4 < 13);
811 READ_UE_OR_RETURN(&sps->pic_order_cnt_type);
812 TRUE_OR_RETURN(sps->pic_order_cnt_type < 3);
814 sps->expected_delta_per_pic_order_cnt_cycle = 0;
815 if (sps->pic_order_cnt_type == 0) {
816 READ_UE_OR_RETURN(&sps->log2_max_pic_order_cnt_lsb_minus4);
817 TRUE_OR_RETURN(sps->log2_max_pic_order_cnt_lsb_minus4 < 13);
818 } else if (sps->pic_order_cnt_type == 1) {
819 READ_BOOL_OR_RETURN(&sps->delta_pic_order_always_zero_flag);
820 READ_SE_OR_RETURN(&sps->offset_for_non_ref_pic);
821 READ_SE_OR_RETURN(&sps->offset_for_top_to_bottom_field);
822 READ_UE_OR_RETURN(&sps->num_ref_frames_in_pic_order_cnt_cycle);
823 TRUE_OR_RETURN(sps->num_ref_frames_in_pic_order_cnt_cycle < 255);
825 for (int i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; ++i) {
826 READ_SE_OR_RETURN(&sps->offset_for_ref_frame[i]);
827 sps->expected_delta_per_pic_order_cnt_cycle +=
828 sps->offset_for_ref_frame[i];
832 READ_UE_OR_RETURN(&sps->max_num_ref_frames);
833 READ_BOOL_OR_RETURN(&sps->gaps_in_frame_num_value_allowed_flag);
835 if (sps->gaps_in_frame_num_value_allowed_flag)
838 READ_UE_OR_RETURN(&sps->pic_width_in_mbs_minus1);
839 READ_UE_OR_RETURN(&sps->pic_height_in_map_units_minus1);
841 READ_BOOL_OR_RETURN(&sps->frame_mbs_only_flag);
842 if (!sps->frame_mbs_only_flag)
843 READ_BOOL_OR_RETURN(&sps->mb_adaptive_frame_field_flag);
845 READ_BOOL_OR_RETURN(&sps->direct_8x8_inference_flag);
847 READ_BOOL_OR_RETURN(&sps->frame_cropping_flag);
848 if (sps->frame_cropping_flag) {
849 READ_UE_OR_RETURN(&sps->frame_crop_left_offset);
850 READ_UE_OR_RETURN(&sps->frame_crop_right_offset);
851 READ_UE_OR_RETURN(&sps->frame_crop_top_offset);
852 READ_UE_OR_RETURN(&sps->frame_crop_bottom_offset);
855 READ_BOOL_OR_RETURN(&sps->vui_parameters_present_flag);
856 if (sps->vui_parameters_present_flag) {
858 res = ParseVUIParameters(sps.get());
863 // If an SPS with the same id already exists, replace it.
864 *sps_id = sps->seq_parameter_set_id;
866 active_SPSes_[*sps_id] = sps.release();
873 const H264SPS* sps;
884 sps = GetSPS(pps->seq_parameter_set_id);
885 TRUE_OR_RETURN(sps);
926 res = ParsePPSScalingLists(*sps, pps.get());
1057 H264Parser::Result H264Parser::ParsePredWeightTable(const H264SPS& sps,
1062 if (sps.chroma_array_type != 0)
1067 sps.chroma_array_type,
1076 sps.chroma_array_type,
1135 const H264SPS* sps;
1155 sps = GetSPS(pps->seq_parameter_set_id);
1156 TRUE_OR_RETURN(sps);
1158 if (sps->separate_colour_plane_flag) {
1163 READ_BITS_OR_RETURN(sps->log2_max_frame_num_minus4 + 4, &shdr->frame_num);
1164 if (!sps->frame_mbs_only_flag) {
1175 if (sps->pic_order_cnt_type == 0) {
1176 READ_BITS_OR_RETURN(sps->log2_max_pic_order_cnt_lsb_minus4 + 4,
1183 if (sps->pic_order_cnt_type == 1 && !sps->delta_pic_order_always_zero_flag) {
1231 res = ParsePredWeightTable(*sps, shdr);