Function report |
Source Code:lib\842\842_compress.c |
Create Date:2022-07-28 06:57:25 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:sw842_compress* Compress the uncompressed buffer of length @ilen at @in to the output buffer*@out, using no more than @olen bytes, using the 842 compression format
Proto:int sw842_compress(const u8 *in, unsigned int ilen, u8 *out, unsigned int *olen, void *wmem)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
const u8 * | in | |
unsigned int | ilen | |
u8 * | out | |
unsigned int * | olen | |
void * | wmem |
483 | repeat_count = 0 |
486 | BUILD_BUG_ON - break compile if a condition is true( size of p > SW842_MEM_COMPRESS) |
488 | init_hashtable_nodes(p, 8) |
489 | init_hashtable_nodes(p, 4) |
490 | init_hashtable_nodes(p, 2) |
497 | bit = 0 |
501 | olen = 0 |
510 | If Value for the false possibility is greater at compile time(ilen < 8) Then Go to skip_comp |
514 | last = ~get value from possibly mis-aligned location((u64 * )in) |
517 | next = get value from possibly mis-aligned location((u64 * )in) |
522 | get_next_data(p) |
530 | If ++repeat_count <= REPEAT_BITS_MAX Then Go to repeat |
533 | If repeat_count Then |
534 | ret = add_repeat_template(p, repeat_count) |
535 | repeat_count = 0 |
540 | If next == 0 Then ret = add_zeros_template(p) |
542 | Else ret = d the next template to use, and add it* the p->dataN fields must already be set for the current 8 byte block |
548 | repeat : |
551 | in += 8 |
552 | ilen -= 8 |
555 | If repeat_count Then |
556 | ret = add_repeat_template(p, repeat_count) |
561 | skip_comp : |
562 | If ilen > 0 Then |
571 | ret = add_end_template(p) |
587 | If bit Then |
595 | If pad Then |
603 | If Value for the false possibility is greater at compile time((total - olen) > UINT_MAX) Then Return -ENOSPC |
608 | Return 0 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |