mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 16:48:11 +00:00
matroska: get rid of _stdint.h include
This commit is contained in:
parent
522de42381
commit
f301e3f236
1 changed files with 14 additions and 15 deletions
|
@ -25,7 +25,6 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "_stdint.h"
|
|
||||||
#include "lzo.h"
|
#include "lzo.h"
|
||||||
|
|
||||||
/*! define if we may write up to 12 bytes beyond the output buffer */
|
/*! define if we may write up to 12 bytes beyond the output buffer */
|
||||||
|
@ -34,8 +33,8 @@
|
||||||
/* #define INBUF_PADDED 1 */
|
/* #define INBUF_PADDED 1 */
|
||||||
typedef struct LZOContext
|
typedef struct LZOContext
|
||||||
{
|
{
|
||||||
const uint8_t *in, *in_end;
|
const guint8 *in, *in_end;
|
||||||
uint8_t *out_start, *out, *out_end;
|
guint8 *out_start, *out, *out_end;
|
||||||
int error;
|
int error;
|
||||||
} LZOContext;
|
} LZOContext;
|
||||||
|
|
||||||
|
@ -79,8 +78,8 @@ get_len (LZOContext * c, int x, int mask)
|
||||||
/*#define UNALIGNED_LOADSTORE */
|
/*#define UNALIGNED_LOADSTORE */
|
||||||
#define BUILTIN_MEMCPY
|
#define BUILTIN_MEMCPY
|
||||||
#ifdef UNALIGNED_LOADSTORE
|
#ifdef UNALIGNED_LOADSTORE
|
||||||
#define COPY2(d, s) *(uint16_t *)(d) = *(uint16_t *)(s);
|
#define COPY2(d, s) *(guint16 *)(d) = *(guint16 *)(s);
|
||||||
#define COPY4(d, s) *(uint32_t *)(d) = *(uint32_t *)(s);
|
#define COPY4(d, s) *(guint32 *)(d) = *(guint32 *)(s);
|
||||||
#elif defined(BUILTIN_MEMCPY)
|
#elif defined(BUILTIN_MEMCPY)
|
||||||
#define COPY2(d, s) memcpy(d, s, 2);
|
#define COPY2(d, s) memcpy(d, s, 2);
|
||||||
#define COPY4(d, s) memcpy(d, s, 4);
|
#define COPY4(d, s) memcpy(d, s, 4);
|
||||||
|
@ -96,8 +95,8 @@ get_len (LZOContext * c, int x, int mask)
|
||||||
static inline void
|
static inline void
|
||||||
copy (LZOContext * c, int cnt)
|
copy (LZOContext * c, int cnt)
|
||||||
{
|
{
|
||||||
register const uint8_t *src = c->in;
|
register const guint8 *src = c->in;
|
||||||
register uint8_t *dst = c->out;
|
register guint8 *dst = c->out;
|
||||||
if (cnt > c->in_end - src) {
|
if (cnt > c->in_end - src) {
|
||||||
cnt = MAX (c->in_end - src, 0);
|
cnt = MAX (c->in_end - src, 0);
|
||||||
c->error |= LZO_INPUT_DEPLETED;
|
c->error |= LZO_INPUT_DEPLETED;
|
||||||
|
@ -129,8 +128,8 @@ copy (LZOContext * c, int cnt)
|
||||||
static inline void
|
static inline void
|
||||||
copy_backptr (LZOContext * c, int back, int cnt)
|
copy_backptr (LZOContext * c, int back, int cnt)
|
||||||
{
|
{
|
||||||
register const uint8_t *src = &c->out[-back];
|
register const guint8 *src = &c->out[-back];
|
||||||
register uint8_t *dst = c->out;
|
register guint8 *dst = c->out;
|
||||||
if (src < c->out_start || src > dst) {
|
if (src < c->out_start || src > dst) {
|
||||||
c->error |= LZO_INVALID_BACKPTR;
|
c->error |= LZO_INVALID_BACKPTR;
|
||||||
return;
|
return;
|
||||||
|
@ -192,9 +191,9 @@ lzo1x_decode (void *out, int *outlen, const void *in, int *inlen)
|
||||||
int x;
|
int x;
|
||||||
LZOContext c;
|
LZOContext c;
|
||||||
c.in = in;
|
c.in = in;
|
||||||
c.in_end = (const uint8_t *) in + *inlen;
|
c.in_end = (const guint8 *) in + *inlen;
|
||||||
c.out = c.out_start = out;
|
c.out = c.out_start = out;
|
||||||
c.out_end = (uint8_t *) out + *outlen;
|
c.out_end = (guint8 *) out + *outlen;
|
||||||
c.error = 0;
|
c.error = 0;
|
||||||
x = GETB (c);
|
x = GETB (c);
|
||||||
if (x > 17) {
|
if (x > 17) {
|
||||||
|
@ -259,10 +258,10 @@ int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
FILE *in = fopen (argv[1], "rb");
|
FILE *in = fopen (argv[1], "rb");
|
||||||
uint8_t *orig = av_malloc (MAXSZ + 16);
|
guint8 *orig = av_malloc (MAXSZ + 16);
|
||||||
uint8_t *comp = av_malloc (2 * MAXSZ + 16);
|
guint8 *comp = av_malloc (2 * MAXSZ + 16);
|
||||||
uint8_t *decomp = av_malloc (MAXSZ + 16);
|
guint8 *decomp = av_malloc (MAXSZ + 16);
|
||||||
size_t s = fread (orig, 1, MAXSZ, in);
|
gsize s = fread (orig, 1, MAXSZ, in);
|
||||||
lzo_uint clen = 0;
|
lzo_uint clen = 0;
|
||||||
long tmp[LZO1X_MEM_COMPRESS];
|
long tmp[LZO1X_MEM_COMPRESS];
|
||||||
int inlen, outlen;
|
int inlen, outlen;
|
||||||
|
|
Loading…
Reference in a new issue