+ struct filter_node *fn = context;
+ struct private_amp_data *pad = fn->private_data;
+ struct btr_node *btrn = fn->btrn;
+ int ret, factor = 64 + pad->amp;
+ size_t i, in_bytes, len;
+ int16_t *in, *out;
+ bool inplace = btr_inplace_ok(btrn);
+
+ if (pad->amp == 0) { /* no amplification */
+ btr_splice_out_node(&fn->btrn);
+ return -E_AMP_ZERO_AMP;
+ }
+next_buffer:
+ ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
+ if (ret < 0)
+ goto err;
+ if (ret == 0)
+ return 0;
+ btr_merge(btrn, fn->min_iqs);
+ in_bytes = btr_next_buffer(btrn, (char **)&in);
+ len = in_bytes / 2;
+ if (len == 0) { /* eof and in_bytes == 1 */
+ ret = -E_AMP_EOF;
+ goto err;
+ }
+
+ if (inplace)
+ out = in;
+ else
+ out = para_malloc(len * 2);
+
+ for (i = 0; i < len; i++) {
+ int x = (in[i] * factor) >> 6;