mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 11:00:08 +01:00
bytestream: add more unchecked variants for bytestream2 API
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit f1ce053cd0)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
committed by
Reinhard Tartler
parent
e788c6e9cb
commit
9e24f2a1f0
@@ -170,6 +170,12 @@ static av_always_inline void bytestream2_skip(GetByteContext *g,
|
|||||||
g->buffer += FFMIN(g->buffer_end - g->buffer, size);
|
g->buffer += FFMIN(g->buffer_end - g->buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_always_inline void bytestream2_skipu(GetByteContext *g,
|
||||||
|
unsigned int size)
|
||||||
|
{
|
||||||
|
g->buffer += size;
|
||||||
|
}
|
||||||
|
|
||||||
static av_always_inline void bytestream2_skip_p(PutByteContext *p,
|
static av_always_inline void bytestream2_skip_p(PutByteContext *p,
|
||||||
unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
@@ -257,6 +263,15 @@ static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g,
|
|||||||
return size2;
|
return size2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g,
|
||||||
|
uint8_t *dst,
|
||||||
|
unsigned int size)
|
||||||
|
{
|
||||||
|
memcpy(dst, g->buffer, size);
|
||||||
|
g->buffer += size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
|
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
|
||||||
const uint8_t *src,
|
const uint8_t *src,
|
||||||
unsigned int size)
|
unsigned int size)
|
||||||
@@ -272,6 +287,15 @@ static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p,
|
|||||||
return size2;
|
return size2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p,
|
||||||
|
const uint8_t *src,
|
||||||
|
unsigned int size)
|
||||||
|
{
|
||||||
|
memcpy(p->buffer, src, size);
|
||||||
|
p->buffer += size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
|
static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
|
||||||
const uint8_t c,
|
const uint8_t c,
|
||||||
unsigned int size)
|
unsigned int size)
|
||||||
@@ -286,6 +310,14 @@ static av_always_inline void bytestream2_set_buffer(PutByteContext *p,
|
|||||||
p->buffer += size2;
|
p->buffer += size2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static av_always_inline void bytestream2_set_bufferu(PutByteContext *p,
|
||||||
|
const uint8_t c,
|
||||||
|
unsigned int size)
|
||||||
|
{
|
||||||
|
memset(p->buffer, c, size);
|
||||||
|
p->buffer += size;
|
||||||
|
}
|
||||||
|
|
||||||
static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
|
static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p)
|
||||||
{
|
{
|
||||||
return p->eof;
|
return p->eof;
|
||||||
|
|||||||
Reference in New Issue
Block a user