btstack_resample.c (c1ab6cc1beb14b16b46e74a3723644016d8c3cc7) | btstack_resample.c (ff3cc4a5378c2f681cc9b75cf54d154a12a3051e) |
---|---|
1/* 2 * Copyright (C) 2018 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 54 unchanged lines hidden (view full) --- 63 int s2 = input_buffer[i]; 64 int os = ((s1*(0x10000 - t)) + (s2*t)) >> 16; 65 output_buffer[dest_samples++] = os; 66 } 67 dest_frames++; 68 context->src_pos += context->src_step; 69 } 70 // process current block | 1/* 2 * Copyright (C) 2018 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 54 unchanged lines hidden (view full) --- 63 int s2 = input_buffer[i]; 64 int os = ((s1*(0x10000 - t)) + (s2*t)) >> 16; 65 output_buffer[dest_samples++] = os; 66 } 67 dest_frames++; 68 context->src_pos += context->src_step; 69 } 70 // process current block |
71 while (1){ | 71 while (true){ |
72 const uint16_t src_pos = context->src_pos >> 16; 73 const uint16_t t = context->src_pos & 0xffff; 74 int index = src_pos * context->num_channels; 75 int i; 76 if (src_pos >= (num_frames - 1)){ 77 // store last sample 78 for (i=0;i<context->num_channels;i++){ 79 context->last_sample[i] = input_buffer[index++]; --- 17 unchanged lines hidden --- | 72 const uint16_t src_pos = context->src_pos >> 16; 73 const uint16_t t = context->src_pos & 0xffff; 74 int index = src_pos * context->num_channels; 75 int i; 76 if (src_pos >= (num_frames - 1)){ 77 // store last sample 78 for (i=0;i<context->num_channels;i++){ 79 context->last_sample[i] = input_buffer[index++]; --- 17 unchanged lines hidden --- |