misc/winutils/include/libavutil/lzo.h
author koda
Wed, 24 Oct 2012 14:55:31 +0100
changeset 7813 7ac83d79b897
permissions -rw-r--r--
support video recording on windows with automation and headers
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7813
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     1
/*
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     2
 * LZO 1x decompression
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     3
 * copyright (c) 2006 Reimar Doeffinger
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     4
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     5
 * This file is part of Libav.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     6
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     7
 * Libav is free software; you can redistribute it and/or
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     8
 * modify it under the terms of the GNU Lesser General Public
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     9
 * License as published by the Free Software Foundation; either
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    10
 * version 2.1 of the License, or (at your option) any later version.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    11
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    12
 * Libav is distributed in the hope that it will be useful,
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    15
 * Lesser General Public License for more details.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    16
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    17
 * You should have received a copy of the GNU Lesser General Public
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    18
 * License along with Libav; if not, write to the Free Software
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    20
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    21
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    22
#ifndef AVUTIL_LZO_H
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    23
#define AVUTIL_LZO_H
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    24
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    25
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    26
 * @defgroup lavu_lzo LZO
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    27
 * @ingroup lavu_crypto
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    28
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    29
 * @{
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    30
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    31
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    32
#include <stdint.h>
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    33
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    34
/** @name Error flags returned by av_lzo1x_decode
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    35
 * @{ */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    36
/// end of the input buffer reached before decoding finished
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    37
#define AV_LZO_INPUT_DEPLETED  1
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    38
/// decoded data did not fit into output buffer
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    39
#define AV_LZO_OUTPUT_FULL     2
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    40
/// a reference to previously decoded data was wrong
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    41
#define AV_LZO_INVALID_BACKPTR 4
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    42
/// a non-specific error in the compressed bitstream
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    43
#define AV_LZO_ERROR           8
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    44
/** @} */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    45
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    46
#define AV_LZO_INPUT_PADDING   8
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    47
#define AV_LZO_OUTPUT_PADDING 12
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    48
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    49
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    50
 * @brief Decodes LZO 1x compressed data.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    51
 * @param out output buffer
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    52
 * @param outlen size of output buffer, number of bytes left are returned here
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    53
 * @param in input buffer
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    54
 * @param inlen size of input buffer, number of bytes left are returned here
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    55
 * @return 0 on success, otherwise a combination of the error flags above
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    56
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    57
 * Make sure all buffers are appropriately padded, in must provide
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    58
 * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    59
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    60
int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    61
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    62
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    63
 * @brief deliberately overlapping memcpy implementation
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    64
 * @param dst destination buffer; must be padded with 12 additional bytes
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    65
 * @param back how many bytes back we start (the initial size of the overlapping window)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    66
 * @param cnt number of bytes to copy, must be >= 0
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    67
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    68
 * cnt > back is valid, this will copy the bytes we just copied,
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    69
 * thus creating a repeating pattern with a period length of back.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    70
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    71
void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    72
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    73
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    74
 * @}
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    75
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    76
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    77
#endif /* AVUTIL_LZO_H */