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