Lines Matching refs:fhdr

60                            Vp8FrameHeader* fhdr) {  in ParseFrame()  argument
64 memset(fhdr, 0, sizeof(*fhdr)); in ParseFrame()
65 fhdr->data = stream_; in ParseFrame()
66 fhdr->frame_size = bytes_left_; in ParseFrame()
68 if (!ParseFrameTag(fhdr)) in ParseFrame()
71 fhdr->first_part_offset = stream_ - fhdr->data; in ParseFrame()
73 if (!ParseFrameHeader(fhdr)) in ParseFrame()
76 if (!ParsePartitions(fhdr)) in ParseFrame()
81 << ", offsets: to first_part=" << fhdr->first_part_offset in ParseFrame()
82 << ", to macroblock data (in bits)=" << fhdr->macroblock_bit_offset; in ParseFrame()
91 bool Vp8Parser::ParseFrameTag(Vp8FrameHeader* fhdr) { in ParseFrameTag() argument
97 fhdr->key_frame = in ParseFrameTag()
99 fhdr->version = GetBitsAt(frame_tag, 1, 2); in ParseFrameTag()
100 fhdr->is_experimental = !!GetBitsAt(frame_tag, 3, 1); in ParseFrameTag()
101 fhdr->show_frame =!!GetBitsAt(frame_tag, 4, 1); in ParseFrameTag()
102 fhdr->first_part_size = GetBitsAt(frame_tag, 5, 19); in ParseFrameTag()
107 if (fhdr->IsKeyframe()) { in ParseFrameTag()
120 fhdr->width = data & 0x3fff; in ParseFrameTag()
121 fhdr->horizontal_scale = data >> 14; in ParseFrameTag()
124 fhdr->height = data & 0x3fff; in ParseFrameTag()
125 fhdr->vertical_scale = data >> 14; in ParseFrameTag()
134 bool Vp8Parser::ParseFrameHeader(Vp8FrameHeader* fhdr) { in ParseFrameHeader() argument
138 bool keyframe = fhdr->IsKeyframe(); in ParseFrameHeader()
148 fhdr->segmentation_hdr = curr_segmentation_hdr_; in ParseFrameHeader()
153 fhdr->loopfilter_hdr = curr_loopfilter_hdr_; in ParseFrameHeader()
157 fhdr->num_of_dct_partitions = static_cast<size_t>(1) in ParseFrameHeader()
160 if (!ParseQuantizationHeader(&fhdr->quantization_hdr)) in ParseFrameHeader()
164 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_entropy_probs); in ParseFrameHeader()
166 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_golden_frame); in ParseFrameHeader()
167 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_alternate_frame); in ParseFrameHeader()
170 if (!fhdr->refresh_golden_frame) { in ParseFrameHeader()
172 fhdr->copy_buffer_to_golden = in ParseFrameHeader()
176 if (!fhdr->refresh_alternate_frame) { in ParseFrameHeader()
178 fhdr->copy_buffer_to_alternate = in ParseFrameHeader()
182 BD_READ_UNSIGNED_OR_RETURN(1, &fhdr->sign_bias_golden); in ParseFrameHeader()
183 BD_READ_UNSIGNED_OR_RETURN(1, &fhdr->sign_bias_alternate); in ParseFrameHeader()
184 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_entropy_probs); in ParseFrameHeader()
185 BD_READ_BOOL_OR_RETURN(&fhdr->refresh_last); in ParseFrameHeader()
191 fhdr->entropy_hdr = curr_entropy_hdr_; in ParseFrameHeader()
193 if (!ParseTokenProbs(&fhdr->entropy_hdr, fhdr->refresh_entropy_probs)) in ParseFrameHeader()
196 BD_READ_BOOL_OR_RETURN(&fhdr->mb_no_skip_coeff); in ParseFrameHeader()
197 if (fhdr->mb_no_skip_coeff) in ParseFrameHeader()
198 BD_READ_UNSIGNED_OR_RETURN(8, &fhdr->prob_skip_false); in ParseFrameHeader()
201 BD_READ_UNSIGNED_OR_RETURN(8, &fhdr->prob_intra); in ParseFrameHeader()
202 BD_READ_UNSIGNED_OR_RETURN(8, &fhdr->prob_last); in ParseFrameHeader()
203 BD_READ_UNSIGNED_OR_RETURN(8, &fhdr->prob_gf); in ParseFrameHeader()
206 if (!ParseIntraProbs(&fhdr->entropy_hdr, fhdr->refresh_entropy_probs, in ParseFrameHeader()
211 if (!ParseMVProbs(&fhdr->entropy_hdr, fhdr->refresh_entropy_probs)) in ParseFrameHeader()
215 fhdr->macroblock_bit_offset = bd_.BitOffset(); in ParseFrameHeader()
216 fhdr->bool_dec_range = bd_.GetRange(); in ParseFrameHeader()
217 fhdr->bool_dec_value = bd_.GetBottom(); in ParseFrameHeader()
218 fhdr->bool_dec_count = 7 - (bd_.BitOffset() + 7) % 8; in ParseFrameHeader()
829 bool Vp8Parser::ParsePartitions(Vp8FrameHeader* fhdr) { in ParsePartitions() argument
830 CHECK_GE(fhdr->num_of_dct_partitions, 1u); in ParsePartitions()
831 CHECK_LE(fhdr->num_of_dct_partitions, kMaxDCTPartitions); in ParsePartitions()
838 size_t first_dct_pos = fhdr->first_part_offset + fhdr->first_part_size + in ParsePartitions()
839 (fhdr->num_of_dct_partitions - 1) * 3; in ParsePartitions()
842 if (fhdr->frame_size < first_dct_pos) in ParsePartitions()
846 size_t bytes_left = fhdr->frame_size - first_dct_pos; in ParsePartitions()
850 fhdr->data + fhdr->first_part_offset + fhdr->first_part_size; in ParsePartitions()
853 for (size_t i = 0; i < fhdr->num_of_dct_partitions - 1; ++i) { in ParsePartitions()
854 fhdr->dct_partition_sizes[i] = (ptr[2] << 16) | (ptr[1] << 8) | ptr[0]; in ParsePartitions()
858 if (bytes_left < fhdr->dct_partition_sizes[i]) in ParsePartitions()
861 bytes_left -= fhdr->dct_partition_sizes[i]; in ParsePartitions()
868 fhdr->dct_partition_sizes[fhdr->num_of_dct_partitions - 1] = bytes_left; in ParsePartitions()
870 DVLOG(4) << "Control part size: " << fhdr->first_part_size; in ParsePartitions()
871 for (size_t i = 0; i < fhdr->num_of_dct_partitions; ++i) in ParsePartitions()
872 DVLOG(4) << "DCT part " << i << " size: " << fhdr->dct_partition_sizes[i]; in ParsePartitions()