/* * Copyright (c) 2012 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0; for (int i = 0; i < kBitsToTest; ++i) { if (bit_method == 2) {
bit = (i & 1);
} elseif (bit_method == 3) {
bit = bit_rnd(2);
}
vpx_write(&bw, bit, static_cast<int>(probas[i]));
}
GTEST_ASSERT_EQ(vpx_stop_encode(&bw), 0); // vpx_reader_fill() may read into uninitialized data that // isn't used meaningfully, but may trigger an MSan warning.
memset(bw_buffer + bw.pos, 0, sizeof(BD_VALUE) - 1);
// First bit should be zero
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
vpx_reader br;
vpx_reader_init(&br, bw_buffer, kBufferSize, nullptr, nullptr);
bit_rnd.Reset(random_seed); for (int i = 0; i < kBitsToTest; ++i) { if (bit_method == 2) {
bit = (i & 1);
} elseif (bit_method == 3) {
bit = bit_rnd(2);
}
GTEST_ASSERT_EQ(vpx_read(&br, probas[i]), bit)
<< "pos: " << i << " / " << kBitsToTest
<< " bit_method: " << bit_method << " method: " << method;
}
}
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.