[PATCH 1/4] core/conv: Add optimized Viterbi decoding

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Tom Tsou tom at tsou.cc
Thu May 1 17:51:41 UTC 2014


On Tue, Apr 29, 2014 at 3:08 AM, Holger Hans Peter Freyther
<holger at freyther.de> wrote:
> On Tue, Apr 29, 2014 at 12:12:09AM -0400, Thomas Tsou wrote:
>> +#define SSE_ALIGN    16
>> +
>> +static int16_t *vdec_malloc(size_t n)
>> +{
>> +#ifdef HAVE_SSE3
>> +     return (int16_t *) memalign(SSE_ALIGN, sizeof(int16_t) * n);
>> +#else
>> +     return (int16_t *) malloc(sizeof(int16_t) * n);
>> +#endif
>> +}
>
> argh, it would be nice if you could use talloc here but then we would
> need to play games and align pointers ourselves. Maybe change the API
> to at least have a 'ctx' similar to other talloc API?

A beneficial change would be to modify the API to allow persistent
decoder objects instead of performing an allocation and tear-down on
every decoding call. From a performance standpoint, the current
implementation is unnecessarily restricted by memory access and page
faults for that reason.

>> +static void free_trellis(struct vtrellis *trellis)
>> +{
>> +     if (!trellis)
>> +             return;
>> +
>> +     free(trellis->vals);
>> +     free(trellis->outputs);
>> +     free(trellis->sums);
>> +     free(trellis);
>
> Can you use talloc here?

Yes. I think that makes sense. Memory alignment is the only issue that
needs to be looked into.

>> +             _traceback_rec(dec, state, out, len);
>
> _ is reserved for the system. We might want to avoid using that.

I thought only double underscore and single underscore with capital
letter were reserved?

  -TT




More information about the OpenBSC mailing list