merged master into nmux

This commit is contained in:
ha7ilm 2017-01-15 21:12:34 +01:00
commit 6386e3f4d1
6 changed files with 181 additions and 1 deletions

15
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,15 @@
First of all, thank you for taking the time to contribute to this project!
Before I can accept your contributions, I need a signed copy of the Individual Contributor License Agreement (ICLA) from you, which is available <a href="ICLA.txt">here</a>.
The ICLA is needed because it will allow me to dual license the OpenWebRX project under AGPL and a commercial license.
I will also apply dual licensing to csdr, but only those parts that are original work (e.g. without the parts enabled by `-DUSE_IMA_ADPCM`; code taken from other projects is clearly separable).
However, even if there is commercial interest in the projects, I promise to keep them as open as possible, keeping my original intention to provide an open-source web-based SDR receiver software to the amateur radio operators and SDR enthusiasts.
This contributor agreement is based on the one of Apache Software Foundation, with some modifications.
When you contribute for the first time, I will send you the ICLA. Replying with only the information requested and the text "I Agree" is sufficient.
Thanks,
Andras, HA7ILM

128
ICLA.txt Normal file
View file

@ -0,0 +1,128 @@
Individual Contributor License Agreement ("Agreement")
In order to clarify the intellectual property license granted
with Contributions from any person or entity, András Retzler
(hereinafter referred to as "Project Owner") must have a
Contributor License Agreement ("CLA") on file that has
been signed by each Contributor, indicating agreement to the license
terms below. This license is for your protection as a Contributor as
well as the protection of the Project Owner; it does not change your
rights to use your own Contributions for any other purpose.
Please read this document carefully before signing and keep a copy
for your records.
Full name: ______________________________________________________
(optional) Public name: _________________________________________
Mailing Address: ________________________________________________
________________________________________________
Country: ______________________________________________________
(optional) Telephone: ___________________________________________
E-Mail: ______________________________________________________
You accept and agree to the following terms and conditions for Your
present and future Contributions submitted to the Project Owner.
Except for the license granted herein to the Project Owner and recipients
of software distributed by the Project Owner, You reserve all right, title,
and interest in and to Your Contributions.
1. Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity
authorized by the copyright owner that is making this Agreement
with the Project Owner. For legal entities, the entity making a
Contribution and all other entities that control, are controlled
by, or are under common control with that entity are considered to
be a single Contributor. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Contribution" shall mean any original work of authorship,
including any modifications or additions to an existing work, that
is intentionally submitted by You to the Project Owner for inclusion
in, or documentation of, any of the products owned or managed by
the Project Owner (the "Work"). For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written
communication sent to the Project Owner or its representatives,
including but not limited to communication on electronic mailing
lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Project Owner for the purpose of
discussing and improving the Work, but excluding communication that
is conspicuously marked or otherwise designated in writing by You
as "Not a Contribution."
2. Grant of Copyright License. Subject to the terms and conditions of
this Agreement, You hereby grant to the Project Owner and to
recipients of software distributed by the Project Owner a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare derivative works of,
publicly display, publicly perform, sublicense, and distribute Your
Contributions and such derivative works.
3. Grant of Patent License. Subject to the terms and conditions of
this Agreement, You hereby grant to the Project Owner and to
recipients of software distributed by the Project Owner a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the
Work, where such license applies only to those patent claims
licensable by You that are necessarily infringed by Your
Contribution(s) alone or by combination of Your Contribution(s)
with the Work to which such Contribution(s) was submitted. If any
entity institutes patent litigation against You or any other entity
(including a cross-claim or counterclaim in a lawsuit) alleging
that your Contribution, or the Work to which you have contributed,
constitutes direct or contributory patent infringement, then any
patent licenses granted to that entity under this Agreement for
that Contribution or Work shall terminate as of the date such
litigation is filed.
4. You represent that you are legally entitled to grant the above
license. If your employer(s) has rights to intellectual property
that you create that includes your Contributions, you represent
that you have received permission to make Contributions on behalf
of that employer, that your employer has waived such rights for
your Contributions to the Project Owner, or that your employer has
executed a separate Corporate CLA with the Project Owner.
5. You represent that each of Your Contributions is Your original
creation (see section 7 for submissions on behalf of others). You
represent that Your Contribution submissions include complete
details of any third-party license or other restriction (including,
but not limited to, related patents and trademarks) of which you
are personally aware and which are associated with any part of Your
Contributions.
6. You are not expected to provide support for Your Contributions,
except to the extent You desire to provide support. You may provide
support for free, for a fee, or not at all. Unless required by
applicable law or agreed to in writing, You provide Your
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied, including, without
limitation, any warranties or conditions of TITLE, NON-
INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
7. Should You wish to submit work that is not Your original creation,
You may submit it to the Project Owner separately from any
Contribution, identifying the complete details of its source and of
any license or other restriction (including, but not limited to,
related patents, trademarks, and license agreements) of which you
are personally aware, and conspicuously marking the work as
"Submitted on behalf of a third-party: [named here]".
8. You agree to notify the Project Owner of any facts or circumstances of
which you become aware that would make these representations
inaccurate in any respect.
Please sign: __________________________________ Date: ________________
Text derived from the Apache Individual Contributor License Agreement
("Agreement") V2.0, available at http://apache.org/licenses/icla.txt

View file

@ -122,6 +122,8 @@ The following commands are available:
- `csdr convert_u8_f`
- `csdr convert_f_u8`
- `csdr convert_s8_f`
- `csdr convert_f_s8`
- `csdr convert_i16_f`
- `csdr convert_f_i16`
@ -422,4 +424,3 @@ However, before the implementation of some algoritms, GPL-licensed code from oth
In order to eliminate any licesing issues, these parts are placed under a different file.
However, the library is still fully functional with BSD-only code, altough having only less-optimized versions of some algorithms.
It should also be noted that if you compile with `-DUSE_FFTW` and `-DLIBCSDR_GPL` (as default), the GPL license would apply on the whole result.

24
csdr.c
View file

@ -58,6 +58,8 @@ char usage[]=
"list of functions:\n\n"
" convert_u8_f\n"
" convert_f_u8\n"
" convert_s8_f\n"
" convert_f_s8\n"
" convert_f_i16\n"
" convert_i16_f\n"
" realpart_cf\n"
@ -364,6 +366,28 @@ int main(int argc, char *argv[])
TRY_YIELD;
}
}
if(!strcmp(argv[1],"convert_s8_f"))
{
for(;;)
{
FEOF_CHECK;
fread(buffer_s8, sizeof(signed char), BUFSIZE, stdin);
convert_s8_f(buffer_s8, output_buffer, BUFSIZE);
FWRITE_R;
TRY_YIELD;
}
}
if(!strcmp(argv[1],"convert_f_s8")) //not tested
{
for(;;)
{
FEOF_CHECK;
FREAD_R;
convert_f_s8(input_buffer, buffer_s8, BUFSIZE);
fwrite(buffer_s8, sizeof(signed char), BUFSIZE, stdout);
TRY_YIELD;
}
}
if(!strcmp(argv[1],"convert_f_i16"))
{
if(!sendbufsize(initialize_buffers())) return -2;

View file

@ -1144,6 +1144,11 @@ void convert_u8_f(unsigned char* input, float* output, int input_size)
for(int i=0;i<input_size;i++) output[i]=((float)input[i])/(UCHAR_MAX/2.0)-1.0; //@convert_u8_f
}
void convert_s8_f(signed char* input, float* output, int input_size)
{
for(int i=0;i<input_size;i++) output[i]=((float)input[i])/SCHAR_MAX; //@convert_s8_f
}
void convert_i16_f(short* input, float* output, int input_size)
{
for(int i=0;i<input_size;i++) output[i]=(float)input[i]/SHRT_MAX; //@convert_i16_f
@ -1156,6 +1161,11 @@ void convert_f_u8(float* input, unsigned char* output, int input_size)
//of at least -60 dB is shown on the FFT plot after convert_f_u8 -> convert_u8_f
}
void convert_f_s8(float* input, signed char* output, int input_size)
{
for(int i=0;i<input_size;i++) output[i]=input[i]*SCHAR_MAX; //@convert_f_s8
}
void convert_f_i16(float* input, short* output, int input_size)
{
/*for(int i=0;i<input_size;i++)

View file

@ -189,6 +189,8 @@ void fixed_amplitude_cc(complexf* input, complexf* output, int input_size, float
void convert_u8_f(unsigned char* input, float* output, int input_size);
void convert_f_u8(float* input, unsigned char* output, int input_size);
void convert_s8_f(signed char* input, float* output, int input_size);
void convert_f_s8(float* input, signed char* output, int input_size);
void convert_f_i16(float* input, short* output, int input_size);
void convert_i16_f(short* input, float* output, int input_size);