[Libav-user] Filtering audio example : filtering_audio.c - Why do we use uint16_t
matthieu.corbeau at gmail.com
Wed Dec 3 12:58:48 CET 2014
I am reading a lot this example lately and I have a question that I cannot
quite answer myself. Here is the deal (
in print_frame there is a cast to uint16_t:
const uint16_t *p = (uint16_t*)frame->data
however the filtering description is set with s16:
static const char *filter_descr
Now I tried to change the cast to int16_t instead of uint16_t and I have no
audible change in the filtered stream when played back by ffplay (ffplay -f
s16le -ar 8000 -ac 1 -).
My question is, when casting signed to unsigned, is there any possibility
that the signal gets modified due to the 2-complementation (or are the
samples always positive somehow) ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user