FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavcodec
mlz.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 Umair Khan <omerjerk@gmail.com>
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef AVCODEC_MLZ_H
22
#define AVCODEC_MLZ_H
23
24
#include "
get_bits.h
"
25
26
#define CODE_UNSET -1
27
#define CODE_BIT_INIT 9
28
#define DIC_INDEX_INIT 512 // 2^9
29
#define DIC_INDEX_MAX 32768 // 2^15
30
#define FLUSH_CODE 256
31
#define FREEZE_CODE 257
32
#define FIRST_CODE 258
33
#define MAX_CODE 32767
34
#define TABLE_SIZE 35023 // TABLE_SIZE must be a prime number
35
36
/** Dictionary structure for mlz decompression
37
*/
38
typedef
struct
MLZDict
{
39
int
string_code
;
40
int
parent_code
;
41
int
char_code
;
42
int
match_len
;
43
}
MLZDict
;
44
45
/** MLZ data strucure
46
*/
47
typedef
struct
MLZ
{
48
int
dic_code_bit
;
49
int
current_dic_index_max
;
50
unsigned
int
bump_code
;
51
unsigned
int
flush_code
;
52
int
next_code
;
53
int
freeze_flag
;
54
MLZDict
*
dict
;
55
void
*
context
;
56
}
MLZ
;
57
58
/** Initialize the dictionary
59
*/
60
void
ff_mlz_init_dict
(
void
* context,
MLZ
*mlz);
61
62
/** Flush the dictionary
63
*/
64
void
ff_mlz_flush_dict
(
MLZ
*dict);
65
66
/** Run mlz decompression on the next size bits and the output will be stored in buff
67
*/
68
int
ff_mlz_decompression
(
MLZ
* mlz,
GetBitContext
* gb,
int
size
,
unsigned
char
*buff);
69
70
#endif
/*AVCODEC_MLZ_H*/
MLZDict
Dictionary structure for mlz decompression.
Definition:
mlz.h:38
ff_mlz_flush_dict
void ff_mlz_flush_dict(MLZ *dict)
Flush the dictionary.
Definition:
mlz.c:35
MLZ::dic_code_bit
int dic_code_bit
Definition:
mlz.h:48
ff_mlz_decompression
int ff_mlz_decompression(MLZ *mlz, GetBitContext *gb, int size, unsigned char *buff)
Run mlz decompression on the next size bits and the output will be stored in buff.
Definition:
mlz.c:123
get_bits.h
bitstream reader API header.
size
ptrdiff_t size
Definition:
opengl_enc.c:101
MLZ::dict
MLZDict * dict
Definition:
mlz.h:54
MLZDict::parent_code
int parent_code
Definition:
mlz.h:40
MLZ::bump_code
unsigned int bump_code
Definition:
mlz.h:50
MLZ::flush_code
unsigned int flush_code
Definition:
mlz.h:51
MLZDict::char_code
int char_code
Definition:
mlz.h:41
MLZ
MLZ data strucure.
Definition:
mlz.h:47
ff_mlz_init_dict
void ff_mlz_init_dict(void *context, MLZ *mlz)
Initialize the dictionary.
Definition:
mlz.c:23
MLZDict::match_len
int match_len
Definition:
mlz.h:42
MLZ::freeze_flag
int freeze_flag
Definition:
mlz.h:53
MLZDict::string_code
int string_code
Definition:
mlz.h:39
GetBitContext
Definition:
get_bits.h:56
MLZ::context
void * context
Definition:
mlz.h:55
MLZ::current_dic_index_max
int current_dic_index_max
Definition:
mlz.h:49
MLZ::next_code
int next_code
Definition:
mlz.h:52
Generated on Sun May 13 2018 02:03:52 for FFmpeg by
1.8.6