Lines Matching defs:sample

41 #define APPLY_WEIGHT_F(weight, sample) ((((((sample) & 0xffff) * (weight)) >> 9) + \
42 ((((sample) & ~0xffff) >> 9) * (weight)) + 1) >> 1)
44 #define APPLY_WEIGHT_I(weight, sample) (((weight) * (sample) + 512) >> 10)
46 #define APPLY_WEIGHT(weight, sample) ((sample) != (short) (sample) ? \
47 APPLY_WEIGHT_F(weight, sample) : APPLY_WEIGHT_I (weight, sample))
226 static void process_float(WavPackEncodeContext *s, int32_t *sample)
228 int32_t shift_count, value, f = *sample;
264 *sample = get_sign(f) ? -value : value;
2042 static void wavpack_encode_sample(WavPackEncodeContext *s, WvChannel *c, int32_t sample)
2046 int sign = sample < 0;
2050 if (sample)
2056 } else if (sample) {
2067 sample = ~sample;
2069 if (sample < (int32_t) GET_MED(0)) {
2077 if (sample - low < GET_MED(1)) {
2085 if (sample - low < GET_MED(2)) {
2090 ones_count = 2 + (sample - low) / GET_MED(2);
2115 uint32_t maxcode = high - low, code = sample - low;
2160 static void pack_float_sample(WavPackEncodeContext *s, int32_t *sample)
2166 if (get_exponent(*sample) == 255) {
2167 if (get_mantissa(*sample)) {
2169 put_bits(pb, 23, get_mantissa(*sample));
2176 } else if (get_exponent(*sample)) {
2177 shift_count = max_exp - get_exponent(*sample);
2178 value = 0x800000 + get_mantissa(*sample);
2181 value = get_mantissa(*sample);
2191 if (get_exponent(*sample) || get_mantissa(*sample)) {
2193 put_bits(pb, 23, get_mantissa(*sample));
2196 put_bits(pb, 8, get_exponent(*sample));
2198 put_bits(pb, 1, get_sign(*sample));
2203 put_bits(pb, 1, get_sign(*sample));
2208 put_sbits(pb, shift_count, get_mantissa(*sample));
2210 put_bits(pb, 1, get_mantissa(*sample) & 1);