• Home
  • Raw
  • Download

Lines Matching refs:pd

27 bool BufferPuffWriter::Insert(const PuffData& pd) {  in Insert()  argument
28 switch (pd.type) { in Insert()
30 if (pd.length == 0) { in Insert()
35 DVLOG(2) << "Write literals length: " << pd.length; in Insert()
36 size_t length = pd.type == PuffData::Type::kLiteral ? 1 : pd.length; in Insert()
60 if (pd.type == PuffData::Type::kLiteral) { in Insert()
61 puff_buf_out_[index_] = pd.byte; in Insert()
63 TEST_AND_RETURN_FALSE(pd.read_fn(&puff_buf_out_[index_], length)); in Insert()
65 } else if (pd.type == PuffData::Type::kLiterals) { in Insert()
66 TEST_AND_RETURN_FALSE(pd.read_fn(nullptr, length)); in Insert()
81 DVLOG(2) << "Write length: " << pd.length << " distance: " << pd.distance; in Insert()
83 TEST_AND_RETURN_FALSE(pd.length <= 258 && pd.length >= 3); in Insert()
84 TEST_AND_RETURN_FALSE(pd.distance <= 32768 && pd.distance >= 1); in Insert()
85 if (pd.length < 130) { in Insert()
91 kLenDistHeader | static_cast<uint8_t>(pd.length - 3); in Insert()
101 puff_buf_out_[index_++] = static_cast<uint8_t>(pd.length - 3 - 127); in Insert()
109 WriteUint16ToByteArray(pd.distance - 1, &puff_buf_out_[index_]); in Insert()
117 DVLOG(2) << "Write block metadata length: " << pd.length; in Insert()
119 TEST_AND_RETURN_FALSE(pd.length <= sizeof(pd.block_metadata) && in Insert()
120 pd.length > 0); in Insert()
123 TEST_AND_RETURN_FALSE(index_ + pd.length + 2 <= puff_size_); in Insert()
125 WriteUint16ToByteArray(pd.length - 1, &puff_buf_out_[index_]); in Insert()
130 memcpy(&puff_buf_out_[index_], pd.block_metadata, pd.length); in Insert()
132 index_ += pd.length; in Insert()