mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
check/elements/audioconvert.c: Convert from native endian, not little endian.
Original commit message from CVS: 2005-08-29 Andy Wingo <wingo@pobox.com> * check/elements/audioconvert.c: Convert from native endian, not little endian.
This commit is contained in:
parent
d5a7ae1915
commit
fd30c157b8
3 changed files with 41 additions and 36 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-08-29 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* check/elements/audioconvert.c: Convert from native endian, not
|
||||||
|
little endian.
|
||||||
|
|
||||||
2005-08-29 Michael Smith <msmith@fluendo.com>
|
2005-08-29 Michael Smith <msmith@fluendo.com>
|
||||||
* ext/ogg/Makefile.am:
|
* ext/ogg/Makefile.am:
|
||||||
* ext/ogg/gstogg.c: (plugin_init):
|
* ext/ogg/gstogg.c: (plugin_init):
|
||||||
|
|
|
@ -185,26 +185,26 @@ GST_START_TEST (test_int16)
|
||||||
gint16 in[] = { 16384, -256, 1024, 1024 };
|
gint16 in[] = { 16384, -256, 1024, 1024 };
|
||||||
gint16 out[] = { 8064, 1024 };
|
gint16 out[] = { 8064, 1024 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (2, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE));
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
/* mono to stereo */
|
/* mono to stereo */
|
||||||
{
|
{
|
||||||
gint16 in[] = { 512, 1024 };
|
gint16 in[] = { 512, 1024 };
|
||||||
gint16 out[] = { 512, 512, 1024, 1024 };
|
gint16 out[] = { 512, 512, 1024, 1024 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (2, "LITTLE_ENDIAN", 16, 16, TRUE));
|
out, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
/* signed -> unsigned */
|
/* signed -> unsigned */
|
||||||
{
|
{
|
||||||
gint16 in[] = { 0, -32767, 32767, -32768 };
|
gint16 in[] = { 0, -32767, 32767, -32768 };
|
||||||
guint16 out[] = { 32768, 1, 65535, 0 };
|
guint16 out[] = { 32768, 1, 65535, 0 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, FALSE));
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE));
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, FALSE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE));
|
in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,11 +218,11 @@ GST_START_TEST (test_int_conversion)
|
||||||
gint8 in[] = { 0, 1, 2, 127, -127 };
|
gint8 in[] = { 0, 1, 2, 127, -127 };
|
||||||
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)
|
||||||
);
|
);
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE)
|
in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* 16 -> 8 signed */
|
/* 16 -> 8 signed */
|
||||||
|
@ -230,8 +230,8 @@ GST_START_TEST (test_int_conversion)
|
||||||
gint16 in[] = { 0, 255, 256, 257 };
|
gint16 in[] = { 0, 255, 256, 257 };
|
||||||
gint8 out[] = { 0, 0, 1, 1 };
|
gint8 out[] = { 0, 0, 1, 1 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* 8 unsigned <-> 16 signed */
|
/* 8 unsigned <-> 16 signed */
|
||||||
|
@ -240,11 +240,11 @@ GST_START_TEST (test_int_conversion)
|
||||||
guint8 in[] = { 128, 129, 130, 255, 1 };
|
guint8 in[] = { 128, 129, 130, 255, 1 };
|
||||||
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, FALSE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 8, 8, FALSE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)
|
||||||
);
|
);
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, FALSE)
|
in, get_int_caps (1, "BYTE_ORDER", 8, 8, FALSE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,26 +185,26 @@ GST_START_TEST (test_int16)
|
||||||
gint16 in[] = { 16384, -256, 1024, 1024 };
|
gint16 in[] = { 16384, -256, 1024, 1024 };
|
||||||
gint16 out[] = { 8064, 1024 };
|
gint16 out[] = { 8064, 1024 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (2, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE));
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
/* mono to stereo */
|
/* mono to stereo */
|
||||||
{
|
{
|
||||||
gint16 in[] = { 512, 1024 };
|
gint16 in[] = { 512, 1024 };
|
||||||
gint16 out[] = { 512, 512, 1024, 1024 };
|
gint16 out[] = { 512, 512, 1024, 1024 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (2, "LITTLE_ENDIAN", 16, 16, TRUE));
|
out, get_int_caps (2, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
/* signed -> unsigned */
|
/* signed -> unsigned */
|
||||||
{
|
{
|
||||||
gint16 in[] = { 0, -32767, 32767, -32768 };
|
gint16 in[] = { 0, -32767, 32767, -32768 };
|
||||||
guint16 out[] = { 32768, 1, 65535, 0 };
|
guint16 out[] = { 32768, 1, 65535, 0 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, FALSE));
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE));
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, FALSE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, FALSE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE));
|
in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,11 +218,11 @@ GST_START_TEST (test_int_conversion)
|
||||||
gint8 in[] = { 0, 1, 2, 127, -127 };
|
gint8 in[] = { 0, 1, 2, 127, -127 };
|
||||||
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)
|
||||||
);
|
);
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE)
|
in, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* 16 -> 8 signed */
|
/* 16 -> 8 signed */
|
||||||
|
@ -230,8 +230,8 @@ GST_START_TEST (test_int_conversion)
|
||||||
gint16 in[] = { 0, 255, 256, 257 };
|
gint16 in[] = { 0, 255, 256, 257 };
|
||||||
gint8 out[] = { 0, 0, 1, 1 };
|
gint8 out[] = { 0, 0, 1, 1 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 8, 8, TRUE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* 8 unsigned <-> 16 signed */
|
/* 8 unsigned <-> 16 signed */
|
||||||
|
@ -240,11 +240,11 @@ GST_START_TEST (test_int_conversion)
|
||||||
guint8 in[] = { 128, 129, 130, 255, 1 };
|
guint8 in[] = { 128, 129, 130, 255, 1 };
|
||||||
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
gint16 out[] = { 0, 256, 512, 32512, -32512 };
|
||||||
|
|
||||||
RUN_CONVERSION (in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, FALSE),
|
RUN_CONVERSION (in, get_int_caps (1, "BYTE_ORDER", 8, 8, FALSE),
|
||||||
out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE)
|
out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE)
|
||||||
);
|
);
|
||||||
RUN_CONVERSION (out, get_int_caps (1, "LITTLE_ENDIAN", 16, 16, TRUE),
|
RUN_CONVERSION (out, get_int_caps (1, "BYTE_ORDER", 16, 16, TRUE),
|
||||||
in, get_int_caps (1, "LITTLE_ENDIAN", 8, 8, FALSE)
|
in, get_int_caps (1, "BYTE_ORDER", 8, 8, FALSE)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue