(State s)
| 1070 | } |
| 1071 | |
| 1072 | private static int writeRingBuffer(State s) { |
| 1073 | final int toWrite = Utils.min(s.outputLength - s.outputUsed, |
| 1074 | s.ringBufferBytesReady - s.ringBufferBytesWritten); |
| 1075 | // TODO(eustas): DCHECK(toWrite >= 0) |
| 1076 | if (toWrite != 0) { |
| 1077 | Utils.copyBytes(s.output, s.outputOffset + s.outputUsed, s.ringBuffer, |
| 1078 | s.ringBufferBytesWritten, s.ringBufferBytesWritten + toWrite); |
| 1079 | s.outputUsed += toWrite; |
| 1080 | s.ringBufferBytesWritten += toWrite; |
| 1081 | } |
| 1082 | |
| 1083 | if (s.outputUsed < s.outputLength) { |
| 1084 | return BROTLI_OK; |
| 1085 | } |
| 1086 | return BROTLI_OK_NEED_MORE_OUTPUT; |
| 1087 | } |
| 1088 | |
| 1089 | private static int huffmanTreeGroupAllocSize(int alphabetSizeLimit, int n) { |
| 1090 | final int maxTableSize = MAX_HUFFMAN_TABLE_SIZE[(alphabetSizeLimit + 31) >> 5]; |
no test coverage detected