emile: remove binbuf from emile compression functions.
This commit is contained in:
parent
75cd6d3628
commit
90d8932a03
|
@ -721,7 +721,7 @@ eet_data_image_lossless_compressed_convert(int *size,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
out = emile_binbuf_compress(in, eet_2_emile_compressor(compression), compression);
|
||||
out = emile_compress(in, eet_2_emile_compressor(compression), compression);
|
||||
|
||||
if (!out || (eina_binbuf_length_get(out) > eina_binbuf_length_get(in)))
|
||||
{
|
||||
|
@ -1039,7 +1039,7 @@ eet_data_image_etc1_compressed_convert(int *size,
|
|||
{
|
||||
Eina_Binbuf *out;
|
||||
|
||||
out = emile_binbuf_compress(in, EMILE_LZ4HC, EMILE_COMPRESSOR_BEST);
|
||||
out = emile_compress(in, EMILE_LZ4HC, EMILE_COMPRESSOR_BEST);
|
||||
eina_binbuf_free(in);
|
||||
in = out;
|
||||
}
|
||||
|
@ -1984,7 +1984,7 @@ _eet_data_image_decode_inside(const void *data,
|
|||
{
|
||||
out = eina_binbuf_manage_read_only_new_length((void*) d,
|
||||
w * h * 4);
|
||||
if (!emile_binbuf_expand(in, out,
|
||||
if (!emile_expand(in, out,
|
||||
eet_2_emile_compressor(comp)))
|
||||
{
|
||||
eina_binbuf_free(in);
|
||||
|
@ -1996,9 +1996,9 @@ _eet_data_image_decode_inside(const void *data,
|
|||
{
|
||||
/* FIXME: This could create a huge alloc. So
|
||||
compressed data and tile could not always work.*/
|
||||
out = emile_binbuf_uncompress(in,
|
||||
eet_2_emile_compressor(comp),
|
||||
w * h * 4);
|
||||
out = emile_decompress(in,
|
||||
eet_2_emile_compressor(comp),
|
||||
w * h * 4);
|
||||
eina_binbuf_free(in);
|
||||
if (!out) return 0;
|
||||
|
||||
|
|
|
@ -1886,9 +1886,9 @@ eet_read_cipher(Eet_File *ef,
|
|||
{
|
||||
Eina_Binbuf *out;
|
||||
|
||||
out = emile_binbuf_uncompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
out = emile_decompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
|
||||
eina_binbuf_free(in);
|
||||
if (!out) goto on_error;
|
||||
|
@ -1987,9 +1987,9 @@ eet_read_direct(Eet_File *ef,
|
|||
in = read_binbuf_from_disk(ef, efn);
|
||||
if (!in) goto on_error;
|
||||
|
||||
out = emile_binbuf_uncompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
out = emile_decompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
eina_binbuf_free(in);
|
||||
if (!out) goto on_error;
|
||||
|
||||
|
@ -2089,9 +2089,9 @@ eet_alias_get(Eet_File *ef,
|
|||
in = read_binbuf_from_disk(ef, efn);
|
||||
if (!in) goto on_error;
|
||||
|
||||
out = emile_binbuf_uncompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
out = emile_decompress(in,
|
||||
eet_2_emile_compressor(efn->compression_type),
|
||||
efn->data_size);
|
||||
eina_binbuf_free(in);
|
||||
if (!out) goto on_error;
|
||||
|
||||
|
@ -2207,9 +2207,9 @@ eet_alias(Eet_File *ef,
|
|||
{
|
||||
Eina_Binbuf *out;
|
||||
|
||||
out = emile_binbuf_compress(in,
|
||||
eet_2_emile_compressor(comp),
|
||||
EMILE_COMPRESSOR_BEST);
|
||||
out = emile_compress(in,
|
||||
eet_2_emile_compressor(comp),
|
||||
EMILE_COMPRESSOR_BEST);
|
||||
eina_binbuf_free(in);
|
||||
if (!out) goto on_error;
|
||||
|
||||
|
@ -2327,7 +2327,7 @@ eet_write_cipher(Eet_File *ef,
|
|||
{
|
||||
Eina_Binbuf *out;
|
||||
|
||||
out = emile_binbuf_compress(in, eet_2_emile_compressor(comp), EMILE_COMPRESSOR_BEST);
|
||||
out = emile_compress(in, eet_2_emile_compressor(comp), EMILE_COMPRESSOR_BEST);
|
||||
if (out)
|
||||
{
|
||||
if (eina_binbuf_length_get(out) < eina_binbuf_length_get(in))
|
||||
|
|
|
@ -32,9 +32,9 @@ _emile_compress_buffer_size(const Eina_Binbuf *data, Emile_Compressor_Type t)
|
|||
}
|
||||
|
||||
EAPI Eina_Binbuf *
|
||||
emile_binbuf_compress(const Eina_Binbuf *data,
|
||||
Emile_Compressor_Type t,
|
||||
Emile_Compressor_Level l)
|
||||
emile_compress(const Eina_Binbuf *data,
|
||||
Emile_Compressor_Type t,
|
||||
Emile_Compressor_Level l)
|
||||
{
|
||||
void *compact;
|
||||
int length;
|
||||
|
@ -79,9 +79,9 @@ emile_binbuf_compress(const Eina_Binbuf *data,
|
|||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
emile_binbuf_expand(const Eina_Binbuf *in,
|
||||
Eina_Binbuf *out,
|
||||
Emile_Compressor_Type t)
|
||||
emile_expand(const Eina_Binbuf *in,
|
||||
Eina_Binbuf *out,
|
||||
Emile_Compressor_Type t)
|
||||
{
|
||||
if (!in || !out) return EINA_FALSE;
|
||||
|
||||
|
@ -117,7 +117,7 @@ emile_binbuf_expand(const Eina_Binbuf *in,
|
|||
}
|
||||
|
||||
EAPI Eina_Binbuf *
|
||||
emile_binbuf_uncompress(const Eina_Binbuf *data, Emile_Compressor_Type t, unsigned int dest_length)
|
||||
emile_decompress(const Eina_Binbuf *data, Emile_Compressor_Type t, unsigned int dest_length)
|
||||
{
|
||||
Eina_Binbuf *out;
|
||||
void *expanded;
|
||||
|
@ -128,7 +128,7 @@ emile_binbuf_uncompress(const Eina_Binbuf *data, Emile_Compressor_Type t, unsign
|
|||
out = eina_binbuf_manage_new_length(expanded, dest_length);
|
||||
if (!out) goto on_error;
|
||||
|
||||
if (!emile_binbuf_expand(data, out, t))
|
||||
if (!emile_expand(data, out, t))
|
||||
goto on_error;
|
||||
|
||||
return out;
|
||||
|
|
|
@ -51,9 +51,9 @@ typedef enum
|
|||
*
|
||||
* @since 1.14
|
||||
*/
|
||||
EAPI Eina_Binbuf *emile_binbuf_compress(const Eina_Binbuf *in,
|
||||
Emile_Compressor_Type t,
|
||||
Emile_Compressor_Level level);
|
||||
EAPI Eina_Binbuf *emile_compress(const Eina_Binbuf *in,
|
||||
Emile_Compressor_Type t,
|
||||
Emile_Compressor_Level level);
|
||||
/**
|
||||
* @brief Uncompress a buffer into a newly allocated buffer.
|
||||
*
|
||||
|
@ -69,9 +69,9 @@ EAPI Eina_Binbuf *emile_binbuf_compress(const Eina_Binbuf *in,
|
|||
* @note That if dest_length doesn't match the expanded data, it will
|
||||
* just fail and return @c NULL.
|
||||
*/
|
||||
EAPI Eina_Binbuf *emile_binbuf_uncompress(const Eina_Binbuf *in,
|
||||
Emile_Compressor_Type t,
|
||||
unsigned int dest_length);
|
||||
EAPI Eina_Binbuf *emile_decompress(const Eina_Binbuf *in,
|
||||
Emile_Compressor_Type t,
|
||||
unsigned int dest_length);
|
||||
|
||||
/**
|
||||
* @brief Uncompress a buffer into an existing buffer.
|
||||
|
@ -87,9 +87,9 @@ EAPI Eina_Binbuf *emile_binbuf_uncompress(const Eina_Binbuf *in,
|
|||
* expanded data or it will fail. In case of failure, random garbage
|
||||
* could fill the out buffer.
|
||||
*/
|
||||
EAPI Eina_Bool emile_binbuf_expand(const Eina_Binbuf *in,
|
||||
Eina_Binbuf *out,
|
||||
Emile_Compressor_Type t);
|
||||
EAPI Eina_Bool emile_expand(const Eina_Binbuf *in,
|
||||
Eina_Binbuf *out,
|
||||
Emile_Compressor_Type t);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -499,7 +499,7 @@ _emile_tgv_data(Emile_Image *image,
|
|||
|
||||
if (image->compress)
|
||||
{
|
||||
if (!emile_binbuf_expand(data_start, buffer, EMILE_LZ4HC))
|
||||
if (!emile_expand(data_start, buffer, EMILE_LZ4HC))
|
||||
goto on_error;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue