Lines Matching refs:bw
191 static void PutSegmentHeader(VP8BitWriter* const bw, in PutSegmentHeader() argument
195 if (VP8PutBitUniform(bw, (hdr->num_segments_ > 1))) { in PutSegmentHeader()
199 VP8PutBitUniform(bw, hdr->update_map_); in PutSegmentHeader()
200 if (VP8PutBitUniform(bw, update_data)) { in PutSegmentHeader()
202 VP8PutBitUniform(bw, 1); // (segment_feature_mode = 1. Paragraph 9.3.) in PutSegmentHeader()
204 VP8PutSignedValue(bw, enc->dqm_[s].quant_, 7); in PutSegmentHeader()
207 VP8PutSignedValue(bw, enc->dqm_[s].fstrength_, 6); in PutSegmentHeader()
212 if (VP8PutBitUniform(bw, (proba->segments_[s] != 255u))) { in PutSegmentHeader()
213 VP8PutValue(bw, proba->segments_[s], 8); in PutSegmentHeader()
221 static void PutFilterHeader(VP8BitWriter* const bw, in PutFilterHeader() argument
224 VP8PutBitUniform(bw, hdr->simple_); in PutFilterHeader()
225 VP8PutValue(bw, hdr->level_, 6); in PutFilterHeader()
226 VP8PutValue(bw, hdr->sharpness_, 3); in PutFilterHeader()
227 if (VP8PutBitUniform(bw, use_lf_delta)) { in PutFilterHeader()
230 if (VP8PutBitUniform(bw, need_update)) { in PutFilterHeader()
232 VP8PutValue(bw, 0, 4); in PutFilterHeader()
234 VP8PutSignedValue(bw, hdr->i4x4_lf_delta_, 6); in PutFilterHeader()
235 VP8PutValue(bw, 0, 3); // all others unused in PutFilterHeader()
241 static void PutQuant(VP8BitWriter* const bw, in PutQuant() argument
243 VP8PutValue(bw, enc->base_quant_, 7); in PutQuant()
244 VP8PutSignedValue(bw, enc->dq_y1_dc_, 4); in PutQuant()
245 VP8PutSignedValue(bw, enc->dq_y2_dc_, 4); in PutQuant()
246 VP8PutSignedValue(bw, enc->dq_y2_ac_, 4); in PutQuant()
247 VP8PutSignedValue(bw, enc->dq_uv_dc_, 4); in PutQuant()
248 VP8PutSignedValue(bw, enc->dq_uv_ac_, 4); in PutQuant()
276 VP8BitWriter* const bw = &enc->bw_; in WriteExtensions() local
292 if (!VP8BitWriterAppend(bw, buffer, KTRAILER_SIZE)) { in WriteExtensions()
303 VP8BitWriter* const bw = &enc->bw_; in GeneratePartition0() local
310 pos1 = VP8BitWriterPos(bw); in GeneratePartition0()
311 VP8BitWriterInit(bw, mb_size * 7 / 8); // ~7 bits per macroblock in GeneratePartition0()
313 VP8PutBitUniform(bw, need_extensions); // extensions in GeneratePartition0()
315 VP8PutBitUniform(bw, 0); // colorspace in GeneratePartition0()
317 VP8PutBitUniform(bw, 0); // clamp type in GeneratePartition0()
319 PutSegmentHeader(bw, enc); in GeneratePartition0()
320 PutFilterHeader(bw, &enc->filter_hdr_); in GeneratePartition0()
321 VP8PutValue(bw, enc->num_parts_ == 8 ? 3 : in GeneratePartition0()
324 PutQuant(bw, enc); in GeneratePartition0()
325 VP8PutBitUniform(bw, 0); // no proba update in GeneratePartition0()
326 VP8WriteProbas(bw, &enc->proba_); in GeneratePartition0()
327 pos2 = VP8BitWriterPos(bw); in GeneratePartition0()
329 VP8BitWriterFinish(bw); in GeneratePartition0()
337 pos3 = VP8BitWriterPos(bw); in GeneratePartition0()
345 return !bw->error_; in GeneratePartition0()
358 VP8BitWriter* const bw = &enc->bw_; in VP8EncWrite() local
371 VP8BitWriterSize(bw) + in VP8EncWrite()
397 const uint8_t* const part0 = VP8BitWriterBuf(bw); in VP8EncWrite()
398 const size_t size0 = VP8BitWriterSize(bw); in VP8EncWrite()
402 VP8BitWriterWipeOut(bw); // will free the internal buffer. in VP8EncWrite()