| 42 | /// Get many values from a batch RLE decoder using its low level functions. |
| 43 | template <typename T> |
| 44 | static bool GetRleValues(RleBatchDecoder<T>* decoder, int num_vals, T* vals) { |
| 45 | int decoded = 0; |
| 46 | // Decode repeated and literal runs until we've filled the output. |
| 47 | while (decoded < num_vals) { |
| 48 | if (decoder->NextNumRepeats() > 0) { |
| 49 | EXPECT_EQ(0, decoder->NextNumLiterals()); |
| 50 | int num_repeats_to_output = |
| 51 | min<int>(decoder->NextNumRepeats(), num_vals - decoded); |
| 52 | T repeated_val = decoder->GetRepeatedValue(num_repeats_to_output); |
| 53 | for (int i = 0; i < num_repeats_to_output; ++i) { |
| 54 | *vals = repeated_val; |
| 55 | ++vals; |
| 56 | } |
| 57 | decoded += num_repeats_to_output; |
| 58 | continue; |
| 59 | } |
| 60 | int num_literals_to_output = |
| 61 | min<int>(decoder->NextNumLiterals(), num_vals - decoded); |
| 62 | if (num_literals_to_output == 0) return false; |
| 63 | if (!decoder->GetLiteralValues(num_literals_to_output, vals)) return false; |
| 64 | decoded += num_literals_to_output; |
| 65 | vals += num_literals_to_output; |
| 66 | } |
| 67 | return true; |
| 68 | } |
| 69 | |
| 70 | /// Get many values from a batch RLE decoder using its low level functions. |
| 71 | template <typename T> |
nothing calls this directly
no test coverage detected